scripts: path comparisons break on Windows (check-greys fails the pre-push hook, upgrade-opentui skips nothing)

Aperta Adatta ai principianti
#66,192 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@deosiree ci sta già lavorando.

Dal 24/11/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Inizia da script/check-greys.ts alla chiamata EXCEPTIONS.find, vicino alla riga 74, e da script/upgrade-opentui.ts al filtro file.split("/"), vicino alle righe 41-43. Entrambi confrontano percorsi provenienti da Bun.Glob, che usa il separatore della piattaforma, con stringhe scritte con /. La correzione consiste nel normalizzare i separatori prima del confronto, come già fa script/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts:31. È fatto quando bun script/check-greys.ts termina con codice 0 su Windows con le stesse esenzioni di Linux e lo script di aggiornamento salta node_modules e dist anche lì.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

platform/windows status/repro-plausible type/bug version/v2
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 dev at b0cda20
  • Windows 10 22H2, Bun 1.4.5, PowerShell 5.1
Steps to reproduce
  1. Clone on Windows without Developer Mode.
  2. bun script/check-greys.ts → 172 problems, exit 1. On Linux the same command exits 0.
  3. Read script/upgrade-opentui.ts:41-43: the filter keeps node_modules and dist entries 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).

Lingua principale
TypeScript
Stelle
228k
Fork
31k
Merge medio
5h 19m
PR unite (30g)
457

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.