Repository navigation
Fix two latent Windows faults in packages/ui - #179
Merged
Merged
Conversation
main went red on all three windows-latest legs after #177 merged. Four tests failed, all in ui, and none of them are migration damage -- they are bugs ui always had. Its own verify.yml ran ubuntu-latest only, so nothing had ever executed this code on Windows. Core's matrix runs the full OS cross product on push to main and found them on first contact. test/cli.test.ts passed `new URL('..', import.meta.url).pathname` as a spawn cwd. On Windows that is "/D:/a/urlcode/..." -- leading slash, forward slashes, not a valid path -- so spawnSync failed and status came back null instead of 0. Three tests died on it. fileURLToPath is the correct conversion and is what core already uses. test/package.test.ts called execFileSync('npm', ...), which is ENOENT on Windows because npm is npm.cmd and execFileSync does not resolve it without a shell. scripts/build-candidate.ts already had the platform check; this now matches it. Nothing else in packages/ spawns npm or reads .pathname off a file URL. To be clear about the CI behavior, since main being red looks alarming: this is the documented design. ci.yml runs the Node axis on Linux for pull requests and the full three-OS cross product on push to main, and says so -- "platform- specific faults (path case, symlinks, separators) still get caught, just one push to main later where the full cross product runs." Fixing forward is the intended flow, not a gap. Co-Authored-By: Claude Opus 5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 19, 2026
Follow-up to #179. Naming npm.cmd got past ENOENT and into EINVAL: since the CVE-2024-27980 fix, Node refuses to spawn a .cmd without shell: true. Runs npm-cli.js under the current Node instead, the idiom scripts/pack-sources.mjs already uses.
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.
mainwent red on all threewindows-latestlegs after #177 merged. Fourtests failed, all in
packages/ui.None of it is migration damage. These are bugs ui always had; its own
verify.ymlranubuntu-latestonly, so this code had never been executed onWindows. Core's matrix runs the full OS cross product on push to
mainandfound them immediately — the same pattern as CodeQL scanning these packages for
the first time.
list,eject,preview(test/cli.test.ts)new URL('..', import.meta.url).pathnameis/D:/a/urlcode/...on Windows — leading slash, forward slashes, not a valid path.spawnSyncfails andstatusisnull, not0.test/package.test.ts)execFileSync('npm', …)is ENOENT on Windows: npm isnpm.cmd, whichexecFileSyncwill not resolve without a shell.Both fixes use idioms core already had —
fileURLToPath, and theprocess.platform === 'win32' ? 'npm.cmd' : 'npm'check fromscripts/build-candidate.ts. Nothing else underpackages/spawns npm orreads
.pathnameoff a file URL.Note this PR's own checks run Linux-only by design, so they cannot confirm the
Windows fix; the push-to-main run after merge is what proves it.
🤖 Generated with Claude Code