fix(cli): derive baked version from package.json
Problem
superset update reports success but superset --version never changes — e.g. it prints Updated 0.2.19 → 0.2.22 while --version keeps saying 0.2.19.
Root cause
packages/cli/cli.config.ts hardcoded const VERSION = "0.2.19", and that constant is baked into every binary as both --version and process.env.SUPERSET_VERSION. It was never bumped, while package.json and the cli-v* git tags moved on to 0.2.22.
The two sources of truth diverged:
version.txtin thecli-latestrelease is derived from the git tag →0.2.22- the version baked into the binary →
0.2.19
So the update flow: reads version.txt (target 0.2.22), sees baked current 0.2.19, downloads & installs today's tarball (which is the real 0.2.22 build), prints Updated 0.2.19 → 0.2.22 — but the freshly installed binary still self-reports 0.2.19. Every update looks like a no-op and the CLI perpetually thinks an update is available.
Fix
Read the version from package.json so there's a single source of truth that can't drift from the release tag.
-const VERSION = "0.2.19";
+import pkg from "./package.json" with { type: "json" };
+const VERSION = pkg.version;
Notes
Takes effect once the next CLI release is cut — the 0.2.22 build already in cli-latest will keep reporting 0.2.19 until then.
Test plan
-
bun run lint -
bun run typecheck --filter=@superset/cli - Verified
cli.config.tsresolvesversionand theSUPERSET_VERSIONdefine to0.2.22
Summary by cubic
Fixes CLI version reporting by deriving the baked version from package.json. superset --version and SUPERSET_VERSION now match the release tag, so updates no longer look like no-ops.
- Bug Fixes
- Read version from
./package.jsoninpackages/cli/cli.config.tsinstead of a hardcoded string. - Aligns
--versionandprocess.env.SUPERSET_VERSIONwith the publishedcli-v*tag. - Note: takes effect with the next CLI release; the current
0.2.22build will still report0.2.19.
- Read version from
Summary by CodeRabbit
- Chores
- Updated CLI version management to dynamically source from package metadata instead of a hardcoded value, improving version consistency across builds.