Repository navigation
fix(cli): derive VERSION from package.json so release bumps stay in sync - #256
Merged
Merged
Conversation
The publish workflow bumps packages/cli/package.json before building and testing, but src/version.ts held a hand-maintained copy. The release run for cli 0.1.2 therefore failed 'CLI version stays in sync with package.json'. Import the manifest version instead, so a bump needs no second edit, and keep the test as a wiring/semver guard.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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
The
publishworkflow run for the CLI release failed at Build and test:publish.ymlbumpspackages/cli/package.jsonvianpm versionbefore running the build/tests, butsrc/version.tsheld a hand-maintained copy of the version. Every release bump therefore broke the CLI test suite (and, if it had passed, would have shipped a staleline --version/ MCPserverInfo.version).Changes
packages/cli/src/version.tsnow derivesVERSIONfrom../package.json(JSON import, inlined at build time byvp pack), so a release bump needs no second edit.packages/cli/test/version.test.tskeeps the manifest comparison as a wiring guard and adds a semver shape assertion.Testing
cd packages/cli && pnpm exec vp test— 51 passed.package.json→0.1.2): tests pass andnode dist/line.mjs --versionprints0.1.2.pnpm run build,pnpm test,pnpm run test:scripts,pnpm run checkall pass locally.No credentials or protocol behavior involved.