-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Resolve peerDependencies from all higher levels, not just root #4478
Changes from 1 commit
a1ab4b3
e79d0f4
e04d5d0
bd77957
86a3d26
dd3a380
c384f4b
73ab3fd
a443166
fc87e2b
08b1a4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -449,8 +449,8 @@ export default class PackageLinker { | |
const range = peerDeps[name]; | ||
const pkgs = this.resolver.getAllInfoForPackageName(name); | ||
const found = pkgs.find(pkg => { | ||
const {root, version} = pkg._reference || {}; | ||
return root && this._satisfiesPeerDependency(range, version); | ||
const {level, version} = pkg._reference || {}; | ||
return level <= ref.level && this._satisfiesPeerDependency(range, version); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should be prioritizing some links over others, i.e. top level dependency should satisfy its dependencies from root (same level). I'm not sure whether a nested dependency should satisfy it from root first or sibling first. But maybe instead of find, we need to add it to a collection and then pick out either the lowest level or closest level match. WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good thinking! I think it should resolve to the closest. I'll update the code. |
||
}); | ||
const foundPattern = found && found._reference && found._reference.patterns; | ||
|
||
|
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.
This update is not required so I can revert if you want.