@@ -38,11 +38,14 @@ const compilerOptions = {
38
38
} ;
39
39
40
40
function verifyTypeScriptSetup ( ) {
41
+ let firstTimeSetup = false ;
42
+
41
43
if ( ! fs . existsSync ( paths . appTsConfig ) ) {
42
44
if ( ! paths . appIndexJs . match ( / \. t s ? $ / ) ) {
43
45
return ;
44
46
}
45
47
writeJson ( paths . appTsConfig , { } ) ;
48
+ firstTimeSetup = true ;
46
49
}
47
50
48
51
const isYarn = fs . existsSync ( paths . yarnLockFile ) ;
@@ -98,6 +101,7 @@ function verifyTypeScriptSetup() {
98
101
99
102
if ( tsconfig . compilerOptions == null ) {
100
103
tsconfig . compilerOptions = { } ;
104
+ firstTimeSetup = true ;
101
105
}
102
106
103
107
for ( const option of Object . keys ( compilerOptions ) ) {
@@ -134,17 +138,28 @@ function verifyTypeScriptSetup() {
134
138
}
135
139
136
140
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
+ }
148
163
writeJson ( paths . appTsConfig , tsconfig ) ;
149
164
}
150
165
0 commit comments