Repository navigation
fix(scripts): 删除旧 macOS/Windows 客户端遗留的脚本分支和资源 - #2500
Merged
Merged
Conversation
旧 Swift 与 Tauri 客户端已在 #1799 删除,下列代码只在已不存在的目录存在时才运行, 现在不再检查或生成任何东西: - generate-i18n.mjs:删掉 Swift 枚举、Localizable.strings、Windows 字典的生成分支, 旧手写 key 检查和 --macos-locales 参数;只生成桌面端 Go 字典,校验规则不变。 - verify-app-language-localization.mjs:删掉 macos/Sources 的 Swift 扫描和 zh-Hans.lproj 读取,只保留 desktop/internal 的 Go 检查。 - verify-runtime-bundle-immutability.sh:删掉 macos/Sources 与 windows/tauri 的写入检查。 - verify-platform-feature-matrix-change.mjs:平台实现路径只剩 desktop。 - 删除 scripts/macos/package/package-macos-localizations.sh(没有任何调用方)和 只给原生字符串表用的 shared/i18n/fixtures/。 - .gitattributes:删掉 6 条指向已删除路径的换行规则。 - 测试改为针对 Go 生成物;同时修复 test-runtime-bundle-immutability.mjs 中 #2498 漏改的工作流镜像列表(main 上 3/4 失败)。 - 同步 shared/i18n/README.md、scripts.md 目录表和两篇 Agent Note; 仍被校验的旧客户端词条数据留在 #1807 清理。 Refs #1807
1 task done
xiaoyumuxi
marked this pull request as ready for review
November 28, 2026 15:39
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 3 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
10 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
旧 Swift macOS 客户端和 Tauri Windows 客户端已在 #1799 删除,但多个脚本仍保留只在
macos/Sources、macos/Resources、windows/tauri存在时才运行的分支。目录不在时这些分支直接跳过,既不检查也不生成任何东西,却会让人以为 Swift/Tauri 文案和发行目录仍在被校验。仓库里还剩一个没有调用方的 macOS 打包脚本、两份只给原生字符串表用的 fixture,以及 6 条指向已删除路径的.gitattributes规则。顺带修一处 main 上的红灯:#2498 往
verify-runtime-bundle-immutability.sh的工作流清单加了file_type_mappings_test.go,但test-runtime-bundle-immutability.mjs里的镜像列表没跟着改,Desktop CI 的这条测试在 main 上 5 个用例失败 3 个。所有 CI 工作流(10 个)和
.github/actions/*都仍在使用,本 PR 没有删除任何工作流。改动 / Changes
i18n 生成器
scripts/i18n/generate-i18n.mjsshared.generated.ts、SwiftAppLanguage.generated.swift、各语言Localizable.strings的生成分支,以及它们用到的nativeTemplate、stringsEntry、swiftQuote、quote和生成区域标记常量。windowsKeys/legacyDirectory)和--macos-locales参数;用法变为[--check|--coverage]。desktop/internal/i18n/shared.generated.go;清单与词条的校验规则(含仍存在的macos/windows字段)不变,生成结果字节不变(--check通过)。i18n 源码检查
scripts/i18n/verify-app-language-localization.mjsmacos/Sources的 Swift 扫描和zh-Hans.lproj/Localizable.strings读取(原第 11–188 行);desktop/internal的 Go 检查原样保留,报错文案改为指向i18n.Shared/i18n.SharedFormat。i18n 测试
scripts/i18n/test-i18n.mjsLocalizable.strings、macOS 打包和原生 ABI 的用例;fixture 只创建desktop/internal/i18n。shared.generated.go;Swift case 和 macos 别名的校验用例保留(校验仍存在)。57/57 通过。发行目录只读检查
verify-runtime-bundle-immutability.sh:删除macos/Sources与windows/tauri/src-tauri/src的写入检查,结束语只描述共享桌面源码。test-runtime-bundle-immutability.mjs:删除对应的旧客户端用例;镜像列表补上 feat(desktop): support built-in and custom file type mappings #2498 新增的file_type_mappings_test.go,去掉末尾重复的remote_devcontainer_form_test.go,顺序与脚本一致。功能矩阵变更门禁
verify-platform-feature-matrix-change.mjs的平台实现路径只剩desktop;测试改用desktop/internal/fixture.go触发门禁。删除的文件
scripts/macos/package/package-macos-localizations.sh(全仓库没有调用方,scripts/macos/随之为空)。shared/i18n/fixtures/format-v1.json、native-abi-v1.json(只服务原生字符串表,桌面测试从未读取)。.gitattributesmacos/Resources/*.lproj/Localizable.strings、AppLanguage.generated.swift、windows/tauri/src/i18n/shared.generated.ts、Plugins/mac/Official/JavaSupport/templates/**、macos/Sources/LitheModuleAPI/Logging/*.swift、rust/crates/diagnostics/src/catalog_generated.rs(Core 已在独立仓库)。shared.generated.go的 LF 规则保留。文档与 Agent Note
shared/i18n/README.md整体改写为只描述 Go 字典:读取接口、检查器实际拒绝的写法、新增语言要同时改desktop/internal/i18n/i18n.go;旧客户端字段标明“仍校验、不再生成,见 [Feature] 统一 Viva 桌面文案的共享 i18n 来源与校验 #1807”。.agents/skills/develop-lithe/references/scripts.md:scripts/macos/一行去掉“现有package/”。2026-10-23-shared-i18n-generation.md:更正“新增语言只需改清单”“桌面测试消费 format-v1”等已不成立的说法,适用范围去掉 fixture。2026-11-14-core-app-contracts-single-source.md:fixture 的位置改为“已随生成路径删除”,删除对应验证行和适用范围。不在本 PR 范围内 / Out of scope
以下与 #1807 同因,已补充到 #1807,不在本 PR 处理:
shared/i18n中只服务旧客户端的数据:8,622 条只标记macos/windows的词条、4,930 个macos.key和 302 个windows.key别名、18 条overrides.macos/overrides.windows、清单的macos/swiftCase/platformDefaults及对应校验。其中macos值(en/zh-Hans)正是桌面端保存语言设置用的代码,删除前要先迁走这层对应关系。i18n.go,不由清单驱动。AGENTS.md“界面文案必须走统一 i18n 接口”和develop-lithei18n 一节里的 macOS(SwiftUI、L10n.string、Localizable.strings)规则已过时。shared/platform-feature-matrix/features/shared-i18n.json的legacy证据固定在旧 revision,按矩阵规则保留原样;归档 Note 不改。类型专属:fix
复现与根因
origin/main(12f76af95)运行node --test scripts/desktop/verify/test-runtime-bundle-immutability.mjs,5 个用例中 3 个失败(checks both desktop platforms…、ignores test-only executable lookups…、requires each listed workflow…),原因是 fixture 没有写file_type_mappings_test.go,脚本报must keep TestFileTypeMappingsStayOutsideInstalledPackage;期望全部通过。其余改动无用户可观察缺陷,动机是删除只在已删除目录存在时才运行的死代码。verify-runtime-bundle-immutability.sh的工作流清单,没有同步测试的镜像列表;旧客户端分支是 Epic(0.7.0): 基于 Viva 框架的跨平台方案的迁移(#1794) #1799 删除macos/、windows/时遗留的。检查项
scripts/desktop/verify/test-runtime-bundle-immutability.mjs本身就是回归,main 上pass 2 / fail 3,本 PR 后pass 4 / fail 0(删掉的 1 个是旧客户端用例)rg确认package-macos-localizations、fixtures/format-v1、native-abi-v1、--macos-locales、scripts/macos在工作流、脚本、Makefile 中没有引用;nativeTemplate只有测试导入且已同步删除.agents/notes/implemented/bug-fix/记录:只删死代码和补测试清单,没有新的行为约束;受影响的两篇 Note 已原地更新范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/<id>.json:没有用户可观察变化./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh;改了平台实现路径的,还运行了./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空shared/i18n/;插件的构建步骤、资源路径和补丁没有写进docs/ci-builds.md、Agent Note 或 SkillUI 验证 / UI evidence
N/A:没有界面变化。
统一日志系统 / Structured logging
N/A:没有改动日志相关路径。
界面文案 / i18n
node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单(Go 检查规则原样保留,只删除旧 Swift 扫描)逻辑归属 / Logic placement
N/A:只改仓库脚本,没有业务逻辑。
性能与内存 / Performance and memory
N/A:不涉及运行时。
设置 / Settings
N/A:不涉及设置。
插件契约 / Plugin contract
N/A:不涉及插件契约。
发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh(12 个工作流保留安装包测试)docs/ci-builds.md的 i18n 说明本来就只写 Go 生成物,无需修改无用代码与重构 / Dead code and refactoring
refactor标签的 Issue:[Feature] 统一 Viva 桌面文案的共享 i18n 来源与校验 #1807(已在原单补充评论,未新开重复 Issue)验证 / Verification
node --test --test-timeout=60000 scripts/i18n/test-i18n.mjsnode scripts/i18n/verify-app-language-localization.mjsnode scripts/i18n/generate-i18n.mjs --check/--coverage./scripts/desktop/verify/verify-runtime-bundle-immutability.shnode --test scripts/desktop/verify/test-runtime-bundle-immutability.mjsnode --test scripts/platform-feature-matrix/test-platform-feature-matrix.mjs./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD./scripts/agent-notes/verify-agent-notes.sh./.agents/skills/write-stable-tests/scripts/verify-test-stability.shdesktop/**/*_test.go,本 PR 只改 JS 测试;JS 用例均带单项超时,子进程spawnSync上限 5 秒rg命令git diff --check未能执行的检查和原因: 没有在 Windows 上运行;改动只涉及 Node/zsh 仓库脚本,Desktop CI 在 Linux 上运行同一组 i18n 与发行目录测试。没有改 Go 代码,所以没有运行
desktop-go.sh test。提交前确认 / Final checks
main创建;目标分支:main(已 rebase 到 12f76af).build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图