Skip to content

Commit fd7e3f1

Browse files
committed
update commands.py and CONTRIBUTING.md to reflect the fact that JS build artifacts must be updated when updating plotly.js version
1 parent 9a753fe commit fd7e3f1

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

CONTRIBUTING.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,22 +273,24 @@ python commands.py updateplotlyjs
273273
```
274274

275275
This downloads new versions of `plot-schema.json` and `plotly.min.js` from the `plotly/plotly.js` GitHub repository
276-
and places them in `plotly/package_data`.
277-
It then regenerates all of the `graph_objs` classes based on the new schema,
278-
and finally runs `npm install` in `js/` to refresh `js/package-lock.json` against the new `plotly.js`.
279-
Commit the updated `js/package-lock.json` along with the regenerated files.
276+
and places them in `codegen/resources/` and `plotly/package_data/`, respectively.
280277

281-
The JupyterLab extension and FigureWidget bundles in `plotly/labextension` and `plotly/package_data/widgetbundle.js`
282-
are rebuilt as part of the release flow (see [RELEASE.md](RELEASE.md)) rather than on every plotly.js bump.
278+
It then does the following:
279+
- Regenerates all of the `graph_objs` classes based on the new schema
280+
- Runs `npm install` in `js/`to refresh `js/package-lock.json` against the new `plotly.js`
281+
- Runs `npm run build` to rebuild the JupyterLab extension and FigureWidget bundles in `plotly/labextension` and `plotly/package_data/widgetbundle.js`.
283282

284-
If you need to skip the `npm install` step entirely (e.g. `npm` isn't available),
283+
Commit the updated files under `js/`, `plotly/graph_objs/`, `plotly/offline/` `codegen/resources/`, and `plotly/package_data/`.
284+
285+
If you need to skip the `npm` steps entirely (e.g. `npm` isn't available),
285286
set the `SKIP_NPM=1` environment variable:
286287

287288
```bash
288289
SKIP_NPM=1 python commands.py updateplotlyjs
289290
```
290291

291-
If you do skip it, you'll need to run `npm install` in `js/` yourself before committing so the lockfile stays in sync.
292+
If you do skip it, you'll need to find a way to manually run `npm install && npm run build` in `js/` before committing,
293+
so that the lockfile and build artifacts stay in sync with `js/package.json`.
292294

293295
### Using a Development Branch of Plotly.js
294296

commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def install_js_deps(local, build=True):
5050
When ``build`` is True (the default), also runs ``npm run build`` to
5151
rebuild the JupyterLab extension and FigureWidget bundles and verifies
5252
that the widget bundle exists. Pass ``build=False`` when you only need
53-
to refresh ``node_modules`` / ``package-lock.json`` (e.g. after a
54-
plotly.js version bump) and don't need the bundles rebuilt.
53+
to refresh ``node_modules`` / ``package-lock.json`` but don't
54+
need the bundles rebuilt.
5555
"""
5656

5757
npmName = "npm"
@@ -224,7 +224,7 @@ def update_plotlyjs(plotly_js_version, outdir):
224224
update_bundle(plotly_js_version)
225225
update_schema(plotly_js_version)
226226
perform_codegen(outdir)
227-
install_js_deps(local=None, build=False)
227+
install_js_deps(local=None, build=True)
228228

229229

230230
# FIXME: switch to argparse

0 commit comments

Comments
 (0)