@@ -35,7 +35,7 @@ type Answers = {
35
35
authorEmail : string ;
36
36
authorUrl : string ;
37
37
repoUrl : string ;
38
- type : 'native' | 'native-swift' | 'cpp' | 'expo' ;
38
+ type : 'native' | 'native-swift' | 'js' | ' cpp' | 'expo' ;
39
39
} ;
40
40
41
41
export const args : Record < ArgName , yargs . Options > = {
@@ -65,7 +65,7 @@ export const args: Record<ArgName, yargs.Options> = {
65
65
} ,
66
66
'type' : {
67
67
description : 'Type package do you want to develop' ,
68
- choices : [ 'native' , 'native-swift' , 'cpp' , 'expo' ] ,
68
+ choices : [ 'native' , 'native-swift' , 'js' , ' cpp', 'expo' ] ,
69
69
} ,
70
70
} ;
71
71
@@ -173,6 +173,10 @@ export default async function create(argv: yargs.Arguments<any>) {
173
173
name : 'JavaScript module with Web support using Expo' ,
174
174
value : 'expo' ,
175
175
} ,
176
+ {
177
+ name : 'JavaScript module' ,
178
+ value : 'js' ,
179
+ } ,
176
180
] ,
177
181
default : 'native' ,
178
182
} ,
@@ -223,6 +227,7 @@ export default async function create(argv: yargs.Arguments<any>) {
223
227
native : type === 'native' || type === 'cpp' || 'native-swift' ,
224
228
cpp : type === 'cpp' ,
225
229
swift : type === 'native-swift' ,
230
+ type,
226
231
} ,
227
232
author : {
228
233
name : authorName ,
@@ -262,7 +267,15 @@ export default async function create(argv: yargs.Arguments<any>) {
262
267
} else {
263
268
await copyDir ( NATIVE_FILES , folder ) ;
264
269
265
- if ( type === 'cpp' ) {
270
+ if ( type === 'js' ) {
271
+ await Promise . all (
272
+ [
273
+ `android` ,
274
+ `ios` ,
275
+ `${ options . project . podspec } .podspec` ,
276
+ ] . map ( ( file ) => fs . remove ( path . join ( folder , file ) ) )
277
+ ) ;
278
+ } else if ( type === 'cpp' ) {
266
279
await copyDir ( CPP_FILES , folder ) ;
267
280
} else if ( type === 'native-swift' ) {
268
281
await copyDir ( SWIFT_FILES , folder ) ;
0 commit comments