Skip to content

ct --version prints 0.0.0 — the version is hardcoded, not read from package.json #116

Closed

Description

@2000game

What happens

$ ./node_modules/.bin/ct --version
0.0.0
$ node -p "require('@eqrm/ct-cli/package.json').version"
1.7.0

src/index.ts:25 has .version("0.0.0") as a literal, so every build of every release reports 0.0.0.

Why it matters more than a cosmetic string

--version is the one thing you reach for when a plan does something you did not expect, and it is the only cheap way to answer "am I running the pinned package or something else on this machine?". Because it answers 0.0.0 for both, it cannot distinguish them — and it actively misleads: a downstream repo's handoff notes told the next person that 0.0.0 proves a globally-linked dev build is shadowing the pinned one. That diagnosis was wrong, and the time went into chasing a PATH problem that did not exist.

It also makes bug reports worse: nobody can state the version they hit a bug on without going and reading package.json.

Suggestion

Inject the real version at build time (tsup define, or import package.json with a resolve alias) and have --version print it. If distinguishing a local dev build is useful, printing the resolved entry path alongside it would settle the "which ct am I running" question outright:

1.7.0 (/path/to/repo/node_modules/@eqrm/ct-cli/dist/index.js)

Found on 1.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageUnsorted intake — decide in the weekly sweep

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions