Skip to content

fix(ci): 模块外置后 npm install 崩溃 + 空 catalog OOTB/registry 对齐#15

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-370cf596-5137-4711-943d-25b7c06b9d7c-8077
Closed

fix(ci): 模块外置后 npm install 崩溃 + 空 catalog OOTB/registry 对齐#15
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-370cf596-5137-4711-943d-25b7c06b9d7c-8077

Conversation

@cursor

@cursor cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

背景

审查 main push c559ab4..afb4167(batch 模块外置到 Tanya7z/sfmc-modules@modules-v0.4.0 + 删除 remote-controller/dist)。

ootb run 29895479322 失败npm install
Cannot read properties of undefined (reading 'extraneous')

审查分级(DRY / OCP / DIP / LSP / LoD)

级别 原则 问题 本 PR 修复
BLOCKER DRY / 配置单一真相 package-lock.json 残留 8 个 link:true 指向已删的 modules/packages/* 删除陈旧链接并验证干净 npm install
BLOCKER LSP 业务 catalog 已刻意清空,但 check-catalog / check-ootb / smoke-modules / sim-new-user 仍把空数组当失败 modules/catalog 合法;强制校验非空的 services/catalog.json
MAJOR DRY / LSP sfmc/src/registry.ts 把整份 index 当成扁平 map,而 tools/fetch-module.mjs 正确读 json.modulesfindUnknownModules 误判全部已装模块 对齐同一解析契约
MINOR DRY .gitignore 只忽略 remote-controller/dist/index.js 改为整目录 remote-controller/dist/

仍未修(记录,避免与 #13/#14 重复刷)

验证

  • 干净目录 npm install --no-audit --no-fund 成功
  • node tools/check-catalog.jsOK (0 feature modules, 3 services)
  • SFMC_ROOT=$PWD node tools/check-ootb.js6/6 PASS
  • 临时 db-server + node tools/smoke-modules.js → PASS(空 catalog 基线)
  • npm run build --workspace=@sfmc/sdk --workspace=db-server --workspace=sfmc 通过
Open in Web View Automation 

cursoragent and others added 2 commits July 22, 2026 06:08
业务包迁出 modules/packages 后 lockfile 仍保留 8 个 link:true 条目指向已删目录,
导致 npm install 在 CI 抛出 Cannot read properties of undefined (reading 'extraneous')。
同步将 remote-controller/dist/ 整目录忽略,与其余 workspace 的 dist 约定一致。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
业务模块外置后本地 catalog 允许为空;check-catalog/ootb/smoke/sim 不再把空数组当失败。
同时让 sfmc/src/registry.ts 按 fetch-module 契约解析 { modules: { id→{repo,tag} } },
避免 findUnknownModules 把全部已装模块误判为未知来源(DRY/LSP)。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Jul 22, 2026
index.json 权威形态为 { version, modules: { id → {repo,tag} } }。
sfmc/src/registry.ts 原先把整棵 JSON 当扁平 map,导致 CLI 把 version/
generatedAt 当成模块 id(DRY/LSP 与 fetch-module 分叉)。与 #15 同修。

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
@Tanya7z
Tanya7z deleted the cursor/bc-370cf596-5137-4711-943d-25b7c06b9d7c-8077 branch July 22, 2026 14:13
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