Skip to content

Replace execa with tinyexec#4930

Closed
stianjensen wants to merge 2 commits into
wix:masterfrom
stianjensen:tinyexec
Closed

Replace execa with tinyexec#4930
stianjensen wants to merge 2 commits into
wix:masterfrom
stianjensen:tinyexec

Conversation

@stianjensen
Copy link
Copy Markdown
Contributor

Description

Drop execa (large dependency tree) in favor of tinyexec ^0.3.0 (zero dependencies, dual CJS/ESM). Uses args-tokenizer to split command strings since tinyexec expects (command, args[]) rather than a single command string.

tinyexec 1.x is ESM-only, so I opted to use the 0.3.x line for now (since my understanding is Detox still supports node versions that don't support require(esm)).


For features/enhancements:

  • I have added/updated the relevant references in the documentation files.

For API changes:

  • I have made the necessary changes in the types index file.

Drop execa (large dependency tree) in favor of tinyexec ^0.3.0 (zero
dependencies, dual CJS/ESM). Uses args-tokenizer to split command
strings since tinyexec expects (command, args[]) rather than a single
command string.

tinyexec 1.x is ESM-only, so I opted to use the 0.3.x line for now
(since my understanding is Detox still supports node versions that
don't support require(esm)).
@stianjensen stianjensen requested a review from noomorph as a code owner April 14, 2026 20:02
….stop()

execa v5 sent SIGKILL 5 s after SIGTERM via forceKillAfterTimeout (default).
tinyexec has no such built-in, so re-implement the same behaviour manually:
send SIGTERM, schedule SIGKILL at 5000 ms with unref(), cancel on exit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@noomorph
Copy link
Copy Markdown
Collaborator

Superseded by #4956, which retains your commit in history — it'll land to master on merge. Thanks for the contribution @stianjensen!

@noomorph noomorph closed this May 30, 2026
@stianjensen
Copy link
Copy Markdown
Contributor Author

Thanks! Just happy to see it landing 😄

noomorph added a commit that referenced this pull request 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 added a commit that referenced this pull request 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>
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