Skip to content

Run the kit on Windows as well as macOS and Linux - #1

Merged
routaz merged 1 commit into
mainfrom
windows-support
Oct 8, 2026
Merged

routaz merged 1 commit into
mainfrom
windows-support

Conversation

@routaz

@routaz routaz commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Problem

On Windows the kit stopped before any test ran. npx, npm and an npm-installed claude are .cmd shims, and Node can't spawn those without a shell (ENOENT, or EINVAL since the CVE-2024-27980 fix). Errors from Supabase key lookup were swallowed into "Local Supabase is not running", even with the stack up.

Change

  • kit/run.ts: run() / npx() / failure(). On Windows it quotes the kit's own arguments into one cmd.exe command line and refuses anything cmd.exe could still expand (", %, !, ^, newlines). Elsewhere it calls the command directly, as before. Every npx call site, Claude detection and the demo capture script use it.
  • Agent prompts go in on stdin (claude -p reads it), so free text never touches a command line on any platform.
  • Forward-slash test paths from listTests(): Playwright reads file filters as regexes, so e2e\specs\… turned into \s and the mutation runner selected nothing on Windows.
  • CRLF-tolerant mutations (kit/eol.ts): find/replace strings match CRLF files and function sources created from CRLF migrations.
  • snapshot.ts entry check compares file URLs; .gitattributes keeps checkouts LF so format:check passes on Windows.
  • Failures from npx calls now name the cause (spawn error, end of stderr, or exit code).
  • CI: new Tests (windows-latest / macos-latest) job runs typecheck, unit tests, the suite, coverage and the mutation runner.

Verified on macOS

npm run check (31 unit tests), npm test 48 passed, npm run coverage -- --strict 19/19, npm run mutate 12/12 caught, requireClaude through the new runner, node kit/heal/snapshot.ts. Windows is covered by the new CI job.

On Windows the kit stopped before any test ran: npx, npm and an npm-installed
claude are .cmd shims, which Node can't spawn without a shell. kit/run.ts now
quotes the kit's own arguments into one cmd.exe command line there, refusing
anything cmd.exe could still expand, and calls the command directly elsewhere.
Agent prompts go in on stdin, so free text never reaches a command line.

Other Windows breaks fixed on the way:
- Test paths from listTests() use forward slashes. Playwright reads file
  filters as regular expressions, so e2e\specs became \s and the mutation
  runner selected nothing.
- Mutation find/replace strings match CRLF files and CRLF function sources.
- snapshot.ts's entry check compares file URLs, not file:// plus a path.
- .gitattributes keeps checkouts LF, so format:check passes on Windows.

Errors from npx calls now say why they failed, e.g. the Supabase CLI's own
message instead of always "Local Supabase is not running". CI runs the unit
tests, the suite, coverage and the mutation runner on Windows and macOS too.
@routaz
routaz merged commit 91b8f06 into main Oct 8, 2026
8 checks passed
@routaz
routaz deleted the windows-support branch October 8, 2026 19:56
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