@mikro-orm/migrations-mongodb 7.0.0-dev.0 → 7.0.0-dev.2
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/JSMigrationGenerator.d.ts +1 -1
- package/JSMigrationGenerator.js +4 -8
- package/Migration.js +1 -5
- package/MigrationGenerator.js +8 -12
- package/MigrationRunner.d.ts +1 -1
- package/MigrationRunner.js +1 -5
- package/MigrationStorage.d.ts +1 -1
- package/MigrationStorage.js +2 -39
- package/Migrator.d.ts +3 -3
- package/Migrator.js +32 -35
- package/TSMigrationGenerator.d.ts +1 -1
- package/TSMigrationGenerator.js +4 -8
- package/index.d.ts +8 -8
- package/index.js +8 -24
- package/package.json +6 -15
- package/typings.js +1 -2
- package/index.mjs +0 -10
package/JSMigrationGenerator.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.JSMigrationGenerator = void 0;
|
|
4
|
-
const MigrationGenerator_1 = require("./MigrationGenerator");
|
|
5
|
-
class JSMigrationGenerator extends MigrationGenerator_1.MigrationGenerator {
|
|
1
|
+
import { MigrationGenerator } from './MigrationGenerator.js';
|
|
2
|
+
export class JSMigrationGenerator extends MigrationGenerator {
|
|
6
3
|
/**
|
|
7
4
|
* @inheritDoc
|
|
8
5
|
*/
|
|
@@ -12,10 +9,10 @@ class JSMigrationGenerator extends MigrationGenerator_1.MigrationGenerator {
|
|
|
12
9
|
ret += `const { Migration } = require('@mikro-orm/migrations-mongodb');\n\n`;
|
|
13
10
|
ret += `class ${className} extends Migration {\n\n`;
|
|
14
11
|
ret += ` async up() {\n`;
|
|
15
|
-
/*
|
|
12
|
+
/* v8 ignore next */
|
|
16
13
|
diff.up.forEach(sql => ret += this.createStatement(sql, 4));
|
|
17
14
|
ret += ` }\n\n`;
|
|
18
|
-
/*
|
|
15
|
+
/* v8 ignore next 5 */
|
|
19
16
|
if (diff.down.length > 0) {
|
|
20
17
|
ret += ` async down() {\n`;
|
|
21
18
|
diff.down.forEach(sql => ret += this.createStatement(sql, 4));
|
|
@@ -26,4 +23,3 @@ class JSMigrationGenerator extends MigrationGenerator_1.MigrationGenerator {
|
|
|
26
23
|
return ret;
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
exports.JSMigrationGenerator = JSMigrationGenerator;
|
package/Migration.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Migration = void 0;
|
|
4
|
-
class Migration {
|
|
1
|
+
export class Migration {
|
|
5
2
|
driver;
|
|
6
3
|
config;
|
|
7
4
|
ctx;
|
|
@@ -25,4 +22,3 @@ class Migration {
|
|
|
25
22
|
return this.driver.getConnection().getCollection(entityName);
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
exports.Migration = Migration;
|
package/MigrationGenerator.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const core_1 = require("@mikro-orm/core");
|
|
5
|
-
const fs_extra_1 = require("fs-extra");
|
|
6
|
-
/* istanbul ignore next */
|
|
7
|
-
class MigrationGenerator {
|
|
1
|
+
import { Utils, } from '@mikro-orm/core';
|
|
2
|
+
import { writeFile } from 'node:fs/promises';
|
|
3
|
+
export class MigrationGenerator {
|
|
8
4
|
driver;
|
|
9
5
|
namingStrategy;
|
|
10
6
|
options;
|
|
@@ -17,17 +13,18 @@ class MigrationGenerator {
|
|
|
17
13
|
* @inheritDoc
|
|
18
14
|
*/
|
|
19
15
|
async generate(diff, path, name) {
|
|
20
|
-
/*
|
|
16
|
+
/* v8 ignore next */
|
|
21
17
|
const defaultPath = this.options.emit === 'ts' && this.options.pathTs ? this.options.pathTs : this.options.path;
|
|
22
|
-
path =
|
|
23
|
-
|
|
18
|
+
path = Utils.normalizePath(this.driver.config.get('baseDir'), path ?? defaultPath);
|
|
19
|
+
Utils.ensureDir(path);
|
|
24
20
|
const timestamp = new Date().toISOString().replace(/[-T:]|\.\d{3}z$/ig, '');
|
|
25
21
|
const className = this.namingStrategy.classToMigrationName(timestamp, name);
|
|
26
22
|
const fileName = `${this.options.fileName(timestamp, name)}.${this.options.emit}`;
|
|
27
23
|
const ret = await this.generateMigrationFile(className, diff);
|
|
28
|
-
await
|
|
24
|
+
await writeFile(path + '/' + fileName, ret, { flush: true });
|
|
29
25
|
return [ret, fileName];
|
|
30
26
|
}
|
|
27
|
+
/* v8 ignore start */
|
|
31
28
|
/**
|
|
32
29
|
* @inheritDoc
|
|
33
30
|
*/
|
|
@@ -39,4 +36,3 @@ class MigrationGenerator {
|
|
|
39
36
|
return '\n';
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
exports.MigrationGenerator = MigrationGenerator;
|
package/MigrationRunner.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MigrationsOptions, Transaction } from '@mikro-orm/core';
|
|
2
2
|
import type { MongoDriver } from '@mikro-orm/mongodb';
|
|
3
|
-
import type { Migration } from './Migration';
|
|
3
|
+
import type { Migration } from './Migration.js';
|
|
4
4
|
export declare class MigrationRunner {
|
|
5
5
|
protected readonly driver: MongoDriver;
|
|
6
6
|
protected readonly options: MigrationsOptions;
|
package/MigrationRunner.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MigrationRunner = void 0;
|
|
4
|
-
class MigrationRunner {
|
|
1
|
+
export class MigrationRunner {
|
|
5
2
|
driver;
|
|
6
3
|
options;
|
|
7
4
|
connection;
|
|
@@ -34,4 +31,3 @@ class MigrationRunner {
|
|
|
34
31
|
delete this.masterTransaction;
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
|
-
exports.MigrationRunner = MigrationRunner;
|
package/MigrationStorage.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MigrationsOptions, Transaction } from '@mikro-orm/core';
|
|
2
2
|
import type { MongoDriver } from '@mikro-orm/mongodb';
|
|
3
3
|
import type { MigrationParams, UmzugStorage } from 'umzug';
|
|
4
|
-
import type { MigrationRow } from './typings';
|
|
4
|
+
import type { MigrationRow } from './typings.js';
|
|
5
5
|
export declare class MigrationStorage implements UmzugStorage {
|
|
6
6
|
protected readonly driver: MongoDriver;
|
|
7
7
|
protected readonly options: MigrationsOptions;
|
package/MigrationStorage.js
CHANGED
|
@@ -1,41 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.MigrationStorage = void 0;
|
|
37
|
-
const path = __importStar(require("node:path"));
|
|
38
|
-
class MigrationStorage {
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
export class MigrationStorage {
|
|
39
3
|
driver;
|
|
40
4
|
options;
|
|
41
5
|
masterTransaction;
|
|
@@ -79,4 +43,3 @@ class MigrationStorage {
|
|
|
79
43
|
return name;
|
|
80
44
|
}
|
|
81
45
|
}
|
|
82
|
-
exports.MigrationStorage = MigrationStorage;
|
package/Migrator.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type MigrationParams, type RunnableMigration } from 'umzug';
|
|
2
2
|
import { type Constructor, type IMigrator, type MikroORM, type MigratorEvent, type MaybePromise } from '@mikro-orm/core';
|
|
3
3
|
import type { EntityManager } from '@mikro-orm/mongodb';
|
|
4
|
-
import type { Migration } from './Migration';
|
|
5
|
-
import { MigrationStorage } from './MigrationStorage';
|
|
6
|
-
import type { MigrateOptions, MigrationResult, MigrationRow, UmzugMigration } from './typings';
|
|
4
|
+
import type { Migration } from './Migration.js';
|
|
5
|
+
import { MigrationStorage } from './MigrationStorage.js';
|
|
6
|
+
import type { MigrateOptions, MigrationResult, MigrationRow, UmzugMigration } from './typings.js';
|
|
7
7
|
export declare class Migrator implements IMigrator {
|
|
8
8
|
private readonly em;
|
|
9
9
|
private umzug;
|
package/Migrator.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const MigrationStorage_1 = require("./MigrationStorage");
|
|
10
|
-
const TSMigrationGenerator_1 = require("./TSMigrationGenerator");
|
|
11
|
-
const JSMigrationGenerator_1 = require("./JSMigrationGenerator");
|
|
12
|
-
class Migrator {
|
|
1
|
+
import { Umzug } from 'umzug';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { Utils, } from '@mikro-orm/core';
|
|
4
|
+
import { MigrationRunner } from './MigrationRunner.js';
|
|
5
|
+
import { MigrationStorage } from './MigrationStorage.js';
|
|
6
|
+
import { TSMigrationGenerator } from './TSMigrationGenerator.js';
|
|
7
|
+
import { JSMigrationGenerator } from './JSMigrationGenerator.js';
|
|
8
|
+
export class Migrator {
|
|
13
9
|
em;
|
|
14
10
|
umzug;
|
|
15
11
|
runner;
|
|
@@ -24,9 +20,9 @@ class Migrator {
|
|
|
24
20
|
this.driver = this.em.getDriver();
|
|
25
21
|
this.config = this.em.config;
|
|
26
22
|
this.options = this.config.get('migrations');
|
|
27
|
-
/*
|
|
28
|
-
const key = (this.config.get('preferTs',
|
|
29
|
-
this.absolutePath =
|
|
23
|
+
/* v8 ignore next */
|
|
24
|
+
const key = (this.config.get('preferTs', Utils.detectTypeScriptSupport()) && this.options.pathTs) ? 'pathTs' : 'path';
|
|
25
|
+
this.absolutePath = Utils.absolutePath(this.options[key], this.config.get('baseDir'));
|
|
30
26
|
this.createUmzug();
|
|
31
27
|
}
|
|
32
28
|
static register(orm) {
|
|
@@ -36,7 +32,7 @@ class Migrator {
|
|
|
36
32
|
* @inheritDoc
|
|
37
33
|
*/
|
|
38
34
|
async createMigration(path, blank = false, initial = false, name) {
|
|
39
|
-
|
|
35
|
+
this.ensureMigrationsDirExists();
|
|
40
36
|
const diff = { up: [], down: [] };
|
|
41
37
|
const migration = await this.generator.generate(diff, path, name);
|
|
42
38
|
return {
|
|
@@ -45,12 +41,14 @@ class Migrator {
|
|
|
45
41
|
diff,
|
|
46
42
|
};
|
|
47
43
|
}
|
|
44
|
+
/* v8 ignore start */
|
|
48
45
|
/**
|
|
49
46
|
* @inheritDoc
|
|
50
47
|
*/
|
|
51
48
|
async checkMigrationNeeded() {
|
|
52
49
|
return true;
|
|
53
50
|
}
|
|
51
|
+
/* v8 ignore stop */
|
|
54
52
|
/**
|
|
55
53
|
* @inheritDoc
|
|
56
54
|
*/
|
|
@@ -72,13 +70,13 @@ class Migrator {
|
|
|
72
70
|
return this;
|
|
73
71
|
}
|
|
74
72
|
createUmzug() {
|
|
75
|
-
this.runner = new
|
|
76
|
-
this.storage = new
|
|
73
|
+
this.runner = new MigrationRunner(this.driver, this.options);
|
|
74
|
+
this.storage = new MigrationStorage(this.driver, this.options);
|
|
77
75
|
let migrations = {
|
|
78
|
-
glob:
|
|
76
|
+
glob: join(this.absolutePath, this.options.glob).replace(/\\/g, '/'),
|
|
79
77
|
resolve: (params) => this.resolve(params),
|
|
80
78
|
};
|
|
81
|
-
/*
|
|
79
|
+
/* v8 ignore next 8 */
|
|
82
80
|
if (this.options.migrationsList) {
|
|
83
81
|
migrations = this.options.migrationsList.map(migration => {
|
|
84
82
|
if (typeof migration === 'function') {
|
|
@@ -87,7 +85,7 @@ class Migrator {
|
|
|
87
85
|
return this.initialize(migration.class, migration.name);
|
|
88
86
|
});
|
|
89
87
|
}
|
|
90
|
-
this.umzug = new
|
|
88
|
+
this.umzug = new Umzug({
|
|
91
89
|
storage: this.storage,
|
|
92
90
|
logger: undefined,
|
|
93
91
|
migrations,
|
|
@@ -99,29 +97,29 @@ class Migrator {
|
|
|
99
97
|
this.umzug.on('reverting', event => logger.log('migrator', `Processing '${event.name}'`, { enabled: true }));
|
|
100
98
|
this.umzug.on('reverted', event => logger.log('migrator', `Reverted '${event.name}'`, { enabled: true }));
|
|
101
99
|
}
|
|
102
|
-
/*
|
|
100
|
+
/* v8 ignore next 3 */
|
|
103
101
|
if (this.options.generator) {
|
|
104
102
|
this.generator = new this.options.generator(this.driver, this.config.getNamingStrategy(), this.options);
|
|
105
103
|
}
|
|
106
104
|
else if (this.options.emit === 'js' || this.options.emit === 'cjs') {
|
|
107
|
-
this.generator = new
|
|
105
|
+
this.generator = new JSMigrationGenerator(this.driver, this.config.getNamingStrategy(), this.options);
|
|
108
106
|
}
|
|
109
107
|
else {
|
|
110
|
-
this.generator = new
|
|
108
|
+
this.generator = new TSMigrationGenerator(this.driver, this.config.getNamingStrategy(), this.options);
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
111
|
/**
|
|
114
112
|
* @inheritDoc
|
|
115
113
|
*/
|
|
116
114
|
async getExecutedMigrations() {
|
|
117
|
-
|
|
115
|
+
this.ensureMigrationsDirExists();
|
|
118
116
|
return this.storage.getExecutedMigrations();
|
|
119
117
|
}
|
|
120
118
|
/**
|
|
121
119
|
* @inheritDoc
|
|
122
120
|
*/
|
|
123
121
|
async getPendingMigrations() {
|
|
124
|
-
|
|
122
|
+
this.ensureMigrationsDirExists();
|
|
125
123
|
return this.umzug.pending();
|
|
126
124
|
}
|
|
127
125
|
/**
|
|
@@ -141,7 +139,7 @@ class Migrator {
|
|
|
141
139
|
}
|
|
142
140
|
resolve(params) {
|
|
143
141
|
const createMigrationHandler = async (method) => {
|
|
144
|
-
const migration = await
|
|
142
|
+
const migration = await Utils.dynamicImport(params.path);
|
|
145
143
|
const MigrationClass = Object.values(migration)[0];
|
|
146
144
|
const instance = new MigrationClass(this.driver, this.config);
|
|
147
145
|
await this.runner.run(instance, method);
|
|
@@ -152,12 +150,12 @@ class Migrator {
|
|
|
152
150
|
down: () => createMigrationHandler('down'),
|
|
153
151
|
};
|
|
154
152
|
}
|
|
155
|
-
/* istanbul ignore next */
|
|
156
153
|
initialize(MigrationClass, name) {
|
|
157
154
|
const instance = new MigrationClass(this.driver, this.config);
|
|
158
155
|
return {
|
|
159
156
|
name: this.storage.getMigrationName(name),
|
|
160
157
|
up: () => this.runner.run(instance, 'up'),
|
|
158
|
+
/* v8 ignore next */
|
|
161
159
|
down: () => this.runner.run(instance, 'down'),
|
|
162
160
|
};
|
|
163
161
|
}
|
|
@@ -166,8 +164,8 @@ class Migrator {
|
|
|
166
164
|
return name.match(/^\d{14}$/) ? this.options.fileName(name) : name;
|
|
167
165
|
}
|
|
168
166
|
prefix(options) {
|
|
169
|
-
if (
|
|
170
|
-
return { migrations:
|
|
167
|
+
if (Utils.isString(options) || Array.isArray(options)) {
|
|
168
|
+
return { migrations: Utils.asArray(options).map(name => this.getMigrationFilename(name)) };
|
|
171
169
|
}
|
|
172
170
|
if (!options) {
|
|
173
171
|
return {};
|
|
@@ -182,11 +180,11 @@ class Migrator {
|
|
|
182
180
|
return options;
|
|
183
181
|
}
|
|
184
182
|
async runMigrations(method, options) {
|
|
185
|
-
|
|
183
|
+
this.ensureMigrationsDirExists();
|
|
186
184
|
if (!this.options.transactional || !this.options.allOrNothing) {
|
|
187
185
|
return this.umzug[method](this.prefix(options));
|
|
188
186
|
}
|
|
189
|
-
if (
|
|
187
|
+
if (Utils.isObject(options) && options.transaction) {
|
|
190
188
|
return this.runInTransaction(options.transaction, method, options);
|
|
191
189
|
}
|
|
192
190
|
return this.driver.getConnection().transactional(trx => this.runInTransaction(trx, method, options));
|
|
@@ -199,10 +197,9 @@ class Migrator {
|
|
|
199
197
|
this.storage.unsetMasterMigration();
|
|
200
198
|
return ret;
|
|
201
199
|
}
|
|
202
|
-
|
|
200
|
+
ensureMigrationsDirExists() {
|
|
203
201
|
if (!this.options.migrationsList) {
|
|
204
|
-
|
|
202
|
+
Utils.ensureDir(this.absolutePath);
|
|
205
203
|
}
|
|
206
204
|
}
|
|
207
205
|
}
|
|
208
|
-
exports.Migrator = Migrator;
|
package/TSMigrationGenerator.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.TSMigrationGenerator = void 0;
|
|
4
|
-
const MigrationGenerator_1 = require("./MigrationGenerator");
|
|
5
|
-
class TSMigrationGenerator extends MigrationGenerator_1.MigrationGenerator {
|
|
1
|
+
import { MigrationGenerator } from './MigrationGenerator.js';
|
|
2
|
+
export class TSMigrationGenerator extends MigrationGenerator {
|
|
6
3
|
/**
|
|
7
4
|
* @inheritDoc
|
|
8
5
|
*/
|
|
@@ -10,10 +7,10 @@ class TSMigrationGenerator extends MigrationGenerator_1.MigrationGenerator {
|
|
|
10
7
|
let ret = `import { Migration } from '@mikro-orm/migrations-mongodb';\n\n`;
|
|
11
8
|
ret += `export class ${className} extends Migration {\n\n`;
|
|
12
9
|
ret += ` async up(): Promise<void> {\n`;
|
|
13
|
-
/*
|
|
10
|
+
/* v8 ignore next */
|
|
14
11
|
diff.up.forEach(sql => ret += this.createStatement(sql, 4));
|
|
15
12
|
ret += ` }\n\n`;
|
|
16
|
-
/*
|
|
13
|
+
/* v8 ignore next 5 */
|
|
17
14
|
if (diff.down.length > 0) {
|
|
18
15
|
ret += ` async down(): Promise<void> {\n`;
|
|
19
16
|
diff.down.forEach(sql => ret += this.createStatement(sql, 4));
|
|
@@ -23,4 +20,3 @@ class TSMigrationGenerator extends MigrationGenerator_1.MigrationGenerator {
|
|
|
23
20
|
return ret;
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
exports.TSMigrationGenerator = TSMigrationGenerator;
|
package/index.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
* @module migrations-mongodb
|
|
4
4
|
*/
|
|
5
|
-
export * from './Migrator';
|
|
6
|
-
export * from './Migration';
|
|
7
|
-
export * from './MigrationRunner';
|
|
8
|
-
export * from './MigrationGenerator';
|
|
9
|
-
export * from './JSMigrationGenerator';
|
|
10
|
-
export * from './TSMigrationGenerator';
|
|
11
|
-
export * from './MigrationStorage';
|
|
12
|
-
export * from './typings';
|
|
5
|
+
export * from './Migrator.js';
|
|
6
|
+
export * from './Migration.js';
|
|
7
|
+
export * from './MigrationRunner.js';
|
|
8
|
+
export * from './MigrationGenerator.js';
|
|
9
|
+
export * from './JSMigrationGenerator.js';
|
|
10
|
+
export * from './TSMigrationGenerator.js';
|
|
11
|
+
export * from './MigrationStorage.js';
|
|
12
|
+
export * from './typings.js';
|
package/index.js
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
1
|
/**
|
|
18
2
|
* @packageDocumentation
|
|
19
3
|
* @module migrations-mongodb
|
|
20
4
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
export * from './Migrator.js';
|
|
6
|
+
export * from './Migration.js';
|
|
7
|
+
export * from './MigrationRunner.js';
|
|
8
|
+
export * from './MigrationGenerator.js';
|
|
9
|
+
export * from './JSMigrationGenerator.js';
|
|
10
|
+
export * from './TSMigrationGenerator.js';
|
|
11
|
+
export * from './MigrationStorage.js';
|
|
12
|
+
export * from './typings.js';
|
package/package.json
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/migrations-mongodb",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "7.0.0-dev.2",
|
|
4
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.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"module": "index.mjs",
|
|
7
|
-
"typings": "index.d.ts",
|
|
8
6
|
"exports": {
|
|
9
7
|
"./package.json": "./package.json",
|
|
10
|
-
".":
|
|
11
|
-
"import": {
|
|
12
|
-
"types": "./index.d.ts",
|
|
13
|
-
"default": "./index.mjs"
|
|
14
|
-
},
|
|
15
|
-
"require": "./index.js"
|
|
16
|
-
}
|
|
8
|
+
".": "./index.js"
|
|
17
9
|
},
|
|
18
10
|
"repository": {
|
|
19
11
|
"type": "git",
|
|
@@ -49,7 +41,7 @@
|
|
|
49
41
|
"node": ">= 22.11.0"
|
|
50
42
|
},
|
|
51
43
|
"scripts": {
|
|
52
|
-
"build": "yarn clean && yarn compile && yarn copy
|
|
44
|
+
"build": "yarn clean && yarn compile && yarn copy",
|
|
53
45
|
"clean": "yarn run -T rimraf ./dist",
|
|
54
46
|
"compile": "yarn run -T tsc -p tsconfig.build.json",
|
|
55
47
|
"copy": "node ../../scripts/copy.mjs"
|
|
@@ -58,8 +50,7 @@
|
|
|
58
50
|
"access": "public"
|
|
59
51
|
},
|
|
60
52
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/mongodb": "7.0.0-dev.
|
|
62
|
-
"fs-extra": "11.3.0",
|
|
53
|
+
"@mikro-orm/mongodb": "7.0.0-dev.2",
|
|
63
54
|
"mongodb": "6.13.0",
|
|
64
55
|
"umzug": "3.8.2"
|
|
65
56
|
},
|
|
@@ -67,6 +58,6 @@
|
|
|
67
58
|
"@mikro-orm/core": "^6.4.5"
|
|
68
59
|
},
|
|
69
60
|
"peerDependencies": {
|
|
70
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
61
|
+
"@mikro-orm/core": "7.0.0-dev.2"
|
|
71
62
|
}
|
|
72
63
|
}
|
package/typings.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/index.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import mod from "./index.js";
|
|
2
|
-
|
|
3
|
-
export default mod;
|
|
4
|
-
export const JSMigrationGenerator = mod.JSMigrationGenerator;
|
|
5
|
-
export const Migration = mod.Migration;
|
|
6
|
-
export const MigrationGenerator = mod.MigrationGenerator;
|
|
7
|
-
export const MigrationRunner = mod.MigrationRunner;
|
|
8
|
-
export const MigrationStorage = mod.MigrationStorage;
|
|
9
|
-
export const Migrator = mod.Migrator;
|
|
10
|
-
export const TSMigrationGenerator = mod.TSMigrationGenerator;
|