@@ -115,8 +115,7 @@ type ArgName =
115
115
| 'type'
116
116
| 'local'
117
117
| 'example'
118
- | 'react-native-version'
119
- | 'with-recommended-options' ;
118
+ | 'react-native-version' ;
120
119
121
120
type ProjectLanguages = 'kotlin-objc' | 'kotlin-swift' | 'cpp' | 'js' ;
122
121
@@ -141,7 +140,6 @@ type Answers = {
141
140
type ?: ProjectType ;
142
141
example ?: boolean ;
143
142
reactNativeVersion ?: string ;
144
- withRecommendedOptions ?: boolean ;
145
143
} ;
146
144
147
145
const LANGUAGE_CHOICES : {
@@ -150,7 +148,7 @@ const LANGUAGE_CHOICES: {
150
148
types : ProjectType [ ] ;
151
149
} [ ] = [
152
150
{
153
- title : ` Kotlin & Objective-C` ,
151
+ title : ' Kotlin & Objective-C' ,
154
152
value : 'kotlin-objc' ,
155
153
types : [ 'view-module-legacy' , 'view-module-mixed' , 'view-module-new' ] ,
156
154
} ,
@@ -221,16 +219,6 @@ const TYPE_CHOICES: {
221
219
} ,
222
220
] ;
223
221
224
- const RECOMMENDED_TEMPLATE : {
225
- type : ProjectType ;
226
- languages : ProjectLanguages ;
227
- description : string ;
228
- } = {
229
- type : 'view-module-mixed' ,
230
- languages : 'kotlin-objc' ,
231
- description : `Backward compatible Fabric view & Turbo module with Kotlin & Objective-C` ,
232
- } ;
233
-
234
222
const args : Record < ArgName , yargs . Options > = {
235
223
'slug' : {
236
224
description : 'Name of the npm package' ,
@@ -277,10 +265,6 @@ const args: Record<ArgName, yargs.Options> = {
277
265
type : 'boolean' ,
278
266
default : true ,
279
267
} ,
280
- 'with-recommended-options' : {
281
- description : `Whether to use the recommended template. ${ RECOMMENDED_TEMPLATE . description } ` ,
282
- type : 'boolean' ,
283
- } ,
284
268
} ;
285
269
286
270
// FIXME: fix the type
@@ -448,68 +432,24 @@ async function create(argv: yargs.Arguments<any>) {
448
432
} ,
449
433
validate : ( input ) => / ^ h t t p s ? : \/ \/ / . test ( input ) || 'Must be a valid URL' ,
450
434
} ,
451
- 'with-recommended-options' : {
452
- type : 'select' ,
453
- name : 'withRecommendedOptions' ,
454
- message : 'Do you want to customize the library type and languages?' ,
455
- choices : [
456
- {
457
- title : 'Use recommended defaults' ,
458
- value : true ,
459
- description : RECOMMENDED_TEMPLATE . description ,
460
- } ,
461
- {
462
- title : 'Customize' ,
463
- value : false ,
464
- } ,
465
- ] ,
466
- } ,
467
435
'type' : {
468
436
type : 'select' ,
469
437
name : 'type' ,
470
438
message : 'What type of library do you want to develop?' ,
471
- choices : ( _ , values ) => {
472
- if ( values . withRecommendedOptions ) {
473
- return TYPE_CHOICES . filter (
474
- ( choice ) => choice . value === RECOMMENDED_TEMPLATE . type
475
- ) ;
476
- }
477
-
478
- return TYPE_CHOICES . map ( ( choice ) =>
479
- choice . value === RECOMMENDED_TEMPLATE . type
480
- ? {
481
- ...choice ,
482
- title : `${ choice . title } ${ kleur . yellow ( '(Recommended)' ) } ` ,
483
- }
484
- : choice
485
- ) ;
486
- } ,
439
+ choices : TYPE_CHOICES ,
487
440
} ,
488
441
'languages' : {
489
442
type : 'select' ,
490
443
name : 'languages' ,
491
444
message : 'Which languages do you want to use?' ,
492
445
choices : ( _ , values ) => {
493
- if ( values . withRecommendedOptions ) {
494
- return LANGUAGE_CHOICES . filter ( ( choice ) => {
495
- return choice . value === RECOMMENDED_TEMPLATE . languages ;
496
- } ) ;
497
- }
498
-
499
446
return LANGUAGE_CHOICES . filter ( ( choice ) => {
500
447
if ( choice . types ) {
501
448
return choice . types . includes ( values . type ) ;
502
449
}
503
450
504
451
return true ;
505
- } ) . map ( ( choice ) =>
506
- choice . value === RECOMMENDED_TEMPLATE . languages
507
- ? {
508
- ...choice ,
509
- title : `${ choice . title } ${ kleur . yellow ( '(Recommended)' ) } ` ,
510
- }
511
- : choice
512
- ) ;
452
+ } ) ;
513
453
} ,
514
454
} ,
515
455
} ;
0 commit comments