Conversation
…e builtins as files (dataelement#563) Local sources install through a project-relative file:./ spec so pnpm no longer reads an absolute file:C:\... as a relative suffix across drives/junction spellings. Node builtin dependencies short-circuit instead of being resolved as files and rejected by the closure boundary check. Both covered by new red-green regressions in test/generation-installer.test.ts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #563
变更内容
generations/installer.mjs·installGeneration:本地源安装改用项目相对 specfile:./${relative(stagingDir, sourceCopy)}。原绝对形式file:${sourceCopy}在 Windows 上会被 pnpm 当作相对后缀解析,在跨盘符/跨 junction 拼写下产生双绝对路径拼接(错误路径形如<staging>/<id>/C:/...)。generations/installer.mjs·verifyGenerationPeers:Node 内置模块依赖短路放行(isBuiltin(dependency))。原实现把内置模块 id 当成本地文件解析,realpath失败后落入闭包边界检查,误报resolves outside the generation and installation closure: node:*。验证结果
test/generation-installer.test.ts两条,并做红绿对照:还原修复后仅这两条失败、恢复后全绿——两条均先复现缺陷再验证修复。hands pnpm a project-relative file: spec for local sources (#563):注入 spawn 捕获 pnpm 实收 argv,断言 spec 为file:./source/local-shape;skips Node builtin dependencies instead of resolving them as files (#563):声明node:fs/node:crypto依赖的 generation 校验通过。npx vitest run test/generation-installer.test.ts:23/23 通过(修复后);修复还原后 21/23(仅新增两条红)。npm test(完整回归):1184 通过 / 9 失败 / 2 跳过。9 条失败与本改动无关:8 条(feishu-release-notes5、github-release-notes3)在未修改的干净树上同样失败(环境预存),1 条(host-disabled-plugins)为并行负载下抖动,单独复跑通过(6/6,带本改动)。npm run typecheck:通过。git diff --check:干净。风险与影响
isBuiltin判定为 Node 内置的名称生效,普通包的解析、闭包边界与"缺失/越界/失效链接"拒绝行为不变。scripts/generation-poc.mjs的活市场端到端未在本 PR 运行环境复跑,file: spec 形状以注入 spawn 的 argv 断言为准。