Skip to content

Commit 9be2cd4

Browse files
authoredMar 29, 2024··
feat: update packages to make publish smaller (#49)
* chore: replace @edx/frontend-plugin-framework with @openedx/frontend-plugin-framework in example apps * chore: update dev and peer dependency
1 parent bf2f1bf commit 9be2cd4

19 files changed

+180
-247
lines changed
 

‎.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const config = createConfig('eslint');
55

66
config.rules = {
77
'import/no-unresolved': ['error', {
8-
ignore: ['@edx/frontend-plugin-framework/example*'],
8+
ignore: ['@openedx/frontend-plugin-framework/example*'],
99
}],
1010
'import/no-extraneous-dependencies': ['error', {
1111
devDependencies: true,

‎Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ precommit:
2424

2525
requirements:
2626
npm ci
27+
cd example && npm ci && cd ..
28+
cd example-plugin-app && npm ci && cd ..
2729

2830
i18n.extract:
2931
# Pulling display strings from .jsx files into .json files...

‎README.rst

+5-9
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,13 @@ Getting Started
3535
Using the Example Apps
3636
----------------------
3737

38-
1. Run ``npm install`` in the root directory.
38+
1. Run ``make requirements`` in the root directory.
3939

40-
2. In separate terminals, run ``npm install`` inside both example app directories (``/example`` and ``/example-plugin-app``).
40+
2. Run ``npm run start`` in the root directory.
4141

42-
3. Run ``npm run start`` in both directories.
42+
3. Open another terminal and run ``npm run start:example`` to start the example app. You can visit http://localhost:8080 to see the example app.
4343

44-
Alternatively, once the packages are installed in both apps, you can run the apps from the root directory.
45-
46-
1. ``npm run start`` runs the host MFE (``example``)
47-
48-
2. ``npm run start:plugins`` runs the child MFE (``example-plugin-app``)
44+
4. Make change to the existing code, everything should be hot reloaded.
4945

5046
Add Library Dependency
5147
----------------------
@@ -103,7 +99,7 @@ file as well to define its plugin slots.
10399
104100
// env.config.js
105101
106-
import { DIRECT_PLUGIN, IFRAME_PLUGIN, PLUGIN_OPERATIONS } from '@edx/frontend-plugin-framework';
102+
import { DIRECT_PLUGIN, IFRAME_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
107103
108104
// import any additional dependencies or functions to be used for each plugin operation
109105
import Sidebar from './widgets/social/Sidebar';

‎example-plugin-app/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ config.rules = {
88
packageDir: path.join(__dirname, '..'),
99
}],
1010
'import/no-unresolved': ['error', {
11-
ignore: ['@edx/frontend-plugin-framework*'],
11+
ignore: ['@openedx/frontend-plugin-framework*'],
1212
}],
1313
};
1414

‎example-plugin-app/package-lock.json

+42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎example-plugin-app/src/DefaultIframe.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint react/prop-types: off */
22

33
import React from 'react';
4-
import { Plugin } from '@edx/frontend-plugin-framework';
4+
import { Plugin } from '@openedx/frontend-plugin-framework';
55

66
function DefaultComponent() {
77
return (

‎example-plugin-app/src/PluginIframe.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Plugin } from '@edx/frontend-plugin-framework';
2+
import { Plugin } from '@openedx/frontend-plugin-framework';
33

44
export default function PluginIframe() {
55
return (

‎example-plugin-app/webpack.dev.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = createConfig('webpack-dev', {
88
// applications. Because this example app is using code from the parent frontend-plugin-framework
99
// library, it runs into the same issues our applications do when loading libraries from
1010
// local source, rather than from their node_modules directory.
11-
'@edx/frontend-plugin-framework': path.resolve(__dirname, '..', 'src/plugins'),
11+
'@openedx/frontend-plugin-framework': path.resolve(__dirname, '..', 'dist'),
1212
react: path.resolve(__dirname, 'node_modules', 'react'),
1313
'react-dom': path.resolve(__dirname, 'node_modules', 'react-dom'),
1414
'react-router-dom': path.resolve(__dirname, 'node_modules', 'react-router-dom'),

‎example/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ config.rules = {
88
packageDir: path.join(__dirname, '..'),
99
}],
1010
'import/no-unresolved': ['error', {
11-
ignore: ['@edx/frontend-plugin-framework*'],
11+
ignore: ['@openedx/frontend-plugin-framework*'],
1212
}],
1313
};
1414

‎example/env.config.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
DIRECT_PLUGIN,
44
IFRAME_PLUGIN,
55
PLUGIN_OPERATIONS,
6-
} from '@edx/frontend-plugin-framework';
6+
} from '@openedx/frontend-plugin-framework';
77
import DefaultDirectWidget from './src/components/DefaultDirectWidget';
88
import PluginDirect from './src/components/PluginDirect';
99
import ModularComponent from './src/components/ModularComponent';

‎example/package-lock.json

+56-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎example/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"prop-types": "^15.8.1",
1717
"react": "^17.0.0",
1818
"react-dom": "^17.0.0",
19-
"react-router-dom": "^6.22.1",
19+
"react-router": "^6.22.3",
20+
"react-router-dom": "^6.22.3",
2021
"regenerator-runtime": "^0.14.1"
2122
},
2223
"devDependencies": {

‎example/src/pluginSlots/PluginSlotWithInsert.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { PluginSlot } from '@edx/frontend-plugin-framework';
3+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
44

55
function PluginSlotWithInsert() {
66
return (

‎example/src/pluginSlots/PluginSlotWithModifyWrapHide.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { PluginSlot } from '@edx/frontend-plugin-framework';
3+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
44
import ModularComponent from '../components/ModularComponent';
55

66

‎example/src/pluginSlots/PluginSlotWithModularPlugins.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { PluginSlot } from '@edx/frontend-plugin-framework';
3+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
44
import ModularComponent from '../components/ModularComponent';
55

66
function PluginSlotWithModularPlugins() {

‎example/src/pluginSlots/PluginSlotWithoutDefault.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { PluginSlot } from '@edx/frontend-plugin-framework';
3+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
44

55
function PluginSlotWithoutDefault() {
66
return (

‎example/webpack.dev.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = createConfig('webpack-dev', {
88
// applications. Because this example app is using code from the parent frontend-plugin-framework
99
// library, it runs into the same issues our applications do when loading libraries from
1010
// local source, rather than from their node_modules directory.
11-
'@edx/frontend-plugin-framework': path.resolve(__dirname, '..', 'src/plugins'),
11+
'@openedx/frontend-plugin-framework': path.resolve(__dirname, '..', 'dist'),
1212
react: path.resolve(__dirname, 'node_modules', 'react'),
1313
'react-dom': path.resolve(__dirname, 'node_modules', 'react-dom'),
1414
'react-router-dom': path.resolve(__dirname, 'node_modules', 'react-router-dom'),

0 commit comments

Comments
 (0)
Please sign in to comment.