Dev-stamp the standalone CLI version in nightly builds#3928
Merged
Conversation
…l nightly version
| // endpoint, and never sees nightly updates. | ||
| const cliPackageJsonPath = path.resolve( 'apps', 'cli', 'package.json' ); | ||
| const cliPackageJson = JSON.parse( await fs.readFile( cliPackageJsonPath, 'utf8' ) ); | ||
| cliPackageJson.version = devVersion; |
Contributor
There was a problem hiding this comment.
There's no guarantee that the apps/cli version is the same as the apps/studio version.
Let's read the current version from apps/cli/package.json and add to it the same way we do with the version from apps/studio/package.json
Contributor
There was a problem hiding this comment.
I realize that this may not have been that big a concern given our versioning strategy (CLI-only releases are allowed to bump the patch version, and app releases always bump the minor version). Still, it makes sense for the code to be resilient
Collaborator
📊 Performance Test ResultsComparing f87571e vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
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 as1.12.0-dev103. Traced it toprepare-dev-build-version.mjsdev-stamping onlyapps/studio/package.json. I reviewed the change myself.Proposed Changes
prepare-dev-build-version.mjsrewrites the version to theX.(Y+1).0-devNdev 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__(whatstudio --versionreports) didn't match the version the bundle is actually published under on the CDN.This stamps
apps/cli/package.jsonwith the same dev version. After it:studio --versionon a nightly reports its real version (e.g.1.12.0-dev103) instead of a static, meaningless1.11.0.-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
The CLI build (
cli:bundle) runs after this script in the build pipelines, so the bundle bakes the stamped version.Pre-merge Checklist