[core] Fix various dependency issues #17317
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is incomplete and only deals with issues encountered by
yarn docs:dev
. Also fixes some peer dependency warning related to emotion (need squash those in the future).It's both aimed at preventing future issues with incorrect dependency trees and incrementally adjusting the worktree to work with yarn v2.
The basic problem is that most of our workspaces require implicit dependencies from other packages/workspaces which only works by virtue of the dependency tree being trivial at the moment. We already get a glimpse of issues with this approach by having
next
in our dependency tree which introduces multiple versions of a single package. The issue in particular was different babel plugins being used resulting in bigger published npm packages than expected. At some point this got fixed by using theresolutions
field but these issues are hard to spot andresolutions
might not always work.yarn v2
(especially PnP) enforces declaring dependencies which gets rid of potential dependency issues while also making it trivial to spot which requested package from which file resolves to which version.