Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ jobs:
hatch run lint:build
pipx run interrogate -v .
pipx run doc8 --max-line-length=200 docs/source *.md
npm install -g yarn
yarn
yarn eslint:check
yarn prettier:check
yarn build:utils
yarn integrity
python -m pip install -U "jupyterlab>=4.6.0a0,<4.7"
jlpm
jlpm eslint:check
jlpm prettier:check
jlpm build:utils
jlpm integrity

tests_check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/buildutils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,29 @@ jobs:
- name: Reset version
run: |
hatch version 9.8.7
jlpm run lerna version 9.8.7 --no-push --force-publish --no-git-tag-version --yes
jlpm run set:workspace-version 9.8.7
git commit -am "Release 9.8.7"

- name: Patch Release
run: |
jlpm release:patch --force
jlpm release:patch

- name: Minor Release
run: |
jlpm release:bump minor --force
jlpm release:bump minor

- name: Release Cycle
run: |
# beta
jlpm release:bump release --force
jlpm release:bump release
# rc
jlpm release:bump release --force
jlpm release:bump release
# final
jlpm release:bump release --force
jlpm release:bump release

- name: Major Release
run: |
jlpm release:bump major --force
jlpm release:bump major

npm:
runs-on: ubuntu-latest
Expand Down
21 changes: 0 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,6 @@ Running the end to end tests in headful mode will trigger something like the fol

![playwright-headed-demo](https://user-images.githubusercontent.com/591645/141274633-ca9f9c2f-eef6-430e-9228-a35827f8133d.gif)

## Tasks caching

The repository is configured to use the Lerna caching system (via `nx`) for some of the development scripts.

This helps speed up rebuilds when running `jlpm run build` multiple times to avoid rebuilding packages that have not changed on disk.

You can generate a graph to have a better idea of the dependencies between all the packages using the following command:

```
npx nx graph
```

Running the command will open a browser tab by default with a graph that looks like the following:

![a screenshot showing the nx task graph](https://github.com/jupyter/notebook/assets/591645/34eb46f0-b0e5-44b6-9430-ae5fbd673a4b)

To learn more about Lerna caching:

- https://lerna.js.org/docs/features/cache-tasks
- https://nx.dev/docs/features/cache-task-results

### Updating reference snapshots

Often a PR might make changes to the user interface, which can cause the visual regression tests to fail.
Expand Down
1 change: 0 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@
},
"devDependencies": {
"@jupyterlab/builder": "~4.6.0-alpha.4",
"@jupyterlab/buildutils": "~4.6.0-alpha.4",
"@rspack/cli": "^1.7.1",
"@rspack/core": "^1.7.1",
"@types/rimraf": "^3.0.2",
Expand Down
14 changes: 14 additions & 0 deletions buildutils/src/npm-pack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

import commander from 'commander';

import { packPublicWorkspaces } from './utils';

commander.description('Pack all public workspace packages').action(() => {
packPublicWorkspaces();
});

commander.parse(process.argv);
77 changes: 20 additions & 57 deletions buildutils/src/release-bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ import * as utils from '@jupyterlab/buildutils';

import commander from 'commander';

import { getPythonVersion, postbump } from './utils';
import {
getPythonVersion,
jsVersionToPythonVersion,
normalizeJSVersion,
postbump,
syncWorkspaceVersions,
} from './utils';

// Specify the program signature.
commander
.description('Update the version')
.option('--dry-run', 'Dry run')
.option('--force', 'Force the upgrade')
.option('--skip-commit', 'Whether to skip commit changes')
.arguments('<spec>')
.action((spec: any, opts: any) => {
Expand All @@ -36,21 +41,24 @@ commander
// For patch, defer to `patch:release` command
if (spec === 'patch') {
let cmd = 'jlpm run release:patch';
if (opts.force) {
cmd += ' --force';
}
if (!commit) {
cmd += ' --skip-commit';
}
utils.run(cmd);
process.exit(0);
}

const symbolicSpecs = new Set(['major', 'minor', 'release', 'build']);

// Make sure we have a valid version spec.
const options = ['major', 'minor', 'release', 'build'];
if (options.indexOf(spec) === -1) {
throw new Error(`Version spec must be one of: ${options}`);
if (!symbolicSpecs.has(spec)) {
spec = jsVersionToPythonVersion(normalizeJSVersion(spec));
}

if (isFinal && spec === 'release') {
throw new Error('Use "major" or "minor" to switch back to alpha release');
}

if (isFinal && spec === 'build') {
throw new Error('Cannot increment a build on a final release');
}
Expand All @@ -63,51 +71,13 @@ commander
return;
}

// If this is a major release during the alpha cycle, bump
// just the Python version.
if (prev.indexOf('a') !== -1 && spec === 'major') {
// Bump the version.
if (!symbolicSpecs.has(spec)) {
utils.run(`hatch version ${spec}`);

// Run the post-bump script.
syncWorkspaceVersions(getPythonVersion());
postbump(commit);

return;
}

// Determine the version spec to use for lerna.
let lernaVersion = 'preminor';
if (spec === 'build') {
lernaVersion = 'prerelease';
// a -> b
} else if (spec === 'release' && prev.indexOf('a') !== -1) {
lernaVersion = 'prerelease --preid=beta';
// b -> rc
} else if (spec === 'release' && prev.indexOf('b') !== -1) {
lernaVersion = 'prerelease --preid=rc';
// rc -> final
} else if (spec === 'release' && prev.indexOf('rc') !== -1) {
lernaVersion = 'patch';
}
if (lernaVersion === 'preminor') {
lernaVersion += ' --preid=alpha';
}

let cmd = `jlpm run lerna version --force-publish --no-push --no-git-tag-version ${lernaVersion}`;
if (opts.force) {
cmd += ' --yes';
}
// For a preminor release, we bump 10 minor versions so that we do
// not conflict with versions during minor releases of the top
// level package.
if (lernaVersion === 'preminor') {
for (let i = 0; i < 10; i++) {
utils.run(cmd);
}
} else {
utils.run(cmd);
}

// Bump the version.
let pySpec = spec;
if (spec === 'release') {
Expand All @@ -129,17 +99,10 @@ commander
pySpec = 'rc';
}
} else if (spec === 'major' || spec === 'minor') {
if (prev.indexOf('a') !== -1) {
pySpec = `${spec},beta`;
} else if (prev.indexOf('b') !== -1) {
pySpec = `${spec},rc`;
} else if (prev.indexOf('rc') !== -1) {
pySpec = `${spec},release`;
} else {
pySpec = `${spec},alpha`;
}
pySpec = `${spec},alpha`;
}
utils.run(`hatch version ${pySpec}`);
syncWorkspaceVersions(getPythonVersion());

// Run the post-bump script.
postbump(commit);
Expand Down
12 changes: 2 additions & 10 deletions buildutils/src/release-patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import * as utils from '@jupyterlab/buildutils';

import commander from 'commander';

import { getPythonVersion, postbump } from './utils';
import { getPythonVersion, postbump, syncWorkspaceVersions } from './utils';

// Specify the program signature.
commander
.description('Create a patch release')
.option('--force', 'Force the upgrade')
.option('--skip-commit', 'Whether to skip commit changes')
.action((options: any) => {
// Make sure we can patch release.
Expand All @@ -34,14 +33,7 @@ commander

// Patch the python version
utils.run('hatch version patch');

// Version the changed
let cmd =
'jlpm run lerna version patch --no-push --force-publish --no-git-tag-version';
if (options.force) {
cmd += ' --yes';
}
utils.run(cmd);
syncWorkspaceVersions(getPythonVersion());

// Whether to commit after bumping
const commit = options.skipCommit !== true;
Expand Down
17 changes: 17 additions & 0 deletions buildutils/src/set-workspace-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

import commander from 'commander';

import { syncWorkspaceVersions } from './utils';

commander
.description('Set the JavaScript workspace package versions')
.arguments('<version>')
.action((version: string) => {
syncWorkspaceVersions(version);
});

commander.parse(process.argv);
Loading
Loading