fix(cli): report packaged version in installed builds#153
fix(cli): report packaged version in installed builds#153benvinegar merged 1 commit intomodem-dev:mainfrom
Conversation
Greptile SummaryThis PR fixes a long-standing issue where Key changes:
Confidence Score: 5/5This PR is safe to merge — the change is a targeted, well-tested simplification with no runtime regressions. All changed files are clean with no P0 or P1 issues. The approach (static JSON import at build time) is the idiomatic solution for this class of problem in Bun bundles. The deduplication of UNKNOWN_CLI_VERSION is strictly an improvement. The new smoke-test assertion closes the gap that originally caused the bug to go undetected. No breaking interface changes. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["bun build --compile src/main.tsx"] -->|"bundles at build time"| B["package.json version\nembedded in binary"]
B --> C["src/core/version.ts\nimport packageJson from '../../package.json'"]
C --> D["resolveCliVersion()"]
D -->|"valid string"| E["return packageJson.version"]
D -->|"empty / non-string\n(defensive guard)"| F["return UNKNOWN_CLI_VERSION\n'0.0.0-unknown'"]
E --> G["hunk --version output"]
F --> G
G --> H["smoke-prebuilt-install.ts\nasserts stdout === packageVersion + newline"]
Reviews (1): Last reviewed commit: "fix(cli): report packaged version in ins..." | Re-trigger Greptile |
|
Sweet! |
https://pi.dev/session/#801a09f0bbc28059312d25111ba2e0e2
Summary
hunk --versionTesting