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: add example apps #33

Merged
merged 25 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4840244
feat: WIP add example apps
jsnwesson Feb 26, 2024
2871fb2
refactor: remove i18n files
jsnwesson Feb 26, 2024
9cd9b91
fix: update Plugin to use useIntl
jsnwesson Feb 26, 2024
a8b9ebd
fix: wrap getConfig in usePluginSlot
jsnwesson Feb 27, 2024
1835b2c
feat: add plugin slots and plugin components
jsnwesson Feb 28, 2024
01b6503
feat: add plugin slots to display Operations and modularized plugins
jsnwesson Feb 29, 2024
efeef91
feat: add plugin slot to demonstrate Hide, Modify, Wrap
jsnwesson Feb 29, 2024
877b422
fix: dependency fix
jsnwesson Feb 29, 2024
c6a8ab6
fix: modify lint configuration
jsnwesson Feb 29, 2024
daab333
fix: dependency fix
jsnwesson Feb 29, 2024
005a836
fix: convert frontend build and paragon to use @openedx scope
jsnwesson Feb 29, 2024
3524655
lint: fix linting for example app
jsnwesson Feb 29, 2024
c9bc53b
lint: fix lint for example-plugin-app
jsnwesson Feb 29, 2024
9327e97
fix: lint configuration for plugin library
jsnwesson Feb 29, 2024
2a425d3
fix: lint errors for Plugin and PluginContainers
jsnwesson Feb 29, 2024
3efb5e8
fix: remove unnecessary dependencies, add index file in /src
jsnwesson Feb 29, 2024
e257c22
Revert "fix: remove unnecessary dependencies, add index file in /src"
jsnwesson Mar 1, 2024
577206b
fix: remove frontend-platform from example app package.json
jsnwesson Mar 1, 2024
617e97c
fix: update frontend-platform
jsnwesson Mar 1, 2024
b0a4799
fix: update frontend-platform to resolve sharp issue
jsnwesson Mar 1, 2024
99b9669
fix: lint and license consistency
jsnwesson Mar 1, 2024
d8ef919
chore: bump react versions in example apps
jsnwesson Mar 1, 2024
315375a
docs: fix README format
jsnwesson Mar 1, 2024
a340cab
Merge branch 'master' into jwesson/create-example-apps
jsnwesson Mar 1, 2024
e70b31a
fix: add check for getConfigSlots
jsnwesson Mar 1, 2024
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
19 changes: 17 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const { createConfig } = require('@edx/frontend-build');
const { createConfig } = require('@openedx/frontend-build');

module.exports = createConfig('eslint');
const config = createConfig('eslint');

config.rules = {
'import/no-unresolved': ['error', {
ignore: ['@edx/frontend-plugin-framework/example*'],
}],
'import/no-extraneous-dependencies': ['error', {
devDependencies: true,
}],
};

config.ignorePatterns = [
'example*',
];

module.exports = config;
18 changes: 17 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,27 @@ for a component that lives in another MFE (the 'Child MFE') to be plugged into a

Getting Started
===============
1. Add Library Dependency
Add Library Dependency
-------------------------

Add ``@edx/frontend-plugin-framework`` to the ``package.json`` of both Host and Child MFEs.

Using the Example Apps
----------------------

1. Run ``npm install`` in the root directory.

2. In separate terminals, run ``npm install`` inside both example app directories (``/example`` and ``/example-plugin-app``).

3. Run ``npm run start`` in both directories.

Alternatively, once the packages are installed in both apps, you can run the apps from the root directory.

1. ``npm run start`` runs the host MFE (``example``)

2. ``npm run start:plugins`` runs the child MFE (``example-plugin-app``)


Micro-frontend configuration document (JS)
------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions example-plugin-app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
15 changes: 15 additions & 0 deletions example-plugin-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { getBaseConfig } = require('@openedx/frontend-build');
const path = require('path');

const config = getBaseConfig('eslint');

config.rules = {
'import/no-extraneous-dependencies': ['error', {
packageDir: path.join(__dirname, '..'),
}],
'import/no-unresolved': ['error', {
ignore: ['@edx/frontend-plugin-framework*'],
}],
};

module.exports = config;
32 changes: 32 additions & 0 deletions example-plugin-app/env.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// eslint-disable-next-line no-unused-vars
const config = {
ACCESS_TOKEN_COOKIE_NAME: 'edx-jwt-cookie-header-payload',
ACCOUNT_PROFILE_URL: 'http://localhost:1995',
ACCOUNT_SETTINGS_URL: 'http://localhost:1997',
BASE_URL: 'http://localhost:8081',
CREDENTIALS_BASE_URL: 'http://localhost:18150',
CSRF_TOKEN_API_PATH: '/csrf/api/v1/token',
DISCOVERY_API_BASE_URL: 'http://localhost:18381',
PUBLISHER_BASE_URL: 'http://localhost:18400',
ECOMMERCE_BASE_URL: 'http://localhost:18130',
LANGUAGE_PREFERENCE_COOKIE_NAME: 'openedx-language-preference',
LEARNING_BASE_URL: 'http://localhost:2000',
LMS_BASE_URL: 'http://localhost:18000',
LOGIN_URL: 'http://localhost:18000/login',
LOGOUT_URL: 'http://localhost:18000/logout',
STUDIO_BASE_URL: 'http://localhost:18010',
MARKETING_SITE_BASE_URL: 'http://localhost:18000',
ORDER_HISTORY_URL: 'http://localhost:1996/orders',
REFRESH_ACCESS_TOKEN_ENDPOINT: 'http://localhost:18000/login_refresh',
SEGMENT_KEY: null,
SITE_NAME: 'localhost',
USER_INFO_COOKIE_NAME: 'edx-user-info',
LOGO_URL: 'https://edx-cdn.org/v3/default/logo.svg',
LOGO_TRADEMARK_URL: 'https://edx-cdn.org/v3/default/logo-trademark.svg',
LOGO_WHITE_URL: 'https://edx-cdn.org/v3/default/logo-white.svg',
FAVICON_URL: 'https://edx-cdn.org/v3/default/favicon.ico',
MFE_CONFIG_API_URL: null,
APP_ID: null,
SUPPORT_URL: 'https://support.edx.org',
PORT: 8081,
};
Loading
Loading