Skip to content

Commit cbfddad

Browse files
committed
Add CI to check for changes to js build files
1 parent b8cc069 commit cbfddad

9 files changed

+4011
-35
lines changed

.circleci/config.yml

+12-33
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,27 @@ executors:
1414
- image: cimg/python:<<parameters.python_version>>-browsers
1515

1616
commands:
17+
check-js-build:
18+
description: Fail if JupyterLab extension build artifacts are out of date
19+
steps:
20+
- run:
21+
name: Check JupyterLab build artifacts
22+
command: |
23+
echo "Checking for uncommitted changes in plotly/labextension/..."
24+
git diff --exit-code plotly/labextension/ || (echo "Error: JupyterLab build artifacts out of date. Run 'npm run build' in js/ and commit the results." && exit 1)
25+
1726
test_core:
1827
steps:
1928
- checkout
2029
- browser-tools/install-chrome
2130
- browser-tools/install-chromedriver
31+
- check-js-build
2232
- run:
2333
name: Install dependencies
2434
command: |
2535
curl -LsSf https://astral.sh/uv/install.sh | sh
2636
uv venv
2737
source .venv/bin/activate
28-
uv pip install jupyter
29-
cd js
30-
npm ci
31-
npm run build
32-
cd ..
3338
uv pip install .
3439
uv pip install -r ./test_requirements/requirements_core.txt
3540
- run:
@@ -55,17 +60,13 @@ commands:
5560
- checkout
5661
- browser-tools/install-chrome
5762
- browser-tools/install-chromedriver
63+
- check-js-build
5864
- run:
5965
name: Install dependencies
6066
command: |
6167
curl -LsSf https://astral.sh/uv/install.sh | sh
6268
uv venv
6369
source .venv/bin/activate
64-
uv pip install jupyter
65-
cd js
66-
npm ci
67-
npm run build
68-
cd ..
6970
uv pip install .
7071
uv pip install -r ./test_requirements/requirements_optional.txt
7172
@@ -243,11 +244,6 @@ jobs:
243244
curl -LsSf https://astral.sh/uv/install.sh | sh
244245
uv venv
245246
source .venv/bin/activate
246-
uv pip install jupyter
247-
cd js
248-
npm i
249-
npm run build
250-
cd ..
251247
uv pip install -e .
252248
uv pip install -r ./test_requirements/requirements_core.txt black inflect jupyterlab
253249
- run:
@@ -281,19 +277,6 @@ jobs:
281277

282278
steps:
283279
- checkout
284-
285-
- run:
286-
name: initial NPM Build
287-
command: |
288-
curl -LsSf https://astral.sh/uv/install.sh | sh
289-
uv venv
290-
source .venv/bin/activate
291-
uv pip install jupyter
292-
cd js
293-
npm ci
294-
npm run build
295-
git status
296-
297280
- run:
298281
name: PyPI Build
299282
command: |
@@ -324,6 +307,7 @@ jobs:
324307
- checkout
325308
- browser-tools/install-chrome
326309
- browser-tools/install-chromedriver
310+
- check-js-build
327311

328312
- run:
329313
name: Install dependencies
@@ -337,11 +321,6 @@ jobs:
337321
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
338322
uv pip uninstall plotly
339323
uv pip install -e .
340-
uv pip install jupyter
341-
cd js
342-
npm ci
343-
npm run build
344-
cd ../..
345324
fi
346325
347326
- run:

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ doc/.ipynb_checkpoints
6060
tags
6161
doc/check-or-enforce-order.py
6262
plotly/package_data/widgetbundle.js
63-
plotly/labextension/*
64-
js/lib
6563

6664
tests/percy/*.html
6765
tests/percy/pandas2/*.html

js/lib/mimeExtension.js

+3,865
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plotly/labextension/package.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "jupyterlab-plotly",
3+
"main": "lib/mimeExtension.js",
4+
"repository": {
5+
"type": "git",
6+
"url": "https://github.com/plotly/plotly.py"
7+
},
8+
"description": "The plotly Jupyter extension",
9+
"author": "The plotly.py team",
10+
"license": "MIT",
11+
"scripts": {
12+
"build:widget": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/package_data/widgetbundle.js src/widget.ts",
13+
"build:mimerenderer": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=lib/mimeExtension.js src/mimeExtension.ts",
14+
"build:labextension": "jupyter labextension build .",
15+
"build": "npm run build:widget && npm run build:mimerenderer && npm run build:labextension",
16+
"watch": "npm run build -- --watch --sourcemap=inline",
17+
"typecheck": "tsc --noEmit"
18+
},
19+
"dependencies": {
20+
"lodash-es": "^4.17.21",
21+
"plotly.js": "3.0.1",
22+
"@lumino/widgets": "~2.4.0"
23+
},
24+
"devDependencies": {
25+
"@jupyterlab/builder": "^4.3.6 || ^3.6.8",
26+
"@types/plotly.js": "^2.33.4",
27+
"esbuild": "^0.23.1",
28+
"typescript": "^5.6.2"
29+
},
30+
"jupyterlab": {
31+
"mimeExtension": true,
32+
"outputDir": "../plotly/labextension",
33+
"_build": {
34+
"load": "static/remoteEntry.6da8cafc79c9700a7f84.js",
35+
"mimeExtension": "./mimeExtension"
36+
}
37+
}
38+
}

plotly/labextension/static/340.183c15a978a3bd06e343.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*! Bundled license information:
2+
3+
plotly.js/dist/plotly.js:
4+
(*!
5+
* The buffer module from node.js, for the browser.
6+
*
7+
* @author Feross Aboukhadijeh <https://feross.org>
8+
* @license MIT
9+
*)
10+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
11+
(*!
12+
* Determine if an object is a Buffer
13+
*
14+
* @author Feross Aboukhadijeh <https://feross.org>
15+
* @license MIT
16+
*)
17+
(*!
18+
* pad-left <https://github.com/jonschlinkert/pad-left>
19+
*
20+
* Copyright (c) 2014-2015, Jon Schlinkert.
21+
* Licensed under the MIT license.
22+
*)
23+
(*!
24+
* repeat-string <https://github.com/jonschlinkert/repeat-string>
25+
*
26+
* Copyright (c) 2014-2015, Jon Schlinkert.
27+
* Licensed under the MIT License.
28+
*)
29+
(*! Bundled license information:
30+
31+
native-promise-only/lib/npo.src.js:
32+
(*! Native Promise Only
33+
v0.8.1 (c) Kyle Simpson
34+
MIT License: http://getify.mit-license.org
35+
*)
36+
37+
polybooljs/index.js:
38+
(*
39+
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
40+
* @license MIT
41+
* @preserve Project Home: https://github.com/voidqk/polybooljs
42+
*)
43+
44+
ieee754/index.js:
45+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
46+
47+
buffer/index.js:
48+
(*!
49+
* The buffer module from node.js, for the browser.
50+
*
51+
* @author Feross Aboukhadijeh <https://feross.org>
52+
* @license MIT
53+
*)
54+
55+
safe-buffer/index.js:
56+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
57+
58+
assert/build/internal/util/comparisons.js:
59+
(*!
60+
* The buffer module from node.js, for the browser.
61+
*
62+
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
63+
* @license MIT
64+
*)
65+
66+
object-assign/index.js:
67+
(*
68+
object-assign
69+
(c) Sindre Sorhus
70+
@license MIT
71+
*)
72+
73+
maplibre-gl/dist/maplibre-gl.js:
74+
(**
75+
* MapLibre GL JS
76+
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt
77+
*)
78+
*)
79+
*/

plotly/labextension/static/remoteEntry.6da8cafc79c9700a7f84.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plotly/labextension/static/style.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* This is a generated file of CSS imports */
2+
/* It was generated by @jupyterlab/builder in Build.ensureAssets() */
3+
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"packages": [
3+
{
4+
"name": "process",
5+
"versionInfo": "0.11.10",
6+
"licenseId": "MIT",
7+
"extractedText": "(The MIT License)\n\nCopyright (c) 2013 Roman Shtylman <[email protected]>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
8+
}
9+
]
10+
}

0 commit comments

Comments
 (0)