Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39,208 changes: 20,771 additions & 18,437 deletions package-lock.json

Large diffs are not rendered by default.

326 changes: 162 additions & 164 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,166 +1,164 @@
{
"name": "@openedx/frontend-base",
"version": "1.0.0",
"description": "Build tools, setup and config for frontend apps",
"publishConfig": {
"access": "public"
},
"main": "index.ts",
"module": "index.ts",
"bin": {
"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"
},
"scripts": {
"build": "make build",
"dev:shell": "npm run build && node ./tools/dist/cli/openedx.js dev:shell",
"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",
"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",
"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",
"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",
"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",
"temp:refresh-test-project": "cd test-project && npm i --audit=false --fund=false ../openedx-frontend-base-1.0.0.tgz && cd ../",
"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 ../",
"clean": "rm -rf dist",
"docs": "jsdoc -c jsdoc.json",
"docs:watch": "nodemon -w runtime -w docs/template -w README.md -e js,jsx,ts,tsx --exec npm run docs",
"lint": "eslint .; npm run lint:tools; npm --prefix ./test-project run lint",
"lint:tools": "cd ./tools && eslint . && cd ..",
"test": "npm run test:tools && npm run test:app && npm run test:runtime && npm run test:shell",
"test:app": "npm --prefix ./test-project i; npm --prefix ./test-project run build",
"test:tools": "jest tools --config tools/jest.config.js",
"test:runtime": "jest runtime --config runtime/jest.config.js",
"test:shell": "jest shell --config shell/jest.config.js --passWithNoTests --coverage"
},
"repository": {
"type": "git",
"url": "git+https://github.com/openedx/frontend-base.git"
},
"keywords": [],
"author": "Open edX Community",
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/openedx/frontend-base/issues"
},
"sideEffects": [
"*.css",
"*.scss"
],
"homepage": "https://github.com/openedx/frontend-base#readme",
"dependencies": {
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@edx/new-relic-source-map-webpack-plugin": "2.1.0",
"@eslint/compat": "^1.2.1",
"@eslint/js": "^9.13.0",
"@formatjs/cli": "^6.0.3",
"@formatjs/ts-transformer": "^3.13.14",
"@module-federation/enhanced": "^0.6.12",
"@module-federation/runtime": "^0.6.12",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
"@stylistic/eslint-plugin": "^2.9.0",
"@types/eslint__js": "^8.42.3",
"@types/gradient-string": "^1.1.6",
"autoprefixer": "^10.4.20",
"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",
"classnames": "^2.5.1",
"clean-webpack-plugin": "^4.0.0",
"compression": "^1.7.4",
"css-loader": "^7.1.2",
"cssnano": "^6.1.2",
"eslint": "^9.13.0",
"eslint-plugin-formatjs": "^5.1.3",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-jsx-a11y": "^6.10.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.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",
"globals": "^15.11.0",
"gradient-string": "^2.0.2",
"history": "^4.10.1",
"html-webpack-plugin": "5.6.0",
"identity-obj-proxy": "3.0.0",
"image-minimizer-webpack-plugin": "3.8.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jwt-decode": "^3.1.2",
"localforage": "^1.10.0",
"localforage-memoryStorageDriver": "^0.9.2",
"lodash.camelcase": "^4.3.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.47",
"postcss-custom-media": "10.0.8",
"postcss-loader": "7.3.4",
"postcss-rtlcss": "^5.5.0",
"prop-types": "^15.8.1",
"react-dev-utils": "12.0.1",
"react-focus-on": "^3.9.4",
"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-embedded": "^1.80.4",
"sass-loader": "^16.0.2",
"sharp": "^0.33.5",
"source-map-loader": "4.0.2",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"typescript": "^5.6.3",
"typescript-eslint": "^8.11.0",
"universal-cookie": "^4.0.4",
"url-loader": "^4.1.1",
"uuid": "^11.0.2",
"webpack": "^5.95.0",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-merge": "^5.10.0",
"webpack-remove-empty-scripts": "1.0.4"
},
"devDependencies": {
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.2",
"@tsconfig/node18": "^18.2.4",
"@types/compression": "^1.7.5",
"@types/jest": "^29.5.14",
"@types/lodash.camelcase": "^4.3.9",
"@types/lodash.merge": "^4.6.9",
"@types/node": "^18.19.43",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.11",
"axios-mock-adapter": "^1.22.0",
"jest-chain": "^1.1.6",
"jsdoc": "^4.0.3",
"nodemon": "^3.1.4",
"react-test-renderer": "^17.0.2"
},
"peerDependencies": {
"@openedx/paragon": "^22.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^8.1.3",
"react-router": "^6.26.1",
"react-router-dom": "^6.26.1",
"redux": "^4.2.1"
}
"name": "@openedx/frontend-base",
"version": "1.0.0",
"description": "Build tools, setup and config for frontend apps",
"publishConfig": {
"access": "public"
},
"main": "index.ts",
"module": "index.ts",
"bin": {
"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"
},
"scripts": {
"build": "make build",
"dev:shell": "npm run build && node ./tools/dist/cli/openedx.js dev:shell",
"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",
"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",
"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",
"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",
"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",
"temp:refresh-test-project": "cd test-project && npm i --audit=false --fund=false ../openedx-frontend-base-1.0.0.tgz && cd ../",
"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 ../",
"clean": "rm -rf dist",
"docs": "jsdoc -c jsdoc.json",
"docs:watch": "nodemon -w runtime -w docs/template -w README.md -e js,jsx,ts,tsx --exec npm run docs",
"lint": "eslint .; npm run lint:tools; npm --prefix ./test-project run lint",
"lint:tools": "cd ./tools && eslint . && cd ..",
"test": "npm run test:tools && npm run test:app && npm run test:runtime && npm run test:shell",
"test:app": "npm --prefix ./test-project i; npm --prefix ./test-project run build",
"test:tools": "jest tools --config tools/jest.config.js",
"test:runtime": "jest runtime --config runtime/jest.config.js",
"test:shell": "jest shell --config shell/jest.config.js --passWithNoTests --coverage"
},
"repository": {
"type": "git",
"url": "git+https://github.com/openedx/frontend-base.git"
},
"keywords": [],
"author": "Open edX Community",
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/openedx/frontend-base/issues"
},
"sideEffects": [
"*.css",
"*.scss"
],
"homepage": "https://github.com/openedx/frontend-base#readme",
"dependencies": {
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.24.7",
"@edx/new-relic-source-map-webpack-plugin": "2.1.0",
"@eslint/compat": "^1.2.1",
"@eslint/js": "^9.13.0",
"@formatjs/cli": "^6.0.3",
"@formatjs/ts-transformer": "^3.13.14",
"@module-federation/enhanced": "^0.13.0",
"@module-federation/runtime": "^0.13.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
"@stylistic/eslint-plugin": "^2.9.0",
"@types/eslint__js": "^8.42.3",
"@types/gradient-string": "^1.1.6",
"autoprefixer": "^10.4.20",
"axios": "^1.7.9",
"axios-cache-interceptor": "^1.6.0",
"babel-jest": "^29.7.0",
"babel-plugin-formatjs": "^10.5.16",
"chalk": "^4.1.2",
"classnames": "^2.5.1",
"clean-webpack-plugin": "^4.0.0",
"compression": "^1.7.4",
"css-loader": "^7.1.2",
"cssnano": "^6.1.2",
"eslint": "^9.13.0",
"eslint-plugin-formatjs": "^5.1.3",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-jsx-a11y": "^6.10.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.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",
"globals": "^15.11.0",
"gradient-string": "^2.0.2",
"history": "^4.10.1",
"html-webpack-plugin": "5.6.0",
"identity-obj-proxy": "3.0.0",
"image-minimizer-webpack-plugin": "3.8.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jwt-decode": "^3.1.2",
"localforage": "^1.10.0",
"localforage-memoryStorageDriver": "^0.9.2",
"lodash.camelcase": "^4.3.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.47",
"postcss-custom-media": "10.0.8",
"postcss-loader": "7.3.4",
"postcss-rtlcss": "^5.5.0",
"prop-types": "^15.8.1",
"react-dev-utils": "12.0.1",
"react-focus-on": "^3.9.4",
"react-intl": "^6.6.6",
"react-refresh": "0.16.0",
"react-refresh-typescript": "^2.0.9",
"react-responsive": "^10.0.0",
"react-transition-group": "^4.4.5",
"resolve-url-loader": "^5.0.0",
"sass-embedded": "^1.87.0",
"sass-loader": "^16.0.2",
"sharp": "^0.33.5",
"source-map-loader": "4.0.2",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"typescript": "^5.6.3",
"typescript-eslint": "^8.11.0",
"universal-cookie": "^4.0.4",
"url-loader": "^4.1.1",
"uuid": "^11.0.2",
"webpack": "^5.97.1",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-merge": "^5.10.0",
"webpack-remove-empty-scripts": "1.0.4"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@tsconfig/node20": "^20.1.5",
"@types/compression": "^1.7.5",
"@types/jest": "^29.5.14",
"@types/lodash.camelcase": "^4.3.9",
"@types/lodash.merge": "^4.6.9",
"@types/node": "^18.19.43",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"axios-mock-adapter": "^1.22.0",
"jest-chain": "^1.1.6",
"jsdoc": "^4.0.3",
"nodemon": "^3.1.4"
},
"peerDependencies": {
"@openedx/paragon": "^22.17.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^8.1.3",
"react-router": "^6.26.1",
"react-router-dom": "^6.26.1",
"redux": "^4.2.1"
}
}
2 changes: 1 addition & 1 deletion runtime/react/hooks.test.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';
import siteConfig from 'site.config';
import { EnvironmentTypes } from '../../types';
import { sendTrackEvent } from '../analytics';
Expand Down
2 changes: 1 addition & 1 deletion runtime/slots/ui/layout/hooks.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import { useOperations } from '../../hooks';
import * as uiHooks from '../hooks';
import { UiOperation } from '../types';
Expand Down
9 changes: 6 additions & 3 deletions shell/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { IntlProvider } from 'react-intl';
import { Hyperlink, Image } from '@openedx/paragon';

interface LogoProps {
Expand All @@ -18,8 +19,10 @@ export default function Logo({
}

return (
<Hyperlink destination={destinationUrl} className="p-0">
{image}
</Hyperlink>
<IntlProvider locale="en">
<Hyperlink destination={destinationUrl} className="p-0">
{image}
</Hyperlink>
</IntlProvider>
);
}
2 changes: 1 addition & 1 deletion shell/dev-project/header/CoursesLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useWidgetOptions } from '../../../runtime';

export default function CoursesLink() {
const options = useWidgetOptions();
const title = options.title ?? 'Courses';
const title = typeof options.title === 'string' ? options.title : 'Courses';

return (
<div className="d-flex">
Expand Down
2 changes: 1 addition & 1 deletion shell/dev-project/slot-showcase/LayoutWithOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default function LayoutWithOptions() {
const widgets = useWidgets();
const options = useLayoutOptions();

const title = options.title ?? 'Foo';
const title = typeof options.title === 'string' ? options.title : 'Foo';

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion shell/dev-project/slot-showcase/WidgetWithOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useWidgetOptions } from '../../../runtime';
export default function WidgetWithOptions() {
const options = useWidgetOptions();

const title = options.title ?? 'Foo';
const title = typeof options.title === 'string' ? options.title : 'Foo';

return (
<div>{title}</div>
Expand Down
2 changes: 1 addition & 1 deletion shell/footer/LabeledLinkColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function LabeledLinkColumn() {

return (
<div className="d-flex flex-grow-1 flex-column gap-2 small">
{options.label && (
{typeof options.label === 'string' && (
<div className="mb-1 font-weight-bold">{options.label}</div>
)}
{widgets}
Expand Down
Loading
Loading