Add a new bump strategy for peers bump#1132
Conversation
🦋 Changeset detectedLatest commit: 10c5a06 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 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 |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 01c10ae:
|
a902f73 to
2bae4f5
Compare
|
Thank you very much for your PR! I will review this thoroughly after the weekend. |
packages/config/schema.json
Outdated
| "description": "The minimum bump type to trigger automatic update of internal dependencies that are part of the same release.", | ||
| "default": "patch" | ||
| }, | ||
| "updatePeerDependencies": { |
There was a problem hiding this comment.
I think that we need a little bit more config for this - the last time I was thinking about it I got like 3 different options for the "what to do with the peer-dependent version" and a different setting for what to do about the peer-dependent's dependency range.
I hope to gather more thoughts about this over the weekend and gonna get back to you with the desired config shape for this feature.
There was a problem hiding this comment.
Thanks for review. I do also concern about what the correct config name/shape should be. And after writing the test, I came up with a question: is it necessary to follow the peers patch bumps too?
Also, I believe this strategy is more reasonable than the current behavior, since a major bump is only required if a peer had a major bump, so would you consider make it the default strategy?
I'm not clear if you were asking what to do when peers' bump exceeds the dependent's range. |
Note that the config `updatePeersDependencies="follow"` is an unmerged feature(see: changesets/changesets#1132). Also keeps all sub-package linked before 1.0.
|
My current thought about shape of config:
When
@Andarist What do you think about it? |
Hm, quite frankly - I'm personally almost always confused by In XState we currently always update ranges in peer dependents (with a custom script). It feels quite safe to do that, we didn't really encounter any problems with this approach. The main difference is that we do it despite a peer dependent not being released in any particular release. Potential downsides of this approach:
I feel even stronger about this thing not relying on packages being part of the same release. This setting might even sometimes make a package to be included as part of the release. I feel like the proposed options need to be extended with smth like I think that perhaps the names of those options could use some bike-shedding but that's also the least interesting part at this stage of this PR. We can always rename things just before landing this. What's needed right now is the implementation and the docs. |
Indeed. The version of peer dependent is still out of control. The point people felt pain at most is that it requires major bump unexpectedly. People probably can tolerate it result in some patch bump, but ultimately we should give people more precisely control. And during the time with the experience of my modified changeset, I felt I felt people should have a way to specified the the result bump type for a peer dependent, and probably the most intuitive way to achieve this is specify both bump type of peer dependency and peer dependent in a same changeset. That means, we should not bump the peer dependent automatically, when it was listed together with the peer dependency in the same changeset, as the developer already specified a desired bump type. Suppose
We need an option to enable the behavior described in the first situation, e.g. An additional option Probably we could introduce @Andarist If finally we reach an agreement, I could probably work on it this weekend, but it could takes some times longer than expected. |
|
Any update on this PR? Currently I have pipelines disabled for auto version bump because of this. Would really be nice if a simple patch version of |
2bae4f5 to
448e506
Compare
The proposed changes were implemented in the latest commit.
@Andarist Do we have a chance to get it reviewed and merged? |
1aab481 to
01c10ae
Compare
|
Anything we can do to help this one along? This would be extremely helpful for my org |
|
@stevejcox one of our co-maintainers came up with a patch to hold us over for the time being yarn1: pnpm (his original patch) |
|
Any updates on this? |
|
Is there anything we can do to help merge this PR? |
|
Any updates on this? |
|
Any updates on this as well? |
|
Anything we can do? I’m ready to sacrifice a goat to get this PR merged |
|
@Andarist We also really need this PR to be merged 👀 |
|
@Andarist +1 on this change being needed, any update on it getting merged? |
|
any update? our peer update with minor, and another package related to this peer has bump to major version |
|
We can stay on a fork before the author merges this PR. |
|
@Andarist please review, this feature is really needed! |
|
Issue release a non wanted major in our company. please review it soon @Andarist |
|
any update on this? |
|
Hello? Any updates on this? @Andarist ? |
01c10ae to
c5da966
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1132 +/- ##
==========================================
+ Coverage 81.04% 81.15% +0.10%
==========================================
Files 54 54
Lines 2221 2271 +50
Branches 657 699 +42
==========================================
+ Hits 1800 1843 +43
- Misses 417 424 +7
Partials 4 4 ☔ View full report in Codecov by Sentry. |
c5da966 to
10c5a06
Compare
|
Rebased upon the lastest HEAD. Wish for review. @Andarist |
|
It doesn't seem like there has been any movement on this in a while... Worth asking again, does anyone have any updates or workarounds? I've been working around it by removing packages from |
|
Our team is also affected by this issue. In our case we use In our case we'd prefer to have major versions generate major bumps of peer-dependent packages, and that's it. Since we are using caret ranges, minor and patch releases of the dependency should still be compatible. It seems that this PR lost its wind either because of the design of the config parameters, or perhaps just because the maintainer no longer has the time. In case it was the former, I'd like to throw out an alternative option - allowing a // .changeset/config.js
const config = {
autoReleaseDependents: ({
depType,
nextRelease,
}) => {
// For peer-deps, create a major release if the dependency has a major release:
if (depType === "peerDependencies" && nextRelease.type === "major") {
return "major";
}
// For regular deps, create a patch release always so it's easy to get the updated version of the nested dependency:
if (depType === "dependencies" && (nextRelease.type === "minor" || nextRelease.type === "major")) {
return "patch";
}
}
};
export default config;I'm sure there's some details to consider, but perhaps this would give us something more flexible than having 5+ different config values? |
See the discussion at #1367. |
|
Any updates on this? |
|
This is also affecting us. Any idea when this can be merged ? |
Changesets is currently doing wrong major bumps, see changesets/changesets#1132
|
Any news? It's been two and a half years... it's too bad because changesets has been working really great for our design system project but the automatic major bumps are really undesirable and I can't stress this enough... |
If merged, resolve #1011, #960, #822