@@ -38,11 +38,14 @@ const compilerOptions = {
3838} ;
3939
4040function verifyTypeScriptSetup ( ) {
41+ let firstTimeSetup = false ;
42+
4143 if ( ! fs . existsSync ( paths . appTsConfig ) ) {
4244 if ( ! paths . appIndexJs . match ( / \. t s ? $ / ) ) {
4345 return ;
4446 }
4547 writeJson ( paths . appTsConfig , { } ) ;
48+ firstTimeSetup = true ;
4649 }
4750
4851 const isYarn = fs . existsSync ( paths . yarnLockFile ) ;
@@ -98,6 +101,7 @@ function verifyTypeScriptSetup() {
98101
99102 if ( tsconfig . compilerOptions == null ) {
100103 tsconfig . compilerOptions = { } ;
104+ firstTimeSetup = true ;
101105 }
102106
103107 for ( const option of Object . keys ( compilerOptions ) ) {
@@ -134,17 +138,28 @@ function verifyTypeScriptSetup() {
134138 }
135139
136140 if ( messages . length > 0 ) {
137- console . warn (
138- chalk . bold (
139- 'The following changes are being made to your' ,
140- chalk . cyan ( 'tsconfig.json' ) ,
141- 'file:'
142- )
143- ) ;
144- messages . forEach ( message => {
145- console . warn ( ' - ' + message ) ;
146- } ) ;
147- console . warn ( ) ;
141+ if ( firstTimeSetup ) {
142+ console . log (
143+ chalk . bold (
144+ 'Your' ,
145+ chalk . cyan ( 'tsconfig.json' ) ,
146+ 'has been populated with default values.'
147+ )
148+ ) ;
149+ console . log ( ) ;
150+ } else {
151+ console . warn (
152+ chalk . bold (
153+ 'The following changes are being made to your' ,
154+ chalk . cyan ( 'tsconfig.json' ) ,
155+ 'file:'
156+ )
157+ ) ;
158+ messages . forEach ( message => {
159+ console . warn ( ' - ' + message ) ;
160+ } ) ;
161+ console . warn ( ) ;
162+ }
148163 writeJson ( paths . appTsConfig , tsconfig ) ;
149164 }
150165
0 commit comments