Skip to content

Fix runtime version output - #15

Open
120850853 wants to merge 1 commit into
cloudfloo:mainfrom
120850853:fix-runtime-version-output
Open

Fix runtime version output#15
120850853 wants to merge 1 commit into
cloudfloo:mainfrom
120850853:fix-runtime-version-output

Conversation

@120850853

Copy link
Copy Markdown

Summary

Fixes #14.

The CLI currently hardcodes .version('0.1.0'), so release-published packages can report stale metadata. The current npm package @contextmesh/cli@1.0.0 prints 0.1.0 for contextmesh --version.

This PR:

  • reads the version from the runtime package's package.json,
  • keeps 0.1.0 as a fallback for unusual local/runtime cases,
  • adds a Jest CLI smoke test that simulates a release package version differing from the source checkout version.

Verification

npm run build
npx jest src/__tests__/cli.test.ts --runInBand
npm test -- --runInBand
npm run typecheck
npm run lint:check
npm pack --pack-destination /tmp/earn-micro-scan/contextmesh-pack

Notes:

  • npm run lint:check exits 0; it still reports the existing no-explicit-any warnings in unrelated files.
  • npm ci currently fails on main because package-lock.json is missing optional esbuild/fsevents entries expected by current npm. I used npm install --ignore-scripts --no-audit --no-fund to build the local verification environment and did not commit lockfile churn.

Fresh install smoke from a packed tarball whose package.json version was set to 1.0.0:

contextmesh --version -> 1.0.0
package.json version -> 1.0.0

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.

CLI --version reports 0.1.0 for published 1.0.0 package

1 participant