Repository navigation
change peer dependent bump type to patch - #2090
Conversation
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. |
…ause Скрипт срезал любой мажор, пришедший без явного major-changeset. Он жил ради changesets/changesets#822: на 0.x пакете peer-диапазон workspace:^ patch-only, поэтому минор ядра выводил peer из диапазона, и changesets эскалировал зависимого до мажора. Сам файл был помечен PENDING REMOVAL с гейтом «первый реальный релиз с минором ядра без всплывшего мажора» — гейт прошёл и остался непрочитанным. Три замера на реальном дереве (git archive HEAD в чистый воркспейс, changeset version под @changesets/cli 3.0.3): 1. Гейт, который скрипт назначил себе сам: минор ядра 0.136.5 -> 0.137.0 тронул 23 манифеста и дал НОЛЬ мажоров, вердикт самого скрипта — «No major bumps detected». Кроме ядра двинулся только router-benchmarks, патчем, через ребро dependencies. 2. Инструмент дискриминирует: инъекция 1.0.0 в пост-version манифест дала «Blocked major bump ... Capped 1». Значит вердикт из (1) — это измерение, а не no-op. 3. Причины больше нет в апстриме: откат peer одного адаптера на до-фиксовый workspace:^ всё равно даёт патч (0.36.0 -> 0.36.1), а не мажор. changesets/changesets#822 и changesets/changesets#2090 закрыты completed 2026-06-24, мажор v3 несёт фикс. Миной на дороге к 1.0 он не был: applyBump возвращал null на уровне major, вызывающий делал continue, поэтому явный major-changeset проходил насквозь. Правило «pre-1.0 не берёт мажор» сохраняет единственного живого исполнителя в .changeset/check-changeset.mjs. Попутно сняты две повисшие ссылки на удалённый файл (syncpack.config.mjs, check-changeset.mjs) и исправлены два утверждения CLAUDE.md: «minor bump триггерит мажор от changesets» опровергнуто замером (3), а «each declares workspace:>=0.1.0» — неверно, changeset version двигает peer-пол на каждом релизе для пакетов с ребром devDependencies на ядро. Claude-Session: https://claude.ai/code/session_01Ws4eQ4YAetztqb4HPg86Sj

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