@mikro-orm/cli 7.1.0-dev.33 → 7.1.0-dev.34

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.
@@ -1,5 +1,5 @@
1
1
  import { mkdirSync, writeFileSync } from 'node:fs';
2
- import { basename, dirname, join, relative, resolve } from 'node:path';
2
+ import { basename, dirname, join, resolve } from 'node:path';
3
3
  import { colors, EntitySchema, MetadataStorage } from '@mikro-orm/core';
4
4
  import { fs } from '@mikro-orm/core/fs-utils';
5
5
  import { CLIHelper } from '../CLIHelper.js';
@@ -177,10 +177,8 @@ export class DiscoveryExportCommand {
177
177
  }
178
178
  // Generate import lines
179
179
  for (const [filePath, items] of byFile) {
180
- let rel = relative(outDir, filePath);
181
- if (!rel.startsWith('.')) {
182
- rel = './' + rel;
183
- }
180
+ // `fs.relativePath` ensures POSIX separators (node:path.relative returns backslashes on Windows)
181
+ let rel = fs.relativePath(filePath, outDir);
184
182
  // Remove .ts extension and optionally add .js for ESM
185
183
  rel = rel.replace(/\.[cm]?[jt]s$/, '');
186
184
  if (esm) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/cli",
3
- "version": "7.1.0-dev.33",
3
+ "version": "7.1.0-dev.34",
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.1.0-dev.33",
54
- "mikro-orm": "7.1.0-dev.33",
53
+ "@mikro-orm/core": "7.1.0-dev.34",
54
+ "mikro-orm": "7.1.0-dev.34",
55
55
  "yargs": "17.7.2"
56
56
  },
57
57
  "engines": {