Skip to content

fix(pack-update): DRY/OCP 收敛 provider 解析与流式下载 - #64

Merged
Tanya7z merged 1 commit into
mainfrom
cursor/bc-16b21cf5-53c4-4fb3-abf9-ed11385b632d-16cc
Jul 24, 2026
Merged

fix(pack-update): DRY/OCP 收敛 provider 解析与流式下载#64
Tanya7z merged 1 commit into
mainfrom
cursor/bc-16b21cf5-53c4-4fb3-abf9-ed11385b632d-16cc

Conversation

@cursor

@cursor cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

背景

Push main@c9a58ea(合并 #63)后 ootb 已绿。对 #63 / SEA 拆除后的 pack-update 残余做 SOLID 审查并直接出补丁。

审查(原则标注)

级别 原则 问题
MAJOR DRY / OCP probe / search / bind / check 四处写死 createPackSourceProvider(cfg, "curseforge") + needKey
MAJOR LSP / DRY i18n bindOk / probeAutoBind 写死 cf:,与 binding.provider 分派契约不一致
MAJOR DRY / DIP CF download 自建 fetch+整包进内存,与 BDS httpDownload 重复且大包有 OOM 风险
MAJOR DRY BDS 更新与 CF 下载各自复制 lastTime/lastLoaded 进度环路
MINOR Demeter / 文档 CLAUDE.md 仍文档化已删除的 panel/

改动

  1. resolveConfiguredPackProvider / providerShortLabel 进入 providers 注册表;编排入口统一解析
  2. i18n 改为 {provider}:{slug}
  3. CF download → @sfmc-bds/bds-tools/http(新增 exports ./http);无 Content-Length 时仍回调进度
  4. SDK bindByteProgressToBar;BDS check-update 与 CF 共用(失败重试每次新建 binder)
  5. CLAUDE.md 对齐 sfmc CLI;新增 pack-update-config.test.mjs

验证

  • npm run typecheck -w @sfmc-bds/cli / bds-tools
  • npm test -w @sfmc-bds/cli(15 pass)
  • npm test -w @sfmc-bds/bds-tools(21 pass)

未改

  • ServiceId pack-manager 注册(主路径已不 spawn)
  • ootb 强制跑 pack-update / eslint-plugin tests
Open in Web View Automation 

审查 main@c9a58ea(#63 合入后):入口四处写死 curseforge/needKey、
i18n 写死 cf:、CF 下载整包进内存、进度环路与 BDS 更新重复。

- resolveConfiguredPackProvider / providerShortLabel 注册表化
- bindOk/probeAutoBind 使用 {provider} 占位(LSP)
- CF download 改走 bds-tools/httpDownload + 导出 ./http
- SDK bindByteProgressToBar 供 BDS/CF 共用;无 Content-Length 也回调
- CLAUDE.md 去掉已删除的 panel/;补充 config 契约测试

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z
Tanya7z marked this pull request as ready for review July 24, 2026 12:32
@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.

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