@@ -4,6 +4,7 @@ import { DockerUtilities } from '../../../docker';
44import { FsUtilities , QuestionsFor } from '../../../encapsulation' ;
55import { DefaultEnvKeys , EnvUtilities } from '../../../env' ;
66import { EslintUtilities } from '../../../eslint' ;
7+ import { TsUtilities } from '../../../ts' ;
78import { TsConfigUtilities } from '../../../tsconfig' ;
89import { OmitStrict } from '../../../types' ;
910import { generatePlaceholderPassword , getPath , Path , toKebabCase , toPascalCase } from '../../../utilities' ;
@@ -197,6 +198,11 @@ export class AddZibriCommand extends BaseAddCommand<AddZibriConfiguration> {
197198 'dataSources: [DbDataSource]' ,
198199 `dataSources: [${ toPascalCase ( databaseName ) } DataSource]`
199200 ) ;
201+ await FsUtilities . replaceInFile (
202+ getPath ( root , 'src' , 'index.ts' ) ,
203+ 'createDefaultData(DbDataSource);' ,
204+ `createDefaultData(${ toPascalCase ( databaseName ) } DataSource);`
205+ ) ;
200206
201207 const environmentModel : Path = getPath ( root , 'src' , 'environment' , ENVIRONMENT_MODEL_TS_FILE_NAME ) ;
202208
@@ -289,6 +295,10 @@ export class AddZibriCommand extends BaseAddCommand<AddZibriConfiguration> {
289295 '\'zibri@zibri.de\'' ,
290296 `environment.${ DefaultEnvKeys . defaultUserEmail ( config . name ) } `
291297 ) ;
298+ await TsUtilities . addImportStatements (
299+ createDefaultDataTs ,
300+ [ { defaultImport : false , element : 'environment' , path : './environment/environment' } ]
301+ ) ;
292302 }
293303
294304 private async setupTsConfig ( projectName : string ) : Promise < void > {
@@ -306,7 +316,9 @@ export class AddZibriCommand extends BaseAddCommand<AddZibriConfiguration> {
306316 sourceMap : undefined ,
307317 skipLibCheck : undefined ,
308318 noImplicitAny : undefined ,
309- noFallthroughCasesInSwitch : undefined
319+ noFallthroughCasesInSwitch : undefined ,
320+ module : undefined ,
321+ moduleResolution : undefined
310322 }
311323 }
312324 ) ;
0 commit comments