MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / configure

Function configure

packages/cli/src/CLIConfigurator.ts:53–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51}
52
53export async function configure(): Promise<Argv<{ config: string[] | undefined; contextName: string }>> {
54 fs.checkPackageVersion();
55 const settings = CLIHelper.getSettings();
56 const version = Utils.getORMVersion();
57
58 if (settings.preferTs !== false) {
59 const preferTs = await CLIHelper.registerTypeScriptSupport(settings.tsConfigPath, settings.tsLoader);
60
61 /* v8 ignore next */
62 if (!preferTs) {
63 process.env.MIKRO_ORM_CLI_PREFER_TS ??= '0';
64 }
65 }
66
67 return createBasicConfig()
68 .version(version)
69 .command(new ClearCacheCommand())
70 .command(new GenerateCacheCommand())
71 .command(new CompileCommand())
72 .command(new DiscoveryExportCommand())
73 .command(new GenerateEntitiesCommand())
74 .command(new CreateDatabaseCommand())
75 .command(new ImportCommand())
76 .command(new DatabaseSeedCommand())
77 .command(new CreateSeederCommand())
78 .command(SchemaCommandFactory.create('create'))
79 .command(SchemaCommandFactory.create('drop'))
80 .command(SchemaCommandFactory.create('update'))
81 .command(SchemaCommandFactory.create('fresh'))
82 .command(MigrationCommandFactory.create('create'))
83 .command(MigrationCommandFactory.create('up'))
84 .command(MigrationCommandFactory.create('down'))
85 .command(MigrationCommandFactory.create('list'))
86 .command(MigrationCommandFactory.create('check'))
87 .command(MigrationCommandFactory.create('pending'))
88 .command(MigrationCommandFactory.create('fresh'))
89 .command(MigrationCommandFactory.create('log'))
90 .command(MigrationCommandFactory.create('unlog'))
91 .command(MigrationCommandFactory.create('rollup'))
92 .command(new DebugCommand());
93}

Callers 2

CLIHelper.test.tsFile · 0.90
cli.tsFile · 0.85

Calls 7

createBasicConfigFunction · 0.85
checkPackageVersionMethod · 0.80
getSettingsMethod · 0.80
getORMVersionMethod · 0.80
versionMethod · 0.65
createMethod · 0.65

Tested by

no test coverage detected