Skip to content

fix(cli): report the package version from --version - #6

Merged
lecstor merged 1 commit into
mainfrom
fix/cli-version-from-package
Nov 5, 2026
Merged

lecstor merged 1 commit into
mainfrom
fix/cli-version-from-package

Conversation

@lecstor

@lecstor lecstor commented Nov 5, 2026

Copy link
Copy Markdown
Member

Why

makespdf --version always printed 0.1.0. The value was hardcoded in the first scaffold and never updated, so 0.2.1 reports the wrong version.

What changed

  • --version now uses CLIENT_VERSION from client-info.ts, which reads package.json. The X-MakesPDF-Client header already used it.
  • The command definition moves from src/index.ts to src/main.ts, so a test can import it without running the CLI. index.ts now only calls runMain.
  • Changeset included (patch).

Testing

  • The new src/main.test.ts fails against the old value (expected '0.1.0' to be '0.2.1') and passes with the fix.
  • Typecheck, pnpm test (23 tests) and pnpm build pass locally.
  • The built CLI prints 0.2.1 for --version, and skill and --help still work.

The version was hardcoded as 0.1.0 in the first scaffold and never updated. Read it from package.json like the client header does. The command definition moves out of index.ts so a test can import it without running the CLI.
@lecstor
lecstor merged commit 9eaef70 into main Nov 5, 2026
3 checks passed
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.

1 participant