-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Peer dependency resolutions #4099
Comments
My first attempt to resolve the issue was to override Basically I would like to eliminate the big block of warnings yarn outputs so that if there's a new warning I know it's a good one. I guess the current workaround might be to add I'd be willing to make an attempt at a PR for this, but I'm not sure which solution would be accepted. |
You can do this using https://yarnpkg.com/features/protocols#patch This allows you to modify the src of a dependency. |
@gruckion I've tried to patch Project: https://github.com/kachkaev/njt (updated Yarn to 4.0.0-rc.23 in dc55c6ad). Original problem:
I have replaced
This is not yet solved because of donavon/use-persisted-state#69. So I’ve created a local patch: via
The patch has applied, but "use-persisted-state@npm:0.3.3":
version: 0.3.3
resolution: "use-persisted-state@npm:0.3.3"
dependencies:
"@use-it/event-listener": "npm:^0.1.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0
checksum: 9d31133d7367f65505c605bbb0a40d3db3791db6a31241e063a7cd4960f977fe650458d7c532eb7ad14bf4547c8ba35ed09cbf876065d60b57438a9686676973
languageName: node
linkType: hard
"use-persisted-state@patch:use-persisted-state@npm%3A0.3.3#~/.yarn/patches/use-persisted-state-npm-0.3.3-c90a367c6d.patch":
version: 0.3.3
resolution: "use-persisted-state@patch:use-persisted-state@npm%3A0.3.3#~/.yarn/patches/use-persisted-state-npm-0.3.3-c90a367c6d.patch::version=0.3.3&hash=083366"
dependencies:
"@use-it/event-listener": "npm:^0.1.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0
checksum: bfb493da60e47d87995173870a24e81d40558ffc70100a6b5e7c152a74abeb2865eb101020378131fd7a3b929fa94a24e0a55f0e84cc26b94f149f2a4b2e1e36
languageName: node
linkType: hard What am I missing? UPD: I removed a dependency with problematic peer dependency, |
I have same issue. |
|
Describe the user story
As a developer, I want to overwrite the version number of a peer dependency in a nested package, so that Yarn will stop warning that the installed version of the dependency doesn't satisfy the requested version, but will still check the peer dependency using the new version number I've specified.
Describe the solution you'd like
I can think of a few options, each having its own set of potential drawbacks:
peerResolutions
field.resolutions
to replacepeerDependencies
as well asdependencies
.packageExtensions
to overwrite existing peer dependencies, maybe with a new syntax where I provideversion: XXX
andoverwrite: true
.Describe the drawbacks of your solution
packageExtensions
.Describe alternatives you've considered
I haven't had any success ignoring the mismatched peer dependencies using
peerDependenciesMeta
, nor trying to adjust them withresolutions
; neither seems to work.I could use
logFilters
to discard matching messages, but that's not much of a solution, and doesn't suppress the warning "Some peer dependencies are incorrectly met".The text was updated successfully, but these errors were encountered: