fix(deps): exclude @types/* packages from component peer dependencies - #10186
Conversation
When @types/* packages are listed as peers in env.jsonc, they should not be added to components' peer dependencies. The env is installed alongside the component and handles TypeScript compilation, so these type packages are already available without the component needing them directly.
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where @types/* packages listed as peer dependencies in env.jsonc were incorrectly being added to components' peer dependencies. Since these TypeScript type definition packages are only needed for compilation (handled by the environment), and the env is always installed alongside components, there's no need for components to declare them as their own dependencies.
Changes:
- Added logic to exclude
@types/*packages from component dependencies when they appear in env peer dependencies - Includes comprehensive inline documentation explaining the rationale
|
Code Review by Qodo
1. Stale missing @types issue
|
|
Code review by qodo was updated up to the latest commit f67480f |
|
Code review by qodo was updated up to the latest commit f9964c2 |
|
Code review by qodo was updated up to the latest commit 0176b9a |
…rom-component-peers
…rom-component-peers
|
Code review by qodo was updated up to the latest commit 4004b33 |
|
Code review by qodo was updated up to the latest commit ddfde6c |
|
Code review by qodo was updated up to the latest commit 6972bf2 |
|
Code review by qodo was updated up to the latest commit 7ed4421 |
…eer-variant split
|
Code review by qodo was updated up to the latest commit c224e06 |



When
@types/*packages are listed as peers in env.jsonc, they were incorrectly being added to components' peer dependencies.The fix excludes
@types/*packages from component dependencies entirely when they're in the env's peers. This is correct because:@types/*packages are only needed for TypeScript compilation (handled by the env), components don't need them in their own dependenciesWhy the blast radius is small
A package listed as an env peer is only attached to a component if the component actually imports it.
@types/*packages are never imported directly in code, so an env's@types/*peer on its own never reaches a component.A
@types/foobecomes a component dependency only when it's present in the repo'sworkspace.jsonc(or a component's model) and the basefoopackage is imported — then it's auto-detected as a dev dependency, which this change keeps out of the component's peers.So this only affects repos that put
@types/*in their ownworkspace.jsonc(such as this one). The vast majority of users don't, so their components are unaffected.