1- var Generator = require ( ' yeoman-generator' ) ;
2- var path = require ( ' path' ) ;
1+ var Generator = require ( " yeoman-generator" ) ;
2+ var path = require ( " path" ) ;
33
44module . exports = class extends Generator {
55 constructor ( args , opts ) {
@@ -8,31 +8,29 @@ module.exports = class extends Generator {
88 // name of the app based on the directory name generated by React Native
99 this . name = process . cwd ( ) . split ( path . sep ) . pop ( ) ;
1010
11- this . argument ( 'component' , { type : String , required : true } ) ;
12- this . option ( 'classComponent' ) ;
11+ this . argument ( "component" , { type : String , required : true } ) ;
1312 }
1413
1514 writing ( ) {
16- var template = ( this . options . classComponent ) ? 'class.tsx' : 'stateless.tsx' ;
1715 var component = this . options . component ;
1816
1917 // create entry points for Android and iOS
2018 this . fs . copyTpl (
21- this . templatePath ( template ) ,
19+ this . templatePath ( "index.tsx" ) ,
2220 this . destinationPath ( `App/Components/${ component } /index.tsx` ) ,
23- { name : this . name , component : component , }
21+ { name : this . name , component : component }
2422 ) ;
2523
2624 this . fs . copyTpl (
27- this . templatePath ( ' styles.ts' ) ,
25+ this . templatePath ( " styles.ts" ) ,
2826 this . destinationPath ( `App/Components/${ component } /styles.ts` ) ,
29- { name : this . name , component : component , }
27+ { name : this . name , component : component }
3028 ) ;
3129
3230 this . fs . copyTpl (
33- this . templatePath ( ' test.tsx' ) ,
31+ this . templatePath ( " test.tsx" ) ,
3432 this . destinationPath ( `App/Components/${ component } /index.test.tsx` ) ,
35- { name : this . name , component : component , }
33+ { name : this . name , component : component }
3634 ) ;
3735 }
3836} ;
0 commit comments