Skip to content

feat(cli): add --serial; fix npm-only -- separator for script args - #116

Merged
hyldmo merged 2 commits into
mainfrom
hyldmo/npm-glob-arg-passthrough
Aug 25, 2026
Merged

hyldmo merged 2 commits into
mainfrom
hyldmo/npm-glob-arg-passthrough

Conversation

@hyldmo

@hyldmo hyldmo commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Why

numux -p 'npm:codegen:* --project-id \$SUPABASE_PROJECT_ID' failed in a yarn repo:

[ts] Must specify one of --local, --linked, --project-id, or --db-url
[go] Must specify one of --local, --linked, --project-id, or --db-url

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> vs run <script> -- <args>:

pm run s --fix run s -- --fix
npm 11 [] swallowed ["--fix"]
yarn 4 ["--fix"] ["--","--fix"]
pnpm 10 ["--fix"] ["--","--fix"]
bun 1.3 ["--fix"] ["--fix"]

npm is the only one that needs the separator, and bun takes either form. So it is emitted for npm alone.

--serial

New flag plus serial: true config 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.

  • 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. A failed dependency still skips its dependents, as before.
  • numux validate prints 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 cases
  • bun run typecheck, bun run lint clean
  • End to end in a bun repo: panes start in order one → two → three, args arrive as --project-id abc with no literal --
  • End to end in a yarn repo: numux validate shows yarn run codegen:ts --project-id \$SUPABASE_PROJECT_ID

🤖 Generated with Claude Code

hyldmo and others added 2 commits August 26, 2026 00:56
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>
@hyldmo
hyldmo merged commit 14e4aef into main Aug 25, 2026
2 checks passed
@hyldmo
hyldmo deleted the hyldmo/npm-glob-arg-passthrough branch August 25, 2026 23:00
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant