()
| 51 | } |
| 52 | |
| 53 | export 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 | } |
no test coverage detected