From c8c83c7f59c69a9c8eb9ae9f55e2cf3d52561b1c Mon Sep 17 00:00:00 2001 From: XisFool <191339965+XisFool@users.noreply.github.com> Date: Wed, 28 Oct 2026 05:27:42 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E9=BD=90=E9=85=8D=E7=BD=AE=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4=20review=20=E8=B7=9F=E8=BF=9B=E9=A1=B9=EF=BC=9A?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E5=8F=8D=E5=90=91=E6=96=AD=E8=A8=80=E3=80=81?= =?UTF-8?q?doctor=20=E6=AE=8B=E7=95=99=E6=A3=80=E6=9F=A5=E3=80=81CHANGELOG?= =?UTF-8?q?=20=E4=B8=8E=E4=B8=BB=E9=A2=98=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bootstrap 漂移测试加反向断言:RUNTIME_FILES 每一项必须在仓库中真实存在 - --doctor 新增 retainedBackups 检查:列出 .retained-* 原文副本并提示手动清理(只读不删) - CHANGELOG 补 Unreleased 条目:上一批 P0 修复与本次跟进(含测试覆盖说明) - saveUserTheme 解析失败报错点出文件路径与严格 JSON 要求,原文件保持不动 - 同步 module-reference 与中英文 README 卸载/doctor 说明 验证:npm test 496/488/0/8,verify 10/10,verify-install 14/14 Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> --- CHANGELOG.md | 8 +++++++ README.md | 2 +- README_en.md | 2 +- docs/module-reference.md | 3 ++- runtime/doctor.js | 36 ++++++++++++++++++++++++++++ runtime/lang.js | 4 ++++ runtime/theme-selector.js | 11 +++++++-- tests/unit/bootstrap.test.mjs | 3 +++ tests/unit/doctor.test.mjs | 38 ++++++++++++++++++++++++++++++ tests/unit/theme-selector.test.mjs | 24 +++++++++++++++++++ 10 files changed, 126 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4f912e..370012e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added (新增特性) - **CLI 查询**:新增 `--version`/`-v` 与 `--help`/`-h`,无需等待 stdin。 +- **分发 LICENSE**:本地复制与远端下载清单均包含仓库 `LICENSE`,修复分发物缺失 MIT 许可文本的问题。 +- **远端清单漂移测试**:新增单测断言 `RUNTIME_FILES` 覆盖 `runtime/` 下全部 `.js/.json` 与相对 `require()` 依赖,并反向断言清单每一项在仓库中真实存在,防止重蹈 v0.3.9 漏 `update-checker.js` 的事故。 +- **doctor 残留副本检查**:`--doctor` 新增 `codebuddy` 检查项,列出卸载时保留的 `.bak.codebuddy-hud.retained-*` 原文副本并提示手动清理(只列出、不自动删除)。 ### Changed (变更) @@ -32,6 +35,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Windows PATH**:安装/卸载保留 HKCU `Path` 的 `%VAR%` 与注册表值类型;卸载按归一化路径移除 runtime bin,避免误删或漏删。 - **effort 状态**:临时文件 + rename 原子写入,避免并发读到半截 JSON。 - **bootstrap 查询源**:兼容 `CODEBUDDY_HUD_REMOTE_PKG_URL` 旧名;显式 Release URL 跳过默认 302/API 查询,两变量同设时新名优先。 +- **安装/卸载 JSONC 无损**:`--setup`/`--uninstall` 改为局部文本编辑,仅改动 `statusLine` 成员,保留注释、BOM、换行与格式;已有 `padding` 与额外字段予以保留;卸载在确认 `statusLine` 之外无改动时整文精确还原,否则仅回写该字段并把原文另存 `.retained-