Skip to content

Move codegen and spm command wrappers into community-cli-plugin (#57652)#57652

Open
huntie wants to merge 3 commits into
react:mainfrom
huntie:export-D113412987
Open

Move codegen and spm command wrappers into community-cli-plugin (#57652)#57652
huntie wants to merge 3 commits into
react:mainfrom
huntie:export-D113412987

Conversation

@huntie

@huntie huntie commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary:

Migrate the codegen and spm command implementations out of react-native.config.js and into the react-native/community-cli-plugin package, alongside the existing bundleCommand and startCommand.

This continues moving command definitions into the plugin so react-native.config.js becomes a thin routing layer, as the file's own comment already calls for.

Changes

  • Add src/commands/spm/index.js and src/commands/codegen/index.js, each defining and default-exporting its command (unchanged name, description, and options) plus an exported args type — mirroring the bundle/start command structure.
  • Export spmCommand and codegenCommand from src/index.flow.js.
  • Drop the inline spmCommand and codegenCommand definitions from react-native.config.js.
  • Add docs to README.

Changelog: [Internal]

Differential Revision: D113412987

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 23, 2026
@meta-codesync meta-codesync Bot changed the title Move codegen and spm command wrappers into community-cli-plugin Move codegen and spm command wrappers into community-cli-plugin (#57652) Jul 23, 2026
huntie added a commit to huntie/react-native that referenced this pull request Jul 23, 2026
…t#57652)

Summary:

Migrate the `codegen` and `spm` command implementations out of `react-native.config.js` and into the `react-native/community-cli-plugin` package, alongside the existing `bundleCommand` and `startCommand`.

This continues moving command definitions into the plugin so `react-native.config.js` becomes a thin routing layer, as the file's own comment already calls for.

**Changes**

- Add `src/commands/spm/index.js` and `src/commands/codegen/index.js`, each defining and default-exporting its command (unchanged `name`, `description`, and `options`) plus an exported args type — mirroring the `bundle`/`start` command structure.
- Export `spmCommand` and `codegenCommand` from `src/index.flow.js`.
- Drop the inline `spmCommand` and `codegenCommand` definitions from `react-native.config.js`.

Changelog: [Internal]

Differential Revision: D113412987
@huntie
huntie force-pushed the export-D113412987 branch from d86b0ee to 7284dfd Compare July 23, 2026 16:42
huntie added 3 commits July 23, 2026 09:54
Summary:

Remove the unused `--version` option from the standalone bundle script wrapper (unreferenced, separately available via RN CLI).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D113389459
Summary:

Simplify the `scripts/bundle.js` wrapper and remove the `commander` dependency from `packages/react-native`.

This script is a lightweight wrapper around `npx react-native bundle`, with extra local config arg handling (for now, unchanged / remains located here).

**Refactor only** with script behaviour unchanged.

**Other changes**

- Combined arg parsing is hoisted into `community-cli-plugin` (which does have `commander`) via `unstable_createBundleCommandParser`.
- Drop `program` value export (also unused).

**Notes**

After this change, only `yargs` remains as a direct dependency `react-native` package (`packages/react-native/scripts/`) (a future cleanup).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D113389458
…t#57652)

Summary:

Migrate the `codegen` and `spm` command implementations out of `react-native.config.js` and into the `react-native/community-cli-plugin` package, alongside the existing `bundleCommand` and `startCommand`.

This continues moving command definitions into the plugin so `react-native.config.js` becomes a thin routing layer, as the file's own comment already calls for.

**Changes**

- Add `src/commands/spm/index.js` and `src/commands/codegen/index.js`, each defining and default-exporting its command (unchanged `name`, `description`, and `options`) plus an exported args type — mirroring the `bundle`/`start` command structure.
- Export `spmCommand` and `codegenCommand` from `src/index.flow.js`.
- Drop the inline `spmCommand` and `codegenCommand` definitions from `react-native.config.js`.
- Add docs to README.

Changelog: [Internal]

Differential Revision: D113412987
@huntie
huntie force-pushed the export-D113412987 branch from 7284dfd to 3a90a9a Compare July 23, 2026 16:54
@meta-codesync

meta-codesync Bot commented Jul 23, 2026

Copy link
Copy Markdown

@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113412987.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant