change peer dependent bump type to patch - #2090
Conversation
🦋 Changeset detectedLatest commit: b532e10 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
5bd02dc to
2112841
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2090 +/- ##
==========================================
- Coverage 85.47% 85.34% -0.13%
==========================================
Files 66 66
Lines 2547 2545 -2
Branches 704 697 -7
==========================================
- Hits 2177 2172 -5
- Misses 340 343 +3
Partials 30 30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
patch
| "packages/pkg-b/package.json": JSON.stringify({ | ||
| name: "pkg-b", | ||
| version: "1.0.0", | ||
| peerDependencies: { "pkg-a": "workspace:^" }, |
There was a problem hiding this comment.
this test was wrong for a long time 😄
bluwy
left a comment
There was a problem hiding this comment.
It looks like we can also remove the onlyUpdatePeerDependentsWhenOutOfRange option now but we can do that later.
me trying to do that is part of why this took so long, we actually can't because it technically has a different effect than this. it really is just a duplication (+inversion) of the so we need to keep it for now, and maybe hopefully merge it into |
|
Nice to see this finally land! The always Sharing some prior art in case it's useful for a future iteration: I've been building a changesets successor (bumpy) and this exact problem was the first thing I dug into. Landed somewhere a bit different and figured the reasoning might be worth a data point. Two axes turned out to matter independently: 1. When to bump the peer dependent. bumpy only bumps it when the new version actually falls out of the dependent's declared range. A caret range absorbing an in-range minor bump produces no release at all -- which kills a lot of the churn people complain about, before you even get to "what level." 2. What level to bump it to. Instead of a fixed constant, the default matches the triggering bump (major→major, minor→minor, patch→patch) and only fires when the new version actually leaves the dependent's declared range. The thinking: the out-of-range case is precisely when the dependent's contract genuinely changed -- if core goes 1→2, a consumer can no longer pair the dependent with core 1.x, which is breaking for the dependent too. A flat That said {
// proactive mode — opt-in; default is range-gated "match"
"updateInternalDependencies": "patch",
"dependencyBumpRules": {
"peerDependencies": { "trigger": "patch", "bumpAs": "patch" }, // equivalent to this PR
}
}So a team that wants the old always- Writeup with the full propagation algorithm is here if it's useful. Not trying to pitch, just figured the design space exploration might save you some cycles. Happy to go deeper on any of it. |
|
thank you for the thoughtful comment! you're right that this doesn't properly address some of the closed issues, but this change acts as temporary improvement for we will discuss how to improve this further for |
this PR changes the bump type for peer dependents from
majortopatch.i think this is the best default behavior. the previous
majorbump is motivated due to Changesets not being able to know whether the changes in the peerDep are passed through the dependent, therefore we assume all changes are.with this new bump strategy, we hand over the responsibility for knowing how the dependent should be bumped to the maintainers, rather than forcing
majoronto them.if the change is not surfaced in the dependent, they can keep the
patchbump.if the change does require action from the users, this is a breaking change for the dependent (no matter how Changesets bumps it automatically), and the maintainer should add a changeset describing it (like always).
closes #524
closes #822
closes #827 (bring for v3.1 or v4:
updatePeerDependentsAs)closes #963
closes #1011
closes #1126
closes #1132 (bring for v3.1 or v4 discussion)
closes #1228
closes #1279
closes #1600 (bring for v3.1 or v4 discussion)
closes #1759
closes #1887