Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 0 additions & 7 deletions lerna.json

This file was deleted.

19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@
"docs/jupyter-chat-example"
],
"scripts": {
"build": "lerna run build --stream --scope jupyterlab-chat-extension --include-dependencies",
"build:core": "lerna run build --stream --scope \"@jupyter/chat\"",
"build:lite-docs": "lerna run build --stream --scope jupyter-chat-example --include-dependencies",
"build:prod": "lerna run build:prod --stream",
"clean": "lerna run clean",
"clean:all": "lerna run clean:all",
"build": "jlpm workspace @jupyter/chat run build && jlpm workspace jupyterlab-chat run build && jlpm workspace jupyterlab-chat-extension run build",
"build:core": "jlpm workspace @jupyter/chat run build",
"build:lite-docs": "jlpm workspace @jupyter/chat run build && jlpm workspace jupyter-chat-example run build",
"build:prod": "jlpm workspace @jupyter/chat run build:prod && jlpm workspace jupyterlab-chat run build:prod && jlpm workspace jupyterlab-chat-extension run build:prod && jlpm workspace jupyter-chat-example run build:prod",
"clean": "jlpm workspace @jupyter/chat run clean && jlpm workspace jupyterlab-chat run clean && jlpm workspace jupyterlab-chat-extension run clean && jlpm workspace jupyter-chat-example run clean",
"clean:all": "jlpm workspace @jupyter/chat run clean:all && jlpm workspace jupyterlab-chat run clean:all && jlpm workspace jupyterlab-chat-extension run clean:all && jlpm workspace jupyter-chat-example run clean:all",
"dev": "jupyter lab --config playground/config.py",
"eslint": "eslint . --ext .ts,.tsx --cache --fix",
"eslint:check": "eslint . --ext .ts,.tsx",
"install:extension": "lerna run install:extension",
"install:extension": "jlpm workspace @jupyter/chat run install:extension && jlpm workspace jupyterlab-chat run install:extension && jlpm workspace jupyterlab-chat-extension run install:extension && jlpm workspace jupyter-chat-example run install:extension",
"lint:check": "jlpm run prettier:check && jlpm run eslint:check",
"lint": "jlpm run prettier && jlpm run eslint && jlpm stylelint",
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
"stylelint": "jlpm stylelint:check --fix",
"stylelint:check": "stylelint --cache \"**/style/**/*.css\"",
"test": "lerna run test",
"watch": "lerna run watch --parallel --stream"
"test": "jlpm workspace @jupyter/chat run test && jlpm workspace jupyterlab-chat run test",
"watch": "jlpm workspace jupyterlab-chat-extension run watch"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^3.0.1",
Expand All @@ -52,7 +52,6 @@
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
"lerna": "^6.4.1",
"prettier": "^3.0.0",
"style-loader": "^3.3.1",
"stylelint": "^15.10.1",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ path = "package.json"
fields = ["description", "authors", "urls"]

[tool.jupyter-releaser.options]
version-cmd = "cd ../.. && python scripts/bump_version.py --force --skip-if-dirty"
version-cmd = "cd ../.. && python scripts/bump_version.py --skip-if-dirty"
python_packages = [
"python/jupyterlab-chat"
]
Expand Down
31 changes: 21 additions & 10 deletions scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from jupyter_releaser.util import get_version, run
from packaging.version import parse

LERNA_CMD = "jlpm run lerna version --no-push --force-publish --no-git-tag-version"

VERSION_SPEC = ["major", "minor", "release", "next", "patch"]


Expand Down Expand Up @@ -54,10 +52,9 @@ def increment_version(current, spec):


@click.command()
@click.option("--force", default=False, is_flag=True)
@click.option("--skip-if-dirty", default=False, is_flag=True)
@click.argument("spec", nargs=1)
def bump(force, skip_if_dirty, spec):
def bump(skip_if_dirty, spec):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we could put this script under tests on CI, just checking if we are able to bump versions?

This could be done separately though, if we are confident the changes still ensure the current release process works as expected.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah by default it tests bumping as next iirc. I meant checking that passing another value like the version number also works fine.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #399

status = run("git status --porcelain").strip()
if len(status) > 0:
if skip_if_dirty:
Expand All @@ -78,14 +75,28 @@ def bump(force, skip_if_dirty, spec):
p = p.replace("a", "alpha").replace("b", "beta")
js_version += f"-{p}.{x}"

# bump the JS packages
lerna_cmd = f"{LERNA_CMD} {js_version}"
if force:
lerna_cmd += " --yes"
run(lerna_cmd)

HERE = Path(__file__).parent.parent.resolve()

# bump the JS workspace packages
workspace_files = list(HERE.glob("packages/*/package.json")) + list(
HERE.glob("docs/*/package.json")
)
local_packages = set()
for pkg_file in workspace_files:
data = json.loads(pkg_file.read_text())
if "name" in data:
local_packages.add(data["name"])
for pkg_file in workspace_files:
data = json.loads(pkg_file.read_text())
data["version"] = js_version
for dep_field in ("dependencies", "devDependencies", "peerDependencies"):
if dep_field in data:
for dep_name in list(data[dep_field]):
if dep_name in local_packages:
data[dep_field][dep_name] = f"^{js_version}"
with pkg_file.open(mode="w") as f:
json.dump(data, f, indent=2)

# bump the Python packages
for version_file in HERE.glob("python/**/_version.py"):
content = version_file.read_text().splitlines()
Expand Down
Loading
Loading