Skip to content

fix(pack-update): 修复 bindOk 重复 enabled 导致 ootb TS1117 - #66

Merged
Tanya7z merged 2 commits into
mainfrom
cursor/bc-4b967f90-6a3f-43d1-be93-f333df164819-2bee
Jul 24, 2026
Merged

fix(pack-update): 修复 bindOk 重复 enabled 导致 ootb TS1117#66
Tanya7z merged 2 commits into
mainfrom
cursor/bc-4b967f90-6a3f-43d1-be93-f333df164819-2bee

Conversation

@cursor

@cursor cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

背景

Push main@99b882d(合并 #64)与前序 baff02a 的 ootb 均失败:

  • smoke → Build all workspaces
  • TS1117: An object literal cannot have multiple properties with the same name
  • 位置:sfmc/src/pack-update/service.tspackUpdate.bindOk 参数)

根因:baff02a 合并冲突同时保留了两侧的 enabled 键(#63bindingEnabledLabel(binding.enabled) + 本地 cfg.defaultBindingEnabled ? packs.list.on/off)。

审查(原则标注)

级别 原则 问题
BLOCKER DRY / LSP bindOk 对象字面量双 enabled → TS1117,构建失败
MAJOR DRY bindingEnabledLabel 写死 on/off,与 formatSourcesList 的 i18n 分叉
MINOR LSP httpDownload 中途无 Content-Length 仍回调,但 finish 在 total=0 时跳过最终回调

改动

  1. 删除重复 enabled;以 binding.enabledmakeBindingFromHit 已吸收 defaultBindingEnabled)为唯一权威
  2. bindingEnabledLabel / sources 列表共用 packs.list.on|off
  3. httpDownload finish:无 Content-Length 时用 finalBytes 作总量补最终进度回调

验证

  • 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)
  • CLI build 无 TS1117 / duplicate-object-key

未改

  • ServiceId pack-manager 注册(主路径已不 spawn)
  • ootb 强制跑 pack-update / eslint-plugin tests
  • needKey 文案仍偏 CurseForge(仅一源时可用)
Open in Web View Automation 

cursoragent and others added 2 commits July 24, 2026 12:35
main@baff02a 合并冲突在 probeSourceAfterInstall 的 bindOk 参数里留下两个
enabled,触发 TS1117,ootb Build 失败。删除重复键,以 binding.enabled
(经 makeBindingFromHit)为唯一权威;bindingEnabledLabel / sources 列表
共用 packs.list.on|off。httpDownload 在无 Content-Length 时补最终进度回调。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z
Tanya7z marked this pull request as ready for review July 24, 2026 12:38
@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 56466b8 into main Jul 24, 2026
1 check passed

@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 审查(main@56466b8 合入后)

ootb success 30093856620 — TS1117 / bindOk 双 enabled 已关闭。

本 PR 已解决

级别 原则 结论
BLOCKER DRY/LSP bindOk 重复 enabled 已消除
MAJOR DRY bindingEnabledLabel 共用 packs.list.on|off
MINOR→部分 LSP httpDownload finish 无 Content-Length 补回调 ✅

合入后残余 → #67

级别 原则 问题
MAJOR LSP bindByteProgressToBar 仍以占位 1MB start,总量变已知后不重设刻度
MAJOR DRY bindOk / setBinding 多出口未抽取
MINOR OCP needKey 文案写死 CurseForge

补丁 PR:#67

View PR

Open in Web View Automation 

Sent by Cursor Automation: SFMC-Review

@Tanya7z
Tanya7z deleted the cursor/bc-4b967f90-6a3f-43d1-be93-f333df164819-2bee 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