-
Notifications
You must be signed in to change notification settings - Fork 87
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
Feature Request: Option to prevent auto bumping peerDependencies #970
Comments
@SevenOutman This would make sense because your @org/base as peer dependency accepts minor version changes. Have you tried changing the dependency range from |
Thanks @jvince for your response! However I don't think this works for me.
With this, when I publish base 1.0.1, I will still have the peer dependencies bumped, right? My point was that peer dependencies should not be auto bumped at all. Because its semantic is significantly different from that of dependencies/devDependencies - for which auto-bumping is fine. Increasing the version of a peer dependency declaration equals removing the previous versions from the supported version range, which alone is a breaking change (for reference semver/semver#502 (comment)). Take typescript and a ts-based tooling package for exapmle, only when my packages starts using the new features in ts 5.6 should I increase the peer dependency to 5.6. I'm never supposed to increase it only because a new version is out. Otherwise my user will have to upgrade their ts to 5.6 in order to use my package, while it actually works with earlier ts versions. |
@SevenOutman You are quite right about the peer dependencies, they should not be auto-bumped. Maybe the best approach when you have a case where you have some package in monorepo that has peer dependency to some other package(s) from the same monorepo is to move that peer dependency package to a separate repository(?). As for the dependencies I assumed that the beachball would skip the bumping of the dependant package if the semver was not in the range. For example, let's assume two packages in the monorepo, package A (1.0.5) and package B (1.0.1). Package B has a dependency on package A defined as ~1.0.0. Now let's assume that package A gets some new functionality and its version gets bumped to 1.1.0. Should you update the dependency to package B in package A? Well according to semver yes because it should not have any breaking changes which in the real world might not happen. All said, I really like the concept of change files and will start using it in our new project. |
The Problem
Hi team, thanks for making this tool! It's been helpful to keep our packages up-to-date in the monorepo.
One thing that turns out inconvenient is that, beachball does not seem to handle
peerDependencies
properly, by automatically bumpingpeerDependencies
version when new versions are published.For example, there is a
base
package and afeature
package in the monorepo, andbase
is apeerDependencies
offeature
.When publishing a new version of
@org/base
, say1.1.0
, beachball would update thefeature
's package.json to depended on the new version ofbase
.This is not expected. Unlike
dependencies
, bumpingpeerDependencies
version means thatfeature
no longer works with the older version ofbase
, which is both false and breaking.This Proposal
Can we have an option say
--bump-peer-deps
forbeachball bump
andbeachball publish
that, when set tofalse
, prevents beachball from bumping thepeerDependencies
versions.Any thoughts?
The text was updated successfully, but these errors were encountered: