@goodie-ts/kysely 0.6.1 → 0.7.0

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.
@@ -5,6 +5,9 @@ type ClassDecorator_Stage3 = (target: new (...args: never) => unknown, context:
5
5
  * At compile time, the Kysely transformer plugin discovers @Migration classes
6
6
  * and wires them into an auto-managed MigrationRunner.
7
7
  *
8
+ * At runtime, the migration name is stored as a non-enumerable static
9
+ * property `__migrationName` on the class (no Symbol.metadata).
10
+ *
8
11
  * Classes should extend {@link AbstractMigration} which enforces the required
9
12
  * `up()` method and optional `down()` method at compile time.
10
13
  *
@@ -12,7 +15,10 @@ type ClassDecorator_Stage3 = (target: new (...args: never) => unknown, context:
12
15
  * are executed in lexicographic order by name.
13
16
  */
14
17
  export declare function Migration(name: string): ClassDecorator_Stage3;
15
- /** Read the migration name from a migration instance's Symbol.metadata. */
18
+ /**
19
+ * Read the migration name from a migration instance's class.
20
+ * Returns `undefined` if the class has no @Migration annotation.
21
+ */
16
22
  export declare function getMigrationName(instance: object): string | undefined;
17
23
  export {};
18
24
  //# sourceMappingURL=migration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/decorators/migration.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG,CAC3B,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EACvC,OAAO,EAAE,qBAAqB,KAC3B,IAAI,CAAC;AAEV;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAI7D;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGrE"}
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/decorators/migration.ts"],"names":[],"mappings":"AAAA,KAAK,qBAAqB,GAAG,CAC3B,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EACvC,OAAO,EAAE,qBAAqB,KAC3B,IAAI,CAAC;AAEV;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAQ7D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAErE"}
@@ -1,10 +1,12 @@
1
- const MIGRATION_NAME = Symbol('goodie:migration-name');
2
1
  /**
3
2
  * Mark a class as a Kysely migration with a unique name.
4
3
  *
5
4
  * At compile time, the Kysely transformer plugin discovers @Migration classes
6
5
  * and wires them into an auto-managed MigrationRunner.
7
6
  *
7
+ * At runtime, the migration name is stored as a non-enumerable static
8
+ * property `__migrationName` on the class (no Symbol.metadata).
9
+ *
8
10
  * Classes should extend {@link AbstractMigration} which enforces the required
9
11
  * `up()` method and optional `down()` method at compile time.
10
12
  *
@@ -12,13 +14,19 @@ const MIGRATION_NAME = Symbol('goodie:migration-name');
12
14
  * are executed in lexicographic order by name.
13
15
  */
14
16
  export function Migration(name) {
15
- return (_target, context) => {
16
- context.metadata[MIGRATION_NAME] = name;
17
+ return (target) => {
18
+ Object.defineProperty(target, '__migrationName', {
19
+ value: name,
20
+ enumerable: false,
21
+ configurable: true,
22
+ });
17
23
  };
18
24
  }
19
- /** Read the migration name from a migration instance's Symbol.metadata. */
25
+ /**
26
+ * Read the migration name from a migration instance's class.
27
+ * Returns `undefined` if the class has no @Migration annotation.
28
+ */
20
29
  export function getMigrationName(instance) {
21
- const meta = instance.constructor[Symbol.metadata];
22
- return meta?.[MIGRATION_NAME];
30
+ return instance.constructor.__migrationName;
23
31
  }
24
32
  //# sourceMappingURL=migration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/decorators/migration.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAOvD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;QAC1B,OAAO,CAAC,QAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IAC3C,CAAC,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,IAAI,GAAI,QAAQ,CAAC,WAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5D,OAAO,IAAI,EAAE,CAAC,cAAc,CAAC,CAAC;AAChC,CAAC"}
1
+ {"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/decorators/migration.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,iBAAiB,EAAE;YAC/C,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,OAAQ,QAAQ,CAAC,WAAmB,CAAC,eAAqC,CAAC;AAC7E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodie-ts/kysely",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Kysely integration for goodie-ts — @Transactional decorator, TransactionManager, KyselyDatabase",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@goodie-ts/core": "^0.9.0"
28
+ "@goodie-ts/core": "^0.10.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "kysely": ">=0.27.0",
@@ -53,8 +53,8 @@
53
53
  "mysql2": "^3.0.0",
54
54
  "pg": "^8.0.0",
55
55
  "ts-morph": "^24.0.0",
56
- "@goodie-ts/cli": "0.6.5",
57
- "@goodie-ts/transformer": "0.11.0"
56
+ "@goodie-ts/cli": "0.6.6",
57
+ "@goodie-ts/transformer": "0.12.0"
58
58
  },
59
59
  "files": [
60
60
  "dist"