Skip to content

Commit 7f89bfd

Browse files
authored
feat: replaced packages @edx/paragon & @edx/frontend-build to use openedx namespace (#193)
* feat: replace edx with openedx namespace for paragon & frontend-build, updated respective packages * refactor: updated jest config * feat: babel-plugin-react-intl to babel-plugin-formatjs migration * feat: major version upgrades for frontend-build & frontend-platform along with respective packages * fix: downgrade testing-library packages to version compatible with react v17 * fix: updated jest config to resolve errors, updated snapshots * refactor: updated package-lock to resolve build failures * fix: updated useAddFile function, Blob type to File to resolve property type errors
1 parent eea1f76 commit 7f89bfd

File tree

96 files changed

+7696
-11865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+7696
-11865
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
2-
const { createConfig } = require('@edx/frontend-build');
2+
const { createConfig } = require('@openedx/frontend-build');
33

44
const config = createConfig('eslint', {
55
rules: {

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ i18n = ./src/i18n
77
transifex_input = $(i18n)/transifex_input.json
88

99
# This directory must match .babelrc .
10-
transifex_temp = ./temp/babel-plugin-react-intl
10+
transifex_temp = ./temp/babel-plugin-formatjs
1111

1212
precommit:
1313
npm run lint

jest.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { createConfig } = require('@edx/frontend-build');
1+
const { createConfig } = require('@openedx/frontend-build');
22

33
const config = createConfig('jest', {
44
// setupFilesAfterEnv is used after the jest environment has been loaded. In general this is what you want.
@@ -16,12 +16,15 @@ const config = createConfig('jest', {
1616
'src/data/services/lms/fakeData', // don't check coverage for fake data
1717
],
1818
testTimeout: 120000,
19+
moduleNameMapper: {
20+
'@edx/frontend-lib-special-exams': '<rootDir>/node_modules/@edx/frontend-lib-special-exams',
21+
},
1922
});
2023

2124
config.moduleDirectories = ['node_modules', 'src'];
2225

2326
// add axios to the list of modules to not transform
24-
config.transformIgnorePatterns = ['/node_modules/(?!@edx|axios)'];
27+
config.transformIgnorePatterns = ['/node_modules/(?!@(open)?edx|axios)'];
2528
config.testPathIgnorePatterns = ['/dist'];
2629
console.log({ jestTestConfig: config });
2730

module.config.js.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ module.exports = {
2323
**********************************************************************************************/
2424

2525
// { moduleName: '@edx/brand', dir: '../brand-openedx' }, // replace with your brand checkout
26-
// { moduleName: '@edx/paragon/scss/core', dir: '../paragon', dist: 'scss/core' },
27-
// { moduleName: '@edx/paragon/icons', dir: '../paragon', dist: 'icons' },
28-
// { moduleName: '@edx/paragon', dir: '../paragon', dist: 'dist' },
26+
// { moduleName: '@openedx/paragon/scss/core', dir: '../paragon', dist: 'scss/core' },
27+
// { moduleName: '@openedx/paragon/icons', dir: '../paragon', dist: 'icons' },
28+
// { moduleName: '@openedx/paragon', dir: '../paragon', dist: 'dist' },
2929
// { moduleName: '@edx/frontend-platform', dir: '../frontend-platform', dist: 'dist' },
3030
],
3131
};

package-lock.json

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

package.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"scripts": {
1313
"build": "fedx-scripts webpack",
14-
"i18n_extract": "BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null",
14+
"i18n_extract": "fedx-scripts formatjs extract",
1515
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
1616
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
1717
"snapshot": "fedx-scripts jest --updateSnapshot",
@@ -35,16 +35,16 @@
3535
},
3636
"dependencies": {
3737
"@edx/brand": "npm:@edx/[email protected]",
38-
"@edx/frontend-lib-special-exams": "^2.29.0",
39-
"@edx/frontend-platform": "5.6.1",
40-
"@edx/paragon": "^21.5.3",
41-
"@edx/react-unit-test-utils": "1.7.1",
38+
"@edx/frontend-lib-special-exams": "^3.1.0",
39+
"@edx/frontend-platform": "8.0.0",
40+
"@edx/react-unit-test-utils": "^3.0.0",
4241
"@edx/tinymce-language-selector": "1.1.0",
4342
"@fortawesome/fontawesome-svg-core": "1.2.36",
4443
"@fortawesome/free-brands-svg-icons": "5.15.4",
4544
"@fortawesome/free-regular-svg-icons": "5.15.4",
4645
"@fortawesome/free-solid-svg-icons": "5.15.4",
4746
"@fortawesome/react-fontawesome": "0.2.2",
47+
"@openedx/paragon": "^21.13.1",
4848
"@reduxjs/toolkit": "^1.9.7",
4949
"@tanstack/react-query": "^4.29.25",
5050
"@tanstack/react-query-devtools": "^4.35.3",
@@ -75,24 +75,23 @@
7575
},
7676
"devDependencies": {
7777
"@edx/browserslist-config": "^1.1.1",
78-
"@edx/frontend-build": "12.9.17",
78+
"@openedx/frontend-build": "14.0.3",
7979
"@edx/reactifex": "^2.1.1",
80-
"@testing-library/dom": "^10.0.0",
81-
"@testing-library/jest-dom": "6.4.5",
82-
"@testing-library/react": "15.0.7",
80+
"@testing-library/dom": "^9.3.3",
81+
"@testing-library/jest-dom": "5.17.0",
82+
"@testing-library/react": "12.1.5",
8383
"@testing-library/user-event": "^14.5.1",
8484
"glob": "7.2.3",
8585
"husky": "7.0.4",
86-
"jest": "^29.0.0",
87-
"ts-jest": "^29.0.0"
86+
"jest": "^29.7.0",
87+
"ts-jest": "^29.1.4"
8888
},
8989
"overrides": {
90-
"@edx/react-unit-test-utils": {
91-
"@edx/frontend-build": "12.9.17"
92-
},
9390
"@edx/frontend-lib-special-exams": {
94-
"@edx/frontend-build": "12.9.17",
95-
"@edx/paragon": "^21.5.3"
91+
"@openedx/paragon": "21.13.1"
92+
},
93+
"@edx/frontend-platform": {
94+
"@openedx/paragon": "21.13.1"
9695
}
9796
}
9897
}

src/components/ActionButton.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
44

5-
import { Button, StatefulButton } from '@edx/paragon';
5+
import { Button, StatefulButton } from '@openedx/paragon';
66

77
import { MutationStatus } from 'constants/index';
88

src/components/AppContainer/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33

44
import { useIntl } from '@edx/frontend-platform/i18n';
55
import { ErrorPage } from '@edx/frontend-platform/react';
6-
import { Spinner } from '@edx/paragon';
6+
import { Spinner } from '@openedx/paragon';
77

88
import {
99
useIsPageDataLoaded,

src/components/Assessment/Assessment.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@import "~@edx/brand/paragon/variables";
2-
@import "~@edx/paragon/scss/core/core";
2+
@import "~@openedx/paragon/scss/core/core";
33
@import "~@edx/brand/paragon/overrides";
44

55
.assessment-card {

src/components/Assessment/EditableAssessment/OverallFeedback/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { Form } from '@edx/paragon';
3+
import { Form } from '@openedx/paragon';
44
import { useIntl } from '@edx/frontend-platform/i18n';
55

66
import { useViewStep } from 'hooks/routing';

0 commit comments

Comments
 (0)