@@ -76,12 +76,6 @@ const SWIFT_FILES = {
76
76
view_legacy : path . resolve ( __dirname , '../templates/swift-view-legacy' ) ,
77
77
} as const ;
78
78
79
- const CPP_VIEW_FILES = {
80
- // view_legacy does NOT need component registration
81
- view_mixed : path . resolve ( __dirname , '../templates/cpp-view-mixed' ) ,
82
- view_new : path . resolve ( __dirname , '../templates/cpp-view-new' ) ,
83
- } as const ;
84
-
85
79
type ArgName =
86
80
| 'slug'
87
81
| 'description'
@@ -131,8 +125,8 @@ const LANGUAGE_CHOICES: {
131
125
types : ProjectType [ ] ;
132
126
} [ ] = [
133
127
{
134
- title : 'Java & Objective-C' ,
135
- value : 'java -objc' ,
128
+ title : 'Kotlin & Objective-C' ,
129
+ value : 'kotlin -objc' ,
136
130
types : [
137
131
'module-legacy' ,
138
132
'module-new' ,
@@ -143,8 +137,8 @@ const LANGUAGE_CHOICES: {
143
137
] ,
144
138
} ,
145
139
{
146
- title : 'Kotlin & Objective-C' ,
147
- value : 'kotlin -objc' ,
140
+ title : 'Java & Objective-C' ,
141
+ value : 'java -objc' ,
148
142
types : [
149
143
'module-legacy' ,
150
144
'module-new' ,
@@ -155,13 +149,13 @@ const LANGUAGE_CHOICES: {
155
149
] ,
156
150
} ,
157
151
{
158
- title : 'Java & Swift' ,
159
- value : 'java -swift' ,
152
+ title : 'Kotlin & Swift' ,
153
+ value : 'kotlin -swift' ,
160
154
types : [ 'module-legacy' , 'view-legacy' ] ,
161
155
} ,
162
156
{
163
- title : 'Kotlin & Swift' ,
164
- value : 'kotlin -swift' ,
157
+ title : 'Java & Swift' ,
158
+ value : 'java -swift' ,
165
159
types : [ 'module-legacy' , 'view-legacy' ] ,
166
160
} ,
167
161
{
@@ -269,13 +263,15 @@ const args: Record<ArgName, yargs.Options> = {
269
263
} ,
270
264
} ;
271
265
266
+ // FIXME: fix the type
267
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
272
268
async function create ( argv : yargs . Arguments < any > ) {
273
269
let local = false ;
274
270
275
271
if ( typeof argv . local === 'boolean' ) {
276
272
local = argv . local ;
277
273
} else {
278
- let hasPackageJson = await fs . pathExists (
274
+ const hasPackageJson = await fs . pathExists (
279
275
path . join ( process . cwd ( ) , 'package.json' )
280
276
) ;
281
277
@@ -403,7 +399,7 @@ async function create(argv: yargs.Arguments<any>) {
403
399
type : local ? null : 'text' ,
404
400
name : 'authorUrl' ,
405
401
message : 'What is the URL for the package author?' ,
406
- // @ts -ignore: this is supported, but types are wrong
402
+ // @ts -expect-error this is supported, but types are wrong
407
403
initial : async ( previous : string ) => {
408
404
try {
409
405
const username = await githubUsername ( previous ) ;
@@ -421,7 +417,6 @@ async function create(argv: yargs.Arguments<any>) {
421
417
type : local ? null : 'text' ,
422
418
name : 'repoUrl' ,
423
419
message : 'What is the URL for the repository?' ,
424
- // @ts -ignore: this is supported, but types are wrong
425
420
initial : ( _ : string , answers : Answers ) => {
426
421
if ( / ^ h t t p s ? : \/ \/ g i t h u b .c o m \/ [ ^ / ] + / . test ( answers . authorUrl ) ) {
427
422
return `${ answers . authorUrl } /${ answers . slug
@@ -556,9 +551,9 @@ async function create(argv: yargs.Arguments<any>) {
556
551
557
552
try {
558
553
version = await Promise . race ( [
559
- new Promise < string > ( ( resolve ) =>
560
- setTimeout ( ( ) => resolve ( FALLBACK_BOB_VERSION ) , 1000 )
561
- ) ,
554
+ new Promise < string > ( ( resolve ) => {
555
+ setTimeout ( ( ) => resolve ( FALLBACK_BOB_VERSION ) , 1000 ) ;
556
+ } ) ,
562
557
spawn ( 'npm' , [ 'view' , 'react-native-builder-bob' , 'dist-tags.latest' ] ) ,
563
558
] ) ;
564
559
} catch ( e ) {
@@ -747,12 +742,6 @@ async function create(argv: yargs.Arguments<any>) {
747
742
await copyDir ( CPP_FILES , folder ) ;
748
743
await fs . remove ( path . join ( folder , 'ios' , `${ options . project . name } .m` ) ) ;
749
744
}
750
-
751
- if ( moduleType === 'view' ) {
752
- if ( arch === 'new' || arch === 'mixed' ) {
753
- await copyDir ( CPP_VIEW_FILES [ `${ moduleType } _${ arch } ` ] , folder ) ;
754
- }
755
- }
756
745
}
757
746
758
747
if ( example !== 'none' ) {
@@ -882,8 +871,8 @@ async function create(argv: yargs.Arguments<any>) {
882
871
. map (
883
872
( [ script , { name, color } ] ) => `
884
873
${ kleur [ color ] ( `Run the example app on ${ kleur . bold ( name ) } ` ) } ${ kleur . gray (
885
- ':'
886
- ) }
874
+ ':'
875
+ ) }
887
876
888
877
${ kleur . gray ( '$' ) } yarn example ${ script } `
889
878
)
@@ -896,7 +885,7 @@ async function create(argv: yargs.Arguments<any>) {
896
885
) ;
897
886
}
898
887
}
899
- // eslint-disable-next-line babel/no-unused-expressions
888
+
900
889
yargs
901
890
. command ( '$0 [name]' , 'create a react native library' , args , create )
902
891
. demandCommand ( )
0 commit comments