@openedx/plugin-sample 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +28 -30
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -306,29 +306,34 @@ if (response.data && Array.isArray(response.data)) {
306
306
 
307
307
  ### Prerequisites
308
308
 
309
- 1. **MFE Setup**: Have a learner dashboard MFE running locally
309
+ 1. **Tutor & Tutor-MFE Setup**: Tutor is installed and launched in `dev` mode.
310
310
  2. **Backend Plugin**: Install the backend plugin (see [`../backend-plugin-sample/README.md`](../backend-plugin-sample/README.md))
311
311
  3. **Node.js**: Version 16+ with npm or yarn
312
312
 
313
313
  ### Local Development Setup
314
314
 
315
- #### Step 0: Build Plugin
315
+ #### Step 1: Create module.config.js
316
316
 
317
- ```bash
318
- cd /path/to/sample-plugin/frontend-plugin-sample
319
- npm run build
320
- ```
317
+ Create `module.config.js` in your MFE root, not committed to the repo.
318
+ This tells the MFE to load/use the `@openedx/sample-plugin` package
319
+ as a source (non-built) distribution .
321
320
 
322
- #### Step 1: Install Plugin Package
323
-
324
- ```bash
325
- # In your MFE directory (e.g., frontend-app-learner-dashboard)
326
- npm install /path/to/sample-plugin/frontend-plugin-sample
321
+ ```javascript
322
+ module.exports = {
323
+ localModules: [
324
+ {
325
+ moduleName: '@openedx/plugin-sample',
326
+ dir: '/path/to/sample-plugin/frontend-plugin-sample',
327
+ dist: 'src'
328
+ },
329
+ ],
330
+ };
327
331
  ```
328
332
 
329
333
  #### Step 2: Create env.config.jsx
330
334
 
331
- Create `env.config.jsx` in your MFE root (not committed to repo):
335
+ Create `env.config.jsx` in your MFE root, not committed to the repo.
336
+ This plugs the sample widget into the course list slot.
332
337
 
333
338
  ```javascript
334
339
  import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
@@ -355,29 +360,22 @@ const config = {
355
360
 
356
361
  export default config;
357
362
  ```
358
-
359
- #### Step 3: Create module.config.js
360
-
361
- Create `module.config.js` for local development:
362
-
363
- ```javascript
364
- module.exports = {
365
- localModules: [
366
- {
367
- moduleName: '@openedx/plugin-sample',
368
- dir: '/path/to/sample-plugin/frontend-plugin-sample'
369
- },
370
- ],
371
- };
372
- ```
373
-
374
363
  **Purpose**: Webpack uses your local plugin code instead of the installed package.
375
364
 
376
- #### Step 4: Start Development
365
+ #### Step 3: Start Development
366
+
367
+ Now, from the MFE repository root, install requirements and run the dev server.
377
368
 
378
369
  ```bash
379
- # In your MFE directory
370
+ # Install requirements
380
371
  npm ci
372
+
373
+ # If running Tutor:
374
+ tutor mounts add . # Instruct tutor-mfe to redict requests to this local MFE devserver
375
+ tutor dev reboot -d mfe
376
+ npm run dev
377
+
378
+ # If not running Tutor:
381
379
  npm start
382
380
  ```
383
381
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openedx/plugin-sample",
3
- "version": "3.2.0",
3
+ "version": "3.4.0",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"