-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(node-workspace): Add update-peer-dependencies option that also updates peer dependencies. Fixes #1943 #2094
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this. This was intentionally put in, I'm not entirely sure why, but it is tested behavior. We don't want to break any existing users who are using this without taking a breaking change.
Instead, we could add a configuration to the node-workspace plugin, to includePeerDependencies
and keep the default to false. This way we don't break users and you can get your peer dependencies updated.
In the next major version bump, we can consider switching the default to true because we can make those kinds of breaking changes in a major version bump.
Thanks for the review! I've been out sick, but I'll make the change this week and tag you when I've done so. |
@chingor13 I've added an option It feels like it would be better to make options for plugins a first-class concept rather than handling them in the same place as global options, as then it would be easier to define plugins outside the main release-please source. I think that kind of change is out of scope for this PR, though. Thanks again for all your work on this tool! |
The schema allows for customizing plugins with an object in the config, for example: {
"plugins": [
{
"type": "node-workspace",
"merge": false
}
]
} This could be a place to put the Also note that I am currently refactoring the |
Thanks. I'd be happy to do that refactor in a followup PR, unless you think it should be part of this change? |
I'm not sure if you're asking me to do something here - if you want to merge this one (and potentially release it) before your refactor lands, then you'd get tests for the peerDependencies case (although the implementation that lands in this PR would obviously change during the refactor). Could you clarify what the status is? |
Build failure seems unrelated to this PR |
Please do it as part of this PR. We always want If #2117 lands first, I can deal with the merge conflicts in this PR to make the new tests pass. If this lands first, then I'll update my PR with the new feature. |
Respectfully, I don't think this PR is unreleasable. I followed the existing pattern for existing node-workspace options, so it seems a bit unfair to describe it as unreleasable. I think the possibilities are:
I think refactoring the node-workspace options is more appropriate task for a maintainer (which I am not), and I also think it's unrelated to the work in this PR, which ideally shouldn't introduce breaking changes. This is why I went for option 3 when I added This PR fixes a bug. By request I put the bug fix behind a config flag, so as not to break anyone relying on the old behaviour. I was careful to only raise a mergeable PR, and careful to follow the existing patterns in this code. If you feel that it's still not mergeable in this state, please feel free to push commits before merging. |
So it turns out that the root I need to rethink about the order of how to merge all these changes/fixes together. |
I see that it has landed - yes please, that would be great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will refactor the config option to put into node-workspace options rather than at the top level in a separate PR.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #1943 🦕
Note: There was already a test to make sure that peerDependencies were NOT updated. I can't think of a reason that this behaviour would be desirable, so I just updated the test to expect the peerDependencies to be updated.
Also, the tests don't full pass locally, because this function doesn't alter dates from my locale (eg
10/11/2023
). I didn't fix this, but I believe the tests will totally pass in CI.