Skip to content

fix(market): keep local file: installs portable and stop treating Node builtins as files (#563) - #565

Open
SxyLao1 wants to merge 1 commit into
dataelement:mainfrom
SxyLao1:fix/market-file-spec-and-builtins
Open

SxyLao1 wants to merge 1 commit into
dataelement:mainfrom
SxyLao1:fix/market-file-spec-and-builtins

Conversation

@SxyLao1

@SxyLao1 SxyLao1 commented Sep 25, 2026

Copy link
Copy Markdown

Closes #563

变更内容

  • generations/installer.mjs · installGeneration:本地源安装改用项目相对 spec file:./${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-notes 5、github-release-notes 3)在未修改的干净树上同样失败(环境预存),1 条(host-disabled-plugins)为并行负载下抖动,单独复跑通过(6/6,带本改动)。
    • npm run typecheck:通过。git diff --check:干净。

风险与影响

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generation 安装校验误拒两类合法插件形态:file: 本地源与 Node 内置依赖

1 participant