Skip to content
Closed
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
55 changes: 0 additions & 55 deletions packages/core-cli-utils/README.md

This file was deleted.

42 changes: 0 additions & 42 deletions packages/core-cli-utils/package.json

This file was deleted.

25 changes: 0 additions & 25 deletions packages/core-cli-utils/src/index.flow.js

This file was deleted.

19 changes: 0 additions & 19 deletions packages/core-cli-utils/src/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions packages/core-cli-utils/src/public/version.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/react-native/react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {Command} from '@react-native-community/cli-types';
// depending on and injecting:
// - @react-native-community/cli-platform-android
// - @react-native-community/cli-platform-ios
// - @react-native/community-cli-plugin (via the @react-native/core-cli-utils package)
// - @react-native/community-cli-plugin
// - codegen command should be inhoused into @react-native-community/cli
//
// This is a temporary workaround.
Expand Down
19 changes: 0 additions & 19 deletions packages/rn-tester/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,11 @@
import {Command} from 'commander';
*/

// eslint-disable-next-line @react-native/monorepo/sort-imports
const {patchCoreCLIUtilsPackageJSON} = require('./scripts/monorepo');

function injectCoreCLIUtilsRuntimePatch() {
patchCoreCLIUtilsPackageJSON(true);
const cleared = {
status: false,
};
['exit', 'SIGUSR1', 'SIGUSR2', 'uncaughtException'].forEach(event => {
if (cleared.status) {
return;
}
patchCoreCLIUtilsPackageJSON(false);
cleared.status = true;
});
}

if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
// $FlowFixMe[cannot-resolve-module]
require('../../scripts/shared/babelRegister').registerForMonorepo();
}

injectCoreCLIUtilsRuntimePatch();

const program /*: Command */ = require('./cli.flow.js').default;

if (require.main === module) {
Expand Down
1 change: 1 addition & 0 deletions packages/rn-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@react-native-community/cli": "20.0.0",
"@react-native-community/cli-platform-android": "20.0.0",
"@react-native-community/cli-platform-ios": "20.0.0",
"@react-native/core-cli-utils": "*",
"commander": "^12.0.0",
"listr2": "^6.4.1",
"rxjs": "npm:@react-native-community/rxjs@6.5.4-custom"
Expand Down
41 changes: 0 additions & 41 deletions packages/rn-tester/scripts/monorepo.js

This file was deleted.

File renamed without changes.
18 changes: 18 additions & 0 deletions private/core-cli-utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# @react-native/core-cli-utils

A reference implementation of React Native CLI tooling. This package provides composable, ordered `Task` objects for common CLI operations including Android Gradle builds, iOS Xcode/CocoaPods workflows, Metro bundling with Hermes support, and cache cleaning.

This is not published to npm. Framework authors can use this code as a starting point for their own CLI tooling, but should not depend on it as a versioned API.

## Modules

- **`android`** — Gradle-based Android build tasks (assemble, build, install)
- **`apple`** — Xcode/CocoaPods-based iOS tasks (bootstrap, build, install)
- **`app`** — Metro bundler tasks (watch mode, bundle mode, Hermes bytecode compilation)
- **`clean`** — Cache-cleaning tasks (Android/Gradle, Metro, npm, Watchman, Yarn, CocoaPods)
- **`version`** — Semver version requirements for platform toolchains (Android NDK/SDK, Xcode, Node, etc.)

## Consumers

- [`private/helloworld/`](../helloworld/) — the primary consumer, using Android, iOS, and Metro modules
- [`packages/rn-tester/`](../../packages/rn-tester/) — uses iOS bootstrap for CocoaPods setup
19 changes: 19 additions & 0 deletions private/core-cli-utils/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.0.0",
"description": "Reference implementation of React Native CLI tooling",
"license": "MIT",
"main": "./src/index.js",
"exports": {
".": "./src/index.js",
"./package.json": "./package.json",
"./version.js": "./src/public/version.js"
},
"dependencies": {
"metro-babel-register": "^0.84.3"
},
"devDependencies": {},
"engines": {
"node": "^22.13.0 || ^24.3.0 || >= 26.0.0"
}
}
21 changes: 21 additions & 0 deletions private/core-cli-utils/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/

/*::
export type {Task} from './private/types';
*/

const {tasks: android} = require('./private/android.js');
const {tasks: app} = require('./private/app.js');
const {tasks: apple} = require('./private/apple.js');
const {tasks: clean} = require('./private/clean.js');
const version = require('./public/version.js');

module.exports = {android, app, apple, clean, version};
Loading
Loading