@mikro-orm/reflection 6.3.3-dev.8 → 6.3.3-dev.9

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.
@@ -121,7 +121,15 @@ class TsMorphMetadataProvider extends core_1.MetadataProvider {
121
121
  if (!this.sources) {
122
122
  this.initSourceFiles();
123
123
  }
124
- const source = this.sources.find(s => s.getFilePath().endsWith(core_1.Utils.stripRelativePath(tsPath)));
124
+ const baseDir = this.config.get('baseDir');
125
+ const outDir = this.project.getCompilerOptions().outDir;
126
+ let path = tsPath;
127
+ if (outDir != null) {
128
+ const outDirRelative = core_1.Utils.relativePath(outDir, baseDir);
129
+ path = path.replace(new RegExp(`^${outDirRelative}`), '');
130
+ }
131
+ path = core_1.Utils.stripRelativePath(path);
132
+ const source = this.sources.find(s => s.getFilePath().endsWith(path));
125
133
  if (!source && validate) {
126
134
  throw new core_1.MetadataError(`Source file '${tsPath}' not found. Check your 'entitiesTs' option and verify you have 'compilerOptions.declaration' enabled in your 'tsconfig.json'. If you are using webpack, see https://bit.ly/35pPDNn`);
127
135
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/reflection",
3
- "version": "6.3.3-dev.8",
3
+ "version": "6.3.3-dev.9",
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",
@@ -65,6 +65,6 @@
65
65
  "@mikro-orm/core": "^6.3.2"
66
66
  },
67
67
  "peerDependencies": {
68
- "@mikro-orm/core": "6.3.3-dev.8"
68
+ "@mikro-orm/core": "6.3.3-dev.9"
69
69
  }
70
70
  }