Skip to content

Commit

Permalink
Switch to using jlpm everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Oct 18, 2024
1 parent eae29e3 commit 25b2fc3
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 72 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python }}
- name: Update yarn
run: npm install --global yarn@^3

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand All @@ -50,9 +47,9 @@ jobs:
python -m pip install jupyter_packaging~=0.7.9
- name: Build the extension
run: |
yarn install --frozen-lockfile
yarn run build
yarn run build:examples
jlpm install --frozen-lockfile
jlpm run build
jlpm run build:examples
# First install the dev jupyterlab_widgets, since it is a dependency
pushd jupyterlab_widgets
Expand All @@ -70,17 +67,17 @@ jobs:
- name: Run JS tests
run: |
pushd packages/base
yarn run test:unit:firefox:headless
jlpm run test:unit:firefox:headless
popd
pushd packages/controls
yarn run test:unit:firefox:headless
jlpm run test:unit:firefox:headless
popd
pushd packages/html-manager
yarn run test:unit:firefox:headless
jlpm run test:unit:firefox:headless
popd
pushd examples/web1
yarn run test:firefox:headless
jlpm run test:firefox:headless
popd
6 changes: 3 additions & 3 deletions dev-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ $? -ne 0 ]; then
exit 1
fi

echo -n "Checking JupyterLab (assuming JupyterLab >=3)... "
echo -n "Checking JupyterLab (assuming JupyterLab >=4)... "
jupyter lab --version 2>/dev/null
if [ $? -ne 0 ]; then
echo "no, skipping installation of widgets for jupyterlab"
Expand All @@ -34,8 +34,8 @@ set -e
nbExtFlags="--sys-prefix $1"

echo -n "Installing and building all yarn packages"
yarn install
yarn run build
jlpm install
jlpm run build

echo -n "widgetsnbextension"
cd widgetsnbextension
Expand Down
10 changes: 5 additions & 5 deletions docs/source/dev_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ To install ipywidgets from git, you will need:
version of the notebook, checkout the appropriate tag.
+ See the
[Compatibility table](https://github.com/jupyter-widgets/ipywidgets#compatibility)

- the latest [JupyterLab release](https://github.com/jupyterlab/jupyterlab/releases)



### Installing With Conda
### Installing With Conda

```bash
conda create -c conda-forge -n ipywidgets yarn notebook
Expand All @@ -41,10 +41,10 @@ Rebuilding after making changes

To build and test changes, run the following commands in the ipywidgets repository root directory, empty your browser's cache, and refresh the page.

yarn run clean
yarn run build
jlpm run clean
jlpm run build

If your changes are confined to one package (for example, just in the widgetsnbextension package), then it may be sufficient to just run `yarn run build` in that specific directory.
If your changes are confined to one package (for example, just in the widgetsnbextension package), then it may be sufficient to just run `jlpm run build` in that specific directory.

Tips and troubleshooting
------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/dev_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ git checkout 7.x
git pull origin 7.x
git reset --hard origin/7.x
git clean -fdx
yarn install
yarn run publish
jlpm install
npm publish
```

Lerna will prompt you for version numbers for each of the changed npm packages. Lerna will then change the versions appropriately (including the interdependency versions), commit, tag, and publish the new packages to npm.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/dev_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ To run the Python tests:

To run the Javascript tests in each package directory:

yarn test
jlpm test

This will run the test suite using `karma` with 'debug' level logging.
8 changes: 4 additions & 4 deletions examples/web1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"scripts": {
"build": "webpack",
"clean": "rimraf built",
"test": "npm run test:firefox && npm run test:chrome",
"test:chrome": "npm run test:default",
"test": "jlpm run test:firefox && jlpm run test:chrome",
"test:chrome": "jlpm run test:default",
"test:default": "karma start karma.config.js --log-level debug",
"test:firefox": "npm run test:default -- --browsers Firefox",
"test:firefox:headless": "npm run test:default -- --browsers FirefoxHeadless"
"test:firefox": "jlpm run test:default -- --browsers Firefox",
"test:firefox:headless": "jlpm run test:default -- --browsers FirefoxHeadless"
},
"dependencies": {
"@jupyter-widgets/base": "^4.1.6",
Expand Down
2 changes: 1 addition & 1 deletion examples/web2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "webpack",
"clean": "rimraf built",
"test": "npm run test:default",
"test": "jlpm run test:default",
"test:default": "echo \"No test specified\""
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/web3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"author": "IPython",
"main": "lib/index.js",
"scripts": {
"build": "npm run clean && tsc && node scripts/copyfiles.js && webpack",
"build": "jlpm run clean && tsc && node scripts/copyfiles.js && webpack",
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo && rimraf built",
"host": "http-server",
"lint": "tslint --project tslint.json --format stylish",
"test": "npm run test:default",
"test": "jlpm run test:default",
"test:default": "echo \"No test specified\""
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/web4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"build": "webpack",
"clean": "rimraf built",
"test": "npm run test:default",
"test": "jlpm run test:default",
"test:default": "echo \"No test specified\""
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.2.1",
"npmClient": "yarn",
"npmClient": "jlpm",
"useWorkspaces": true,
"version": "independent"
}
24 changes: 12 additions & 12 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
"css/*.css"
],
"scripts": {
"build": "npm run build:src",
"build": "jlpm run build:src",
"build:src": "tsc",
"build:test": "tsc --project test && webpack --config test/webpack.conf.js",
"clean": "npm run clean:src",
"clean": "jlpm run clean:src",
"clean:src": "rimraf lib && rimraf tsconfig.tsbuildinfo",
"lint": "tslint --project tslint.json --format stylish",
"prepublish": "npm run clean && npm run build",
"test": "npm run test:unit",
"test:coverage": "npm run build:test && webpack --config test/webpack-cov.conf.js && karma start test/karma-cov.conf.js",
"test:unit": "npm run test:unit:firefox && npm run test:unit:chrome",
"test:unit:chrome": "npm run test:unit:default -- --browsers=Chrome",
"test:unit:chrome:debug": "npm run test:unit:default -- --browsers=Chrome --single-run=false",
"test:unit:default": "npm run build:test && karma start test/karma.conf.js --log-level debug",
"test:unit:firefox": "npm run test:unit:default -- --browsers=Firefox",
"test:unit:firefox:headless": "npm run test:unit:default -- --browsers=FirefoxHeadless",
"test:unit:ie": "npm run test:unit:default -- --browsers=IE"
"prepublish": "jlpm run clean && jlpm run build",
"test": "jlpm run test:unit",
"test:coverage": "jlpm run build:test && webpack --config test/webpack-cov.conf.js && karma start test/karma-cov.conf.js",
"test:unit": "jlpm run test:unit:firefox && jlpm run test:unit:chrome",
"test:unit:chrome": "jlpm run test:unit:default -- --browsers=Chrome",
"test:unit:chrome:debug": "jlpm run test:unit:default -- --browsers=Chrome --single-run=false",
"test:unit:default": "jlpm run build:test && karma start test/karma.conf.js --log-level debug",
"test:unit:firefox": "jlpm run test:unit:default -- --browsers=Firefox",
"test:unit:firefox:headless": "jlpm run test:unit:default -- --browsers=FirefoxHeadless",
"test:unit:ie": "jlpm run test:unit:default -- --browsers=IE"
},
"dependencies": {
"@jupyterlab/services": "^6 || ^7",
Expand Down
22 changes: 11 additions & 11 deletions packages/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
"dist/"
],
"scripts": {
"build": "npm run build:src && npm run build:css",
"build": "jlpm run build:src && jlpm run build:css",
"build:css": "postcss --use postcss-import --use postcss-cssnext -o css/widgets.built.css css/widgets.css",
"build:src": "tsc",
"build:test": "tsc --project test && webpack --config test/webpack.conf.js",
"clean": "npm run clean:src",
"clean": "jlpm run clean:src",
"clean:src": "rimraf lib && rimraf tsconfig.tsbuildinfo",
"lint": "tslint --project tslint.json --format stylish",
"prepublish": "npm run clean && npm run build",
"test": "npm run test:unit",
"test:coverage": "npm run build:test && webpack --config test/webpack-cov.conf.js && karma start test/karma-cov.conf.js",
"test:unit": "npm run test:unit:firefox && npm run test:unit:chrome",
"test:unit:chrome": "npm run test:unit:default -- --browsers=Chrome",
"test:unit:default": "npm run build:test && karma start test/karma.conf.js --log-level debug",
"test:unit:firefox": "npm run test:unit:default -- --browsers=Firefox",
"test:unit:firefox:headless": "npm run test:unit:default -- --browsers=FirefoxHeadless",
"test:unit:ie": "npm run test:unit:default -- --browsers=IE"
"prepublish": "jlpm run clean && jlpm run build",
"test": "jlpm run test:unit",
"test:coverage": "jlpm run build:test && webpack --config test/webpack-cov.conf.js && karma start test/karma-cov.conf.js",
"test:unit": "jlpm run test:unit:firefox && jlpm run test:unit:chrome",
"test:unit:chrome": "jlpm run test:unit:default -- --browsers=Chrome",
"test:unit:default": "jlpm run build:test && karma start test/karma.conf.js --log-level debug",
"test:unit:firefox": "jlpm run test:unit:default -- --browsers=Firefox",
"test:unit:firefox:headless": "jlpm run test:unit:default -- --browsers=FirefoxHeadless",
"test:unit:ie": "jlpm run test:unit:default -- --browsers=IE"
},
"dependencies": {
"@jupyter-widgets/base": "^4.1.6",
Expand Down
16 changes: 8 additions & 8 deletions packages/html-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
"css/*.css"
],
"scripts": {
"build": "npm run build:src && webpack && npm run build:embed-amd",
"build": "jlpm run build:src && webpack && jlpm run build:embed-amd",
"build:embed-amd": "node scripts/concat-amd-build.js && rimraf dist/amd",
"build:src": "tsc",
"build:test": "tsc --project test && webpack --config test/webpack.conf.js",
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo && rimraf dist",
"lint": "tslint --project tslint.json --format stylish",
"prepublish": "npm run clean && npm run build",
"test": "npm run test:unit",
"test:unit": "npm run test:unit:firefox && npm run test:unit:chrome",
"test:unit:chrome": "npm run test:unit:default -- --browsers=Chrome",
"test:unit:default": "npm run build:test && karma start test/karma.conf.js --log-level debug --browsers=Firefox",
"test:unit:firefox": "npm run test:unit:default -- --browsers=Firefox",
"test:unit:firefox:headless": "npm run test:unit:default -- --browsers=FirefoxHeadless"
"prepublish": "jlpm run clean && jlpm run build",
"test": "jlpm run test:unit",
"test:unit": "jlpm run test:unit:firefox && jlpm run test:unit:chrome",
"test:unit:chrome": "jlpm run test:unit:default -- --browsers=Chrome",
"test:unit:default": "jlpm run build:test && karma start test/karma.conf.js --log-level debug --browsers=Firefox",
"test:unit:firefox": "jlpm run test:unit:default -- --browsers=Firefox",
"test:unit:firefox:headless": "jlpm run test:unit:default -- --browsers=FirefoxHeadless"
},
"dependencies": {
"@jupyter-widgets/base": "^4.1.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/output/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "npm run build:src",
"build": "jlpm run build:src",
"build:src": "tsc",
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
"lint": "tslint --project tslint.json --format stylish",
"prepublish": "npm run clean && npm run build",
"prepublish": "jlpm run clean && jlpm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions scripts/travis_install_js.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo `yarn -v`
echo `node -v`
yarn
yarn run build
yarn run build:examples
jlpm
jlpm run build
jlpm run build:examples
10 changes: 5 additions & 5 deletions scripts/travis_script_js.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
set -ex
export CHROME_BIN=chromium-browser

yarn run integrity
jlpm run integrity

cd packages

cd base
yarn run test:unit:$BROWSER
jlpm run test:unit:$BROWSER
cd ..

cd controls
yarn run test:unit:$BROWSER
jlpm run test:unit:$BROWSER
cd ..

cd html-manager
yarn run test:unit:$BROWSER
jlpm run test:unit:$BROWSER
cd ..
cd ..

cd examples/web1
yarn run test:firefox
jlpm run test:firefox
cd ../..
2 changes: 1 addition & 1 deletion widgetsnbextension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"build": "webpack",
"clean": "rimraf widgetsnbextension/static",
"prepublish": "npm run clean && npm run build",
"prepublish": "jlpm run clean && jlpm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
Expand Down

0 comments on commit 25b2fc3

Please sign in to comment.