Skip to content

npm: unblock Windows install path in wrapper (#15)#18

Merged
MasonStation merged 1 commit intomainfrom
windows-npm-wrapper
Apr 22, 2026
Merged

npm: unblock Windows install path in wrapper (#15)#18
MasonStation merged 1 commit intomainfrom
windows-npm-wrapper

Conversation

@MasonStation
Copy link
Copy Markdown
Contributor

Tier 3 of #1 (Windows support). Independent of Tier 2 (#17) — separate branch off main.

Summary

The npm wrapper actively refused to install on Windows. This PR unblocks the Windows install path so npx phantom-secrets init works on Windows after a release bump.

Changes

  • package.json — add "win32" to os array (was blocking install with EBADPLATFORM)
  • bin/cli.js — map win32-x64 to x86_64-pc-windows-msvc, download .zip on Windows (Rust release workflow already builds it), extract via PowerShell Expand-Archive, skip chmod +x
  • install.js — respect .exe suffix in the existing-binary check

Release coordination

Must not publish this to npm until a v0.5.0+ tag exists with Windows binaries. Today the latest published tag is v0.4.0 which has no Windows artifacts; if this wrapper shipped now, Windows installs would fetch a 404. Tier 4 of #1 handles the coordinated release.

Test plan

  • CI continues to pass on the Rust workspace (this PR only touches the npm wrapper, so CI behavior is unchanged from main)
  • Manual test once v0.5.0 is published: npx [email protected] init on a Windows machine
  • Edge cases covered in the PowerShell escape: paths with single quotes (doubled via '' -> ''')

Closes #15

The npm wrapper actively refused to install on Windows:
  - package.json os filter: ["darwin", "linux"]  → EBADPLATFORM
  - getPlatformTarget had no win32 branch         → exit 1
  - Extract used tar xzf + chmod +x (Unix only)   → would fail

Changes:
  - Add "win32" to os array
  - Map win32-x64 to x86_64-pc-windows-msvc target
  - Download .zip on Windows (release already produces it), .tar.gz otherwise
  - Extract via PowerShell Expand-Archive on Windows, tar xzf elsewhere
  - Skip chmod +x on Windows
  - Fix .exe suffix check in install.js existsSync path

Requires a v0.5.0+ release tag before `npm publish` — the wrapper
fetches `phantom-x86_64-pc-windows-msvc.zip` which the Rust release
workflow already builds but no published tag exposes yet.

Closes #15

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@MasonStation MasonStation merged commit 1d850e8 into main Apr 22, 2026
4 checks passed
@MasonStation MasonStation deleted the windows-npm-wrapper branch April 22, 2026 17:46
@MasonStation MasonStation mentioned this pull request Apr 22, 2026
14 tasks
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.

npm: unblock Windows install path in wrapper package

1 participant