Skip to content

fix: push@72e24e7 SOLID 审查 — ootb npm install + registry/unzip 契约对齐#18

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-ddf878e5-9eab-4029-9b6c-6ddf6d0db731-f613
Closed

fix: push@72e24e7 SOLID 审查 — ootb npm install + registry/unzip 契约对齐#18
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-ddf878e5-9eab-4029-9b6c-6ddf6d0db731-f613

Conversation

@cursor

@cursor cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

main push e6525bb(fix tools)+ 72e24e7(lodash 挪入 deps)后 ootb 仍红(run 29897268620):Install root depsCannot read properties of undefined (reading 'extraneous')

本 PR 在最新 main 上直接给出可合并补丁(#15/#16 基于旧 tools/.js 树,已被 e6525bb ESM 重写 supersede,请优先合本 PR)。

根因与修复

级别 原则 问题 修复
BLOCKER DRY package-lock.jsonlink 已删 modules/packages/{daily-task,economy,…} 清悬空 link,登记 afk workspace
BLOCKER LSP sfmc/src/registry.ts 把 index 当扁平 map;真实契约是 { modules: {…} }(fetch-module 已正确) parseRegistryIndex + tools/registry-index.mjs 对齐
BLOCKER LSP unzip 未归一化 Windows \\ \\/ 后再 join
MAJOR DRY folderFromEntry 在 catalog 与 packages 重复;check-modules 用 split('/')[2] 统一 folderFromEntryPath
MAJOR DIP fetch-module 动态 import('jszip') 但未声明依赖 jszip
MINOR dirSizeawait walk → 体积恒 0 补 await

验证

  • npm install --no-audit --no-fund
  • npm run build --workspaces --if-present
  • node tools/check-ootb.mjs10/10
  • node tools/smoke-modules.mjs(含 feature-afk 启停翻转)✅

不在本 PR

Open in Web View Automation 

cursoragent and others added 2 commits July 22, 2026 06:42
ootb 在 Install root deps 因 package-lock 仍链接已删除的
modules/packages/* 而崩溃(extraneous)。同步 afk workspace,
并将 fetch-module 所需的 jszip 写入 devDependencies。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
- sfmc registry 与 fetch-module 共用 index.modules 解析契约(LSP/DRY)
- unzip 归一化 Windows \\,避免 Linux 目录布局错乱(LSP)
- catalog/check-modules 复用 folderFromEntryPath(DRY/Demeter)
- 修复 module-commands dirSize 未 await 导致体积统计恒为 0

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查摘要(push e6525bb + 72e24e7

结论:ootb 仍红;本 PR 已给可合并补丁。

BLOCKER

  1. DRYpackage-lock.json 仍 link 已删 packages → npm install extraneous(run 29897268620)
  2. LSPsfmc/src/registry.ts 未解析 { modules: … },与 fetch-module / 真实 index.json 契约不一致
  3. LSPunzip 未归一化 \\,Linux 安装布局错乱

MAJOR

  1. DRY / Demeter — folder 解析重复且 check-modules 用脆弱 split('/')[2]
  2. DIP — 动态 import('jszip') 但未声明依赖

MINOR

  1. dirSize 未 await → 体积统计恒 0

本地验证:check-ootb 10/10、smoke-modules 通过。

#15/#16 基于旧 tools 树,已被本 PR supersede,建议关闭。

View PR

Open in Web View Automation 

Sent by Cursor Automation: SFMC-Review

cursor Bot pushed a commit that referenced this pull request Jul 22, 2026
合并并行审查 #18 的补充:单一 parseRegistryIndex 源、fetch-module 显式依赖 jszip,
以及 module-commands dirSize 未 await 导致体积恒 0。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z

Tanya7z commented Jul 22, 2026

Copy link
Copy Markdown
Member

Superseded by main tools rewrite (e6525bb) and PR #17 CI/registry fixes. Closing as duplicate/outdated.

@Tanya7z Tanya7z closed this Jul 22, 2026
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.

2 participants