@@ -78,21 +78,22 @@ async function isWantStyle() {
7878 ] )
7979}
8080
81- function createApp ( gitURL : string , nameOfApp : string , defaultNodePackageName : string ) {
81+ function createApp ( selectApp : number , nameOfApp : string , defaultNodePackageName : string , style : string ) {
8282 const gitDownSpinner = ora ( "Creating app: " + nameOfApp + "...\n" )
8383 gitDownSpinner . start ( )
84+ const gitURL = getGitURL ( selectApp , style )
8485 shell . exec ( `git clone ${ gitURL } ${ nameOfApp } ` , ( code : number , stdout : string , stderr : string ) => {
8586 gitDownSpinner . stop ( )
8687 if ( code !== 0 ) {
8788 shell . echo ( chalk . cyanBright ( `code: ${ code } ` ) )
8889 shell . echo ( chalk . cyanBright ( `Program output: ${ stdout } ` ) )
8990 shell . echo ( chalk . cyanBright ( `Program stderr: ${ stderr } ` ) )
9091 }
91- flowUp ( nameOfApp , defaultNodePackageName )
92+ flowUp ( selectApp , nameOfApp , defaultNodePackageName , style )
9293 } )
9394}
9495
95- function flowUp ( nameOfApp : string , defaultNodePackageName : string ) {
96+ function flowUp ( selectApp : number , nameOfApp : string , defaultNodePackageName : string , style : string ) {
9697 const projectCleanupSpinner = ora ( "Project Cleanup...\n" )
9798 projectCleanupSpinner . start ( )
9899
@@ -105,17 +106,22 @@ function flowUp(nameOfApp: string, defaultNodePackageName: string) {
105106 )
106107 shell . rm ( "-rf" , `${ nameOfApp } /.git` )
107108 projectCleanupSpinner . stop ( )
108-
109- const npmInstallSpinner = ora ( "npm install...just a moment, please.\n" ) . start ( )
110109 shell . cd ( nameOfApp )
111- shell . exec ( "npm install" )
112- npmInstallSpinner . stop ( )
113-
110+ shell . exec ( "flow update" )
111+ reinstallAutotprefixcer ( selectApp , style )
114112 shell . echo ( chalk . greenBright ( nameOfApp + " created." ) )
115113 process . exit ( 0 )
116114 } , 2000 )
117115}
118116
117+ function reinstallAutotprefixcer ( selectApp :number , style : string ) {
118+ if ( style == TYPE_OF_STYLE . TAILWIND && selectApp == TYPE_OF_APP . REACT ) {
119+ const tailwindSpinner = ora ( "autotprefixcer setting for tailwindcss...\n" ) . start ( )
120+ shell . exec ( "npm install autoprefixer@^9.8.6" )
121+ tailwindSpinner . succeed ( )
122+ }
123+ }
124+
119125function invalidProgramInput ( ) {
120126 shell . echo ( chalk . redBright ( "There is no app for current choice. Please try again." ) )
121127 process . exit ( 0 )
@@ -163,9 +169,9 @@ function selectTheNameOfTheApp() {
163169 if ( ! isValidateComponentNaming ( nameOfApp ) ) {
164170 return process . exit ( 0 )
165171 }
166- const gitURL = getGitURL ( options [ 0 ] . value , style )
172+ const selectApp = options [ 0 ] . value
167173 const defaultNodePackageName = getDefaultNodePackageName ( options [ 0 ] . value )
168- createApp ( gitURL , nameOfApp , defaultNodePackageName )
174+ createApp ( selectApp , nameOfApp , defaultNodePackageName , style )
169175 } )
170176}
171177
0 commit comments