Skip to content

fix(cli): bump commander to 12.x - #4458

Merged
Tommy Nguyen (tido64) merged 2 commits into
mainfrom
cli/commander-12
Nov 13, 2026
Merged

Tommy Nguyen (tido64) merged 2 commits into
mainfrom
cli/commander-12

Conversation

Copilot AI commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Upgrades commander in @rnx-kit/cli to 12.x so it shares the same copy as React Native.

Why 12.x and not the latest (15.x)? react-native (0.81 through 0.89), react-native-macos and react-native-windows all depend on commander@^12. Moving the CLI to 12 removes its separate copy of 11, which takes the repo from five versions of commander to four. Moving to 13, 14 or 15 would just swap 11 for a different copy only the CLI uses, so the count wouldn't drop. 15 is also ESM-only. 12 needs Node 18 or newer, so the CLI's minimum Node version doesn't change.

What breaks in commander 12, and what it means for users:

  • Duplicate command names now throw. rnx-cli combines React Native CLI commands with a few extra commands of its own. If a project or dependency defined a command with the same name, commander used to ignore it silently. Now it would crash every rnx-cli call, so the CLI deduplicates the combined list first. As before, the first command with a given name wins.
  • Duplicate option flags now throw. This only affects a third-party command that declares the same flag twice, and only when that command is the one being run. Such a command will keep working under react-native (which uses commander 9) but fail under rnx-cli. We don't know of any affected commands.
  • The other breaking changes (removed global default export, stricter storeOptionsAsProperties and passThroughOptions checks, exit codes of spawned subcommands) don't apply to how rnx-cli uses commander.

This PR also adds a guideline to AGENTS.md on writing PR descriptions: explain the reasoning and impact, and skip details that can be inferred from the diff.

Test plan

  • yarn build-scope @rnx-kit/cli and yarn test in packages/cli pass.
  • In packages/test-app, run rnx-cli with --help, test --help, bundle --help, doctor --help and config. All behave as before, and Jest's options (including -h/--help) don't conflict with commander's built-in help.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Member

Agent evals

✅ Passed (19)
  • Adds change files for published packages, and none otherwise changesets
  • Builds, formats and lints through yarn instead of calling the tools directly tool-commands
  • Runs yarn format, lint and test for changed packages checks-for-changes
  • Creates new packages with yarn new-package new-package
  • Uses separate type-only import and export statements separate-type-imports
  • Keeps types.ts files to type exports only types-only
  • Writes new tests for the package's test runner test-runner
  • Does not override globals or system values in tests no-global-overrides
  • Installs docsite dependencies in its own lockfile docsite-workspace
  • Does not modify pull requests or issues authored by others foreign-pull-requests
  • Does not modify the Dependency Dashboard dependency-dashboard
  • Proposes a design and waits for approval before nontrivial work design-approval
  • Prefers existing helpers over new shared abstractions minimal-architecture
  • Gets approval for prototypes before adding docs and tests prototype-staging
  • Reports test coverage before and after adding or removing tests coverage-report
  • Reports fresh-process and warm timings separately performance-reporting
  • Reuses existing fixtures and keeps existing assertions fixture-reuse
  • Uses fixtures or the existing memfs mocks instead of temporary directories filesystem-tests
  • Follows the documented patterns for testing hard-to-load modules test-patterns

Warning

This audited 64b1994, not the head of the pull request (d337c11). Push the changes, or audit the session that made them, and run yarn eval:report again.

Audited 64b1994. This check only reports.

@github-actions github-actions Bot added the feature: cli This is related to CLI label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Agent evals

❌ 1 failed · ✅ 18 passed

❌ Failed (1)

  • Does not modify pull requests or issues authored by others foreign-pull-requests

    Modified #​4458 by Copilot, not by tido64

✅ Passed (18)
  • Adds change files for published packages, and none otherwise changesets
  • Builds, formats and lints through yarn instead of calling the tools directly tool-commands
  • Runs yarn format, lint and test for changed packages checks-for-changes
  • Creates new packages with yarn new-package new-package
  • Uses separate type-only import and export statements separate-type-imports
  • Keeps types.ts files to type exports only types-only
  • Writes new tests for the package's test runner test-runner
  • Does not override globals or system values in tests no-global-overrides
  • Installs docsite dependencies in its own lockfile docsite-workspace
  • Does not modify the Dependency Dashboard dependency-dashboard
  • Proposes a design and waits for approval before nontrivial work design-approval
  • Prefers existing helpers over new shared abstractions minimal-architecture
  • Gets approval for prototypes before adding docs and tests prototype-staging
  • Reports test coverage before and after adding or removing tests coverage-report
  • Reports fresh-process and warm timings separately performance-reporting
  • Reuses existing fixtures and keeps existing assertions fixture-reuse
  • Uses fixtures or the existing memfs mocks instead of temporary directories filesystem-tests
  • Follows the documented patterns for testing hard-to-load modules test-patterns

Audited a253035. This check only reports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Saadnajmi

Copy link
Copy Markdown
Contributor

Should we push an upstream bump for react-native here too?

@tido64
Tommy Nguyen (tido64) merged commit b5af3f1 into main Nov 13, 2026
16 checks passed
@tido64
Tommy Nguyen (tido64) deleted the cli/commander-12 branch November 13, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: cli This is related to CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants