fix: use minor bump for 0.x packages when peer dependency causes major#1936
fix: use minor bump for 0.x packages when peer dependency causes major#1936mixelburg wants to merge 1 commit intochangesets:mainfrom
Conversation
By semver convention, 0.x packages are allowed to contain breaking changes in minor versions. When a peer dependency change triggers a major bump for a 0.x dependent, bump minor instead to avoid prematurely jumping to 1.0.0. Fixes changesets#1887
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1936 +/- ##
==========================================
+ Coverage 83.23% 83.81% +0.58%
==========================================
Files 56 56
Lines 2434 2466 +32
Branches 734 743 +9
==========================================
+ Hits 2026 2067 +41
+ Misses 402 393 -9
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What changed
When a peer dependency change triggers a major bump for a dependent package with a 0.x version, the bump type is now instead of . This avoids prematurely jumping from 0.x.y to 1.0.0.
Why
By semver convention, 0.x packages are allowed to contain breaking changes in minor versions. A peer dependency change that would require a major bump in a stable package should only require a minor bump in a 0.x package. Before this fix, adding a peer dependency to a 0.x package would release 1.0.0, which is not desirable.
How
In , the check now additionally checks if the dependent package's current version starts with . If so, is set to instead of .
Closes #1887