Repository navigation
fix: include missing peer depedency updates in changelogs - #1460
breadadams wants to merge 6 commits into
Conversation
🦋 Changeset detectedLatest commit: daf8ba3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1460 +/- ##
==========================================
+ Coverage 81.02% 81.03% +0.01%
==========================================
Files 54 54
Lines 2213 2215 +2
Branches 658 661 +3
==========================================
+ Hits 1793 1795 +2
Misses 416 416
Partials 4 4 ☔ View full report in Codecov by Sentry. |
| if (depType === "peerDependencies") { | ||
| shouldUpdate = !onlyUpdatePeerDependentsWhenOutOfRange; | ||
| shouldUpdate = | ||
| !onlyUpdatePeerDependentsWhenOutOfRange || | ||
| updateInternalDependents === "always"; | ||
| } |
There was a problem hiding this comment.
hm... the alternative would be to say that peer dependencies are special (cause they kinda are...) and skip updating them altogether.
The reason why we have introduced updateInternalDependents === "always" was to make it easier for dependency updates to "flow" into their dependants. But with peers... that's not even a thing. A peer dependency and its peer dependant always form a kind of an implicit relationship. It's explicitly specified by the contract in the package.json but it's enforced in a way different way than with regular dependencies.
I also somewhat question if '*' range should work with updateInternalDependents === "always". But then I guess if it says always... then it means always 🤣 But again, this really was meant to work with ranges that specific some minimum compatible version and * is so loose.
There was a problem hiding this comment.
I see where you're coming from. The fact that our packages are being bumped when a peer is bumped made me think this was intentional behaviour.
We actually have some custom logic running in a prepack script for all our packages (to fix that issue) which manually modifies the peer dep. versions from being "*" to the latest version of said dependency.
We did this because we're using the packages within a monorepo and on some projects that are (currently) outside of the monorepo. If we were to leave the "*" in the published version nothing forces us to update the peers when updating a package in one of our "outside-monorepo" projects.
We're not using ranges anywhere for our internal peer deps, because we ensure that whenever we update a package we also update its (internal) peer deps.
Having said that, this requirement might be specific to our use case - however like I say, since packages are bumped when a peer is, we took it as intentional behaviour and really dislike the empty changelogs 😕.
| - Updated dependencies | ||
| - pkg-b@1.2.1`); |
There was a problem hiding this comment.
With * this is a big fat lie. The dependency itself was not updated. How we are even meant to reason about this?
When installing pkg-c@2.0.1 the package manager is free to leave pkg-b@1.2.0 in node_modules. It doesn't have to bother updating it because the * range says it's OK to leave it alone.
There was a problem hiding this comment.
Oof, right, so this behaviour we're seeing could actually be considered a bug? 😅
As mentioned in my other comment, we sort of depend on it right now - and it works quite nicely, minus the empty changelogs entries.
There's no way for us to hook into this behaviour I believe? i.e. to make this functionality intentional on our side.
What about a new config option (maybe under experimental?) that when true would add a changelog entry for bumps due to peer dep. bumps... what do you think?
I get this is an important decision, but would love to have something thay solves our problem asap to stop getting these darn empty changelog entries 🥺.
|
Hey @Andarist, is there anything we can do to get this moving? Whilst I understand your concerns expressed in the previous comments, these changes are only updating the "changelog logic" to match the "release logic" that is already implemented, i.e. using |
testtoitin test suite, to match others.