Skip to content

Commit bfc1aff

Browse files
authored
Merge pull request #46 from arbrandes/frontend-build-sync
feat!: synchronize (most) features with frontend-build and frontend-platform
2 parents 19a6dbe + b512c9a commit bfc1aff

File tree

18 files changed

+26452
-21465
lines changed

18 files changed

+26452
-21465
lines changed

package-lock.json

Lines changed: 20771 additions & 18437 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 162 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,164 @@
11
{
2-
"name": "@openedx/frontend-base",
3-
"version": "1.0.0",
4-
"description": "Build tools, setup and config for frontend apps",
5-
"publishConfig": {
6-
"access": "public"
7-
},
8-
"main": "index.ts",
9-
"module": "index.ts",
10-
"bin": {
11-
"intl-imports.js": "tools/dist/cli/scripts/intl-imports.js",
12-
"openedx": "tools/dist/cli/openedx.js",
13-
"transifex-utils.js": "tools/dist/cli/scripts/transifex-utils.js"
14-
},
15-
"scripts": {
16-
"build": "make build",
17-
"dev:shell": "npm run build && node ./tools/dist/cli/openedx.js dev:shell",
18-
"temp:refresh-all": "npm run build && npm pack && npm run temp:refresh-base-test && npm run temp:refresh-authn && npm run temp:refresh-project && npm run temp:refresh-project-module && npm run temp:refresh-test-project",
19-
"temp:refresh-base-test": "cd ../frontend-app-base-test && npm i --audit=false --fund=false --save-peer ../frontend-base/openedx-frontend-base-1.0.0.tgz && cd ../frontend-base",
20-
"temp:refresh-authn": "cd ../frontend-app-authn && npm i --audit=false --fund=false --save-peer ../frontend-base/openedx-frontend-base-1.0.0.tgz && cd ../frontend-base",
21-
"temp:refresh-project": "cd ../frontend-project-test && npm i --audit=false --fund=false ../frontend-base/openedx-frontend-base-1.0.0.tgz && cd ../frontend-base",
22-
"temp:refresh-project-module": "cd ../frontend-project-module-test && npm i --audit=false --fund=false ../frontend-base/openedx-frontend-base-1.0.0.tgz && cd ../frontend-base",
23-
"temp:refresh-test-project": "cd test-project && npm i --audit=false --fund=false ../openedx-frontend-base-1.0.0.tgz && cd ../",
24-
"refresh:test-project": "npm run build && npm pack && cd test-project && npm i --audit=false --fund=false ../openedx-frontend-base-1.0.0.tgz && cd ../",
25-
"clean": "rm -rf dist",
26-
"docs": "jsdoc -c jsdoc.json",
27-
"docs:watch": "nodemon -w runtime -w docs/template -w README.md -e js,jsx,ts,tsx --exec npm run docs",
28-
"lint": "eslint .; npm run lint:tools; npm --prefix ./test-project run lint",
29-
"lint:tools": "cd ./tools && eslint . && cd ..",
30-
"test": "npm run test:tools && npm run test:app && npm run test:runtime && npm run test:shell",
31-
"test:app": "npm --prefix ./test-project i; npm --prefix ./test-project run build",
32-
"test:tools": "jest tools --config tools/jest.config.js",
33-
"test:runtime": "jest runtime --config runtime/jest.config.js",
34-
"test:shell": "jest shell --config shell/jest.config.js --passWithNoTests --coverage"
35-
},
36-
"repository": {
37-
"type": "git",
38-
"url": "git+https://github.com/openedx/frontend-base.git"
39-
},
40-
"keywords": [],
41-
"author": "Open edX Community",
42-
"license": "AGPL-3.0",
43-
"bugs": {
44-
"url": "https://github.com/openedx/frontend-base/issues"
45-
},
46-
"sideEffects": [
47-
"*.css",
48-
"*.scss"
49-
],
50-
"homepage": "https://github.com/openedx/frontend-base#readme",
51-
"dependencies": {
52-
"@babel/core": "^7.24.9",
53-
"@babel/preset-env": "^7.24.8",
54-
"@babel/preset-react": "^7.24.7",
55-
"@babel/preset-typescript": "^7.24.7",
56-
"@edx/new-relic-source-map-webpack-plugin": "2.1.0",
57-
"@eslint/compat": "^1.2.1",
58-
"@eslint/js": "^9.13.0",
59-
"@formatjs/cli": "^6.0.3",
60-
"@formatjs/ts-transformer": "^3.13.14",
61-
"@module-federation/enhanced": "^0.6.12",
62-
"@module-federation/runtime": "^0.6.12",
63-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
64-
"@stylistic/eslint-plugin": "^2.9.0",
65-
"@types/eslint__js": "^8.42.3",
66-
"@types/gradient-string": "^1.1.6",
67-
"autoprefixer": "^10.4.20",
68-
"axios": "^1.7.7",
69-
"axios-cache-interceptor": "^1.6.0",
70-
"babel-jest": "^29.7.0",
71-
"babel-plugin-formatjs": "^10.5.16",
72-
"chalk": "^4.1.2",
73-
"classnames": "^2.5.1",
74-
"clean-webpack-plugin": "^4.0.0",
75-
"compression": "^1.7.4",
76-
"css-loader": "^7.1.2",
77-
"cssnano": "^6.1.2",
78-
"eslint": "^9.13.0",
79-
"eslint-plugin-formatjs": "^5.1.3",
80-
"eslint-plugin-jest": "^28.8.3",
81-
"eslint-plugin-jsx-a11y": "^6.10.1",
82-
"eslint-plugin-react": "^7.37.2",
83-
"eslint-plugin-react-hooks": "^5.0.0",
84-
"express": "^4.18.2",
85-
"file-loader": "6.2.0",
86-
"fork-ts-checker-webpack-plugin": "^9.0.2",
87-
"form-urlencoded": "^6.1.5",
88-
"glob": "^7.2.3",
89-
"globals": "^15.11.0",
90-
"gradient-string": "^2.0.2",
91-
"history": "^4.10.1",
92-
"html-webpack-plugin": "5.6.0",
93-
"identity-obj-proxy": "3.0.0",
94-
"image-minimizer-webpack-plugin": "3.8.3",
95-
"jest": "^29.7.0",
96-
"jest-environment-jsdom": "^29.7.0",
97-
"jwt-decode": "^3.1.2",
98-
"localforage": "^1.10.0",
99-
"localforage-memoryStorageDriver": "^0.9.2",
100-
"lodash.camelcase": "^4.3.0",
101-
"lodash.memoize": "^4.1.2",
102-
"lodash.merge": "^4.6.2",
103-
"lodash.snakecase": "^4.1.1",
104-
"mini-css-extract-plugin": "1.6.2",
105-
"parse5": "7.1.2",
106-
"postcss": "^8.4.47",
107-
"postcss-custom-media": "10.0.8",
108-
"postcss-loader": "7.3.4",
109-
"postcss-rtlcss": "^5.5.0",
110-
"prop-types": "^15.8.1",
111-
"react-dev-utils": "12.0.1",
112-
"react-focus-on": "^3.9.4",
113-
"react-intl": "^6.6.6",
114-
"react-refresh": "0.14.2",
115-
"react-refresh-typescript": "^2.0.9",
116-
"react-responsive": "^10.0.0",
117-
"react-transition-group": "^4.4.5",
118-
"resolve-url-loader": "^5.0.0",
119-
"sass-embedded": "^1.80.4",
120-
"sass-loader": "^16.0.2",
121-
"sharp": "^0.33.5",
122-
"source-map-loader": "4.0.2",
123-
"style-loader": "^4.0.0",
124-
"ts-loader": "^9.5.1",
125-
"typescript": "^5.6.3",
126-
"typescript-eslint": "^8.11.0",
127-
"universal-cookie": "^4.0.4",
128-
"url-loader": "^4.1.1",
129-
"uuid": "^11.0.2",
130-
"webpack": "^5.95.0",
131-
"webpack-bundle-analyzer": "^4.10.1",
132-
"webpack-cli": "^5.1.4",
133-
"webpack-dev-server": "^5.1.0",
134-
"webpack-merge": "^5.10.0",
135-
"webpack-remove-empty-scripts": "1.0.4"
136-
},
137-
"devDependencies": {
138-
"@testing-library/dom": "^8.20.1",
139-
"@testing-library/jest-dom": "^6.4.6",
140-
"@testing-library/react": "^12.1.5",
141-
"@testing-library/react-hooks": "^8.0.1",
142-
"@testing-library/user-event": "^14.5.2",
143-
"@tsconfig/node18": "^18.2.4",
144-
"@types/compression": "^1.7.5",
145-
"@types/jest": "^29.5.14",
146-
"@types/lodash.camelcase": "^4.3.9",
147-
"@types/lodash.merge": "^4.6.9",
148-
"@types/node": "^18.19.43",
149-
"@types/react": "^17.0.0",
150-
"@types/react-dom": "^17.0.11",
151-
"axios-mock-adapter": "^1.22.0",
152-
"jest-chain": "^1.1.6",
153-
"jsdoc": "^4.0.3",
154-
"nodemon": "^3.1.4",
155-
"react-test-renderer": "^17.0.2"
156-
},
157-
"peerDependencies": {
158-
"@openedx/paragon": "^22.8.1",
159-
"react": "^17.0.2",
160-
"react-dom": "^17.0.2",
161-
"react-redux": "^8.1.3",
162-
"react-router": "^6.26.1",
163-
"react-router-dom": "^6.26.1",
164-
"redux": "^4.2.1"
165-
}
2+
"name": "@openedx/frontend-base",
3+
"version": "1.0.0",
4+
"description": "Build tools, setup and config for frontend apps",
5+
"publishConfig": {
6+
"access": "public"
7+
},
8+
"main": "index.ts",
9+
"module": "index.ts",
10+
"bin": {
11+
"intl-imports.js": "tools/dist/cli/scripts/intl-imports.js",
12+
"openedx": "tools/dist/cli/openedx.js",
13+
"transifex-utils.js": "tools/dist/cli/scripts/transifex-utils.js"
14+
},
15+
"scripts": {
16+
"build": "make build",
17+
"dev:shell": "npm run build && node ./tools/dist/cli/openedx.js dev:shell",
18+
"temp:refresh-all": "npm run build && npm pack && npm run temp:refresh-base-test && npm run temp:refresh-authn && npm run temp:refresh-project && npm run temp:refresh-project-module && npm run temp:refresh-test-project",
19+
"temp:refresh-base-test": "cd ../frontend-app-base-test && npm i --audit=false --fund=false --save-peer ../frontend-base/openedx-frontend-base-1.0.0.tgz && cd ../frontend-base",
20+
"temp:refresh-authn": "cd ../frontend-app-authn && npm i --audit=false --fund=false --save-peer ../frontend-base/openedx-frontend-base-1.0.0.tgz && cd ../frontend-base",
21+
"temp:refresh-project": "cd ../frontend-project-test && npm i --audit=false --fund=false ../frontend-base/openedx-frontend-base-1.0.0.tgz && cd ../frontend-base",
22+
"temp:refresh-project-module": "cd ../frontend-project-module-test && npm i --audit=false --fund=false ../frontend-base/openedx-frontend-base-1.0.0.tgz && cd ../frontend-base",
23+
"temp:refresh-test-project": "cd test-project && npm i --audit=false --fund=false ../openedx-frontend-base-1.0.0.tgz && cd ../",
24+
"refresh:test-project": "npm run build && npm pack && cd test-project && npm i --audit=false --fund=false ../openedx-frontend-base-1.0.0.tgz && cd ../",
25+
"clean": "rm -rf dist",
26+
"docs": "jsdoc -c jsdoc.json",
27+
"docs:watch": "nodemon -w runtime -w docs/template -w README.md -e js,jsx,ts,tsx --exec npm run docs",
28+
"lint": "eslint .; npm run lint:tools; npm --prefix ./test-project run lint",
29+
"lint:tools": "cd ./tools && eslint . && cd ..",
30+
"test": "npm run test:tools && npm run test:app && npm run test:runtime && npm run test:shell",
31+
"test:app": "npm --prefix ./test-project i; npm --prefix ./test-project run build",
32+
"test:tools": "jest tools --config tools/jest.config.js",
33+
"test:runtime": "jest runtime --config runtime/jest.config.js",
34+
"test:shell": "jest shell --config shell/jest.config.js --passWithNoTests --coverage"
35+
},
36+
"repository": {
37+
"type": "git",
38+
"url": "git+https://github.com/openedx/frontend-base.git"
39+
},
40+
"keywords": [],
41+
"author": "Open edX Community",
42+
"license": "AGPL-3.0",
43+
"bugs": {
44+
"url": "https://github.com/openedx/frontend-base/issues"
45+
},
46+
"sideEffects": [
47+
"*.css",
48+
"*.scss"
49+
],
50+
"homepage": "https://github.com/openedx/frontend-base#readme",
51+
"dependencies": {
52+
"@babel/core": "^7.24.9",
53+
"@babel/preset-env": "^7.24.8",
54+
"@babel/preset-react": "^7.26.3",
55+
"@babel/preset-typescript": "^7.24.7",
56+
"@edx/new-relic-source-map-webpack-plugin": "2.1.0",
57+
"@eslint/compat": "^1.2.1",
58+
"@eslint/js": "^9.13.0",
59+
"@formatjs/cli": "^6.0.3",
60+
"@formatjs/ts-transformer": "^3.13.14",
61+
"@module-federation/enhanced": "^0.13.0",
62+
"@module-federation/runtime": "^0.13.0",
63+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
64+
"@stylistic/eslint-plugin": "^2.9.0",
65+
"@types/eslint__js": "^8.42.3",
66+
"@types/gradient-string": "^1.1.6",
67+
"autoprefixer": "^10.4.20",
68+
"axios": "^1.7.9",
69+
"axios-cache-interceptor": "^1.6.0",
70+
"babel-jest": "^29.7.0",
71+
"babel-plugin-formatjs": "^10.5.16",
72+
"chalk": "^4.1.2",
73+
"classnames": "^2.5.1",
74+
"clean-webpack-plugin": "^4.0.0",
75+
"compression": "^1.7.4",
76+
"css-loader": "^7.1.2",
77+
"cssnano": "^6.1.2",
78+
"eslint": "^9.13.0",
79+
"eslint-plugin-formatjs": "^5.1.3",
80+
"eslint-plugin-jest": "^28.8.3",
81+
"eslint-plugin-jsx-a11y": "^6.10.1",
82+
"eslint-plugin-react": "^7.37.2",
83+
"eslint-plugin-react-hooks": "^5.0.0",
84+
"express": "^4.18.2",
85+
"file-loader": "6.2.0",
86+
"fork-ts-checker-webpack-plugin": "^9.0.2",
87+
"form-urlencoded": "^6.1.5",
88+
"glob": "^7.2.3",
89+
"globals": "^15.11.0",
90+
"gradient-string": "^2.0.2",
91+
"history": "^4.10.1",
92+
"html-webpack-plugin": "5.6.0",
93+
"identity-obj-proxy": "3.0.0",
94+
"image-minimizer-webpack-plugin": "3.8.3",
95+
"jest": "^29.7.0",
96+
"jest-environment-jsdom": "^29.7.0",
97+
"jwt-decode": "^3.1.2",
98+
"localforage": "^1.10.0",
99+
"localforage-memoryStorageDriver": "^0.9.2",
100+
"lodash.camelcase": "^4.3.0",
101+
"lodash.memoize": "^4.1.2",
102+
"lodash.merge": "^4.6.2",
103+
"lodash.snakecase": "^4.1.1",
104+
"mini-css-extract-plugin": "1.6.2",
105+
"parse5": "7.1.2",
106+
"postcss": "^8.4.47",
107+
"postcss-custom-media": "10.0.8",
108+
"postcss-loader": "7.3.4",
109+
"postcss-rtlcss": "^5.5.0",
110+
"prop-types": "^15.8.1",
111+
"react-dev-utils": "12.0.1",
112+
"react-focus-on": "^3.9.4",
113+
"react-intl": "^6.6.6",
114+
"react-refresh": "0.16.0",
115+
"react-refresh-typescript": "^2.0.9",
116+
"react-responsive": "^10.0.0",
117+
"react-transition-group": "^4.4.5",
118+
"resolve-url-loader": "^5.0.0",
119+
"sass-embedded": "^1.87.0",
120+
"sass-loader": "^16.0.2",
121+
"sharp": "^0.33.5",
122+
"source-map-loader": "4.0.2",
123+
"style-loader": "^4.0.0",
124+
"ts-loader": "^9.5.1",
125+
"typescript": "^5.6.3",
126+
"typescript-eslint": "^8.11.0",
127+
"universal-cookie": "^4.0.4",
128+
"url-loader": "^4.1.1",
129+
"uuid": "^11.0.2",
130+
"webpack": "^5.97.1",
131+
"webpack-bundle-analyzer": "^4.10.1",
132+
"webpack-cli": "^5.1.4",
133+
"webpack-dev-server": "^5.1.0",
134+
"webpack-merge": "^5.10.0",
135+
"webpack-remove-empty-scripts": "1.0.4"
136+
},
137+
"devDependencies": {
138+
"@testing-library/dom": "^10.4.0",
139+
"@testing-library/jest-dom": "^6.6.3",
140+
"@testing-library/react": "^16.3.0",
141+
"@testing-library/user-event": "^14.6.1",
142+
"@tsconfig/node20": "^20.1.5",
143+
"@types/compression": "^1.7.5",
144+
"@types/jest": "^29.5.14",
145+
"@types/lodash.camelcase": "^4.3.9",
146+
"@types/lodash.merge": "^4.6.9",
147+
"@types/node": "^18.19.43",
148+
"@types/react": "^18.3.20",
149+
"@types/react-dom": "^18.3.6",
150+
"axios-mock-adapter": "^1.22.0",
151+
"jest-chain": "^1.1.6",
152+
"jsdoc": "^4.0.3",
153+
"nodemon": "^3.1.4"
154+
},
155+
"peerDependencies": {
156+
"@openedx/paragon": "^22.17.0",
157+
"react": "^18.3.1",
158+
"react-dom": "^18.3.1",
159+
"react-redux": "^8.1.3",
160+
"react-router": "^6.26.1",
161+
"react-router-dom": "^6.26.1",
162+
"redux": "^4.2.1"
163+
}
166164
}

runtime/react/hooks.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { act, renderHook } from '@testing-library/react-hooks';
1+
import { act, renderHook } from '@testing-library/react';
22
import siteConfig from 'site.config';
33
import { EnvironmentTypes } from '../../types';
44
import { sendTrackEvent } from '../analytics';

runtime/slots/ui/layout/hooks.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '@testing-library/react-hooks';
1+
import { renderHook } from '@testing-library/react';
22
import { useOperations } from '../../hooks';
33
import * as uiHooks from '../hooks';
44
import { UiOperation } from '../types';

shell/Logo.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { IntlProvider } from 'react-intl';
12
import { Hyperlink, Image } from '@openedx/paragon';
23

34
interface LogoProps {
@@ -18,8 +19,10 @@ export default function Logo({
1819
}
1920

2021
return (
21-
<Hyperlink destination={destinationUrl} className="p-0">
22-
{image}
23-
</Hyperlink>
22+
<IntlProvider locale="en">
23+
<Hyperlink destination={destinationUrl} className="p-0">
24+
{image}
25+
</Hyperlink>
26+
</IntlProvider>
2427
);
2528
}

shell/dev-project/header/CoursesLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useWidgetOptions } from '../../../runtime';
55

66
export default function CoursesLink() {
77
const options = useWidgetOptions();
8-
const title = options.title ?? 'Courses';
8+
const title = typeof options.title === 'string' ? options.title : 'Courses';
99

1010
return (
1111
<div className="d-flex">

shell/dev-project/slot-showcase/LayoutWithOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default function LayoutWithOptions() {
44
const widgets = useWidgets();
55
const options = useLayoutOptions();
66

7-
const title = options.title ?? 'Foo';
7+
const title = typeof options.title === 'string' ? options.title : 'Foo';
88

99
return (
1010
<>

shell/dev-project/slot-showcase/WidgetWithOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useWidgetOptions } from '../../../runtime';
33
export default function WidgetWithOptions() {
44
const options = useWidgetOptions();
55

6-
const title = options.title ?? 'Foo';
6+
const title = typeof options.title === 'string' ? options.title : 'Foo';
77

88
return (
99
<div>{title}</div>

shell/footer/LabeledLinkColumn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function LabeledLinkColumn() {
1010

1111
return (
1212
<div className="d-flex flex-grow-1 flex-column gap-2 small">
13-
{options.label && (
13+
{typeof options.label === 'string' && (
1414
<div className="mb-1 font-weight-bold">{options.label}</div>
1515
)}
1616
{widgets}

0 commit comments

Comments
 (0)