@mikro-orm/cli 7.2.6-dev.4 → 7.2.6-dev.40
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 -0
- package/package.json +3 -3
package/CLIHelper.js
CHANGED
|
@@ -19,6 +19,7 @@ export class CLIHelper {
|
|
|
19
19
|
*/
|
|
20
20
|
static async getConfiguration(contextName, paths, options = {}) {
|
|
21
21
|
this.commonJSCompat(options);
|
|
22
|
+
const configPaths = paths ? [] : (this.getSettings().configPaths ?? []);
|
|
22
23
|
paths ??= await this.getConfigPaths();
|
|
23
24
|
const deps = fs.getORMPackages();
|
|
24
25
|
if (!deps.has('@mikro-orm/cli') && !process.env.MIKRO_ORM_ALLOW_GLOBAL_CLI && !process.versions.deno) {
|
|
@@ -28,6 +29,11 @@ export class CLIHelper {
|
|
|
28
29
|
const env = await this.loadEnvironmentVars();
|
|
29
30
|
const result = await this.getConfigFile(paths);
|
|
30
31
|
if (!result[0]) {
|
|
32
|
+
// an explicitly configured TS path that exists but was filtered out must not fail with an unrelated error
|
|
33
|
+
const skipped = configPaths.find(p => !paths.includes(p) && fs.pathExists(fs.absolutePath(p)));
|
|
34
|
+
if (skipped) {
|
|
35
|
+
throw new Error(`MikroORM config file '${skipped}' was skipped because TypeScript support is not available. Install a TypeScript loader (see \`MIKRO_ORM_CLI_TS_LOADER\`) or point \`configPaths\` to a compiled JS file.`);
|
|
36
|
+
}
|
|
31
37
|
if (Utils.hasObjectKeys(env)) {
|
|
32
38
|
const merged = Utils.mergeConfig({ contextName }, options.preferEnvVars ? options : env, options.preferEnvVars ? env : options);
|
|
33
39
|
await loadOptionalDependencies(merged);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/cli",
|
|
3
|
-
"version": "7.2.6-dev.
|
|
3
|
+
"version": "7.2.6-dev.40",
|
|
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.2.6-dev.
|
|
54
|
-
"mikro-orm": "7.2.6-dev.
|
|
53
|
+
"@mikro-orm/core": "7.2.6-dev.40",
|
|
54
|
+
"mikro-orm": "7.2.6-dev.40",
|
|
55
55
|
"yargs": "17.7.2"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|