Commit 26f7e54
authored
Dev-stamp the standalone CLI version in nightly builds (#3928)
## Related issues
- Related to [STU-1772](https://linear.app/a8c/issue/STU-1772) — the
standalone CLI update workflow depends on this.
## How AI was used in this PR
Caught during real-world testing: installing a published nightly CLI
showed `studio --version` → `1.11.0`, even though the Apps CDN publishes
that same nightly as `1.12.0-dev103`. Traced it to
`prepare-dev-build-version.mjs` dev-stamping only
`apps/studio/package.json`. I reviewed the change myself.
## Proposed Changes
`prepare-dev-build-version.mjs` rewrites the version to the
`X.(Y+1).0-devN` dev form for nightly/dev builds — but only for the
desktop app (`apps/studio/package.json`). The standalone CLI
(`apps/cli/package.json`) was left at the static base version, so its
baked `__STUDIO_CLI_VERSION__` (what `studio --version` reports) didn't
match the version the bundle is actually published under on the CDN.
This stamps `apps/cli/package.json` with the same dev version. After it:
- `studio --version` on a nightly reports its real version (e.g.
`1.12.0-dev103`) instead of a static, meaningless `1.11.0`.
- It unblocks the standalone CLI update notifier (STU-1772): the CLI
derives its update channel from its own version (`-devN` → nightly), so
it needs the real dev version baked in to check the right channel.
Without this, a nightly install looks like "production" to the update
endpoint and never sees nightly updates.
## Testing Instructions
```sh
GITHUB_SHA=$(git rev-parse HEAD) node ./scripts/prepare-dev-build-version.mjs
grep '"version"' apps/studio/package.json apps/cli/package.json
# → both show the same X.(Y+1).0-devN (e.g. 1.12.0-dev103), matching the CDN-published nightly
git checkout -- apps/studio/package.json apps/cli/package.json # revert the local mutation
```
The CLI build (`cli:bundle`) runs after this script in the build
pipelines, so the bundle bakes the stamped version.
## Pre-merge Checklist
- [x] Have you checked for TypeScript, React or other console errors? —
build script only; ran it and verified both files stamp to the same dev
version.1 parent 74ad042 commit 26f7e54
1 file changed
Lines changed: 21 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments