@mikro-orm/core 7.0.0-dev.46 → 7.0.0-dev.48
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.
|
@@ -367,11 +367,8 @@ export class MetadataDiscovery {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
initNullability(prop) {
|
|
370
|
-
if (prop.kind === ReferenceKind.MANY_TO_ONE) {
|
|
371
|
-
return Utils.defaultValue(prop, 'nullable', prop.optional || prop.cascade.includes(Cascade.REMOVE) || prop.cascade.includes(Cascade.ALL));
|
|
372
|
-
}
|
|
373
370
|
if (prop.kind === ReferenceKind.ONE_TO_ONE) {
|
|
374
|
-
return Utils.defaultValue(prop, 'nullable', prop.optional || !prop.owner
|
|
371
|
+
return Utils.defaultValue(prop, 'nullable', prop.optional || !prop.owner);
|
|
375
372
|
}
|
|
376
373
|
return Utils.defaultValue(prop, 'nullable', prop.optional);
|
|
377
374
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.48",
|
|
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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dataloader": "2.2.3",
|
|
55
55
|
"dotenv": "17.2.3",
|
|
56
56
|
"esprima": "4.0.1",
|
|
57
|
-
"mikro-orm": "7.0.0-dev.
|
|
57
|
+
"mikro-orm": "7.0.0-dev.48",
|
|
58
58
|
"reflect-metadata": "0.2.2",
|
|
59
59
|
"tinyglobby": "0.2.13"
|
|
60
60
|
}
|
|
@@ -112,7 +112,6 @@ export class ConfigurationLoader {
|
|
|
112
112
|
settings.preferTs = process.env.MIKRO_ORM_CLI_PREFER_TS != null ? bool(process.env.MIKRO_ORM_CLI_PREFER_TS) : settings.preferTs;
|
|
113
113
|
settings.tsLoader = process.env.MIKRO_ORM_CLI_TS_LOADER ?? settings.tsLoader;
|
|
114
114
|
settings.tsConfigPath = process.env.MIKRO_ORM_CLI_TS_CONFIG_PATH ?? settings.tsConfigPath;
|
|
115
|
-
settings.alwaysAllowTs = process.env.MIKRO_ORM_CLI_ALWAYS_ALLOW_TS != null ? bool(process.env.MIKRO_ORM_CLI_ALWAYS_ALLOW_TS) : settings.alwaysAllowTs;
|
|
116
115
|
settings.verbose = process.env.MIKRO_ORM_CLI_VERBOSE != null ? bool(process.env.MIKRO_ORM_CLI_VERBOSE) : settings.verbose;
|
|
117
116
|
if (process.env.MIKRO_ORM_CLI_CONFIG?.endsWith('.ts')) {
|
|
118
117
|
settings.preferTs = true;
|
|
@@ -120,14 +119,14 @@ export class ConfigurationLoader {
|
|
|
120
119
|
return settings;
|
|
121
120
|
}
|
|
122
121
|
static getConfigPaths() {
|
|
123
|
-
const paths = [];
|
|
124
122
|
const settings = ConfigurationLoader.getSettings();
|
|
123
|
+
const typeScriptSupport = settings.preferTs ?? Utils.detectTypeScriptSupport();
|
|
124
|
+
const paths = [];
|
|
125
125
|
if (process.env.MIKRO_ORM_CLI_CONFIG) {
|
|
126
126
|
paths.push(process.env.MIKRO_ORM_CLI_CONFIG);
|
|
127
127
|
}
|
|
128
128
|
paths.push(...(settings.configPaths || []));
|
|
129
|
-
|
|
130
|
-
if (settings.preferTs !== false || alwaysAllowTs) {
|
|
129
|
+
if (typeScriptSupport) {
|
|
131
130
|
paths.push('./src/mikro-orm.config.ts');
|
|
132
131
|
paths.push('./mikro-orm.config.ts');
|
|
133
132
|
}
|
|
@@ -137,9 +136,8 @@ export class ConfigurationLoader {
|
|
|
137
136
|
const path = distDir ? 'dist' : (buildDir ? 'build' : 'src');
|
|
138
137
|
paths.push(`./${path}/mikro-orm.config.js`);
|
|
139
138
|
paths.push('./mikro-orm.config.js');
|
|
140
|
-
const typeScriptSupport = Utils.detectTypeScriptSupport();
|
|
141
139
|
/* v8 ignore next */
|
|
142
|
-
return Utils.unique(paths).filter(p => p.
|
|
140
|
+
return Utils.unique(paths).filter(p => !p.match(/\.[mc]?ts$/) || typeScriptSupport);
|
|
143
141
|
}
|
|
144
142
|
static isESM() {
|
|
145
143
|
const config = ConfigurationLoader.getPackageConfig();
|