@mikro-orm/cli 7.0.0-dev.6 → 7.0.0-dev.60

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.
@@ -43,7 +43,7 @@ export class CLIConfigurator {
43
43
  const settings = ConfigurationLoader.getSettings();
44
44
  const version = Utils.getORMVersion();
45
45
  if (settings.preferTs !== false) {
46
- const preferTs = await ConfigurationLoader.registerTypeScriptSupport(settings.tsConfigPath);
46
+ const preferTs = await ConfigurationLoader.registerTypeScriptSupport(settings.tsConfigPath, settings.tsLoader);
47
47
  /* v8 ignore next 3 */
48
48
  if (!preferTs) {
49
49
  process.env.MIKRO_ORM_CLI_PREFER_TS ??= '0';
package/CLIHelper.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { readFile } from 'node:fs/promises';
1
2
  import yargs from 'yargs';
2
3
  import { colors, ConfigurationLoader, MikroORM, Utils } from '@mikro-orm/core';
3
4
  /**
@@ -9,7 +10,6 @@ export class CLIHelper {
9
10
  if (!deps.has('@mikro-orm/cli') && !process.env.MIKRO_ORM_ALLOW_GLOBAL_CLI) {
10
11
  throw new Error('@mikro-orm/cli needs to be installed as a local dependency!');
11
12
  }
12
- ConfigurationLoader.commonJSCompat(options);
13
13
  ConfigurationLoader.registerDotenv(options);
14
14
  configPaths ??= ConfigurationLoader.getConfigPaths();
15
15
  contextName ??= process.env.MIKRO_ORM_CONTEXT_NAME ?? 'default';
@@ -21,7 +21,6 @@ export class CLIHelper {
21
21
  options.set('allowGlobalContext', true);
22
22
  options.set('debug', !!settings.verbose);
23
23
  options.getLogger().setDebugMode(!!settings.verbose);
24
- options.set('connect', false);
25
24
  if (settings.preferTs !== false) {
26
25
  options.set('preferTs', true);
27
26
  }
@@ -69,7 +68,7 @@ export class CLIHelper {
69
68
  CLIHelper.dump(' - dependencies:');
70
69
  CLIHelper.dump(` - mikro-orm ${colors.green(version)}`);
71
70
  CLIHelper.dump(` - node ${colors.green(CLIHelper.getNodeVersion())}`);
72
- if (Utils.pathExistsSync(process.cwd() + '/package.json')) {
71
+ if (Utils.pathExists(process.cwd() + '/package.json')) {
73
72
  /* v8 ignore next 3 */
74
73
  if (process.versions.bun) {
75
74
  CLIHelper.dump(` - typescript via bun`);
@@ -89,7 +88,14 @@ export class CLIHelper {
89
88
  return colors.green(pkg.version);
90
89
  }
91
90
  catch {
92
- return '';
91
+ try {
92
+ const path = `${Utils.resolveModulePath(name)}/package.json`;
93
+ const pkg = await readFile(path, { encoding: 'utf8' });
94
+ return colors.green(JSON.parse(pkg).version);
95
+ }
96
+ catch {
97
+ return '';
98
+ }
93
99
  }
94
100
  }
95
101
  static dumpTable(options) {
package/README.md CHANGED
@@ -11,7 +11,6 @@ TypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-or
11
11
  [![Chat on discord](https://img.shields.io/discord/1214904142443839538?label=discord&color=blue)](https://discord.gg/w8bjxFHS7X)
12
12
  [![Downloads](https://img.shields.io/npm/dm/@mikro-orm/core.svg)](https://www.npmjs.com/package/@mikro-orm/core)
13
13
  [![Coverage Status](https://img.shields.io/coveralls/mikro-orm/mikro-orm.svg)](https://coveralls.io/r/mikro-orm/mikro-orm?branch=master)
14
- [![Maintainability](https://api.codeclimate.com/v1/badges/27999651d3adc47cfa40/maintainability)](https://codeclimate.com/github/mikro-orm/mikro-orm/maintainability)
15
14
  [![Build Status](https://github.com/mikro-orm/mikro-orm/workflows/tests/badge.svg?branch=master)](https://github.com/mikro-orm/mikro-orm/actions?workflow=tests)
16
15
 
17
16
  ## 🤔 Unit of What?
@@ -141,7 +140,7 @@ There is also auto-generated [CHANGELOG.md](CHANGELOG.md) file based on commit m
141
140
  - [Composite and Foreign Keys as Primary Key](https://mikro-orm.io/docs/composite-keys)
142
141
  - [Filters](https://mikro-orm.io/docs/filters)
143
142
  - [Using `QueryBuilder`](https://mikro-orm.io/docs/query-builder)
144
- - [Preloading Deeply Nested Structures via populate](https://mikro-orm.io/docs/nested-populate)
143
+ - [Populating relations](https://mikro-orm.io/docs/populating-relations)
145
144
  - [Property Validation](https://mikro-orm.io/docs/property-validation)
146
145
  - [Lifecycle Hooks](https://mikro-orm.io/docs/events#hooks)
147
146
  - [Vanilla JS Support](https://mikro-orm.io/docs/usage-with-js)
@@ -382,6 +381,8 @@ See also the list of contributors who [participated](https://github.com/mikro-or
382
381
 
383
382
  Please ⭐️ this repository if this project helped you!
384
383
 
384
+ > If you'd like to support my open-source work, consider sponsoring me directly at [github.com/sponsors/b4nan](https://github.com/sponsors/b4nan).
385
+
385
386
  ## 📝 License
386
387
 
387
388
  Copyright © 2018 [Martin Adámek](https://github.com/b4nan).
@@ -1,4 +1,4 @@
1
- import { ConfigurationLoader, Utils, colors } from '@mikro-orm/core';
1
+ import { colors, ConfigurationLoader, Utils } from '@mikro-orm/core';
2
2
  import { CLIHelper } from '../CLIHelper.js';
3
3
  export class DebugCommand {
4
4
  command = 'debug';
@@ -11,7 +11,8 @@ export class DebugCommand {
11
11
  await CLIHelper.dumpDependencies();
12
12
  const settings = ConfigurationLoader.getSettings();
13
13
  if (!process.versions.bun && settings.preferTs !== false) {
14
- CLIHelper.dump(' - TypeScript support ' + colors.green('enabled'));
14
+ const loader = process.env.MIKRO_ORM_CLI_TS_LOADER ?? 'auto';
15
+ CLIHelper.dump(' - TypeScript support ' + colors.green(`enabled (${loader})`));
15
16
  }
16
17
  const configPaths = args.config ?? CLIHelper.getConfigPaths();
17
18
  CLIHelper.dump(' - searched config paths:');
@@ -67,8 +68,7 @@ export class DebugCommand {
67
68
  for (let path of paths) {
68
69
  path = Utils.absolutePath(path, baseDir);
69
70
  path = Utils.normalizePath(path);
70
- const found = await Utils.pathExists(path);
71
- if (found) {
71
+ if (Utils.pathExists(path)) {
72
72
  CLIHelper.dump(` - ${path} (${colors.green('found')})`);
73
73
  }
74
74
  else {
@@ -206,7 +206,7 @@ export class MigrationCommandFactory {
206
206
  if (Utils.isString(options.to)) {
207
207
  return msg + ' to version ' + options.to;
208
208
  }
209
- if (options.migrations && options.migrations.length === 1) {
209
+ if (options.migrations?.length === 1) {
210
210
  return msg + ' to version ' + options.migrations[0];
211
211
  }
212
212
  return msg;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mikro-orm/cli",
3
3
  "type": "module",
4
- "version": "7.0.0-dev.6",
4
+ "version": "7.0.0-dev.60",
5
5
  "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.",
6
6
  "exports": {
7
7
  "./package.json": "./package.json",
@@ -41,7 +41,7 @@
41
41
  "mikro-orm": "./cli"
42
42
  },
43
43
  "engines": {
44
- "node": ">= 22.11.0"
44
+ "node": ">= 22.17.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "yarn clean && yarn compile && yarn copy",
@@ -53,13 +53,13 @@
53
53
  "access": "public"
54
54
  },
55
55
  "dependencies": {
56
- "@mikro-orm/core": "7.0.0-dev.6",
57
- "@mikro-orm/knex": "7.0.0-dev.6",
56
+ "@mikro-orm/core": "7.0.0-dev.60",
57
+ "@mikro-orm/knex": "7.0.0-dev.60",
58
58
  "yargs": "17.7.2"
59
59
  },
60
60
  "devDependencies": {
61
- "@mikro-orm/entity-generator": "^6.4.7",
62
- "@mikro-orm/migrations": "^6.4.7",
63
- "@mikro-orm/seeder": "^6.4.7"
61
+ "@mikro-orm/entity-generator": "^6.6.1",
62
+ "@mikro-orm/migrations": "^6.6.1",
63
+ "@mikro-orm/seeder": "^6.6.1"
64
64
  }
65
65
  }