Skip to content

build(cli): replace execa with native spawn in AppStartCommand#4956

Open
noomorph wants to merge 1 commit into
masterfrom
tinyexec
Open

build(cli): replace execa with native spawn in AppStartCommand#4956
noomorph wants to merge 1 commit into
masterfrom
tinyexec

Conversation

@noomorph

@noomorph noomorph commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Closes #4930. Inspired by @stianjensen's original PR — tinyexec was the first choice but caused Windows CI failures due to windowsHide, PATH augmentation, and path.normalize() behaviors that execa never had. Production code now uses Node's built-in child_process.spawn() instead; tinyexec is kept for the integration test runner.

Changes

AppStartCommand.js

  • Replaces execa.command(cmd, {shell:true}) with spawn(cmd, [], {shell:true}) — equivalent behavior, zero new production dependencies.
  • stop() now sends SIGTERM then escalates to SIGKILL after 5 seconds if the process hasn't exited (restores original behavior that was lost in earlier drafts).

Integration tests (detox/test/integration/)

  • Replaces synchronous execa.commandSync() with async tinyexec.x() in bail-test.test.js and initialization-test.test.js.

Package changes

  • execa removed from production dependencies.
  • tinyexec added to devDependencies (only used in integration tests).

New AppStartCommand.test.js

  • Unit tests for the SIGKILL escalation path using jest.useFakeTimers(), covering lines that were missing from the coverage threshold.

🤖 Generated with Claude Code

@noomorph noomorph mentioned this pull request May 30, 2026
2 tasks
@noomorph noomorph changed the title Replace execa with tinyexec feat(cli): replace execa with native spawn in AppStartCommand May 30, 2026
Closes #4930. Inspired by @stianjensen's original PR; tinyexec was
chosen first but caused Windows CI failures (windowsHide, PATH
augmentation, and path.normalize() behaviors absent from execa).
Production code now uses Node's built-in child_process.spawn() instead.

- AppStartCommand.js: execa.command() → spawn(cmd, [], {shell:true}), no new prod deps
- stop(): SIGTERM with 5s SIGKILL escalation (restored from original execa behavior)
- Integration tests: execa.commandSync() → tinyexec.x() (async)
- execa removed from prod dependencies; tinyexec added to devDependencies
- New AppStartCommand.test.js: covers SIGKILL escalation via jest.useFakeTimers()

Co-Authored-By: Stian Jensen <me@stianj.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@noomorph noomorph changed the title feat(cli): replace execa with native spawn in AppStartCommand build(cli): replace execa with native spawn in AppStartCommand May 30, 2026
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