@mikro-orm/core 6.3.5-dev.11 → 6.3.5-dev.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.3.5-dev.11",
3
+ "version": "6.3.5-dev.12",
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
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -64,7 +64,7 @@
64
64
  "esprima": "4.0.1",
65
65
  "fs-extra": "11.2.0",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.3.5-dev.11",
67
+ "mikro-orm": "6.3.5-dev.12",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }
@@ -85,7 +85,8 @@ class ConfigurationLoader {
85
85
  paths.push(process.env.MIKRO_ORM_CLI_CONFIG);
86
86
  }
87
87
  paths.push(...(settings.configPaths || []));
88
- if (settings.useTsNode !== false || settings.alwaysAllowTs) {
88
+ const alwaysAllowTs = settings.alwaysAllowTs ?? process.versions.bun;
89
+ if (settings.useTsNode !== false || alwaysAllowTs) {
89
90
  paths.push('./src/mikro-orm.config.ts');
90
91
  paths.push('./mikro-orm.config.ts');
91
92
  }
@@ -96,7 +97,7 @@ class ConfigurationLoader {
96
97
  paths.push(`./${path}/mikro-orm.config.js`);
97
98
  paths.push('./mikro-orm.config.js');
98
99
  const tsNode = Utils_1.Utils.detectTsNode();
99
- return Utils_1.Utils.unique(paths).filter(p => p.endsWith('.js') || tsNode || settings.alwaysAllowTs);
100
+ return Utils_1.Utils.unique(paths).filter(p => p.endsWith('.js') || tsNode || alwaysAllowTs);
100
101
  }
101
102
  static isESM() {
102
103
  const config = ConfigurationLoader.getPackageConfig();
@@ -104,6 +105,9 @@ class ConfigurationLoader {
104
105
  return type === 'module';
105
106
  }
106
107
  static registerTsNode(configPath = 'tsconfig.json') {
108
+ if (process.versions.bun) {
109
+ return true;
110
+ }
107
111
  const tsConfigPath = (0, node_path_1.isAbsolute)(configPath) ? configPath : (0, node_path_1.join)(process.cwd(), configPath);
108
112
  const tsNode = Utils_1.Utils.tryRequire({
109
113
  module: 'ts-node',
package/utils/Utils.js CHANGED
@@ -632,6 +632,7 @@ class Utils {
632
632
  || !!process[Symbol.for('ts-node.register.instance')] // check if internal ts-node symbol exists
633
633
  || !!process.env.TS_JEST // check if ts-jest is used (works only with v27.0.4+)
634
634
  || !!process.env.VITEST // check if vitest is used
635
+ || !!process.versions.bun // check if bun is used
635
636
  || process.argv.slice(1).some(arg => arg.includes('ts-node')) // registering ts-node runner
636
637
  || process.execArgv.some(arg => arg === 'ts-node/esm') // check for ts-node/esm module loader
637
638
  || (require.extensions && !!require.extensions['.ts']); // check if the extension is registered