Replies: 3 comments 4 replies
|
Verified both claims against current
The report is well-formed (repro → expected → acceptance criteria → verified evidence). Happy to re-verify the rebased branch once the PR is up. |
|
You're right, and thanks for catching it — my count was wrong. Re-verified independently just now:
So no rebase needed and the branch is ready as-is — sorry for the noise, and good catch. Will re-verify once the PR is up. |
|
Hi, @moonquake2004 , Since the packageManager field is set to pnpm, this inconsistency remains. I’m wondering if the fix discussed earlier was not yet merged, or if new commits re-introduced the issue. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
标题(Title)
报告:根 package.json 的 scripts 使用 npm run 与 pnpm-only 声明冲突,且 devDependencies 缺少 unrun 依赖
正文(Body)
根 package.json 的 scripts 使用 npm run,与 packageManager 声明的 pnpm-only 冲突,且 devDependencies 缺少 tsdown 所需的 unrun 依赖。
复现、预期与验收
问题一:scripts 使用
npm run,与packageManager声明的 pnpm-only 冲突package.json的packageManager字段(当前为pnpm@11.7.0,见第 7 行);scripts中各命令的前缀;build、build:lib、typecheck、lint、lint:fix、test:web、test:web:refresh、test:web:perf、test:web:stress、doc-typecheck共 10 个脚本以npm run开头。"packageManager": "pnpm@11.7.0"(配套pnpm-lock.yaml),又在scripts中直接调用npm run,混合使用两种包管理器。npm run不识别 pnpm 的 workspace 协议与--filter语义;仓库其余部分(lefthook.yml、CONTRIBUTING.md、各子包package.json)全部以pnpm或node_modules/.bin调用,唯独根scripts例外,约定不一致。scripts统一使用pnpm run(pnpm run完全兼容npm run的写法),与packageManager字段一致。问题二:devDependencies 缺少
unrungrep '"unrun"' package.json→ 无结果;pnpm-lock.yaml:unrun@0.3.1已作为tsdown@0.22.2的 peerDependency(tsdown 的peerDependencies声明"unrun": "*")出现在 lockfile 中,但根package.json的devDependencies未显式声明;pnpm run dev:web(scripts/dev-web.ts通过 tsdown watch 模式构建)。unrun处于"隐式可用"状态——仅当 tsdown 的 peer 解析恰好带上它时才可用,依赖解析的偶然性;缺失显式声明会让knip、publint等卫生门禁无法正确校验;THIRD_PARTY_NOTICES.md相应缺少 unrun 条目。devDependencies显式声明"unrun": "^0.3.1",并同步重新生成THIRD_PARTY_NOTICES.md。环境
master@47f943859b(release 0.1.0-rc.5)修复与验收
package.json:10 处npm run改为pnpm run;devDependencies增加"unrun": "^0.3.1";pnpm-lock.yaml同步更新(lockfileVersion 不变,仅新增 unrun 解析条目);THIRD_PARTY_NOTICES.md重新生成(含 unrun 条目)。grep -oE '(^|[^a-zA-Z])npm run' package.json | wc -l→ 0;grep -oE 'pnpm run' package.json | wc -l→ 34;pnpm-lock.yamllockfileVersion 保持 9.0 不变,diff 仅新增 unrun 解析条目(+20/-2);tsx scripts/gen-third-party-notices.ts --check→ "THIRD_PARTY_NOTICES.md is up to date"。package.json中不再出现真实的npm run调用;unrun出现在devDependencies;pnpm run hygiene(或至少verify-third-party-notices)通过。fix/root-package-pnpm-unrun,提交4cedb4eca3),如维护者认可,可继续跟进提 PR。All reactions