[rush] strictPeerDependencies are on, but do not complain if internal (inter-subspace) peers are missing
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- nodejs, typescript
- 领域
- build-system, tooling
调研方向
Reproduce the issue with rush update using common/config/rush/pnpm-config.json, subspaces/sdk/pnpm-config.json, and the package-a, package-b, and package-c package.json files. Start by tracing how Rush handles strictPeerDependencies across subspaces and workspace injection. Done means the missing made-up-package peer is reported for both package B and package C.
由索引模型根据 Issue 内容生成。
描述
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? |
[email protected] |
(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 |
- 主要语言
- TypeScript
- 星标
- 6.5k
- 派生
- 708
- 平均合并
- 4 天 13 小时
- 30 天内合并 PR
- 62
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/rushstack 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/rushstack#5971 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
microsoft/rushstack#5902 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/rushstack#5839 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
microsoft/rushstack#5683 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
查看 microsoft/rushstack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
opengovsg/FormSG#10118 · 1 条评论 ·
维护者通常 1 天内回复
-
ai-driven-qa bug claude
难度 1/5 1 小时以内 新手友好度 75/100
linagora/twake-calendar-frontend#1434 · 1 条评论 ·
维护者通常 1 天内回复
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 78/100
jaegertracing/jaeger-ui#4512 ·
维护者通常 1 天内回复
-
area:ide documentation enhancement platform:macos platform:vscode
难度 1/5 1-3 小时 新手友好度 88/100
anthropics/claude-code#97389 ·
维护者通常 1 天内回复