scripts: path comparisons break on Windows (check-greys fails the pre-push hook, upgrade-opentui skips nothing)
维护者通常 1 天内回复
@deosiree 已经在做这个了。
开始于 2026年11月24日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 script/check-greys.ts 中大约第 74 行的 EXCEPTIONS.find 调用开始,并查看 script/upgrade-opentui.ts 中大约第 41-43 行的 file.split("/") 过滤器。两者都将 Bun.Glob 返回的路径(使用平台分隔符)与用 / 书写的字符串进行比较。修复方法是在匹配前统一分隔符,正如 script/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts:31 已经做的那样。完成的标准是:在 Windows 上,bun script/check-greys.ts 以退出码 0 结束,并且豁免项与 Linux 相同;升级脚本在该平台上也会跳过 node_modules 和 dist。
由索引模型根据 Issue 内容生成。
描述
Description
Two repository scripts compare paths from Bun.Glob against strings written with /. The glob returns the platform separator, so on Windows neither comparison works. The repo already normalises for this in one place (script/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts:31), so the convention exists and these two missed it.
script/check-greys.ts — fails the pre-push hook on Windows
EXCEPTIONS are written with / (/style\/token\/color\.css$/, /component\/video-editor\//, …) and matched with EXCEPTIONS.find(([re]) => re.test(file)) (:74). On Windows every scanned path is services\site\src\…, so no exception matches and the checker reports greys from the files the list exists to excuse — legacy tokens, the video editor, the font film, print.
Because bun run check is the pre-push hook, every Windows contributor is blocked until they push with --no-verify, which weakens the hook for everyone.
$ bun script/check-greys.ts
services\site\src\style\token\color.css:7 #f5f5f7 not on the scale
…
172 greys off the shared scale (script/check-greys.ts). # exit 1
script/upgrade-opentui.ts — the skip list silently does nothing
const skip = new Set([".git", ".opencode", ".turbo", "dist", "node_modules"])
…
(file) => !file.split("/").some((part) => skip.has(part))
On Windows file.split("/") yields one part (node_modules\foo\package.json), so skip never matches and the script would rewrite the version field of every package.json under node_modules and dist.
Environment
- opencode
devatb0cda20 - Windows 10 22H2, Bun 1.4.5, PowerShell 5.1
Steps to reproduce
- Clone on Windows without Developer Mode.
bun script/check-greys.ts→ 172 problems, exit 1. On Linux the same command exits 0.- Read
script/upgrade-opentui.ts:41-43: the filter keepsnode_modulesanddistentries on Windows.
Expected behavior
Both scripts match on a separator-normalised path, so the same files are exempted and the same directories are skipped on every platform.
Additional context
Fixes are ready on two branches (check-greys one expression; upgrade-opentui one expression). Verified on Windows: bun script/check-greys.ts exit 1 → 0, bun run lint exit 0, and bun run check 36/36 tasks exit 0 once the checkout's 29 symlinks are materialised (they land as text files without Developer Mode, which is a separate, environment-only obstacle).
- 主要语言
- TypeScript
- 星标
- 228k
- 派生
- 31k
- 平均合并
- 5 小时 19 分钟
- 30 天内合并 PR
- 457
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks可能已有人在做 @argszero 今天认领。 未关闭area/tui platform/wsl status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#66773 · 2 条评论 ·
维护者通常 1 天内回复
-
area/sdk-api platform/linux type/feature version/v2
难度 2/5 1-3 小时 新手友好度 76/100
anomalyco/opencode#66604 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tui platform/linux type/feature version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#66585 · 1 条评论 ·
维护者通常 1 天内回复
-
area/web inference/go reproduced type/bug
难度 2/5 1-3 小时 新手友好度 84/100
anomalyco/opencode#66475 · 1 条评论 ·
维护者通常 1 天内回复
-
[FEATURE]: More colorful built-in Dracula theme for the desktop app可能重新可做 关联的 PR 已关闭且未合并。 未关闭area/desktop type/feature version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#66446 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
knaw-huc/textannoviz#742 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
cloudflare/realtimekit-ui#219 ·
维护者通常 1 天内回复
-
ui
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
mermaid-js/mermaid-v13#1370 ·
维护者通常 1 天内回复
-
area:docs area:plugins bug documentation low-priority platform:windows
难度 1/5 1 小时以内 新手友好度 84/100
anthropics/claude-code#112676 ·