Skip to content

refactor: migrate to frontend-base #669

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

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
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
10 changes: 0 additions & 10 deletions .dockerignore

This file was deleted.

44 changes: 0 additions & 44 deletions .env

This file was deleted.

50 changes: 0 additions & 50 deletions .env.development

This file was deleted.

49 changes: 0 additions & 49 deletions .env.test

This file was deleted.

5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions .eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

30 changes: 8 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
.DS_Store
.eslintcache
env.config.*
node_modules
npm-debug.log
coverage

module.config.js
dist/
public/samples/
/*.tgz

### pyenv ###
.python-version
### i18n ###
src/i18n/transifex_input.json

### Emacs ###
### Editors ###
.DS_Store
*~
*.swo
*.swp

### Development environments ###
.idea
.vscode

# Local package dependencies
module.config.js

### transifex ###
src/i18n/transifex_input.json
temp
src/i18n/messages
/temp
/.vscode
16 changes: 5 additions & 11 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
.eslintignore
.eslintrc.json
.gitignore
docker-compose.yml
Dockerfile
Makefile
npm-debug.log

config
coverage
__mocks__
node_modules
public
*.test.js
*.test.jsx
*.test.ts
*.test.tsx
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ pull_translations:
mkdir src/i18n/messages
cd src/i18n/messages \
&& atlas pull $(ATLAS_OPTIONS) \
translations/frontend-platform/src/i18n/messages:frontend-platform \
translations/frontend-base/src/i18n/messages:frontend-base \
translations/paragon/src/i18n/messages:paragon \
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
translations/frontend-app-learner-dashboard/src/i18n/messages:frontend-app-learner-dashboard

$(intl_imports) frontend-platform paragon frontend-component-footer frontend-app-learner-dashboard
$(intl_imports) frontend-base paragon frontend-app-learner-dashboard

# This target is used by CI.
validate-no-uncommitted-package-lock-changes:
Expand Down
29 changes: 4 additions & 25 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ frontend-app-learner-dashboard
The Learner Home app is a microfrontend (MFE) course listing experience for the Open edX Learning Management System
(LMS). This experience was designed to provide a clean and functional interface to allow learners to view all of their
open enrollments, as well as take relevant actions on those enrollments. It also serves as host to a number of exposed
"widget" containers to provide upsell and discovery widgets as sidebar/footer components.
"widget" containers to provide upsell and discovery widgets as sidebar components.

Quickstart
----------
Expand All @@ -30,31 +30,10 @@ To start the MFE and enable the feature in LMS:
From there, simply load the configured address/port. You should be prompted to log into your LMS if you are not
already, and then redirected to your home page.

Plugins
Widgets
-------
This MFE can be customized using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.

The parts of this MFE that can be customized in that manner are documented `here </src/plugin-slots>`_.

Contributing
------------

A core goal of this app is to provide a clean experimentation interface. To promote this end, we have provided a
silo'ed code directory at ``src/widgets`` in which contributors should add their custom widget components. In order to
ensure our ability to maintain the code stability of the app, the code for these widgets should be strictly contained
within the bounds of that directory.

Once written, the widgets can be configured into one of our widget containers at ``src/containers/WidgetContainers``.
This can include conditional logic, as well as Optimizely triggers. It is important to note that our integration tests
will isolate and ignore these containers, and thus testing your widget is the response of the creator/maintainer of the
widget itself.

Some guidelines for writing widgets:

* Code for the widget should be strictly confined to the ``src/widgets`` directory.
* You can load data from the redux store, but should not add or modify fields in that structure.
* Network events should be managed in component hooks, though can use our ``data/constants/requests:requestStates`` for
ease of tracking the request states.
This MFE can be customized with widgets. The parts of this MFE that can be customized in that manner are documented
`here </src/slots>`_.

License
-------
Expand Down
10 changes: 10 additions & 0 deletions app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="@openedx/frontend-base" />

declare module 'site.config' {
export default SiteConfig;
}

declare module '*.svg' {
const content: string;
export default content;
}
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { createConfig } = require('@openedx/frontend-base/config');

module.exports = createConfig('babel');
22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// @ts-check

const { createLintConfig } = require('@openedx/frontend-base/config');

module.exports = createLintConfig(
{
files: [
'src/**/*',
'site.config.*',
],
},
{
ignores: [
'coverage/*',
'dist/*',
'documentation/*',
'node_modules/*',
'**/__mocks__/*',
'**/__snapshots__/*',
],
},
);
Loading