Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing lerna setup #136

Merged
merged 4 commits into from
Dec 13, 2024
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
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
},
"license": "BSD-3-Clause",
"author": "JupyterLite Contributors",
"workspaces": [
"packages/*"
],
"workspaces": {
"packages": [
"packages/*"
]
},
"repository": {
"type": "git",
"url": "https://github.com/jupyterlite/xeus.git"
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ source_dir = "src"
build_dir = "jupyterlite_xeus/labextension"

[tool.jupyter-releaser.options]
version_cmd = "hatch version"
version_cmd = "python ./scripts/bump_version.py"

[tool.jupyter-releaser.hooks]
before-bump-version = ["python -m pip install 'jupyterlab>=4.0.0,<5'", "jlpm"]
before-build-npm = [
"python -m pip install 'jupyterlab>=4.0.0,<4.3'",
"jlpm",
"YARN_ENABLE_IMMUTABLE_INSTALLS=0 jlpm",
"jlpm build:prod"
]
before-build-python = ["jlpm clean:all"]
Expand Down
30 changes: 30 additions & 0 deletions scripts/bump_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import argparse
import json
from pathlib import Path
from subprocess import run

BUMP_VERSION_CMD = "npx lerna version --no-push --force-publish --no-git-tag-version --yes"


def main():
parser = argparse.ArgumentParser()
parser.add_argument("version")
args = parser.parse_args()
version = args.version

run(f"{BUMP_VERSION_CMD} {version}", shell=True, check=True)

root = Path(__file__).parent.parent
version_file = root / "packages" / "xeus-extension" / "package.json"
package_file = root / "package.json"

version_json = json.loads(version_file.read_text())
version = version_json["version"].replace("-alpha.", "-a").replace("-beta.", "-b").replace("-rc.", "-rc")

package_json = json.loads(package_file.read_text())
package_json["version"] = version
package_file.write_text(json.dumps(package_json, indent=4))


if __name__ == "__main__":
main()
Loading