Yarn command gates use the launcher version instead of the version selected by yarnPath
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
Problem
Vite+ selects Yarn behavior from the version in packageManager, which is the launcher it downloads. However, the launcher hands the command to the release in yarnPath unless ignorePath or YARN_IGNORE_PATH disables that delegation. When the two versions differ, Vite+ makes its decision for a version that does not run the command.
The most serious result is a silent false success. With packageManager: "[email protected]" and yarnPath pointing to Yarn 3.8.7, vp unlink prints a warning and exits with code 0, but the portal: resolution stays in package.json. Running the same launcher directly removes it. This was found in the review of #3286.
Reproduction
These steps need the unlink gate from #3286.
- Set
"packageManager": "[email protected]"inpackage.json. - Copy
bin/yarn.jsfrom@yarnpkg/[email protected]to.yarn/releases/yarn-3.8.7.cjs. - Create
.yarnrc.ymlwithnodeLinker: node-modulesandyarnPath: .yarn/releases/yarn-3.8.7.cjs. - Run
vp install. - Create
../linked-lib/package.jsonwith the namelinked-lib, then runvp link ../linked-lib. - Run
vp unlink linked-lib.
Expected: Yarn 3 removes the linked-lib resolution from package.json.
Actual: Vite+ prints this warning and exits with code 0, and the resolution stays.
warn: yarn unlink requires Yarn Classic or yarn >= 3.0.0. Skipping.
Affected checks
| Result of a mismatch | Checks | Launcher and effective version | Source |
|---|---|---|---|
| Skips a supported command | unlink, patch-commit --save (Yarn 3) |
2.x and 3 or later | #3286 |
| Skips a supported command | audit (Yarn 2.4) |
Below 2.4 and 2.4 or later | #3286 |
| Skips a supported command | patch, patch-commit, rebuild, whoami |
Classic and Berry | main |
| Skips a supported command | list, licenses, team |
Berry and Classic | main |
| Falls back to npm | stage (Yarn 4.16) |
Below 4.16 and 4.16 or later | main |
| Rejects a supported option | not_supported(yarn ...) rules with version conditions |
Depends on the rule | Mostly main |
| Builds arguments for the wrong Yarn family | is_berry() branches |
Classic and Berry | main |
| Sends a setting the effective Yarn rejects | YARN_ENABLE_TIPS in resolve_for_manager |
4.x and 2.x or 3.x | main |
This table comes from reading the code. Only the Yarn 2 launcher delegating to Yarn 3 has been reproduced end to end. The Classic and Berry rows, and whether the Classic launcher delegates in the same way, still need to be confirmed.
Possible direction
An earlier attempt in #3286 (eb4b2c713) ran yarn --version before every Yarn command. It is accurate because Yarn applies its own configuration rules, but it adds a process to every command.
A cheaper option is to resolve with the launcher version first and query the effective version only when Vite+ declines the request, which means a Noop, an InvalidArgument, or a FallbackCommand diagnostic. If the query reports a different version, Vite+ resolves again. Commands that run need no query because Yarn reports its own errors.
This option would not fix the is_berry() argument branches or YARN_ENABLE_TIPS, because those affect commands that do run. Reading the version from the yarnPath file name avoids a process, but the name can be arbitrary, and it would not account for parent or home configuration files or environment overrides.
- 主要语言
- Rust
- 星标
- 6.5k
- 派生
- 297
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 245
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
voidzero-dev/vite-plus 的其他 Issue
-
triage: failed
难度 2/5 1-3 小时 新手友好度 71/100
voidzero-dev/vite-plus#3360 · 2 条评论 ·
维护者通常 1 天内回复
-
triage: not actionable
难度 2/5 1-3 小时 新手友好度 85/100
voidzero-dev/vite-plus#3296 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
pending triage
难度 2/5 1-3 小时 新手友好度 63/100
voidzero-dev/vite-plus#3235 ·
维护者通常 1 天内回复
-
Docker guide: the runtime stage needs libatomic1 for Node.js 25 and later可能已有人在做 @kshanxs 于 13 天前认领。 未关闭documentation
难度 2/5 1-3 小时 新手友好度 84/100
voidzero-dev/vite-plus#3219 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
pending triage
难度 2/5 1-3 小时 新手友好度 72/100
voidzero-dev/vite-plus#2882 · 2 条评论 ·
维护者通常 1 天内回复
查看 voidzero-dev/vite-plus 的全部 Issue
相似的 Issue
-
multiple issues priority: low
难度 2/5 1-3 小时 新手友好度 78/100
storytold/pdfcraft#6469 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
parity priority: low ui
难度 2/5 1-3 小时 新手友好度 82/100
storytold/photocraft#11680 · 1 条评论 ·
维护者通常 2 天内回复
-
triage/needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
praxis-proxy/grid#564 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
ScoopInstaller/Extras#19275 ·
维护者通常 1 天内回复