-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Hello!
Ref: #6800
This PR prevents auto-inserting @types/foo when foo is a peer, if @types/foo already appears in dependencies. After adopting this change, our project’s resolution graph shifted substantially (many resolved versions changed), which raises concerns about unintended impact. I’m not sure this is the right direction and would like to propose a rollback or alternative.
Why this may be incorrect
- The purpose of a peer dependency is to let the consumer control the version of a shared dep. If a library puts
fooinpeerDependencies, it generally also wants the consumer to control@types/foo. - Letting
@types/foolive independencieswhilefoois a peer increases the risk of runtime-types version skew. The consumer upgradesfoo(as intended by peer), but the library still drags a mismatched@types/foovia its owndependencies. - The original issue highlights that
dependenciescan be overridden/ignored bypeerDependencies, but that precedence is precisely the point of peers. - Conceptually, if
foois peer to externalize version control,@types/fooshould follow the same policy; otherwise the type layer breaks the guarantee.
Request
- Please reconsider fix: correctly install implicit nested types dependencies #6800. The safer, more principled behavior is: when
foois a peer, treat@types/fooas peer as well.
its-ho, parksb and minuukang
Metadata
Metadata
Assignees
Labels
No labels