This repository has been archived by the owner on Jun 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 148
Add inferred dependencies to peerDependencies? #366
Comments
Ditto for react.
where "@types/react-dom" has:
This results in the structure:
@sthuck and the yarn people seemed to indicate that yarn would pick "latest" for a dependency of *, but that doesn't seem to be the case here. |
Installing Will install nested This will cause many errors like this one:
|
There's a few lines in yarn.lock that look something like:
manually editing these to combine react@* and [email protected] fixes the problem:
this will cause all of the dependencies on |
glentakahashi
added a commit
to glentakahashi/types-publisher
that referenced
this issue
Aug 15, 2017
Add all of the typesDependencies to be added as peerDependencies instead of dependencies to fix transitive dependency issues such as in microsoft#366
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi guys,
I'll start with the example scenario -
my package.json has these dependencies:
and
@types/angular-mocks
package.json looks like this, as it's dependencies are automatically inferred:since
@types/angular": "*"
gets resolved to @types/angular version 1.6.23 (in Yarn 0.27.5), I end up with the types for angular 1.6. Obviously this is just an example and will happen with any type definitions that has breaking changes compared to previous type definitions.You can see the discussion with yarn guys yarnpkg/yarn#3951, where they explain why '*' is being resolved to latest version and not simply to "any version". They suggest using
peerDependencies
instead, which does seem (to me at least) like the correct thing to do.I do understand this has potential to pop up a 'missing peer dependency' error for lots and lots of people.
But if I understand this bug correctly, as time will pass and new type definitions will break previous versions, more yarn users will experience this issue. So I guess this is for your consideration...
The text was updated successfully, but these errors were encountered: