Skip to content

Commit 9f7efff

Browse files
kdmccormickclaude
andcommitted
feat!: Rename frontend -> frontend-plugin-sample
Why? * frontend-plugin- is a fairly common prefix for plugins using Frontend Plugin Framework * By including the word `sample`, it's more obvious for users of this repo how to adapt it into their own backend plugin (by replacing all occurances of "sample") * When we include a frontend-base "plugin", we'll use the prefix frontend-app- (note that, in frontend-base all plugins are actually just apps). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent e539391 commit 9f7efff

11 files changed

Lines changed: 16 additions & 16 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ jobs:
151151
- name: Setup Node.js
152152
uses: actions/setup-node@v6
153153
with:
154-
node-version-file: './frontend/.nvmrc'
154+
node-version-file: './frontend-plugin-sample/.nvmrc'
155155

156156
- name: Update the package version and publish
157157
run: |
158158
npm install --include=dev
159159
npm version ${{ needs.release.outputs.version }}
160160
npm run build
161161
npm publish
162-
working-directory: './frontend'
162+
working-directory: './frontend-plugin-sample'

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This is a **sample plugin repository** that demonstrates all major Open edX plug
1414

1515
**Repository Structure:**
1616
- `platform-plugin-sample/` - Django app plugin with models, APIs, events, and filters
17-
- `frontend/` - React component for MFE slot customization
17+
- `frontend-plugin-sample/` - React component for MFE slot customization
1818
- `tutor/` - Tutor plugin for easy deployment
1919
- Each directory has comprehensive README.md files with TOCs
2020

@@ -30,7 +30,7 @@ This is a **sample plugin repository** that demonstrates all major Open edX plug
3030
- `platform-plugin-sample/openedx_sample_plugin/pipeline.py` - Open edX Filters implementation
3131
- `platform-plugin-sample/openedx_sample_plugin/models.py` - CourseArchiveStatus model (business logic)
3232
- `platform-plugin-sample/openedx_sample_plugin/views.py` - REST API endpoints consumed by frontend
33-
- `frontend/src/plugin.jsx` - React component that replaces course list slot
33+
- `frontend-plugin-sample/src/plugin.jsx` - React component that replaces course list slot
3434
- `tutor/openedx_sample_plugin.py` - Deployment configuration (currently basic template)
3535

3636
## Build/Lint/Test Commands
@@ -61,7 +61,7 @@ Always run `make quality` and fix issues before creating a PR to ensure consiste
6161
- **Realistic Complexity**: Keep examples practical but not overly complex
6262

6363
### Code Relationships to Preserve
64-
- **Backend ↔ Frontend**: CourseArchiveStatus API in `views.py` consumed by `frontend/src/plugin.jsx`
64+
- **Backend ↔ Frontend**: CourseArchiveStatus API in `views.py` consumed by `frontend-plugin-sample/src/plugin.jsx`
6565
- **Events ↔ Models**: Signal handlers in `signals.py` can update models in `models.py`
6666
- **Settings ↔ Filters**: Filter registration in `settings/common.py` must match classes in `pipeline.py`
6767
- **Apps.py ↔ All**: Plugin configuration affects URL routing, settings, and signal registration

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This sample plugin showcases the **Open edX Hooks Extension Framework**, which a
3232
| **Django App Plugin** | Add models, APIs, views, and business logic | [How to create a plugin app](https://docs.openedx.org/projects/edx-django-utils/en/latest/plugins/how_tos/how_to_create_a_plugin_app.html) | [`platform-plugin-sample/`](./platform-plugin-sample/) | Adding new functionality, APIs, or data models |
3333
| **Events (Signals)** | React to platform events | [Open edX Events Guide](https://docs.openedx.org/projects/openedx-events/en/latest/) | [`platform-plugin-sample/openedx_sample_plugin/signals.py`](./platform-plugin-sample/openedx_sample_plugin/signals.py) | Integrating with external systems, audit logging |
3434
| **Filters** | Modify platform behavior | [Using Open edX Filters](https://docs.openedx.org/projects/openedx-filters/en/latest/how-tos/using-filters.html) | [`platform-plugin-sample/openedx_sample_plugin/pipeline.py`](./platform-plugin-sample/openedx_sample_plugin/pipeline.py) | Customizing business logic, URL redirects |
35-
| **Frontend Slots** | Customize MFE interfaces | [Frontend Plugin Slots](https://docs.openedx.org/en/latest/site_ops/how-tos/use-frontend-plugin-slots.html) | [`frontend/`](./frontend/) | UI customization, adding new components |
35+
| **Frontend Slots** | Customize MFE interfaces | [Frontend Plugin Slots](https://docs.openedx.org/en/latest/site_ops/how-tos/use-frontend-plugin-slots.html) | [`frontend-plugin-sample/`](./frontend-plugin-sample/) | UI customization, adding new components |
3636
| **Brand Packages** | Customize theming | [Open edX Brand Package Interface](https://github.com/openedx/brand-openedx) | [`brand/`](./brand/) | UI theming |
3737
| **Tutor Plugin** | Deploy plugins easily | [Tutor Plugin Development](https://docs.tutor.edly.io/) | [`tutor/`](./tutor/) | Simplified deployment and configuration |
3838

@@ -55,8 +55,8 @@ tutor mounts add "$PWD/platform-plugin-sample"
5555
tutor dev launch
5656

5757
# Frontend Plugin Setup (for learner-dashboard MFE development)
58-
npm install $PWD/frontend
59-
# Add env.config.jsx and module.config.js (see frontend/README.md)
58+
npm install $PWD/frontend-plugin-sample
59+
# Add env.config.jsx and module.config.js (see frontend-plugin-sample/README.md)
6060
npm start
6161
```
6262

@@ -94,7 +94,7 @@ Use the table above to identify which type of plugin matches your needs. You can
9494
- **Backend**: Start with [`platform-plugin-sample/openedx_sample_plugin/apps.py`](./platform-plugin-sample/openedx_sample_plugin/apps.py) to understand plugin registration
9595
- **Events**: Examine [`platform-plugin-sample/openedx_sample_plugin/signals.py`](./platform-plugin-sample/openedx_sample_plugin/signals.py) for event handling patterns
9696
- **Filters**: Review [`platform-plugin-sample/openedx_sample_plugin/pipeline.py`](./platform-plugin-sample/openedx_sample_plugin/pipeline.py) for behavior modification
97-
- **Frontend**: Explore [`frontend/src/plugin.jsx`](./frontend/src/plugin.jsx) for UI customization
97+
- **Frontend**: Explore [`frontend-plugin-sample/src/plugin.jsx`](./frontend-plugin-sample/src/plugin.jsx) for UI customization
9898

9999
### 4. Run This Sample
100100
Follow the [Quick Start Guide](#quick-start-guide) to see everything working together.
@@ -118,7 +118,7 @@ sample-plugin/
118118
│ │ ├── settings/ # Plugin settings configuration
119119
│ │ └── urls.py # URL routing
120120
│ └── tests/ # Comprehensive test examples
121-
├── frontend/
121+
├── frontend-plugin-sample/
122122
│ ├── README.md # Frontend plugin detailed guide
123123
│ ├── src/
124124
│ │ ├── plugin.jsx # React component for MFE slot
@@ -148,11 +148,11 @@ sample-plugin/
148148

149149
1. **Setup**: Follow frontend setup in [Quick Start](#quick-start-guide)
150150
2. **Development**:
151-
- Modify React components in `frontend/src/`
151+
- Modify React components in `frontend-plugin-sample/src/`
152152
- Test with local MFE development server
153153
3. **Testing**: Integration testing with MFE
154154

155-
**Detailed Guide**: See [`frontend/README.md`](./frontend/README.md)
155+
**Detailed Guide**: See [`frontend-plugin-sample/README.md`](./frontend-plugin-sample/README.md)
156156

157157
### Full-Stack Plugin Development
158158

@@ -174,7 +174,7 @@ class CourseArchiveStatusViewSet(viewsets.ModelViewSet):
174174
```
175175

176176
```jsx
177-
// frontend/src/plugin.jsx - Consumes API
177+
// frontend-plugin-sample/src/plugin.jsx - Consumes API
178178
const response = await client.get(
179179
`${lmsBaseUrl}/sample-plugin/api/v1/course-archive-status/`
180180
);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ if (response.data && Array.isArray(response.data)) {
314314

315315
```bash
316316
# In your MFE directory (e.g., frontend-app-learner-dashboard)
317-
npm install /path/to/sample-plugin/frontend
317+
npm install /path/to/sample-plugin/frontend-plugin-sample
318318
```
319319

320320
#### Step 2: Create env.config.jsx
@@ -356,7 +356,7 @@ module.exports = {
356356
localModules: [
357357
{
358358
moduleName: '@openedx/sample-plugin',
359-
dir: '/path/to/sample-plugin/frontend'
359+
dir: '/path/to/sample-plugin/frontend-plugin-sample'
360360
},
361361
],
362362
};

0 commit comments

Comments
 (0)