Skip to content

fix(cli): derive VERSION from package.json so release bumps stay in sync - #256

Merged
nakasyou merged 1 commit into
mainfrom
fix/cli-version-single-source
Nov 4, 2026
Merged

nakasyou merged 1 commit into
mainfrom
fix/cli-version-single-source

Conversation

@nakasyou

@nakasyou nakasyou commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Problem

The publish workflow run for the CLI release failed at Build and test:

packages/cli test: FAIL test/version.test.ts > CLI version stays in sync with package.json
AssertionError: Expected values to be strictly equal: '0.1.0' !== '0.1.2'

publish.yml bumps packages/cli/package.json via npm version before running the build/tests, but src/version.ts held 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 stale line --version / MCP serverInfo.version).

Changes

  • packages/cli/src/version.ts now derives VERSION from ../package.json (JSON import, inlined at build time by vp pack), so a release bump needs no second edit.
  • packages/cli/test/version.test.ts keeps the manifest comparison as a wiring guard and adds a semver shape assertion.

Testing

  • Reproduced the failure locally at the bumped manifest version.
  • cd packages/cli && pnpm exec vp test — 51 passed.
  • Simulated the release bump (package.json → 0.1.2): tests pass and node dist/line.mjs --version prints 0.1.2.
  • pnpm run build, pnpm test, pnpm run test:scripts, pnpm run check all pass locally.

No credentials or protocol behavior involved.

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.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@nakasyou
nakasyou merged commit 72fd535 into main Nov 4, 2026
2 checks passed
@nakasyou
nakasyou deleted the fix/cli-version-single-source branch November 4, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants