From e4eb2b1bf1184383e6db4d2b025d92f4ecc4787f Mon Sep 17 00:00:00 2001 From: David Joy Date: Wed, 2 Oct 2024 15:19:22 -0400 Subject: [PATCH] fix: updating modules to match the new format from frontend-base --- package-lock.json | 280 ++++++++++++++++++++++---- package.json | 10 +- src/ModuleThree.tsx | 27 --- src/index.jsx | 3 - src/index.ts | 3 + src/{ => module-one}/ModuleOne.tsx | 20 +- src/module-one/ModuleOneChild.tsx | 5 + src/module-one/index.tsx | 31 +++ src/module-one/moduleOne.css | 4 + src/module-three/ModuleThree.tsx | 21 ++ src/module-three/ModuleThreeChild.tsx | 5 + src/module-three/index.tsx | 31 +++ src/module-three/moduleThree.scss | 4 + src/module-three/moduleThree.svg | 4 + src/{ => module-two}/ModuleTwo.tsx | 18 +- src/module-two/ModuleTwoChild.tsx | 5 + src/module-two/index.tsx | 34 ++++ src/module-two/moduleTwo.scss | 4 + test.site.config.tsx | 9 +- 19 files changed, 410 insertions(+), 108 deletions(-) delete mode 100644 src/ModuleThree.tsx delete mode 100644 src/index.jsx create mode 100644 src/index.ts rename src/{ => module-one}/ModuleOne.tsx (58%) create mode 100644 src/module-one/ModuleOneChild.tsx create mode 100644 src/module-one/index.tsx create mode 100644 src/module-one/moduleOne.css create mode 100644 src/module-three/ModuleThree.tsx create mode 100644 src/module-three/ModuleThreeChild.tsx create mode 100644 src/module-three/index.tsx create mode 100644 src/module-three/moduleThree.scss create mode 100644 src/module-three/moduleThree.svg rename src/{ => module-two}/ModuleTwo.tsx (56%) create mode 100644 src/module-two/ModuleTwoChild.tsx create mode 100644 src/module-two/index.tsx create mode 100644 src/module-two/moduleTwo.scss diff --git a/package-lock.json b/package-lock.json index a48fe32..39954a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3258,7 +3258,7 @@ "node_modules/@openedx/frontend-base": { "version": "1.0.0", "resolved": "file:../frontend-base/openedx-frontend-base-1.0.0.tgz", - "integrity": "sha512-EM8a+02PoC2mFYJIaqw/9WqfFgpUBhm6TZU/BNEBX4MvbxK3Pkz8gwUMx77N0C5uBjq/yzgdg6qVh364v3lMrg==", + "integrity": "sha512-3zy6c4K4cYD7clztlsEHNT0405tkQpbps0IuSjFIGxYERnVnRI7FPwVPLn26FyQgYrDtjwEI1CAPKc0E0gS9Dg==", "license": "AGPL-3.0", "peer": true, "dependencies": { @@ -3275,11 +3275,12 @@ "@module-federation/enhanced": "^0.4.0", "@module-federation/runtime": "^0.2.6", "@pmmmwh/react-refresh-webpack-plugin": "0.5.15", + "@types/gradient-string": "^1.1.6", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", "autoprefixer": "10.4.19", - "axios": "^0.28.1", - "axios-cache-interceptor": "^0.10.7", + "axios": "^1.7.7", + "axios-cache-interceptor": "^1.6.0", "babel-jest": "^29.7.0", "babel-plugin-formatjs": "^10.5.16", "chalk": "4.1.2", @@ -3298,8 +3299,10 @@ "eslint-plugin-react-hooks": "4.6.0", "express": "^4.18.2", "file-loader": "6.2.0", + "fork-ts-checker-webpack-plugin": "^9.0.2", "form-urlencoded": "^6.1.5", "glob": "^7.2.3", + "gradient-string": "^2.0.2", "history": "^4.10.1", "html-webpack-plugin": "5.6.0", "i18n-iso-countries": "^4.3.1", @@ -3311,13 +3314,13 @@ "localforage": "^1.10.0", "localforage-memoryStorageDriver": "^0.9.2", "lodash.camelcase": "^4.3.0", - "lodash.isempty": "^4.4.0", "lodash.memoize": "^4.1.2", "lodash.merge": "^4.6.2", "lodash.snakecase": "^4.1.1", "mini-css-extract-plugin": "1.6.2", + "parse5": "7.1.2", "postcss": "8.4.40", - "postcss-custom-media": "10.0.6", + "postcss-custom-media": "10.0.8", "postcss-loader": "7.3.4", "postcss-rtlcss": "5.1.2", "prop-types": "^15.8.1", @@ -3325,7 +3328,9 @@ "react-dev-utils": "12.0.1", "react-intl": "^6.6.6", "react-refresh": "0.14.2", + "react-refresh-typescript": "^2.0.9", "react-responsive": "^10.0.0", + "react-transition-group": "^4.4.5", "resolve-url-loader": "5.0.0", "sass": "1.69.7", "sass-loader": "13.3.3", @@ -3340,15 +3345,16 @@ "webpack-bundle-analyzer": "^4.10.1", "webpack-cli": "^5.1.4", "webpack-dev-server": "^4.15.1", - "webpack-merge": "^5.10.0" + "webpack-merge": "^5.10.0", + "webpack-remove-empty-scripts": "1.0.4" }, "bin": { - "intl-imports.js": "dist/tools/cli/scripts/intl-imports.js", - "openedx": "dist/tools/cli/openedx.js", - "transifex-utils.js": "dist/tools/cli/scripts/transifex-utils.js" + "intl-imports.js": "tools/dist/cli/scripts/intl-imports.js", + "openedx": "tools/dist/cli/openedx.js", + "transifex-utils.js": "tools/dist/cli/scripts/transifex-utils.js" }, "peerDependencies": { - "@openedx/paragon": "^22.6.1", + "@openedx/paragon": "^22.8.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-redux": "^8.1.3", @@ -3358,16 +3364,88 @@ } }, "node_modules/@openedx/frontend-base/node_modules/axios": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.1.tgz", - "integrity": "sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "peer": true, "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, + "node_modules/@openedx/frontend-base/node_modules/axios-cache-interceptor": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios-cache-interceptor/-/axios-cache-interceptor-1.6.0.tgz", + "integrity": "sha512-xuo4mZckPQmNV50bJpsMmGfpFV8SXsUWWUVKf1DXQy7t9p+6Pan9zrD3icAlCIdoYFw/ZJFKV6nUVqy8j0XCLQ==", + "peer": true, + "dependencies": { + "cache-parser": "1.2.5", + "fast-defer": "1.1.8", + "object-code": "1.3.3" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/arthurfiorette/axios-cache-interceptor?sponsor=1" + }, + "peerDependencies": { + "axios": "^1" + } + }, + "node_modules/@openedx/frontend-base/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@openedx/frontend-base/node_modules/fork-ts-checker-webpack-plugin": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-9.0.2.tgz", + "integrity": "sha512-Uochze2R8peoN1XqlSi/rGUkDQpRogtLFocP9+PGu68zk1BDAKXfdeCdyVZpgTk8V8WFVQXdEz426VKjXLO1Gg==", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "chalk": "^4.1.2", + "chokidar": "^3.5.3", + "cosmiconfig": "^8.2.0", + "deepmerge": "^4.2.2", + "fs-extra": "^10.0.0", + "memfs": "^3.4.1", + "minimatch": "^3.0.4", + "node-abort-controller": "^3.0.1", + "schema-utils": "^3.1.1", + "semver": "^7.3.5", + "tapable": "^2.2.1" + }, + "engines": { + "node": ">=12.13.0", + "yarn": ">=1.0.0" + }, + "peerDependencies": { + "typescript": ">3.6.0", + "webpack": "^5.11.0" + } + }, + "node_modules/@openedx/frontend-base/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@openedx/frontend-base/node_modules/jest": { "version": "29.6.1", "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.1.tgz", @@ -3394,10 +3472,52 @@ } } }, + "node_modules/@openedx/frontend-base/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@openedx/frontend-base/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/@openedx/frontend-base/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@openedx/paragon": { - "version": "22.7.0", - "resolved": "https://registry.npmjs.org/@openedx/paragon/-/paragon-22.7.0.tgz", - "integrity": "sha512-BWj4vYXUmLS0BinJckxbhNp0o1UPfwURinaSgTxxBkF0L2VUtAO+SldVWvKDqlltzoR062yjcBA5QSGq8Jxgeg==", + "version": "22.8.1", + "resolved": "https://registry.npmjs.org/@openedx/paragon/-/paragon-22.8.1.tgz", + "integrity": "sha512-lm2x0tvNZrtJvp0L+cjvLLmkE9NoUbNIzt9L1FaOx9g92gf8rFVgq4aadq7IVAjN12HW19/QJMEJaQ0SVsvY2A==", "peer": true, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.1.1", @@ -3795,6 +3915,15 @@ "@types/node": "*" } }, + "node_modules/@types/gradient-string": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@types/gradient-string/-/gradient-string-1.1.6.tgz", + "integrity": "sha512-LkaYxluY4G5wR1M4AKQUal2q61Di1yVVCw42ImFTuaIoQVgmV0WP1xUaLB8zwb47mp82vWTpePI9JmrjEnJ7nQ==", + "peer": true, + "dependencies": { + "@types/tinycolor2": "*" + } + }, "node_modules/@types/hoist-non-react-statics": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", @@ -4013,6 +4142,12 @@ "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==" }, + "node_modules/@types/tinycolor2": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/@types/tinycolor2/-/tinycolor2-1.4.6.tgz", + "integrity": "sha512-iEN8J0BoMnsWBqjVbWH/c0G0Hh7O21lpR2/+PrvAVgWdzL7eexIFm4JN/Wn10PTcmNdtS6U67r499mlWMXOxNw==", + "peer": true + }, "node_modules/@types/tough-cookie": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", @@ -4729,6 +4864,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/ansis": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ansis/-/ansis-1.5.2.tgz", + "integrity": "sha512-T3vUABrcgSj/HXv27P+A/JxGk5b/ydx0JjN3lgjBTC2iZUFxQGjh43zCzLSbU4C1QTgmx9oaPeWNJFM+auI8qw==", + "peer": true, + "engines": { + "node": ">=12.13" + }, + "funding": { + "type": "patreon", + "url": "https://patreon.com/biodiscus" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -5010,20 +5158,6 @@ "follow-redirects": "^1.14.0" } }, - "node_modules/axios-cache-interceptor": { - "version": "0.10.7", - "resolved": "https://registry.npmjs.org/axios-cache-interceptor/-/axios-cache-interceptor-0.10.7.tgz", - "integrity": "sha512-UjpxChG5DpF6Kf1IPGMLOzRDNL8ZNS6TOn1jTaVvCE7cWFU904jJwi0T1s+IbijpnLEjK2iq5uLIuR8Sj+RsFQ==", - "peer": true, - "dependencies": { - "cache-parser": "^1.2.4", - "fast-defer": "^1.1.7", - "object-code": "^1.2.4" - }, - "funding": { - "url": "https://github.com/ArthurFiorette/axios-cache-interceptor?sponsor=1" - } - }, "node_modules/axobject-query": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.4.tgz", @@ -8993,6 +9127,19 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, + "node_modules/gradient-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/gradient-string/-/gradient-string-2.0.2.tgz", + "integrity": "sha512-rEDCuqUQ4tbD78TpzsMtt5OIf0cBCSDWSJtUDaF6JsAh+k0v9r++NzxNEG87oDZx9ZwGhD8DaezR2L/yrw0Jdw==", + "peer": true, + "dependencies": { + "chalk": "^4.1.2", + "tinygradient": "^1.1.5" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -11370,12 +11517,6 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "peer": true }, - "node_modules/lodash.isempty": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", - "integrity": "sha512-oKMuF3xEeqDltrGMfDxAPGIVMSSRv8tbRSODbrs4KGsRRLEhrW8N8Rd4DRgB2+621hY8A8XwwrTVhXWpxFvMzg==", - "peer": true - }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -11854,6 +11995,12 @@ "node": ">=10" } }, + "node_modules/node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", + "peer": true + }, "node_modules/node-addon-api": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", @@ -12629,9 +12776,9 @@ } }, "node_modules/postcss-custom-media": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-10.0.6.tgz", - "integrity": "sha512-BjihQoIO4Wjqv9fQNExSJIim8UAmkhLxuJnhJsLTRFSba1y1MhxkJK5awsM//6JJ+/Tu5QUxf624RQAvKHv6SA==", + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-10.0.8.tgz", + "integrity": "sha512-V1KgPcmvlGdxTel4/CyQtBJEFhMVpEmRGFrnVtgfGIHj5PJX9vO36eFBxKBeJn+aCDTed70cc+98Mz3J/uVdGQ==", "funding": [ { "type": "github", @@ -12644,10 +12791,10 @@ ], "peer": true, "dependencies": { - "@csstools/cascade-layer-name-parser": "^1.0.11", - "@csstools/css-parser-algorithms": "^2.6.3", - "@csstools/css-tokenizer": "^2.3.1", - "@csstools/media-query-list-parser": "^2.1.11" + "@csstools/cascade-layer-name-parser": "^1.0.13", + "@csstools/css-parser-algorithms": "^2.7.1", + "@csstools/css-tokenizer": "^2.4.1", + "@csstools/media-query-list-parser": "^2.1.13" }, "engines": { "node": "^14 || ^16 || >=18" @@ -13899,6 +14046,16 @@ "node": ">=0.10.0" } }, + "node_modules/react-refresh-typescript": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/react-refresh-typescript/-/react-refresh-typescript-2.0.9.tgz", + "integrity": "sha512-chAnOO4vpxm/3WkgOVmti+eN8yUtkJzeGkOigV6UA9eDFz12W34e/SsYe2H5+RwYJ3+sfSZkVbiXcG1chEBxlg==", + "peer": true, + "peerDependencies": { + "react-refresh": "0.10.x || 0.11.x || 0.12.x || 0.13.x || 0.14.x", + "typescript": "^4.8 || ^5.0" + } + }, "node_modules/react-remove-scroll": { "version": "2.5.10", "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.10.tgz", @@ -16008,6 +16165,22 @@ "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==", "peer": true }, + "node_modules/tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "peer": true + }, + "node_modules/tinygradient": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/tinygradient/-/tinygradient-1.1.5.tgz", + "integrity": "sha512-8nIfc2vgQ4TeLnk2lFj4tRLvvJwEfQuabdsmvDdQPT0xlk9TaNtpGd6nNRxXoK6vQhN6RSzj+Cnp5tTQmpxmbw==", + "peer": true, + "dependencies": { + "@types/tinycolor2": "^1.4.0", + "tinycolor2": "^1.0.0" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -17012,6 +17185,25 @@ "node": ">=10.0.0" } }, + "node_modules/webpack-remove-empty-scripts": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/webpack-remove-empty-scripts/-/webpack-remove-empty-scripts-1.0.4.tgz", + "integrity": "sha512-W/Vd94oNXMsQam+W9G+aAzGgFlX1aItcJpkG3byuHGDaxyK3H17oD/b5RcqS/ZHzStIKepksdLDznejDhDUs+Q==", + "peer": true, + "dependencies": { + "ansis": "1.5.2" + }, + "engines": { + "node": ">=12.14" + }, + "funding": { + "type": "patreon", + "url": "https://patreon.com/biodiscus" + }, + "peerDependencies": { + "webpack": ">=5.32.0" + } + }, "node_modules/webpack-sources": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", diff --git a/package.json b/package.json index c4b0e31..c160103 100644 --- a/package.json +++ b/package.json @@ -10,21 +10,21 @@ "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ - "/dist", - "/scss/**/*.scss" + "/dist" ], "config": { "name": "baseTest", "exposes": { - "./ModuleOne": "./src/ModuleOne", - "./ModuleTwo": "./src/ModuleTwo", - "./ModuleThree": "./src/ModuleThree" + "./ModuleOne": "./src/module-one", + "./ModuleTwo": "./src/module-two", + "./ModuleThree": "./src/module-three" } }, "browserslist": [ "extends @edx/browserslist-config" ], "scripts": { + "temp:pack-it": "npm run pack frontend-project-test && npm run pack frontend-project-module-test", "build:module": "PORT=8082 openedx build:module", "dev": "PORT=8082 openedx dev", "dev:module": "PORT=8082 openedx dev:module", diff --git a/src/ModuleThree.tsx b/src/ModuleThree.tsx deleted file mode 100644 index a1c5497..0000000 --- a/src/ModuleThree.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Container } from '@openedx/paragon'; -import { Link, Route, Routes } from 'react-router-dom'; - -const ModuleThree = () => ( -
- -

Module Three

-
    -
  • View the Module Three child page content
  • -
  • View Module One
  • -
  • View Module Two
  • -
- - You're viewing the child page of Module Three - } /> - -
-
-); - -export default ModuleThree; - -export const config = { - path: 'three', - component: ModuleThree, -}; diff --git a/src/index.jsx b/src/index.jsx deleted file mode 100644 index 167e4d2..0000000 --- a/src/index.jsx +++ /dev/null @@ -1,3 +0,0 @@ -export { default as ModuleOne } from './ModuleOne'; -export { default as ModuleThree } from './ModuleThree'; -export { default as ModuleTwo } from './ModuleTwo'; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..904fc3c --- /dev/null +++ b/src/index.ts @@ -0,0 +1,3 @@ +export { default as moduleOneConfig } from './module-one'; +export { default as moduleThreeConfig } from './module-three'; +export { default as moduleTwoConfig } from './module-two'; diff --git a/src/ModuleOne.tsx b/src/module-one/ModuleOne.tsx similarity index 58% rename from src/ModuleOne.tsx rename to src/module-one/ModuleOne.tsx index 3fe982b..e6bb217 100644 --- a/src/ModuleOne.tsx +++ b/src/module-one/ModuleOne.tsx @@ -1,30 +1,24 @@ import { getConfig } from '@openedx/frontend-base'; import { Container } from '@openedx/paragon'; -import { Link, Route, Routes } from 'react-router-dom'; +import { Link, Outlet } from 'react-router-dom'; + +import './moduleOne.css'; const ModuleOne = () => (
-

Module One

+

Module One

This module is acting as a homepage because it was mounted at the root.

The site's name is {getConfig().SITE_NAME}!

  • View the child page content
  • View Module Two
  • -
  • View Module THree
  • +
  • View Module Three
- - You're viewing the content of the child page at /child - }/> - + +

Module one content after the outlet.

); export default ModuleOne; - -export const config = { - path: 'one', - component: ModuleOne, -}; diff --git a/src/module-one/ModuleOneChild.tsx b/src/module-one/ModuleOneChild.tsx new file mode 100644 index 0000000..28569d7 --- /dev/null +++ b/src/module-one/ModuleOneChild.tsx @@ -0,0 +1,5 @@ +export default function ModuleOneChild() { + return ( +
You're viewing the content of the child page at /child
+ ) +} diff --git a/src/module-one/index.tsx b/src/module-one/index.tsx new file mode 100644 index 0000000..7077cb3 --- /dev/null +++ b/src/module-one/index.tsx @@ -0,0 +1,31 @@ +import { ApplicationModuleConfig, HeaderTypes } from "@openedx/frontend-base"; + +const config: ApplicationModuleConfig = { + routes: [ + { + path: '/', + lazy: async () => { + const { default: Component } = await import('./ModuleOne'); + return { + Component, + handle: { + headerId: HeaderTypes.DEFAULT, + } + } + }, + children: [ + { + path: 'child', + lazy: async () => { + const { default: Component } = await import('./ModuleOneChild'); + return { + Component, + } + } + } + ] + } + ] +}; + +export default config; diff --git a/src/module-one/moduleOne.css b/src/module-one/moduleOne.css new file mode 100644 index 0000000..b8048ea --- /dev/null +++ b/src/module-one/moduleOne.css @@ -0,0 +1,4 @@ +h1.one { + color: red; + text-decoration: underline wavy; +} diff --git a/src/module-three/ModuleThree.tsx b/src/module-three/ModuleThree.tsx new file mode 100644 index 0000000..9f94c4b --- /dev/null +++ b/src/module-three/ModuleThree.tsx @@ -0,0 +1,21 @@ +import { Container } from '@openedx/paragon'; +import { Link, Outlet } from 'react-router-dom'; + +import './moduleThree.scss'; + +export default function ModuleThree() { + return ( +
+ +

Module Three

+
    +
  • View the Module Three child page content
  • +
  • View Module One
  • +
  • View Module Two
  • +
+ +

Module three content after the outlet.

+
+
+ ) +} diff --git a/src/module-three/ModuleThreeChild.tsx b/src/module-three/ModuleThreeChild.tsx new file mode 100644 index 0000000..74bd238 --- /dev/null +++ b/src/module-three/ModuleThreeChild.tsx @@ -0,0 +1,5 @@ +export default function ModuleThreeChild() { + return ( +
You're viewing the content of the module three child page at /child
+ ) +} diff --git a/src/module-three/index.tsx b/src/module-three/index.tsx new file mode 100644 index 0000000..9747c52 --- /dev/null +++ b/src/module-three/index.tsx @@ -0,0 +1,31 @@ +import { ApplicationModuleConfig, HeaderTypes } from "@openedx/frontend-base"; + +const config: ApplicationModuleConfig = { + routes: [ + { + path: 'three', + lazy: async () => { + const { default: Component } = await import('./ModuleThree'); + return { + Component, + handle: { + headerId: HeaderTypes.STUDIO, + } + } + }, + children: [ + { + path: 'child', + lazy: async () => { + const { default: Component } = await import('./ModuleThreeChild'); + return { + Component, + } + } + } + ] + } + ] +}; + +export default config; diff --git a/src/module-three/moduleThree.scss b/src/module-three/moduleThree.scss new file mode 100644 index 0000000..0473d34 --- /dev/null +++ b/src/module-three/moduleThree.scss @@ -0,0 +1,4 @@ +h1.three { + color: green; + text-decoration: underline double; +} diff --git a/src/module-three/moduleThree.svg b/src/module-three/moduleThree.svg new file mode 100644 index 0000000..0473d34 --- /dev/null +++ b/src/module-three/moduleThree.svg @@ -0,0 +1,4 @@ +h1.three { + color: green; + text-decoration: underline double; +} diff --git a/src/ModuleTwo.tsx b/src/module-two/ModuleTwo.tsx similarity index 56% rename from src/ModuleTwo.tsx rename to src/module-two/ModuleTwo.tsx index f87b8e3..6f18f2c 100644 --- a/src/ModuleTwo.tsx +++ b/src/module-two/ModuleTwo.tsx @@ -1,27 +1,21 @@ import { Container } from '@openedx/paragon'; -import { Link, Route, Routes } from 'react-router-dom'; +import { Link, Outlet } from 'react-router-dom'; + +import './moduleTwo.scss'; const ModuleTwo = () => (
-

Module Two

+

Module Two

  • View the Module Two child page content
  • View Module One
  • View Module Three
- - You're viewing the child page of Module Two. - } /> - + +

Module two content after the outlet.

); export default ModuleTwo; - -export const config = { - path: 'two', - component: ModuleTwo, -}; diff --git a/src/module-two/ModuleTwoChild.tsx b/src/module-two/ModuleTwoChild.tsx new file mode 100644 index 0000000..f53c243 --- /dev/null +++ b/src/module-two/ModuleTwoChild.tsx @@ -0,0 +1,5 @@ +export default function ModuleTwoChild() { + return ( +
You're viewing the content of the module two child page at /child
+ ) +} diff --git a/src/module-two/index.tsx b/src/module-two/index.tsx new file mode 100644 index 0000000..54ded86 --- /dev/null +++ b/src/module-two/index.tsx @@ -0,0 +1,34 @@ +import { ApplicationModuleConfig, HeaderTypes } from "@openedx/frontend-base"; + +const config: ApplicationModuleConfig = { + routes: [ + { + path: 'two', + lazy: async () => { + const { default: Component } = await import('./ModuleTwo'); + return { + Component, + handle: { + headerId: HeaderTypes.LEARNING, + } + } + }, + children: [ + { + path: 'child', + lazy: async () => { + const { default: Component } = await import('./ModuleTwoChild'); + return { + Component, + handle: { + headerId: HeaderTypes.DEFAULT + } + } + } + } + ] + } + ], +}; + +export default config; diff --git a/src/module-two/moduleTwo.scss b/src/module-two/moduleTwo.scss new file mode 100644 index 0000000..2e2f488 --- /dev/null +++ b/src/module-two/moduleTwo.scss @@ -0,0 +1,4 @@ +h1.two { + color: blue; + text-decoration: underline dashed; +} diff --git a/test.site.config.tsx b/test.site.config.tsx index b7e15be..9ea84ff 100644 --- a/test.site.config.tsx +++ b/test.site.config.tsx @@ -1,6 +1,7 @@ -import { SiteConfig } from '@openedx/frontend-base'; +import { EnvironmentTypes, ProjectSiteConfig } from '@openedx/frontend-base'; -const config: SiteConfig = { +const config: ProjectSiteConfig = { + apps: [], ACCESS_TOKEN_COOKIE_NAME: 'edx-jwt-cookie-header-payload', BASE_URL: 'http://localhost:8080', ACCOUNT_PROFILE_URL: 'http://localhost:1995', @@ -17,12 +18,12 @@ const config: SiteConfig = { FAVICON_URL: 'https://edx-cdn.org/v3/default/favicon.ico', MARKETING_SITE_BASE_URL: 'http://localhost:18000', ORDER_HISTORY_URL: 'http://localhost:1996/orders', - REFRESH_ACCESS_TOKEN_ENDPOINT: 'http://localhost:18000/login_refresh', + REFRESH_ACCESS_TOKEN_API_PATH: '/login_refresh', SEGMENT_KEY: '', SITE_NAME: 'localhost', USER_INFO_COOKIE_NAME: 'edx-user-info', APP_ID: 'base-test', - ENVIRONMENT: 'dev', + ENVIRONMENT: EnvironmentTypes.TEST, ACCOUNT_SETTINGS_URL: 'http://localhost:1997', DISCOVERY_API_BASE_URL: 'http://localhost:18381', IGNORED_ERROR_REGEX: null,