Do you want to request a feature or report a bug?
This is a half-feature request, half-bug report.
What is the current behavior?
Currently yarn (and npm) does not include prerelease versions of packages to satisfy semver ranges, unless those ranges explicitly ask for a prerelease version. For example, react@16.0.0-alpha.2 does not satisfy the range react >= 15 even though 16-dot-anything is greater than 15.
If the current behavior is a bug, please provide the steps to reproduce.
Install react@16.0.0-alpha.2 and another package that has a peerDep on react >= 15 (react-helmet for example). Run yarn which prints:
warning "react-helmet@4.0.0" has incorrect peer dependency "react@>=15.0.0".
What is the expected behavior?
With this requested enhancement, when doing peerDep checks, Yarn would consider X.Y.Z-anything.N to be a semver string that is greater than X.Y.{Z-1} and less than X.Y.{Z+1} (and X.{Y+1}.0 and {X+1}.0.0).
I believe this also addresses an issue that Facebook has been having internally between react and other packages that have a peerDep on react.
The semver package doesn't implement this behavior so we'd likely want to write a small module that does a more inclusive version check for peerDeps.
Please mention your node.js, yarn and operating system version.
Node 7.6.0
Yarn 0.21.2
macOS 10.12
Do you want to request a feature or report a bug?
This is a half-feature request, half-bug report.
What is the current behavior?
Currently yarn (and npm) does not include prerelease versions of packages to satisfy semver ranges, unless those ranges explicitly ask for a prerelease version. For example,
react@16.0.0-alpha.2does not satisfy the rangereact >= 15even though 16-dot-anything is greater than 15.If the current behavior is a bug, please provide the steps to reproduce.
Install
react@16.0.0-alpha.2and another package that has a peerDep onreact >= 15(react-helmetfor example). Runyarnwhich prints:What is the expected behavior?
With this requested enhancement, when doing peerDep checks, Yarn would consider
X.Y.Z-anything.Nto be a semver string that is greater thanX.Y.{Z-1}and less thanX.Y.{Z+1}(andX.{Y+1}.0and{X+1}.0.0).I believe this also addresses an issue that Facebook has been having internally between react and other packages that have a peerDep on react.
The
semverpackage doesn't implement this behavior so we'd likely want to write a small module that does a more inclusive version check for peerDeps.Please mention your node.js, yarn and operating system version.
Node 7.6.0
Yarn 0.21.2
macOS 10.12