Skip to content

fix(scripts): 统一索引格式,避免机器人改动产生无关差异 - #2

Merged
xiaoyumuxi merged 1 commit into
mainfrom
fix/index-format
Oct 12, 2026
Merged

xiaoyumuxi merged 1 commit into
mainfrom
fix/index-format

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Collaborator

问题

首次实测 Track plugin releases(追踪 Lua Support 0.2.0)时,脚本用 JSON.stringify(index, null, 2) 写回索引,把 tags、platforms 等短列表全部展开成多行,PR 里出现大量与新版本无关的差异,不便审查。

改动

  • scripts/validate-index.mjs:新增 formatIndex(两格缩进、只含纯值的数组写在一行);校验时要求索引是统一格式,新增 --write-format 自动整理。
  • scripts/track-releases.mjs:写回索引时使用 formatIndex,追踪 PR 只包含新增的版本条目。
  • scripts/store.test.mjs:新增格式往返测试与“已发布索引符合统一格式”测试(共 30 个用例全部通过)。
  • docs/publishing.md:本地校验步骤加入 --write-format。

验证

  • 对实测生成的 bot/track-releases 分支索引运行 --write-format 后,与 main 的差异只剩新增的 0.2.0 版本块。
  • 当前 main 的索引已符合统一格式,无需改动数据。

另:已在仓库创建 issue 模板与追踪工作流使用的 submission、report、new-version 标签。

🤖 Generated with Claude Code

- formatIndex:两格缩进、纯值列表写在一行;track-releases 写回时使用
- validate-index 检查格式,--write-format 自动整理
- 文档补充格式化命令

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xiaoyumuxi
xiaoyumuxi merged commit cb272be into main Oct 12, 2026
1 check passed
@xiaoyumuxi
xiaoyumuxi deleted the fix/index-format branch October 12, 2026 15:54
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.

1 participant