You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a classic monorepo with yarn v1, I used to have with dependencies needed by multiple next.js applications declared at the root of the project. Examples could be next, react and react-dom libs.
With yarn berry, yarn dlx @yarnpkg/doctor will report e.g. react missing in a subpackage as peer dependency, since it's installed in the root and not considered.
I understand that its enforced that dependencies are strictly followed, and don't leak from one workspace to another, but this also has downsides:
in a monorepo with e.g. 50 subpackages, each package.json needs to have a couple of lines more.
dependency versions could run out of sync due to 50 different entries in package.json. This can lead to duplicate entries in the lock file when dependencies are locked throughout the project.
when removing dependencies, it's easy to miss some or even loose track of which dependencies need which peerDependencies.
Is there a way to opt out of this strict handling of dependencies?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In a classic monorepo with yarn v1, I used to have with dependencies needed by multiple next.js applications declared at the root of the project. Examples could be
next
,react
andreact-dom
libs.With yarn berry,
yarn dlx @yarnpkg/doctor
will report e.g.react
missing in a subpackage as peer dependency, since it's installed in the root and not considered.I understand that its enforced that dependencies are strictly followed, and don't leak from one workspace to another, but this also has downsides:
package.json
needs to have a couple of lines more.package.json
. This can lead to duplicate entries in the lock file when dependencies are locked throughout the project.Is there a way to opt out of this strict handling of dependencies?
Beta Was this translation helpful? Give feedback.
All reactions