Skip to content

Commit 38a1f7f

Browse files
committed
[Draft] remove community cli dependency from runMacOS.js
1 parent bfb086b commit 38a1f7f

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

packages/react-native/local-cli/runMacOS/runMacOS.js

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,8 @@
3636

3737
const chalk = require('chalk');
3838
const child_process = require('child_process');
39+
const { error } = require('console');
3940
const path = require('path');
40-
const {logger, CLIError, getDefaultUserTerminal} = (() => {
41-
const cli = require.resolve('@react-native-community/cli/package.json');
42-
const options = {paths: [path.dirname(cli)]};
43-
const tools = require.resolve('@react-native-community/cli-tools', options);
44-
return require(tools);
45-
})();
4641

4742
/**
4843
* @param {string} sourceDir
@@ -59,7 +54,7 @@ function getXcodeProjectPath(sourceDir, xcodeProject) {
5954
*/
6055
function parseArgs(ctx, args) {
6156
if (args.configuration) {
62-
logger.warn(
57+
console.warn(
6358
'Argument --configuration has been deprecated and will be removed in a future release, please use --mode instead.',
6459
);
6560

@@ -70,13 +65,13 @@ function parseArgs(ctx, args) {
7065

7166
const {sourceDir, xcodeProject} = ctx.project?.macos ?? {};
7267
if (!sourceDir) {
73-
throw new CLIError(
68+
throw new error(
7469
'macOS project folder not found. Are you sure this is a React Native project?',
7570
);
7671
}
7772

7873
if (!xcodeProject) {
79-
throw new CLIError(
74+
throw new error(
8075
'Xcode project for macOS not found. Did you forget to run `pod install`?',
8176
);
8277
}
@@ -220,7 +215,7 @@ function buildProject(sourceDir, xcodeProject, scheme, args) {
220215
}
221216
if (code !== 0) {
222217
reject(
223-
new CLIError(
218+
new error(
224219
`
225220
Failed to build macOS project.
226221
@@ -273,7 +268,7 @@ function getBuildSettings(sourceDir, xcodeProject, configuration, scheme) {
273268
}
274269
}
275270

276-
throw new CLIError('Failed to get the target build settings.');
271+
throw new error('Failed to get the target build settings.');
277272
}
278273

279274
function xcprettyAvailable() {
@@ -374,12 +369,6 @@ module.exports = [
374369
default: process.env.RCT_METRO_PORT || 8081,
375370
parse: (/** @type {string} */ val) => Number(val),
376371
},
377-
{
378-
name: '--terminal [string]',
379-
description:
380-
'Launches the Metro Bundler in a new window using the specified terminal path.',
381-
default: getDefaultUserTerminal,
382-
},
383372
],
384373
},
385374
];

0 commit comments

Comments
 (0)