36
36
37
37
const chalk = require ( 'chalk' ) ;
38
38
const child_process = require ( 'child_process' ) ;
39
+ const { error } = require ( 'console' ) ;
39
40
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
- } ) ( ) ;
46
41
47
42
/**
48
43
* @param {string } sourceDir
@@ -59,7 +54,7 @@ function getXcodeProjectPath(sourceDir, xcodeProject) {
59
54
*/
60
55
function parseArgs ( ctx , args ) {
61
56
if ( args . configuration ) {
62
- logger . warn (
57
+ console . warn (
63
58
'Argument --configuration has been deprecated and will be removed in a future release, please use --mode instead.' ,
64
59
) ;
65
60
@@ -70,13 +65,13 @@ function parseArgs(ctx, args) {
70
65
71
66
const { sourceDir, xcodeProject} = ctx . project ?. macos ?? { } ;
72
67
if ( ! sourceDir ) {
73
- throw new CLIError (
68
+ throw new error (
74
69
'macOS project folder not found. Are you sure this is a React Native project?' ,
75
70
) ;
76
71
}
77
72
78
73
if ( ! xcodeProject ) {
79
- throw new CLIError (
74
+ throw new error (
80
75
'Xcode project for macOS not found. Did you forget to run `pod install`?' ,
81
76
) ;
82
77
}
@@ -220,7 +215,7 @@ function buildProject(sourceDir, xcodeProject, scheme, args) {
220
215
}
221
216
if ( code !== 0 ) {
222
217
reject (
223
- new CLIError (
218
+ new error (
224
219
`
225
220
Failed to build macOS project.
226
221
@@ -273,7 +268,7 @@ function getBuildSettings(sourceDir, xcodeProject, configuration, scheme) {
273
268
}
274
269
}
275
270
276
- throw new CLIError ( 'Failed to get the target build settings.' ) ;
271
+ throw new error ( 'Failed to get the target build settings.' ) ;
277
272
}
278
273
279
274
function xcprettyAvailable ( ) {
@@ -374,12 +369,6 @@ module.exports = [
374
369
default : process . env . RCT_METRO_PORT || 8081 ,
375
370
parse : ( /** @type {string } */ val ) => Number ( val ) ,
376
371
} ,
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
- } ,
383
372
] ,
384
373
} ,
385
374
] ;
0 commit comments