Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cli-commander-12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rnx-kit/cli": patch
---

Bumped `commander` to 12.x
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ action creates a release PR or publishes to npm.
Don't add change files for private packages (`"private": true`), e.g.
`@rnx-kit/template` and test apps.

### Pull Request Descriptions

Follow `.github/pull_request_template.md`. Write the description for reviewers
and users: give an overview of the change and explain the reasoning behind it,
such as the motivation, alternatives considered and why they were rejected,
breaking changes, and user-facing impact. Skip implementation details that can
be inferred from the diff, such as file-by-file summaries or how the code was
changed.

## Key Packages

- **`@rnx-kit/cli`** - Main CLI (`rnx-cli`) integrating all tools
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@rnx-kit/types-bundle-config": "workspace:^",
"@rnx-kit/types-kit-config": "workspace:^",
"@rnx-kit/types-node": "workspace:^",
"commander": "^11.1.0",
"commander": "^12.1.0",
"ora": "^5.4.1",
"qrcode": "catalog:"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/bin/rnx-cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Config } from "@react-native-community/cli-types";
import { Command } from "commander";
import * as path from "node:path";
import { loadContextForCommand } from "./context.ts";
import { loadContextForCommand, uniquify } from "./context.ts";
import { findExternalCommands } from "./externalCommands.ts";

type CommandOption = Required<Config["commands"][number]>["options"][number];
Expand All @@ -19,7 +19,10 @@ export async function main() {
const [, , userCommand] = process.argv;

const context = await loadContextForCommand(userCommand);
const allCommands = context.commands.concat(findExternalCommands(context));
// Commander throws if a command name is registered more than once
const allCommands = uniquify(
context.commands.concat(findExternalCommands(context))
);
const program = new Command(path.basename(__filename, ".js"));

for (const info of allCommands) {
Expand Down
11 changes: 2 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5352,7 +5352,7 @@ __metadata:
"@types/connect": "catalog:"
"@types/node": "catalog:"
"@types/qrcode": "catalog:"
commander: "npm:^11.1.0"
commander: "npm:^12.1.0"
markdown-table: "catalog:"
memfs: "catalog:"
metro: "npm:^0.84.0"
Expand Down Expand Up @@ -9266,14 +9266,7 @@ __metadata:
languageName: node
linkType: hard

"commander@npm:^11.1.0":
version: 11.1.0
resolution: "commander@npm:11.1.0"
checksum: 10c0/13cc6ac875e48780250f723fb81c1c1178d35c5decb1abb1b628b3177af08a8554e76b2c0f29de72d69eef7c864d12613272a71fabef8047922bc622ab75a179
languageName: node
linkType: hard

"commander@npm:^12.0.0":
"commander@npm:^12.0.0, commander@npm:^12.1.0":
version: 12.1.0
resolution: "commander@npm:12.1.0"
checksum: 10c0/6e1996680c083b3b897bfc1cfe1c58dfbcd9842fd43e1aaf8a795fbc237f65efcc860a3ef457b318e73f29a4f4a28f6403c3d653d021d960e4632dd45bde54a9
Expand Down
Loading