Skip to content

fix: BDS 路径 helpers 收敛 Demeter/DRY(审查 #57) - #59

Merged
Tanya7z merged 2 commits into
mainfrom
cursor/bc-47045138-5324-4c24-a348-eefd3109596b-3e41
Jul 24, 2026
Merged

fix: BDS 路径 helpers 收敛 Demeter/DRY(审查 #57)#59
Tanya7z merged 2 commits into
mainfrom
cursor/bc-47045138-5324-4c24-a348-eefd3109596b-3e41

Conversation

@cursor

@cursor cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

背景

main@3ed3bc6 合入 #57(SEA Node DRY + pack-lifecycle→pack-manager-lib)与 #58(tsc7 双轨)。ootb 已绿(run 30028138389)。本 PR 收敛审查中仍可验证的 Demeter/DRY 债。

审查(DRY / OCP / DIP / LSP / Demeter)

级别 原则 问题
MAJOR Demeter / DRY pack-lifecycle / world-packs 仍硬拼 config/<uuid>/permission.json
MAJOR Demeter / DRY 多处 path.join(bdsRoot, "worlds") 泄漏布局
MAJOR DRY world_*_packs.json 文件名 ternary 在读写两侧重复
MINOR DRY / LSP readLevelName 与 Sync 仍双份 path/exists;deployToBDS 局部 worldsDirEnablePackOpts.worldsDir 语义冲突
MINOR DRY 未使用的 listEnabledSapiEntries / listEnabledResourcePackDirs 双轨导出

改动

  1. pack-manager-lib 路径权威serverPropertiesPath / bdsWorldsDir / bdsWorldLevelDir / worldPackListFile / configPermissionPath / hasConfigPermission
  2. 读写两侧 editWorldPackList + readWorldPackListResult 共用 worldPackListFile
  3. readLevelNamereadLevelNameSync(同契约 LSP)
  4. 调用方pack-lifecycle / world-packs / cli-pack-manager / server-properties / sfmc packs path 全部改走 helpers;删除死导出
  5. 测试:新增路径 helpers 契约用例

验证

  • npm run build --workspaces --if-present
  • npm run test --workspace @sfmc-bds/bds-tools(21 pass)
  • npm run typecheck(bds-tools + cli)

未改

  • CLI / ServiceId pack-manager 注册仍保留(外部调试薄适配)
  • AGENTS.md 历史 CI pin 叙述(docs drift)
Open in Web View Automation 

#57 已让 pack-lifecycle 直连 pack-manager-lib,但调用方仍硬拼
worlds/config/server.properties 布局。抽出 bdsWorldsDir /
worldPackListFile / configPermissionPath 等权威入口,
readLevelName 委托 Sync,删掉未使用的 listEnabled* 双轨。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z
Tanya7z marked this pull request as ready for review July 24, 2026 11:11
@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Tanya7z
Tanya7z merged commit 2765f4f into main Jul 24, 2026
1 check passed
@Tanya7z
Tanya7z deleted the cursor/bc-47045138-5324-4c24-a348-eefd3109596b-3e41 branch July 25, 2026 12:47
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