Skip to content

fix: flakemetry --version reported 0.0.0 whatever was installed - #287

Merged
AKogut merged 1 commit into
mainfrom
fix/cli-version
Aug 18, 2026
Merged

fix: flakemetry --version reported 0.0.0 whatever was installed#287
AKogut merged 1 commit into
mainfrom
fix/cli-version

Conversation

@AKogut

@AKogut AKogut commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Found while looking for tasks small enough to hand a first-time contributor for #78. This one is too misleading to leave lying around as bait.

$ flakemetry --version
0.0.0            ← package published 0.2.1

CLI_VERSION was a hardcoded '0.0.0'. The version is the first thing anyone is asked for in a bug report, and this one identified nothing — including for the config bug fixed in #279, where 0.2.0 and 0.2.1 behave very differently.

Baked in at build time rather than read at runtime: the published package has no package.json beside the bundle to resolve from.

The test runs the binary

It executes the built dist/cli.js rather than importing the constant, because the constant cannot tell whether the define reached the bundle — which is the only thing that matters. Proved by removing the define:

× reports the version the package actually publishes
AssertionError: expected '0.0.0-dev' to be '0.2.1'

The fallback is 0.0.0-dev rather than 0.0.0, so an unbuilt or misbuilt binary says so instead of impersonating a release.

62/62 turbo tasks.

Found while looking for tasks small enough to hand a first-time contributor.
This one is too misleading to leave lying around: CLI_VERSION was a hardcoded
'0.0.0' while the package published 0.2.1, so the first thing anyone is asked
for in a bug report identified nothing at all.

Baked in at build time rather than read at runtime, because the published
package has no package.json beside the bundle to resolve from.

The test runs the built binary rather than reading the source constant — the
constant cannot tell whether the define actually reached the bundle, which is
the only thing that matters here. Removing the define makes it fail with
0.0.0-dev, which is also a better fallback than a version that looks real.
@AKogut
AKogut merged commit 9ea296a into main Aug 18, 2026
5 checks passed
@AKogut
AKogut deleted the fix/cli-version branch August 18, 2026 13:05
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