@@ -45,6 +45,7 @@ export class InitCommand {
45
45
await CommandUtils . createFile ( basePath + "/package.json" , InitCommand . getPackageJsonTemplate ( projectName ) , false ) ;
46
46
if ( isDocker )
47
47
await CommandUtils . createFile ( basePath + "/docker-compose.yml" , InitCommand . getDockerComposeTemplate ( database ) , false ) ;
48
+ await CommandUtils . createFile ( basePath + "/.gitignore" , InitCommand . getGitIgnoreFile ( ) ) ;
48
49
await CommandUtils . createFile ( basePath + "/README.md" , InitCommand . getReadmeTemplate ( { docker : isDocker } ) , false ) ;
49
50
await CommandUtils . createFile ( basePath + "/tsconfig.json" , InitCommand . getTsConfigTemplate ( ) ) ;
50
51
await CommandUtils . createFile ( basePath + "/ormconfig.json" , InitCommand . getOrmConfigTemplate ( database ) ) ;
@@ -82,19 +83,7 @@ export class InitCommand {
82
83
* Gets contents of the ormconfig file.
83
84
*/
84
85
protected static getOrmConfigTemplate ( database : string ) : string {
85
- const options : ObjectLiteral = {
86
- synchronize : true ,
87
- logging : false ,
88
- entities : [
89
- "src/entity/**/*.ts"
90
- ] ,
91
- migrations : [
92
- "src/migration/**/*.ts"
93
- ] ,
94
- subscribers : [
95
- "src/subscriber/**/*.ts"
96
- ]
97
- } ;
86
+ const options : ObjectLiteral = { } ;
98
87
switch ( database ) {
99
88
case "mysql" :
100
89
Object . assign ( options , {
@@ -157,6 +146,19 @@ export class InitCommand {
157
146
} ) ;
158
147
break ;
159
148
}
149
+ Object . assign ( options , {
150
+ synchronize : true ,
151
+ logging : false ,
152
+ entities : [
153
+ "src/entity/**/*.ts"
154
+ ] ,
155
+ migrations : [
156
+ "src/migration/**/*.ts"
157
+ ] ,
158
+ subscribers : [
159
+ "src/subscriber/**/*.ts"
160
+ ]
161
+ } ) ;
160
162
return JSON . stringify ( options , undefined , 3 ) ;
161
163
}
162
164
@@ -170,6 +172,7 @@ export class InitCommand {
170
172
target : "es5" ,
171
173
module : "commonjs" ,
172
174
moduleResolution : "node" ,
175
+ outDir : "./build" ,
173
176
emitDecoratorMetadata : true ,
174
177
experimentalDecorators : true ,
175
178
sourceMap : true
@@ -178,6 +181,18 @@ export class InitCommand {
178
181
, undefined , 3 ) ;
179
182
}
180
183
184
+ /**
185
+ * Gets contents of the .gitignore file.
186
+ */
187
+ protected static getGitIgnoreFile ( ) : string {
188
+ return `.idea/
189
+ .vscode/
190
+ node_modules/
191
+ build/
192
+ tmp/
193
+ temp/` ;
194
+ }
195
+
181
196
/**
182
197
* Gets contents of the user entity.
183
198
*/
0 commit comments