Repository navigation
feat(config): add snapshot.baseVersion option - #2377
Open
officialasishkumar wants to merge 2 commits into
Open
officialasishkumar wants to merge 2 commits into
officialasishkumar wants to merge 2 commits into
Conversation
Snapshot releases are always versioned on top of 0.0.0 (for example 0.0.0-experimental-20240101000000). Some ecosystems cannot consume a 0.0.0 version (CocoaPods and Capacitor plugins were reported in changesets#1346), and the only existing escape hatch, snapshot.useCalculatedVersion, changes the base to the calculated release version, which is not what those users want. Add an optional snapshot.baseVersion config value (a plain MAJOR.MINOR.PATCH string, validated by the config schema) that replaces the hardcoded 0.0.0 in getSnapshotVersion. It defaults to 0.0.0, so existing behaviour is unchanged, and it is ignored when useCalculatedVersion is enabled. The option is added to the config valibot schema, the generated JSON schema, the Config/WrittenConfig types and the config docs. Tests cover the assembleReleasePlan behaviour (including precedence of useCalculatedVersion), end-to-end `changeset version --snapshot`, and config validation of bad values.
👷 Deploy request for changesets pending review.Visit the deploys page to approve it
|
🦋 Changeset detectedLatest commit: 3bed77c The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2377 +/- ##
==========================================
+ Coverage 87.47% 87.51% +0.03%
==========================================
Files 78 78
Lines 2971 2972 +1
Branches 851 854 +3
==========================================
+ Hits 2599 2601 +2
+ Misses 337 336 -1
Partials 35 35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Closes #1346
Adds an optional
snapshot.baseVersionconfig option that replaces the hardcoded0.0.0base of snapshot versions (e.g.0.0.1-experimental-...), for ecosystems that can't consume0.0.0.MAJOR.MINOR.PATCHstring (validated in the config schema); defaults to0.0.0, so existing behaviour is unchanged.snapshot.useCalculatedVersionistrue.schema.json, types, docs and added a changeset.Tests:
assembleReleasePlanunit tests (including precedence),changeset version --snapshottest, and config validation tests. Ran the affected suites,tsc, eslint andoxfmt --checklocally.