Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replaced packages @edx/paragon & @edx/frontend-build to use openedx namespace #193

Merged
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const { createConfig } = require('@edx/frontend-build');
const { createConfig } = require('@openedx/frontend-build');

const config = createConfig('eslint', {
rules: {
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json

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

precommit:
npm run lint
Expand Down
7 changes: 5 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { createConfig } = require('@edx/frontend-build');
const { createConfig } = require('@openedx/frontend-build');

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

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

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

Expand Down
6 changes: 3 additions & 3 deletions module.config.js.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ module.exports = {
**********************************************************************************************/

// { moduleName: '@edx/brand', dir: '../brand-openedx' }, // replace with your brand checkout
// { moduleName: '@edx/paragon/scss/core', dir: '../paragon', dist: 'scss/core' },
// { moduleName: '@edx/paragon/icons', dir: '../paragon', dist: 'icons' },
// { moduleName: '@edx/paragon', dir: '../paragon', dist: 'dist' },
// { moduleName: '@openedx/paragon/scss/core', dir: '../paragon', dist: 'scss/core' },
// { moduleName: '@openedx/paragon/icons', dir: '../paragon', dist: 'icons' },
// { moduleName: '@openedx/paragon', dir: '../paragon', dist: 'dist' },
// { moduleName: '@edx/frontend-platform', dir: '../frontend-platform', dist: 'dist' },
],
};
19,013 changes: 7,421 additions & 11,592 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 15 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"scripts": {
"build": "fedx-scripts webpack",
"i18n_extract": "BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null",
"i18n_extract": "fedx-scripts formatjs extract",
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
"snapshot": "fedx-scripts jest --updateSnapshot",
Expand All @@ -35,16 +35,16 @@
},
"dependencies": {
"@edx/brand": "npm:@edx/brand-edx.org@2.1.2",
"@edx/frontend-lib-special-exams": "^2.29.0",
"@edx/frontend-platform": "5.6.1",
"@edx/paragon": "^21.5.3",
"@edx/react-unit-test-utils": "1.7.1",
"@edx/frontend-lib-special-exams": "^3.1.0",
"@edx/frontend-platform": "8.0.0",
"@edx/react-unit-test-utils": "^3.0.0",
"@edx/tinymce-language-selector": "1.1.0",
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-brands-svg-icons": "5.15.4",
"@fortawesome/free-regular-svg-icons": "5.15.4",
"@fortawesome/free-solid-svg-icons": "5.15.4",
"@fortawesome/react-fontawesome": "0.2.2",
"@openedx/paragon": "^21.13.1",
"@reduxjs/toolkit": "^1.9.7",
"@tanstack/react-query": "^4.29.25",
"@tanstack/react-query-devtools": "^4.35.3",
Expand Down Expand Up @@ -75,24 +75,23 @@
},
"devDependencies": {
"@edx/browserslist-config": "^1.1.1",
"@edx/frontend-build": "12.9.17",
"@openedx/frontend-build": "14.0.3",
"@edx/reactifex": "^2.1.1",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "15.0.7",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "12.1.5",
"@testing-library/user-event": "^14.5.1",
"glob": "7.2.3",
"husky": "7.0.4",
"jest": "^29.0.0",
"ts-jest": "^29.0.0"
"jest": "^29.7.0",
"ts-jest": "^29.1.4"
},
"overrides": {
"@edx/react-unit-test-utils": {
"@edx/frontend-build": "12.9.17"
},
"@edx/frontend-lib-special-exams": {
"@edx/frontend-build": "12.9.17",
"@edx/paragon": "^21.5.3"
"@openedx/paragon": "21.13.1"
},
"@edx/frontend-platform": {
"@openedx/paragon": "21.13.1"
}
}
}
2 changes: 1 addition & 1 deletion src/components/ActionButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import { Button, StatefulButton } from '@edx/paragon';
import { Button, StatefulButton } from '@openedx/paragon';

import { MutationStatus } from 'constants/index';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppContainer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';

import { useIntl } from '@edx/frontend-platform/i18n';
import { ErrorPage } from '@edx/frontend-platform/react';
import { Spinner } from '@edx/paragon';
import { Spinner } from '@openedx/paragon';

import {
useIsPageDataLoaded,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Assessment/Assessment.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "~@edx/brand/paragon/variables";
@import "~@edx/paragon/scss/core/core";
@import "~@openedx/paragon/scss/core/core";
@import "~@edx/brand/paragon/overrides";

.assessment-card {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

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

import { useViewStep } from 'hooks/routing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ exports[`<EditableAssessment /> render with criteria 1`] = `
/>
<CriterionContainer
criterion={
Object {
{
"name": "criterion1",
}
}
feedback={
<CriterionFeedback
criterion={
Object {
{
"name": "criterion1",
}
}
Expand All @@ -52,7 +52,7 @@ exports[`<EditableAssessment /> render with criteria 1`] = `
input={
<RadioCriterion
criterion={
Object {
{
"name": "criterion1",
}
}
Expand All @@ -63,14 +63,14 @@ exports[`<EditableAssessment /> render with criteria 1`] = `
/>
<CriterionContainer
criterion={
Object {
{
"name": "criterion2",
}
}
feedback={
<CriterionFeedback
criterion={
Object {
{
"name": "criterion2",
}
}
Expand All @@ -80,7 +80,7 @@ exports[`<EditableAssessment /> render with criteria 1`] = `
input={
<RadioCriterion
criterion={
Object {
{
"name": "criterion2",
}
}
Expand All @@ -91,14 +91,14 @@ exports[`<EditableAssessment /> render with criteria 1`] = `
/>
<CriterionContainer
criterion={
Object {
{
"name": "criterion3",
}
}
feedback={
<CriterionFeedback
criterion={
Object {
{
"name": "criterion3",
}
}
Expand All @@ -108,7 +108,7 @@ exports[`<EditableAssessment /> render with criteria 1`] = `
input={
<RadioCriterion
criterion={
Object {
{
"name": "criterion3",
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Assessment/EditableAssessment/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { Card } from '@edx/paragon';
import { Card } from '@openedx/paragon';
import { useIntl } from '@edx/frontend-platform/i18n';

import { useCriteriaConfig } from 'hooks/assessment';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Collapsible } from '@edx/paragon';
import { Collapsible } from '@openedx/paragon';
import { useIntl } from '@edx/frontend-platform/i18n';
import messages from './messages';

Expand Down
4 changes: 2 additions & 2 deletions src/components/Assessment/ReadonlyAssessment/Feedback.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Collapsible, Icon } from '@edx/paragon';
import { ExpandMore, ExpandLess } from '@edx/paragon/icons';
import { Collapsible, Icon } from '@openedx/paragon';
import { ExpandMore, ExpandLess } from '@openedx/paragon/icons';
import { useIntl } from '@edx/frontend-platform/i18n';

import InfoPopover from 'components/InfoPopover';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`<Feedback /> render without props 1`] = `
<Fragment>
<div
className="\\"mt-2"
className=""mt-2"
>
<div
className="d-flex justify-content-between align-items-center"
Expand All @@ -19,7 +19,7 @@ exports[`<Feedback /> render without props 1`] = `
exports[`<Feedback /> renders the component 1`] = `
<Fragment>
<div
className="\\"mt-2"
className=""mt-2"
>
<div
className="d-flex justify-content-between align-items-center"
Expand Down Expand Up @@ -82,7 +82,7 @@ exports[`<Feedback /> renders the component 1`] = `
exports[`<Feedback /> renders without commentBody 1`] = `
<Fragment>
<div
className="\\"mt-2"
className=""mt-2"
>
<div
className="d-flex justify-content-between align-items-center"
Expand Down Expand Up @@ -112,7 +112,7 @@ exports[`<Feedback /> renders without commentBody 1`] = `
exports[`<Feedback /> renders without criterionDescription 1`] = `
<Fragment>
<div
className="\\"mt-2"
className=""mt-2"
>
<div
className="d-flex justify-content-between align-items-center"
Expand Down Expand Up @@ -170,7 +170,7 @@ exports[`<Feedback /> renders without criterionDescription 1`] = `
exports[`<Feedback /> renders without selectedOption 1`] = `
<Fragment>
<div
className="\\"mt-2"
className=""mt-2"
>
<div
className="d-flex justify-content-between align-items-center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`<ReadOnlyAssessment /> render with assessment 1`] = `
defaultOpen={false}
stepLabel={null}
stepScore={
Object {
{
"earned": 5,
"total": 10,
}
Expand All @@ -27,7 +27,7 @@ exports[`<ReadOnlyAssessment /> render with assessments 1`] = `
defaultOpen={false}
stepLabel={null}
stepScore={
Object {
{
"earned": 5,
"total": 10,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
exports[`<ReadOnlyAssessmentContainer /> renders the component 1`] = `
<ReadOnlyAssessment
assessment={
Object {
{
"abc": "def",
}
}
assessments={
Array [
Object {
[
{
"abc": "def",
},
Object {
{
"ghi": "jkl",
},
]
Expand All @@ -21,7 +21,7 @@ exports[`<ReadOnlyAssessmentContainer /> renders the component 1`] = `
step="Step"
stepLabel={null}
stepScore={
Object {
{
"earned": 5,
"total": 10,
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmDialog/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import { ActionRow, AlertModal } from '@edx/paragon';
import { ActionRow, AlertModal } from '@openedx/paragon';
import { FormattedMessage } from '@edx/frontend-platform/i18n';

import ActionButton from 'components/ActionButton';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CriterionContainer/CriterionContainer.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "~@edx/brand/paragon/variables";
@import "~@edx/paragon/scss/core/core";
@import "~@openedx/paragon/scss/core/core";
@import "~@edx/brand/paragon/overrides";

.criteria-label {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CriterionContainer/CriterionFeedback.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

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

import { useViewStep } from 'hooks/routing';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CriterionContainer/GradedCriterion.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Form, FormControlFeedback } from '@edx/paragon';
import { Form, FormControlFeedback } from '@openedx/paragon';
import { FormattedMessage } from '@edx/frontend-platform/i18n';

import messages from './messages';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CriterionContainer/RadioCriterion.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

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

import {
Expand Down
Loading
Loading