Skip to content

fix(bds-tools): scanDestOccupancy 合并冲突导致 changeset-release/--dts 失败 - #86

Merged
Tanya7z merged 4 commits into
mainfrom
cursor/bc-d0d941f9-ddb0-4dbd-b660-faeef2871028-f87a
Jul 27, 2026
Merged

fix(bds-tools): scanDestOccupancy 合并冲突导致 changeset-release/--dts 失败#86
Tanya7z merged 4 commits into
mainfrom
cursor/bc-d0d941f9-ddb0-4dbd-b660-faeef2871028-f87a

Conversation

@cursor

@cursor cursor Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

合入 #80changeset-release / ootbbds-tools --dts 失败(TS2304: Cannot find name 'uuid'|'version'|'name')。

根因(BLOCKER · DRY)

#80 抽取 readPackDirOccupancy 后,与 #81(BOM/catch 拓宽)合并时冲突解决拼坏:scanDestOccupancy 保留了 facts 外壳与 facts?.… 写出,却残留旧的未声明 uuid=/version=/name= 赋值,且从未 facts = readPackDirOccupancy(dir)

运行时这些赋值抛 ReferenceError,被 catch 吞掉 → 占用 uuid 恒空 → 同 uuid 覆盖决策失效。

修复

  • facts = readPackDirOccupancy(dir)(单一占用读取权威来源)
  • 保留 fix(logs/config): BDS 级别 DRY + 剥前缀误判 + BOM/ensure 对齐 #81 的 catch-all(不可读 → uuid 空占位)
  • scanDestOccupancy 单测(含 kind)
  • 清理已写入 pre.json#changesets 的残留 .mdalign-release-token-dry / bds-log-filter-solid),只留 pending build-deps-world-packs-solid

验证

  • node tools/build-publishable.mjs(含 bds-tools --dts
  • node --test bds-tools/world-packs.test.mjs(15 pass)
  • node --test tools/changeset-release.test.mjs(12 pass)

Trigger

workflow_run failure @ e75f2d6(Merge #80)→ runs 30199481775 / 30199481763

Open in Web View Automation 

cursoragent and others added 4 commits July 26, 2026 11:08
#80/#81 合入时 scanDestOccupancy 保留了 facts 外壳却残留未声明的
uuid/version/name 赋值,changeset-release/ootb 的 tsc7 --dts 挂掉;
运行时 ReferenceError 被 catch 吞掉会使占用 uuid 恒空。

改为 facts = readPackDirOccupancy(dir)(DRY),补 scan 单测;
清理已写入 pre.json 的残留 changeset 文件,避免与 pending 混淆。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
保留 #81 扫描不中断契约(try/catch),采用完整+残缺 header 覆盖;
同步 #84 后 package-lock 中 sdk/cli 的 0.2.0-beta.1。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
pre 模式下 apply-release-plan 不会删除 .md(仅 exit/非 pre 才删),
须留盘至 pre exit;listPendingChangesetFiles 靠 pre.json 排除。
误删会破坏 pre exit 时对历史 changeset 的再计算。

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

cursor Bot commented Jul 27, 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 ad21f2f into main Jul 27, 2026
1 check passed
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