@mikro-orm/cli 7.0.0-dev.90 → 7.0.0-dev.91
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.
- package/CLIHelper.js +6 -8
- package/package.json +4 -4
package/CLIHelper.js
CHANGED
|
@@ -81,6 +81,7 @@ export class CLIHelper {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
const esmConfigOptions = this.isESM() ? { entityGenerator: { esmImport: true } } : {};
|
|
84
|
+
await lookupExtensions(tmp);
|
|
84
85
|
return new Configuration(Utils.mergeConfig({}, esmConfigOptions, tmp, options, env));
|
|
85
86
|
}
|
|
86
87
|
static async getORM(contextName, configPaths, opts = {}) {
|
|
@@ -279,19 +280,16 @@ export class CLIHelper {
|
|
|
279
280
|
process.env.MIKRO_ORM_CLI_ALWAYS_ALLOW_TS ??= '1';
|
|
280
281
|
const explicitLoader = tsLoader ?? process.env.MIKRO_ORM_CLI_TS_LOADER ?? 'auto';
|
|
281
282
|
const loaders = {
|
|
282
|
-
swc: {
|
|
283
|
-
tsx: {
|
|
284
|
-
jiti: {
|
|
285
|
-
tsimp: {
|
|
283
|
+
swc: { module: '@swc-node/register/esm-register' },
|
|
284
|
+
tsx: { module: 'tsx/esm/api', cb: (tsx) => tsx.register({ tsconfig: configPath }) },
|
|
285
|
+
jiti: { module: 'jiti/register', cb: () => Utils.dynamicImportProvider = id => import(id).then(mod => mod?.default ?? mod) },
|
|
286
|
+
tsimp: { module: 'tsimp/import' },
|
|
286
287
|
};
|
|
287
288
|
for (const loader of Utils.keys(loaders)) {
|
|
288
289
|
if (explicitLoader !== 'auto' && loader !== explicitLoader) {
|
|
289
290
|
continue;
|
|
290
291
|
}
|
|
291
|
-
const {
|
|
292
|
-
const isEsm = this.isESM();
|
|
293
|
-
/* v8 ignore next */
|
|
294
|
-
const module = isEsm ? esm : cjs;
|
|
292
|
+
const { module, cb } = loaders[loader];
|
|
295
293
|
const mod = await Utils.tryImport({ module });
|
|
296
294
|
if (mod) {
|
|
297
295
|
cb?.(mod);
|
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.
|
|
4
|
+
"version": "7.0.0-dev.91",
|
|
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",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
57
|
-
"@mikro-orm/knex": "7.0.0-dev.
|
|
58
|
-
"mikro-orm": "7.0.0-dev.
|
|
56
|
+
"@mikro-orm/core": "7.0.0-dev.91",
|
|
57
|
+
"@mikro-orm/knex": "7.0.0-dev.91",
|
|
58
|
+
"mikro-orm": "7.0.0-dev.91",
|
|
59
59
|
"yargs": "17.7.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|