-
-
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
fix(nm): declare @yarnpkg/pnp
as a dependency
#4958
Conversation
In other words the compiled code of |
Fwiw I personally have no qualms with it being a regular dependency, my thinking being that regular deps are meant to be all the deps required for a package to work properly once installed by users, whether it's at runtime or typecheck. Anecdotically, it's the same interpretation we follow in
Peer deps also don't seem a right fit to me, because they delegate the responsibility of installing packages to the users, which goes against what Yarn is for (managing packages / versions). The only reason we'd do this would be for what essentially amounts to optional size optimization, and I admit I'm not a fan of this tradeoff. Ideally it'd be nice to support a |
What is your objective point here, except your sole opinion?
We could have used Let's discuss seriously. |
I think in this case the Read the section about |
Compatibility is already guaranteed by the types. Not compatible code will not compile. I have not yet seen any types declared as peer dependencies. It would worsen the DX. Especially as Yarn doesn't automatically install the peer deps. |
Of course not compatible code will not compile, but you don't know with which version of the package it is compatible. That's why peer dependency expresses the version of the package it is compatible with.
Can't be a point in discussion.
It depends on the tools you use and how you use them. Having dependencies declared as production that are really not production can worsen your DX too, think of extra install time and extra disk space consumed by an application in the cloud. |
The file that I need doesn't use pnp at all, so if you choose to make it a peer, it would be nice to move the hoist function to a separate package. |
@yarnpkg/pnp
as a dependency
What's the problem this PR addresses?
Currently when using the nm package directly, there is compilation error because pnp is not in the deps:
How did you fix it?
...
Checklist