Skip to content

Commit 8782017

Browse files
authored
Add a note about schema inclusion rule (#266)
* Add a note about schema inclusion rule * Expand on schema requirements * Lint
1 parent 871fbe1 commit 8782017

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

main-menu/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,35 @@ in the web browser console.
131131
```
132132
jlab-examples:main-menu has been called from the menu.
133133
```
134+
135+
**WARNING** The schema must be included in the final bundle, and the location of the
136+
schema directory needs to be provided to the JupyterLab extension build system.
137+
138+
To achieve this, the `package.json` must include:
139+
140+
- `"schema/*.json"` entry in the `files` section
141+
- `schemaDir` key with path to the schema directory in the `jupyterlab` section
142+
143+
<!-- prettier-ignore-start -->
144+
```json5
145+
// package.json#L16-L20
146+
147+
"files": [
148+
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
149+
"style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
150+
"schema/*.json"
151+
],
152+
```
153+
<!-- prettier-ignore-end -->
154+
155+
<!-- prettier-ignore-start -->
156+
```json5
157+
// package.json#L94-L98
158+
159+
"jupyterlab": {
160+
"extension": true,
161+
"outputDir": "jupyterlab_examples_main_menu/labextension",
162+
"schemaDir": "schema"
163+
},
164+
```
165+
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)