-
Notifications
You must be signed in to change notification settings - Fork 663
Description
Summary
Imagine a rush.js managed monorepo, with two subspaces, default and sdk.
strictPeerDependencies are on, in both the global config and both subspace configs.
BUT
Imagine packages A, B, C
Package A has a peerDependency for "madeUpPackage". Package A is in the SDK subspace.
Package B consumes package A. Package B does not have madeUpPackage installed. Package B is in the SDK subspace.
Package C consumes package A. Package C does not have madeUpPackage installed. Package C is in the default subspace.
When I run rush update, only complains on Package C.
But how do I make it complain about missing peer from perspective of package B
Repro steps
Expected result: rush install/update command failed
Actual result: rush install pass correctly
Details
Reproduction Setup
Monorepo Structure
monorepo/
├── rush.json
├── common/
│ └── config/
│ └── rush/
│ └── pnpm-config.json # Global config
├── subspaces/
│ ├── default/
│ │ └── pnpm-config.json # Default subspace config
│ └── sdk/
│ └── pnpm-config.json # SDK subspace config
└── packages/
├── package-a/package.json # SDK subspace - declares peerDependency
├── package-b/package.json # SDK subspace - consumes A, missing peer
└── package-c/package.json # default subspace - consumes A, missing peer
Configuration
common/config/rush/pnpm-config.json (Global):
{
"useWorkspaces": true,
"strictPeerDependencies": true
"alwaysInjectDependenciesFromOtherSubspaces": true,
}subspaces/sdk/pnpm-config.json:
{
"useWorkspaces": true,
"strictPeerDependencies": true
}Package Definitions
packages/package-a/package.json (SDK subspace):
{
"name": "@myorg/package-a",
"version": "1.0.0",
"devDependencies": {
"made-up-package": "^2.0.0"
},
"peerDependencies": {
"made-up-package": "^2.0.0"
}
}packages/package-b/package.json (SDK subspace):
{
"name": "@myorg/package-b",
"version": "1.0.0",
"devDependencies": {
"@myorg/package-a": "workspace:*"
// ❌ "made-up-package" is NOT installed - should trigger error
}
}packages/package-c/package.json (deafult subspace):
{
"name": "@myorg/package-c",
"version": "1.0.0",
"devDependencies": {
"@myorg/package-a": "workspace:*"
// ❌ "made-up-package" is NOT installed - should trigger error
}
}Expected Behavior
Running rush update should fail and report missing peer dependencies for both Package B and Package C:
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
@myorg/package-b
└─┬ @myorg/package-a
└── ✕ missing peer made-up-package@^2.0.0
@myorg/package-c
└─┬ @myorg/package-a
└── ✕ missing peer made-up-package@^2.0.0
Actual Behavior
Running rush update only complains about Package C:
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
@myorg/package-c
└─┬ @myorg/package-a
└── ✕ missing peer made-up-package@^2.0.0
Package B is silently ignored, even though it has the exact same missing peer dependency.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
| Question | Answer |
|---|---|
@microsoft/rush globally installed version? |
5.158.1 |
rushVersion from rush.json? |
5.158.1 |
pnpmVersion, npmVersion, or yarnVersion from rush.json? |
pnpm@8.15.4 |
(if pnpm) useWorkspaces from pnpm-config.json? |
yes |
| Operating system? | Mac |
| Would you consider contributing a PR? | yes |
Node.js version (node -v)? |
22.13.0 |
Metadata
Metadata
Assignees
Labels
Type
Projects
Status