fix: make npm run release work from the frontend subdir#6
Merged
Conversation
npm version skips its git commit/tag step when run from frontend/ (the package dir is not the git root), so the previous flow bumped files and ran the version/postversion hooks but never created the release commit or tag, and pushed prematurely. Drive git explicitly instead. - Add scripts/release.mjs: require a clean tree, bump via `npm version --no-git-tag-version`, sync manifest.json, warn on missing changelog entry, then commit + annotated tag + push --follow-tags. - Point release[:patch|minor|major] at the script; drop the version and postversion lifecycle hooks. - Remove the now-unused sync-manifest-version.mjs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
npm run release(added in #5) didn't actually cut a release. Whennpm versionruns fromfrontend/— which is a subdirectory of the git repo, not the git root — it decides it is "not a git repository" and silently skips creating the release commit and tag, while still running theversion/postversionlifecycle scripts. The net effect:postversion'sgit pushfired prematurely (pushing the wrong commit),vX.Y.Ztag was created, so CI never built a Release.Fix
Drive git explicitly from a script instead of relying on
npm version's built-in git step.scripts/release.mjs:package.json+package-lock.jsonvianpm version <type> --no-git-tag-version.manifest.json.changelog.jsonhas no entry for the new version.git commit→ annotatedgit tag→git push --follow-tags.release[:patch|minor|major]at the script; drop theversionandpostversionlifecycle hooks.sync-manifest-version.mjs.Result
npm run releasenow reliably commits the bump, tagsvX.Y.Z, and pushes — triggering CI to build the zip and create the GitHub Release. Verified the clean-tree guard aborts safely on a dirty tree.🤖 Generated with Claude Code