@atls/nestjs-mikro-orm-config 0.0.1 → 0.0.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
 
2
2
 
3
+ ## [0.0.2](https://github.com/atls/nestjs/compare/@atls/nestjs-mikro-orm-config@0.0.1...@atls/nestjs-mikro-orm-config@0.0.2) (2025-12-31)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+
9
+ * **packages:** linter errors ([204ce22](https://github.com/atls/nestjs/commit/204ce229e375b09ffd69d93e47c08bd1d1fbea1b))
10
+ * **packages:** linter errors ([d41854b](https://github.com/atls/nestjs/commit/d41854b94d5502ebf2b9e18d22cac33f98c8fc41))
11
+ * **packages:** tests ([ae0f308](https://github.com/atls/nestjs/commit/ae0f308e695cfe39b4e2d38b6a33be4f7e5a8821))
12
+
13
+
14
+
15
+
16
+
3
17
  ## 0.0.1 (2025-03-14)
4
18
 
5
19
 
@@ -26,26 +26,37 @@ let MikroORMConfig = class MikroORMConfig {
26
26
  this.host = host;
27
27
  }
28
28
  createMikroOrmOptions() {
29
+ const { driver, port, host, database, username, password, debug, entities, migrationsList, migrationsTableName, } = this.options;
30
+ let resolvedEntities = [];
31
+ if (Array.isArray(entities)) {
32
+ resolvedEntities = entities;
33
+ }
34
+ else if (entities) {
35
+ resolvedEntities = Object.values(entities);
36
+ }
37
+ let resolvedMigrationsList = [];
38
+ if (Array.isArray(migrationsList)) {
39
+ resolvedMigrationsList = migrationsList;
40
+ }
41
+ else if (migrationsList) {
42
+ resolvedMigrationsList = Object.keys(migrationsList).map((name) => ({
43
+ name,
44
+ class: migrationsList[name],
45
+ }));
46
+ }
29
47
  return MikroORMConfigBuilder.build({
30
- driver: this.options.driver,
31
- port: this.port || this.options?.port,
32
- host: this.host || this.options?.host,
33
- dbName: this.options?.database,
34
- user: this.options?.username,
35
- password: this.options?.password,
36
- debug: this.options?.debug,
37
- entities: Array.isArray(this.options.entities)
38
- ? this.options.entities
39
- : Object.values(this.options.entities),
48
+ driver,
49
+ port: this.port || port,
50
+ host: this.host || host,
51
+ dbName: database,
52
+ user: username,
53
+ password,
54
+ debug,
55
+ entities: resolvedEntities,
40
56
  migrations: {
41
57
  disableForeignKeys: false,
42
- tableName: this.options.migrationsTableName,
43
- migrationsList: Array.isArray(this.options.migrationsList)
44
- ? this.options.migrationsList
45
- : Object.keys(this.options.migrationsList).map((name) => ({
46
- name,
47
- class: this.options.migrationsList[name],
48
- })),
58
+ tableName: migrationsTableName,
59
+ migrationsList: resolvedMigrationsList,
49
60
  },
50
61
  });
51
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atls/nestjs-mikro-orm-config",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "BSD-3-Clause",
5
5
  "type": "module",
6
6
  "exports": {
@@ -27,8 +27,8 @@
27
27
  "devDependencies": {
28
28
  "@mikro-orm/core": "5.7.12",
29
29
  "@mikro-orm/nestjs": "5.2.0",
30
- "@nestjs/common": "10.0.5",
31
- "@nestjs/core": "10.0.5",
30
+ "@nestjs/common": "10.4.1",
31
+ "@nestjs/core": "10.4.1",
32
32
  "reflect-metadata": "^0.2.2",
33
33
  "rxjs": "^7.8.1"
34
34
  },