@mikro-orm/cli 7.1.16-dev.10 → 7.1.16-dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,9 +11,11 @@ export interface BaseCommand<CommandArgs extends BaseArgs = BaseArgs> extends Co
11
11
  declare function createBasicConfig(): Argv<{
12
12
  config: string[] | undefined;
13
13
  contextName: string;
14
+ quiet: boolean;
14
15
  }>;
15
16
  export declare function configure(): Promise<Argv<{
16
17
  config: string[] | undefined;
17
18
  contextName: string;
19
+ quiet: boolean;
18
20
  }>>;
19
21
  export {};
@@ -30,6 +30,12 @@ function createBasicConfig() {
30
30
  type: 'string',
31
31
  desc: 'Set name of config to load out of the ORM configuration file. Used when config file exports an array or a function',
32
32
  default: process.env.MIKRO_ORM_CONTEXT_NAME ?? 'default',
33
+ })
34
+ .option('quiet', {
35
+ alias: 'q',
36
+ type: 'boolean',
37
+ desc: 'Do not show any auxiliary output.',
38
+ default: false,
33
39
  })
34
40
  .alias('v', 'version')
35
41
  .alias('h', 'help')
package/CLIHelper.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Configuration, type EntityManager, type EntityManagerType, type IDataba
3
3
  * @internal
4
4
  */
5
5
  export declare class CLIHelper {
6
+ static quiet: boolean;
6
7
  /**
7
8
  * Gets a named configuration
8
9
  *
@@ -16,6 +17,7 @@ export declare class CLIHelper {
16
17
  static isDBConnected(config: Configuration, reason?: false): Promise<boolean>;
17
18
  static isDBConnected(config: Configuration, reason: true): Promise<true | string>;
18
19
  static getDriverDependencies(config: Configuration): string[];
20
+ static info(text: string): void;
19
21
  static dump(text: string, config?: Configuration): void;
20
22
  static getSettings(): Settings;
21
23
  static getConfigPaths(): Promise<string[]>;
@@ -35,18 +37,19 @@ export declare class CLIHelper {
35
37
  empty: string;
36
38
  }): void;
37
39
  /**
38
- * Tries to register TS support in the following order: oxc, swc, tsx, jiti, tsimp
40
+ * Tries to register TS support in the following order: oxc, swc, tsx, jiti, tsimp, nub
39
41
  * Use `MIKRO_ORM_CLI_TS_LOADER` env var to set the loader explicitly.
42
+ * `nub` is skipped when a custom tsconfig path is used, and it supports only the legacy decorators.
40
43
  * This method is used only in CLI context.
41
44
  */
42
- static registerTypeScriptSupport(configPath?: string, tsLoader?: 'oxc' | 'swc' | 'tsx' | 'jiti' | 'tsimp' | 'auto'): Promise<boolean>;
45
+ static registerTypeScriptSupport(configPath?: string, tsLoader?: 'oxc' | 'swc' | 'tsx' | 'jiti' | 'tsimp' | 'nub' | 'auto'): Promise<boolean>;
43
46
  static isESM(): boolean;
44
47
  static showHelp(): void;
45
48
  }
46
49
  export interface Settings {
47
50
  verbose?: boolean;
48
51
  preferTs?: boolean;
49
- tsLoader?: 'oxc' | 'swc' | 'tsx' | 'jiti' | 'tsimp' | 'auto';
52
+ tsLoader?: 'oxc' | 'swc' | 'tsx' | 'jiti' | 'tsimp' | 'nub' | 'auto';
50
53
  tsConfigPath?: string;
51
54
  configPaths?: string[];
52
55
  }
package/CLIHelper.js CHANGED
@@ -9,6 +9,7 @@ import { searchConfiguration } from './searchConfiguration.js';
9
9
  * @internal
10
10
  */
11
11
  export class CLIHelper {
12
+ static quiet = false;
12
13
  /**
13
14
  * Gets a named configuration
14
15
  *
@@ -88,6 +89,13 @@ export class CLIHelper {
88
89
  return [];
89
90
  }
90
91
  }
92
+ static info(text) {
93
+ if (CLIHelper.quiet) {
94
+ return;
95
+ }
96
+ // eslint-disable-next-line no-console
97
+ console.log(text);
98
+ }
91
99
  static dump(text, config) {
92
100
  if (config?.get('highlighter')) {
93
101
  text = config.get('highlighter').highlight(text);
@@ -177,6 +185,9 @@ export class CLIHelper {
177
185
  case 'libsql':
178
186
  ret.driver ??= await import('@mikro-orm/libsql').then(m => m.LibSqlDriver);
179
187
  break;
188
+ case 'sql-js':
189
+ ret.driver ??= await import('@mikro-orm/sql-js').then(m => m.SqlJsDriver);
190
+ break;
180
191
  case 'oracledb':
181
192
  ret.driver ??= await import('@mikro-orm/oracledb').then(m => m.OracleDriver);
182
193
  break;
@@ -257,8 +268,9 @@ export class CLIHelper {
257
268
  CLIHelper.dump(ret);
258
269
  }
259
270
  /**
260
- * Tries to register TS support in the following order: oxc, swc, tsx, jiti, tsimp
271
+ * Tries to register TS support in the following order: oxc, swc, tsx, jiti, tsimp, nub
261
272
  * Use `MIKRO_ORM_CLI_TS_LOADER` env var to set the loader explicitly.
273
+ * `nub` is skipped when a custom tsconfig path is used, and it supports only the legacy decorators.
262
274
  * This method is used only in CLI context.
263
275
  */
264
276
  static async registerTypeScriptSupport(configPath = 'tsconfig.json', tsLoader) {
@@ -270,18 +282,26 @@ export class CLIHelper {
270
282
  process.env.TSIMP_PROJECT ??= configPath;
271
283
  process.env.MIKRO_ORM_CLI_ALWAYS_ALLOW_TS ??= '1';
272
284
  const explicitLoader = tsLoader ?? process.env.MIKRO_ORM_CLI_TS_LOADER ?? 'auto';
285
+ const usesDefaultTsConfig = fs.absolutePath(configPath) === fs.absolutePath('tsconfig.json');
273
286
  const setEsmImportProvider = () => {
274
287
  return (globalThis.dynamicImportProvider = (id) => import(id).then(mod => mod?.default ?? mod));
275
288
  };
289
+ if (explicitLoader === 'nub' && !usesDefaultTsConfig) {
290
+ throw new Error('The `nub` loader does not support a custom tsconfig path. Use the project tsconfig.json or select another loader.');
291
+ }
276
292
  const loaders = {
277
293
  oxc: { esm: '@oxc-node/core/register', cjs: '@oxc-node/core/register' },
278
294
  swc: { esm: '@swc-node/register/esm-register', cjs: '@swc-node/register' },
279
295
  tsx: { esm: 'tsx/esm/api', cjs: 'tsx/cjs/api', cb: (tsx) => tsx.register({ tsconfig: configPath }) },
280
296
  jiti: { cjs: 'jiti/register', cb: setEsmImportProvider },
281
297
  tsimp: { cjs: 'tsimp/import', cb: setEsmImportProvider },
298
+ nub: { esm: '@nubjs/loader', cjs: '@nubjs/loader' },
282
299
  };
283
300
  const errors = [];
284
301
  for (const loader of Utils.keys(loaders)) {
302
+ if (loader === 'nub' && !usesDefaultTsConfig) {
303
+ continue;
304
+ }
285
305
  if (explicitLoader !== 'auto' && loader !== explicitLoader) {
286
306
  continue;
287
307
  }
@@ -312,8 +332,12 @@ export class CLIHelper {
312
332
  if (errors.length > 0) {
313
333
  throw new Error(errors.map(e => e.message).join('\n'), { cause: errors[0] });
314
334
  }
335
+ const loadersMessage = usesDefaultTsConfig
336
+ ? '`oxc`, `swc`, `tsx`, `jiti`, `tsimp` nor `nub`'
337
+ : '`oxc`, `swc`, `tsx`, `jiti` nor `tsimp`';
338
+ const nubHint = usesDefaultTsConfig ? '' : ' The `nub` loader was skipped as a custom tsconfig path is configured.';
315
339
  // eslint-disable-next-line no-console
316
- console.warn('Neither `oxc`, `swc`, `tsx`, `jiti` nor `tsimp` found in the project dependencies, support for working with TypeScript files might not work. To use `oxc`, install `@oxc-node/core`. To use `swc`, install both `@swc-node/register` and `@swc/core`.');
340
+ console.warn(`Neither ${loadersMessage} found in the project dependencies, support for working with TypeScript files might not work.${nubHint} To use \`oxc\`, install \`@oxc-node/core\`. To use \`swc\`, install both \`@swc-node/register\` and \`@swc/core\`.`);
317
341
  return false;
318
342
  }
319
343
  static isESM() {
package/README.md CHANGED
@@ -24,6 +24,7 @@ npm install @mikro-orm/mysql # MySQL
24
24
  npm install @mikro-orm/mariadb # MariaDB
25
25
  npm install @mikro-orm/sqlite # SQLite
26
26
  npm install @mikro-orm/libsql # libSQL / Turso
27
+ npm install @mikro-orm/sql-js # sql.js (in-memory SQLite in WASM)
27
28
  npm install @mikro-orm/mongodb # MongoDB
28
29
  npm install @mikro-orm/mssql # MS SQL Server
29
30
  npm install @mikro-orm/oracledb # Oracle
@@ -7,6 +7,7 @@ export class ClearCacheCommand {
7
7
  * @inheritDoc
8
8
  */
9
9
  async handler(args) {
10
+ CLIHelper.quiet = args.quiet;
10
11
  const config = await CLIHelper.getConfiguration(args.contextName, args.config);
11
12
  if (!config.get('metadataCache').enabled) {
12
13
  CLIHelper.dump(colors.red('Metadata cache is disabled in your configuration. Set cache.enabled to true to use this command.'));
@@ -14,6 +15,6 @@ export class ClearCacheCommand {
14
15
  }
15
16
  const cache = config.getMetadataCacheAdapter();
16
17
  await cache.clear();
17
- CLIHelper.dump(colors.green('Metadata cache was successfully cleared'));
18
+ CLIHelper.info(colors.green('Metadata cache was successfully cleared'));
18
19
  }
19
20
  }
@@ -17,6 +17,7 @@ export class CompileCommand {
17
17
  * @inheritDoc
18
18
  */
19
19
  async handler(args) {
20
+ CLIHelper.quiet = args.quiet;
20
21
  const config = await CLIHelper.getConfiguration(args.contextName, args.config);
21
22
  const settings = CLIHelper.getSettings();
22
23
  config.set('debug', !!settings.verbose);
@@ -51,12 +52,15 @@ export class CompileCommand {
51
52
  mkdirSync(dirname(outPath), { recursive: true });
52
53
  writeFileSync(outPath, output);
53
54
  writeFileSync(dtsPath, dts);
54
- CLIHelper.dump(colors.green(`Compiled functions generated to ${outPath} (${captured.length} functions)`));
55
- CLIHelper.dump(`\nExample usage in your ORM config:\n`);
55
+ if (args.quiet) {
56
+ return;
57
+ }
58
+ CLIHelper.info(colors.green(`Compiled functions generated to ${outPath} (${captured.length} functions)`));
59
+ CLIHelper.info(`\nExample usage in your ORM config:\n`);
56
60
  const importPath = esm ? './compiled-functions.js' : './compiled-functions';
57
- CLIHelper.dump(` ${esm ? 'import' : 'const'} compiledFunctions ${esm ? 'from ' : '= require('}${colors.cyan(`'${importPath}'`)}${esm ? '' : ')'};`);
58
- CLIHelper.dump('');
59
- CLIHelper.dump(` export default defineConfig({ compiledFunctions });\n`);
61
+ CLIHelper.info(` ${esm ? 'import' : 'const'} compiledFunctions ${esm ? 'from ' : '= require('}${colors.cyan(`'${importPath}'`)}${esm ? '' : ')'};`);
62
+ CLIHelper.info('');
63
+ CLIHelper.info(` export default defineConfig({ compiledFunctions });\n`);
60
64
  }
61
65
  static capture(metadata, config) {
62
66
  const captured = [];
@@ -6,6 +6,7 @@ export class CreateDatabaseCommand {
6
6
  * @inheritDoc
7
7
  */
8
8
  async handler(args) {
9
+ CLIHelper.quiet = args.quiet;
9
10
  const orm = await CLIHelper.getORM(args.contextName, args.config);
10
11
  await orm.schema.ensureDatabase();
11
12
  await orm.close(true);
@@ -14,10 +14,11 @@ export class CreateSeederCommand {
14
14
  * @inheritDoc
15
15
  */
16
16
  async handler(args) {
17
+ CLIHelper.quiet = args.quiet;
17
18
  const className = CreateSeederCommand.getSeederClassName(args.seeder);
18
19
  const orm = await CLIHelper.getORM(args.contextName, args.config);
19
20
  const path = await orm.seeder.create(className);
20
- CLIHelper.dump(colors.green(`Seeder ${args.seeder} successfully created at ${path}`));
21
+ CLIHelper.info(colors.green(`Seeder ${args.seeder} successfully created at ${path}`));
21
22
  await orm.close(true);
22
23
  }
23
24
  /**
@@ -15,10 +15,11 @@ export class DatabaseSeedCommand {
15
15
  * @inheritDoc
16
16
  */
17
17
  async handler(args) {
18
+ CLIHelper.quiet = args.quiet;
18
19
  const orm = await CLIHelper.getORM(args.contextName, args.config);
19
20
  const className = args.class ?? orm.config.get('seeder').defaultSeeder;
20
21
  await orm.seeder.seedString(className);
21
- CLIHelper.dump(colors.green(`Seeder ${className} successfully executed`));
22
+ CLIHelper.info(colors.green(`Seeder ${className} successfully executed`));
22
23
  await orm.close(true);
23
24
  }
24
25
  }
@@ -8,6 +8,7 @@ export class DebugCommand {
8
8
  * @inheritDoc
9
9
  */
10
10
  async handler(args) {
11
+ CLIHelper.quiet = args.quiet;
11
12
  CLIHelper.dump(`Current ${colors.cyan('MikroORM')} CLI configuration`);
12
13
  CLIHelper.dumpDependencies();
13
14
  const settings = CLIHelper.getSettings();
@@ -4,6 +4,7 @@ type DiscoveryExportArgs = BaseArgs & {
4
4
  path?: string[];
5
5
  out?: string;
6
6
  dump?: boolean;
7
+ quiet?: boolean;
7
8
  };
8
9
  export declare class DiscoveryExportCommand implements BaseCommand<DiscoveryExportArgs> {
9
10
  command: string;
@@ -10,6 +10,7 @@ const driverPackageMap = {
10
10
  MariaDbDriver: '@mikro-orm/mariadb',
11
11
  SqliteDriver: '@mikro-orm/sqlite',
12
12
  LibSqlDriver: '@mikro-orm/libsql',
13
+ SqlJsDriver: '@mikro-orm/sql-js',
13
14
  MsSqlDriver: '@mikro-orm/mssql',
14
15
  OracleDriver: '@mikro-orm/oracledb',
15
16
  MongoDriver: '@mikro-orm/mongodb',
@@ -41,6 +42,7 @@ export class DiscoveryExportCommand {
41
42
  * @inheritDoc
42
43
  */
43
44
  handler = async (args) => {
45
+ CLIHelper.quiet = args.quiet;
44
46
  const config = await CLIHelper.getConfiguration(args.contextName, args.config);
45
47
  const paths = this.resolvePaths(args, config);
46
48
  const baseDir = fs.absolutePath(config.get('baseDir') ?? process.cwd());
@@ -60,13 +62,16 @@ export class DiscoveryExportCommand {
60
62
  const output = this.generateFile(discovered, outPath, esm, driverPackage);
61
63
  mkdirSync(dirname(outPath), { recursive: true });
62
64
  writeFileSync(outPath, output);
63
- CLIHelper.dump(colors.green(`Entity exports generated to ${outPath} (${discovered.length} entities)`));
64
- CLIHelper.dump(`\nExample usage in your ORM config:\n`);
65
+ if (args.quiet) {
66
+ return;
67
+ }
68
+ CLIHelper.info(colors.green(`Entity exports generated to ${outPath} (${discovered.length} entities)`));
69
+ CLIHelper.info(`\nExample usage in your ORM config:\n`);
65
70
  const importExt = esm ? '.js' : '';
66
71
  const importPath = `./${basename(outPath).replace(/\.ts$/, importExt)}`;
67
- CLIHelper.dump(` import { entities } from ${colors.cyan(`'${importPath}'`)};`);
68
- CLIHelper.dump('');
69
- CLIHelper.dump(' export default defineConfig({ entities });\n');
72
+ CLIHelper.info(` import { entities } from ${colors.cyan(`'${importPath}'`)};`);
73
+ CLIHelper.info('');
74
+ CLIHelper.info(' export default defineConfig({ entities });\n');
70
75
  };
71
76
  resolvePaths(args, config) {
72
77
  if (args.path && args.path.length > 0) {
@@ -10,6 +10,7 @@ export class GenerateCacheCommand {
10
10
  desc: `Generate development cache for '.ts' files`,
11
11
  });
12
12
  args.option('combined', {
13
+ type: 'string',
13
14
  alias: 'c',
14
15
  desc: `Generate production cache into a single JSON file that can be used with the GeneratedCacheAdapter.`,
15
16
  });
@@ -19,7 +20,10 @@ export class GenerateCacheCommand {
19
20
  * @inheritDoc
20
21
  */
21
22
  async handler(args) {
22
- const options = args.combined ? { combined: './metadata.json' } : {};
23
+ CLIHelper.quiet = args.quiet;
24
+ const options = typeof args.combined !== 'undefined'
25
+ ? { combined: args.combined === '' ? './metadata.json' : args.combined }
26
+ : {};
23
27
  const config = await CLIHelper.getConfiguration(args.contextName, args.config, {
24
28
  metadataCache: { enabled: true, adapter: FileCacheAdapter, options },
25
29
  });
@@ -29,6 +33,6 @@ export class GenerateCacheCommand {
29
33
  const discovery = new MetadataDiscovery(new MetadataStorage(), config.getDriver().getPlatform(), config);
30
34
  await discovery.discover(args.ts ?? false);
31
35
  const combined = args.combined && config.get('metadataCache').combined;
32
- CLIHelper.dump(colors.green(`${combined ? 'Combined ' : ''}${args.ts ? 'TS' : 'JS'} metadata cache was successfully generated${combined ? ' to ' + combined : ''}`));
36
+ CLIHelper.info(colors.green(`${combined ? 'Combined ' : ''}${args.ts ? 'TS' : 'JS'} metadata cache was successfully generated${combined ? ' to ' + combined : ''}`));
33
37
  }
34
38
  }
@@ -1,4 +1,5 @@
1
1
  import { CLIHelper } from '../CLIHelper.js';
2
+ import { colors } from '@mikro-orm/core';
2
3
  export class GenerateEntitiesCommand {
3
4
  command = 'generate-entities';
4
5
  describe = 'Generate entities based on current database schema';
@@ -31,6 +32,7 @@ export class GenerateEntitiesCommand {
31
32
  * @inheritDoc
32
33
  */
33
34
  async handler(args) {
35
+ CLIHelper.quiet = args.quiet;
34
36
  if (!args.save && !args.dump) {
35
37
  return CLIHelper.showHelp();
36
38
  }
@@ -43,6 +45,9 @@ export class GenerateEntitiesCommand {
43
45
  if (args.dump) {
44
46
  CLIHelper.dump(dump.join('\n\n'));
45
47
  }
48
+ else {
49
+ CLIHelper.info(colors.green(`Entities generated successfully`));
50
+ }
46
51
  await orm.close(true);
47
52
  }
48
53
  }
@@ -8,10 +8,11 @@ export class ImportCommand {
8
8
  * @inheritDoc
9
9
  */
10
10
  async handler(args) {
11
+ CLIHelper.quiet = args.quiet;
11
12
  const orm = await CLIHelper.getORM(args.contextName, args.config, { multipleStatements: true });
12
13
  const buf = await readFile(args.file);
13
14
  await orm.em.getConnection().executeDump(buf.toString());
14
- CLIHelper.dump(colors.green(`File ${args.file} successfully imported`));
15
+ CLIHelper.info(colors.green(`File ${args.file} successfully imported`));
15
16
  await orm.close(true);
16
17
  }
17
18
  }
@@ -98,6 +98,7 @@ export class MigrationCommandFactory {
98
98
  return args;
99
99
  }
100
100
  static async handleMigrationCommand(args, method) {
101
+ CLIHelper.quiet = args.quiet;
101
102
  // to be able to run have a master transaction, but run marked migrations outside of it, we need a second connection
102
103
  const options = { pool: { min: 1, max: 2 } };
103
104
  const orm = await CLIHelper.getORM(args.contextName, args.config, options);
@@ -146,7 +147,7 @@ export class MigrationCommandFactory {
146
147
  const opts = MigrationCommandFactory.getUpDownOptions(args);
147
148
  await migrator[method](opts);
148
149
  const message = this.getUpDownSuccessMessage(method, opts);
149
- CLIHelper.dump(colors.green(message));
150
+ CLIHelper.info(colors.green(message));
150
151
  }
151
152
  static async handlePendingCommand(migrator) {
152
153
  const pending = await migrator.getPending();
@@ -171,10 +172,10 @@ export class MigrationCommandFactory {
171
172
  static async handleCreateCommand(migrator, args, config) {
172
173
  const ret = await migrator.create(args.path, args.blank, args.initial, args.name);
173
174
  if (ret.diff.up.length === 0) {
174
- return CLIHelper.dump(colors.green(`No changes required, schema is up-to-date`));
175
+ return CLIHelper.info(colors.green(`No changes required, schema is up-to-date`));
175
176
  }
176
177
  if (args.dump) {
177
- CLIHelper.dump(colors.green('Creating migration with following queries:'));
178
+ CLIHelper.info(colors.green('Creating migration with following queries:'));
178
179
  CLIHelper.dump(colors.green('up:'));
179
180
  CLIHelper.dump(ret.diff.up.map(sql => ' ' + sql).join('\n'), config);
180
181
  /* v8 ignore if */
@@ -187,11 +188,11 @@ export class MigrationCommandFactory {
187
188
  CLIHelper.dump(colors.yellow(`(${config.getDriver().constructor.name} does not support automatic down migrations)`));
188
189
  }
189
190
  }
190
- CLIHelper.dump(colors.green(`${ret.fileName} successfully created`));
191
+ CLIHelper.info(colors.green(`${ret.fileName} successfully created`));
191
192
  }
192
193
  static async handleCheckCommand(migrator, orm) {
193
194
  if (!(await migrator.checkSchema())) {
194
- return CLIHelper.dump(colors.green(`No changes required, schema is up-to-date`));
195
+ return CLIHelper.info(colors.green(`No changes required, schema is up-to-date`));
195
196
  }
196
197
  await orm.close(true);
197
198
  CLIHelper.dump(colors.yellow(`Changes detected. Please create migration to update schema.`));
@@ -199,25 +200,25 @@ export class MigrationCommandFactory {
199
200
  }
200
201
  static async handleFreshCommand(args, migrator, orm) {
201
202
  await orm.schema.drop({ dropMigrationsTable: true, dropDb: args.dropDb });
202
- CLIHelper.dump(colors.green('Dropped schema successfully'));
203
+ CLIHelper.info(colors.green('Dropped schema successfully'));
203
204
  const opts = MigrationCommandFactory.getUpDownOptions(args);
204
205
  await migrator.up(opts);
205
206
  const message = this.getUpDownSuccessMessage('up', opts);
206
- CLIHelper.dump(colors.green(message));
207
+ CLIHelper.info(colors.green(message));
207
208
  if (args.seed !== undefined) {
208
209
  const seederClass = args.seed || orm.config.get('seeder').defaultSeeder;
209
210
  await orm.seeder.seedString(seederClass);
210
- CLIHelper.dump(colors.green(`Database seeded successfully with seeder class ${seederClass}`));
211
+ CLIHelper.info(colors.green(`Database seeded successfully with seeder class ${seederClass}`));
211
212
  }
212
213
  }
213
214
  static async handleLogUnlogCommand(args, migrator, method) {
214
215
  await migrator[`${method}Migration`](args.name);
215
216
  const action = method === 'log' ? 'logged' : 'unlogged';
216
- CLIHelper.dump(colors.green(`Successfully ${action} migration '${args.name}'`));
217
+ CLIHelper.info(colors.green(`Successfully ${action} migration '${args.name}'`));
217
218
  }
218
219
  static async handleRollupCommand(migrator) {
219
220
  const ret = await migrator.rollup();
220
- CLIHelper.dump(colors.green(`${ret.fileName} successfully created (rollup)`));
221
+ CLIHelper.info(colors.green(`${ret.fileName} successfully created (rollup)`));
221
222
  }
222
223
  static getUpDownOptions(flags) {
223
224
  const ret = !flags.to && !flags.from && flags.only ? { migrations: flags.only.split(/[, ]+/) } : {};
@@ -76,6 +76,7 @@ export class SchemaCommandFactory {
76
76
  return args;
77
77
  }
78
78
  static async handleSchemaCommand(args, method, successMessage) {
79
+ CLIHelper.quiet = args.quiet;
79
80
  if (!args.run && !args.dump) {
80
81
  return CLIHelper.showHelp();
81
82
  }
@@ -102,7 +103,7 @@ export class SchemaCommandFactory {
102
103
  if (typeof args.seed !== 'undefined') {
103
104
  await orm.seeder.seedString(args.seed || orm.config.get('seeder').defaultSeeder);
104
105
  }
105
- CLIHelper.dump(colors.green(successMessage));
106
+ CLIHelper.info(colors.green(successMessage));
106
107
  await orm.close(true);
107
108
  }
108
109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/cli",
3
- "version": "7.1.16-dev.10",
3
+ "version": "7.1.16-dev.11",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -50,8 +50,8 @@
50
50
  "copy": "node ../../scripts/copy.mjs"
51
51
  },
52
52
  "dependencies": {
53
- "@mikro-orm/core": "7.1.16-dev.10",
54
- "mikro-orm": "7.1.16-dev.10",
53
+ "@mikro-orm/core": "7.1.16-dev.11",
54
+ "mikro-orm": "7.1.16-dev.11",
55
55
  "yargs": "17.7.2"
56
56
  },
57
57
  "engines": {