mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1098] [MERGED] fix(deploy): resolve wrangler .CMD shim on Windows #1094
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#1094
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/1098
Author: @piffie
Created: 5/6/2026
Status: ✅ Merged
Merged: 5/6/2026
Merged by: @james-elicx
Base:
main← Head:fix/windows-wrangler-shim📝 Commits (5)
8495545fix(deploy): resolve wrangler .CMD shim on Windows (#1095)4238f72Apply suggestion from @ask-bonk[bot]8442afdstyle: format deploy.tse0a7045Merge remote-tracking branch 'origin/main' into pr-1098-fix2638fcedtest(app-elements): include artifactCompatibility in legacy-payload round-trip expectation📊 Changes
3 files changed (+81 additions, -5 deletions)
View changed files
📝
packages/vinext/src/deploy.ts(+32 -5)📝
tests/app-elements.test.ts(+1 -0)📝
tests/deploy.test.ts(+48 -0)📄 Description
Summary
Fixes #1095 —
vinext deployon Windows fails withspawnSync wrangler ENOENTbecauserunWranglerDeployinvokes the bare-namenode_modules/.bin/wranglerfile. On Windows that file is a Unix shebang script with no PATHEXT extension, soCreateProcess()(used byexecFileSync) refuses to execute it. The.CMDshim sitting next to it is the actual Windows-executable.Change
resolveWranglerBin(root, platform?)fromrunWranglerDeploy.win32prefer.bin/wrangler.CMD, fall back to.bin/wrangler(covers oddball PMs that don't generate a.CMDshim)..bin/wrangleronly.platformis an injected parameter (defaulting toprocess.platform) so the helper is unit-testable without mutating globals.Considered Option 2 (
cross-spawn) and Option 3 (shell: true) from the bug report. Option 1 keeps the dep surface unchanged and matches the issue tracker's recommendation; happy to switch tocross-spawnif maintainers prefer.Tests
Five new cases in
tests/deploy.test.ts → describe("resolveWranglerBin"):.CMDwhen both files exist.CMDexistsnode_modules)pnpm test tests/deploy.test.ts— 215 passed (210 existing + 5 new).pnpm exec vp check packages/vinext/src/deploy.ts tests/deploy.test.ts— clean (formatting, lint, types).Test plan
tests/deploy.test.tspasses (Windows 11, Node 24.13.0, pnpm 10)vp checkclean on changed filesvinext deploy --previewnow invokes wrangler successfully on Windowsvinext deploy --dry-runthere would catch any future regression🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.