Skip to content

chore: support Windows in dev env - #68

Merged
filipmyllari merged 8 commits into
mainfrom
chore/windows-support-dev
Sep 23, 2026
Merged

filipmyllari merged 8 commits into
mainfrom
chore/windows-support-dev

Conversation

@bespoyasov

@bespoyasov bespoyasov commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Follows up on #67.

Fixes Windows compatibility issues in the dev pipeline so tests can pass on Windows.

  • Adds CLAUDE.md to .prettierignore. Clone with git clone -c core.symlinks=true so CLAUDE.md is a real symlink (needs Developer Mode or symlink privilege). prepare does not change git config.
  • Uses fileURLToPath() in Vitest configs instead of URL.pathname
  • Uses os.tmpdir() on Windows for test temp directories
  • Makes e2e mock binaries platform-aware (.js scripts plus .cmd for cmd.exe). The CLI runs {name}.js with Node via resolveBin, because execFile/spawn cannot execute .cmd without a shell.
  • Uses path.delimiter for PATH separator in e2e sessions
  • Sets Windows-equivalent env vars (USERPROFILE, TEMP, TMP) and deduplicates case-insensitive keys (Path vs PATH) with overlayEnv
  • Skips /usr/bin-dependent e2e test on Windows (so far)

Not included

  • TERM env var: xterm-256color is harmless on Windows, left as-is
  • Windows CI job: deferred

Remaining work

  • Fixed-length temp dir prefix across all platforms for stable e2e snapshots on Windows (__tests__/shared/project-scaffold/index.ts:22-24)
  • Portable "node not on PATH" e2e test for Windows: git install location varies (__tests__/e2e/system-check-failure.e2e.ts:22-26)

Test plan

  • pnpm qa passes (typecheck + lint + 194 tests)
  • On a Windows machine, clone with core.symlinks=true (or re-checkout CLAUDE.md after enabling it) so CLAUDE.md is a real symlink
  • pnpm test:e2e passes on Windows

bespoyasov and others added 7 commits September 10, 2026 15:40
Add CLAUDE.md to .prettierignore so Prettier skips the symlink target,
and enable core.symlinks in the prepare script so Windows clones
checkout the symlink correctly after pnpm install.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
URL.pathname returns /C:/Users/... on Windows, breaking path alias
resolution. fileURLToPath() handles this correctly cross-platform.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
/tmp/ doesn't exist on Windows. Use perPlatform() to pick os.tmpdir()
on Windows while keeping /tmp/ on Unix for stable e2e snapshot column
alignment.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
On Windows, scripts need a .cmd launcher instead of a Unix shebang and
chmod. Split binary writing into writeUnixBinary/writeWindowsBinary in
a new fs.ts module and add IS_WINDOWS to the e2e env constants.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Windows uses ; not : as the PATH separator.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Windows uses USERPROFILE/TEMP/TMP instead of HOME/TMPDIR. Set the
Windows equivalents alongside the Unix vars so both are available.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The test relies on /usr/bin as a PATH with git but not node, which
has no portable Windows equivalent. Other system-check tests already
validate the failure UI.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@bespoyasov
bespoyasov marked this pull request as ready for review September 17, 2026 13:47
Deduplicate case-insensitive env keys, run PATH .js shims with Node
instead of .cmd files, and stop mutating git config in prepare.

Co-authored-by: Cursor <[email protected]>
@filipmyllari
filipmyllari self-requested a review September 23, 2026 15:26
@filipmyllari
filipmyllari merged commit c129a56 into main Sep 23, 2026
3 checks passed
@filipmyllari
filipmyllari deleted the chore/windows-support-dev branch September 23, 2026 15:27
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.

2 participants