@@ -35,7 +35,7 @@ type Answers = {
3535 authorEmail : string ;
3636 authorUrl : string ;
3737 repoUrl : string ;
38- type : 'native' | 'native-swift' | 'cpp' | 'expo' ;
38+ type : 'native' | 'native-swift' | 'js' | ' cpp' | 'expo' ;
3939} ;
4040
4141export const args : Record < ArgName , yargs . Options > = {
@@ -65,7 +65,7 @@ export const args: Record<ArgName, yargs.Options> = {
6565 } ,
6666 'type' : {
6767 description : 'Type package do you want to develop' ,
68- choices : [ 'native' , 'native-swift' , 'cpp' , 'expo' ] ,
68+ choices : [ 'native' , 'native-swift' , 'js' , ' cpp', 'expo' ] ,
6969 } ,
7070} ;
7171
@@ -173,6 +173,10 @@ export default async function create(argv: yargs.Arguments<any>) {
173173 name : 'JavaScript module with Web support using Expo' ,
174174 value : 'expo' ,
175175 } ,
176+ {
177+ name : 'JavaScript module' ,
178+ value : 'js' ,
179+ } ,
176180 ] ,
177181 default : 'native' ,
178182 } ,
@@ -223,6 +227,7 @@ export default async function create(argv: yargs.Arguments<any>) {
223227 native : type === 'native' || type === 'cpp' || 'native-swift' ,
224228 cpp : type === 'cpp' ,
225229 swift : type === 'native-swift' ,
230+ type,
226231 } ,
227232 author : {
228233 name : authorName ,
@@ -262,7 +267,15 @@ export default async function create(argv: yargs.Arguments<any>) {
262267 } else {
263268 await copyDir ( NATIVE_FILES , folder ) ;
264269
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' ) {
266279 await copyDir ( CPP_FILES , folder ) ;
267280 } else if ( type === 'native-swift' ) {
268281 await copyDir ( SWIFT_FILES , folder ) ;
0 commit comments