Skip to content

Commit

Permalink
build: Fix npm package update (#361)
Browse files Browse the repository at this point in the history
- Use `npm version` to bump the version of package.json
  - Updates the package-lock.json correctly as well
- Add `_js` packages for generated JS files when bundling python to
.gitignore
- Add dev0 to the package.json as well
- Fixes #259
  • Loading branch information
mofojed authored Mar 15, 2024
1 parent bb28df3 commit cabbcab
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ post_package_bump_hooks = [
# prepare the github release changelog file
"mkdir -p ../../releases",
"../../tools/extract_changelog.sh CHANGELOG.md > ../../releases/GITHUB_CHANGELOG-{{package}}.md",
# update the version number to have a .dev0 suffix (when possible, only done for python plugins)
# update the version number to have a `dev0` suffix
"../../tools/update_version.sh {{package}} {{version}} --dev",
"git commit -m 'chore(version): update {{package}} version to {{version}}'",
# push the tag and the commits to main
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_js/
1 change: 1 addition & 0 deletions plugins/ui/src/deephaven/ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_js/
13 changes: 11 additions & 2 deletions tools/update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ case "$package" in
update_file table-example/src/js/package.json '"version": "' '",'
;;
ui)
update_file ui/src/js/package.json '"version": "' '",'
update_file ui/src/setup.cfg 'version = ' '' "$extra"
update_file ui/setup.cfg 'version = ' '' "$extra"
;;
utilities)
update_file utilities/setup.cfg 'version = ' '' "$extra"
Expand All @@ -152,4 +151,14 @@ case "$package" in
}
esac

# We still need to bump these JS packages for Enterprise legacy reasons, even though they're packaged with Python
npm_version="${version}"
[ "$dev" = true ] && npm_version="${version}-dev0"
case "$package" in
matplotlib | plotly | plotly-express | ui)
# The working directory is already `plugins/<package-name>`, so we just specify workspace as `src/js` and it does the right thing
npm version "$npm_version" --workspace=src/js
;;
esac

log_info "Done updating $package version to $version${extra}"

0 comments on commit cabbcab

Please sign in to comment.