feat(cli): add --serial; fix npm-only -- separator for script args - #116
Merged
Merged
Conversation
Script patterns with extra args (`'npm:codegen:* --project-id abc'`) always inserted a `--` separator before the args. npm needs it, since it swallows anything after the script name. yarn and pnpm forward the args as-is and pass the `--` through to the script, where Go/cobra CLIs like `supabase` read every following flag as a positional arg: yarn run codegen:ts -- --project-id abc → supabase: "Must specify one of --local, --linked, --project-id, or --db-url" Measured against npm 11, yarn 4, pnpm 10 and bun 1.3: only npm needs the separator, and bun accepts either form. So emit it for npm alone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`--serial` (or `serial: true`) runs processes sequentially in display order — the same order the tabs use, so it follows `sort`. Each process waits for the previous one to become ready, which for one-shot commands means to exit. `dependsOn` still holds: `ProcessManager.serialOrder()` moves a dependency ahead of its dependents when display order puts them the other way around, so the chain cannot deadlock. A failed process does not skip the rest of the chain, unlike a failed dependency. `numux validate` prints the resulting run order. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in version 2.19.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Why
numux -p 'npm:codegen:* --project-id \$SUPABASE_PROJECT_ID'failed in a yarn repo:numux expanded the pattern to
yarn run codegen:ts -- --project-id abc. Yarn passes that--verbatim to the script, so the supabase CLI (cobra) read every flag after it as a positional argument.Measured behavior,
run <script> <args>vsrun <script> -- <args>:run s --fixrun s -- --fix[]swallowed["--fix"]✅["--fix"]✅["--","--fix"]❌["--fix"]✅["--","--fix"]❌["--fix"]✅["--fix"]✅npm is the only one that needs the separator, and bun takes either form. So it is emitted for npm alone.
--serialNew flag plus
serial: trueconfig key. Processes run one at a time in display order (sort), each waiting for the previous to become ready — for one-shot commands, to exit.dependsOnstill holds.ProcessManager.serialOrder()moves a dependency ahead of its dependents when display order puts them the other way around, so the chain cannot deadlock.numux validateprints the run order:Serial: one at a time (ts → go).Test plan
bun test— 709 pass, including 4 new serial-mode cases (order, single concurrency, failure does not break the chain, dependency reordering) and 3 new package-manager separator casesbun run typecheck,bun run lintcleanone → two → three, args arrive as--project-id abcwith no literal--numux validateshowsyarn run codegen:ts --project-id \$SUPABASE_PROJECT_ID🤖 Generated with Claude Code