fix(cli): switch shelve run to spawn + process-group signal handling#730
Merged
Conversation
- Replace tinyexec + tree-kill with node:child_process.spawn and proper process-group kill via process.kill(-pid). Fixes the long-standing childPid bug where signals were never propagated and child trees were left as zombies. - Drop the implicit npx fallback (~200ms cold start, broken signals) and invoke node_modules/.bin/nr directly when shorthand commands are passed. - Declare tinyexec and consola as direct dependencies of @shelve/cli. They were transitive-only before, so installs under npm/yarn/bun broke whenever pnpm hoisting wasn't there to save the day.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
Merged
6 tasks
ESLint require-await flagged spawnChild as async without an await inside; the function never needed to be async — it returns the ChildProcess immediately and lifecycle handlers wire process.exit. Dropped the await at the call site too (it was awaiting a non-promise).
commit: |
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.
Summary
Two bugs landed in the previous `shelve run` rewrite:
This PR replaces `tinyexec` with `node:child_process.spawn` (no extra dependency) and uses process-group killing so that `pnpm dev` / `npm start`-style commands — which themselves spawn children — get cleanly torn down.
This is the smallest, lowest-risk piece of the v5 CLI work; ship it first to unblock anyone using `shelve run` today.
Test plan