@geekmidas/testkit 3.0.0 → 3.1.1
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 +32 -0
- package/dist/{Factory-BOX312yd.d.cts → Factory-CUM2767q.d.cts} +2 -2
- package/dist/{Factory-BOX312yd.d.cts.map → Factory-CUM2767q.d.cts.map} +1 -1
- package/dist/Factory.d.cts +2 -2
- package/dist/{KyselyFactory-Dy5zzV4B.d.cts → KyselyFactory-OMwcuAX_.d.cts} +3 -3
- package/dist/{KyselyFactory-Dy5zzV4B.d.cts.map → KyselyFactory-OMwcuAX_.d.cts.map} +1 -1
- package/dist/KyselyFactory.d.cts +3 -3
- package/dist/{ObjectionFactory-CD-WFuMJ.d.cts → ObjectionFactory-DvmZVHhe.d.cts} +3 -3
- package/dist/{ObjectionFactory-CD-WFuMJ.d.cts.map → ObjectionFactory-DvmZVHhe.d.cts.map} +1 -1
- package/dist/ObjectionFactory.d.cts +3 -3
- package/dist/{PostgresKyselyMigrator-CTNftoZK.d.cts → PostgresKyselyMigrator-B2M6Gjvv.d.cts} +3 -2
- package/dist/PostgresKyselyMigrator-B2M6Gjvv.d.cts.map +1 -0
- package/dist/{PostgresKyselyMigrator-CqNs3qX8.cjs → PostgresKyselyMigrator-BGBxjnFv.cjs} +3 -3
- package/dist/PostgresKyselyMigrator-BGBxjnFv.cjs.map +1 -0
- package/dist/{PostgresKyselyMigrator-x0uvWs3U.d.mts → PostgresKyselyMigrator-CvwXycJE.d.mts} +3 -2
- package/dist/PostgresKyselyMigrator-CvwXycJE.d.mts.map +1 -0
- package/dist/{PostgresKyselyMigrator-BIKd7G5C.mjs → PostgresKyselyMigrator-PI0QhvB1.mjs} +2 -2
- package/dist/PostgresKyselyMigrator-PI0QhvB1.mjs.map +1 -0
- package/dist/PostgresKyselyMigrator.cjs +1 -1
- package/dist/PostgresKyselyMigrator.d.cts +1 -1
- package/dist/PostgresKyselyMigrator.d.mts +1 -1
- package/dist/PostgresKyselyMigrator.mjs +1 -1
- package/dist/better-auth.d.cts +2 -2
- package/dist/{directory-DGOcVlKD.d.cts → directory-Bpz5c5pj.d.cts} +3 -3
- package/dist/{directory-DGOcVlKD.d.cts.map → directory-Bpz5c5pj.d.cts.map} +1 -1
- package/dist/{faker-Cg76aFNO.d.cts → faker-zVCm31nU.d.cts} +3 -3
- package/dist/{faker-Cg76aFNO.d.cts.map → faker-zVCm31nU.d.cts.map} +1 -1
- package/dist/faker.d.cts +1 -1
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.mjs +1 -1
- package/dist/kysely.cjs +1 -1
- package/dist/kysely.d.cts +4 -4
- package/dist/kysely.d.mts +2 -2
- package/dist/kysely.mjs +1 -1
- package/dist/objection.d.cts +3 -3
- package/dist/os/directory.d.cts +1 -1
- package/dist/os/index.d.cts +1 -1
- package/package.json +8 -8
- package/src/PostgresKyselyMigrator.ts +4 -1
- package/test/helpers.ts +3 -2
- package/dist/PostgresKyselyMigrator-BIKd7G5C.mjs.map +0 -1
- package/dist/PostgresKyselyMigrator-CTNftoZK.d.cts.map +0 -1
- package/dist/PostgresKyselyMigrator-CqNs3qX8.cjs.map +0 -1
- package/dist/PostgresKyselyMigrator-x0uvWs3U.d.mts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @geekmidas/testkit
|
|
2
2
|
|
|
3
|
+
## 3.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 🐛 [#11](https://github.com/geekmidas/toolbox/pull/11) [`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309) Thanks [@geekmidas](https://github.com/geekmidas)! - Patch release across all packages to realign published versions with the
|
|
8
|
+
registry. The previous release only published the four packages that had
|
|
9
|
+
version bumps; the remaining packages failed with "cannot publish over the
|
|
10
|
+
previously published versions" because their versions were unchanged.
|
|
11
|
+
- Updated dependencies [[`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309)]:
|
|
12
|
+
- @geekmidas/envkit@1.1.1
|
|
13
|
+
- @geekmidas/logger@1.0.3
|
|
14
|
+
- @geekmidas/services@2.0.1
|
|
15
|
+
|
|
16
|
+
## 3.1.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- [#9](https://github.com/geekmidas/toolbox/pull/9) [`e31a60a`](https://github.com/geekmidas/toolbox/commit/e31a60a971366180a0e7bec6e7da56d8f36aa21f) Thanks [@geekmidas](https://github.com/geekmidas)! - Support kysely 0.29.
|
|
21
|
+
|
|
22
|
+
kysely 0.29 moved `Migrator` and `FileMigrationProvider` from the root barrel
|
|
23
|
+
(`'kysely'`) to the `'kysely/migration'` subpath. `@geekmidas/testkit`'s
|
|
24
|
+
`PostgresKyselyMigrator` now imports `Migrator` from `'kysely/migration'` and
|
|
25
|
+
its kysely peer becomes `~0.29.4` — consumers must be on kysely 0.29+.
|
|
26
|
+
|
|
27
|
+
The library packages that only declare a kysely _peer_ (`db`, `audit`, `studio`,
|
|
28
|
+
`telescope`) don't touch the moved symbols, so their peer range is _widened_ to
|
|
29
|
+
`>=0.28.2 <0.30.0` — they now support both 0.28 and 0.29 (non-breaking).
|
|
30
|
+
|
|
31
|
+
`@geekmidas/cli`'s scaffolded `test/globalSetup.ts` template now imports
|
|
32
|
+
`FileMigrationProvider` from `'kysely/migration'` so generated projects work on
|
|
33
|
+
kysely 0.29.
|
|
34
|
+
|
|
3
35
|
## 3.0.0
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
1
|
+
import { FakerFactory } from "./faker-zVCm31nU.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/Factory.d.ts
|
|
4
4
|
|
|
@@ -144,4 +144,4 @@ type ExtractSeedAttrs<T> = T extends ((context: {
|
|
|
144
144
|
//# sourceMappingURL=Factory.d.ts.map
|
|
145
145
|
//#endregion
|
|
146
146
|
export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
|
|
147
|
-
//# sourceMappingURL=Factory-
|
|
147
|
+
//# sourceMappingURL=Factory-CUM2767q.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory-
|
|
1
|
+
{"version":3,"file":"Factory-CUM2767q.d.cts","names":[],"sources":["../src/Factory.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;;;;;;;;;;;;;;;;;;;;AAiD6B,uBAjDP,OAiDO,CAAA,iBAhDX,MAgDW,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cA/Cd,MA+Cc,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA;EAAQ;;;;;;;;;;;;;;;;EAavB,OAAA,UAAA,CAAA,aA1CkB,WA0ClB,CAAA,CAAA,MAAA,EA1CuC,IA0CvC,CAAA,EA1C8C,IA0C9C;EA8BF;;;;;;EAK0C,SAAW,MAAA,CAAA,UAAA,MApEhC,QAoEgC,CAAA,CAAA,WAAA,EAnElD,CAmEkD,EAAA,KAAA,CAAA,EAlEvD,UAkEuD,CAlE5C,QAkE4C,CAlEnC,CAkEmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAjE7D,OAiE6D,CAjErD,OAiEqD,CAjE7C,UAiE6C,CAjElC,QAiEkC,CAjEzB,CAiEyB,CAAA,CAAA,CAAA,CAAA;EAAM;AAAP;AAgChE;;;;;EAKsD,SAAe,UAAA,CAAA,UAAA,MA7FhC,QA6FgC,CAAA,CAAA,KAAA,EAAA,MAAA,EAAA,WAAA,EA3FtD,CA2FsD,EAAA,KAAA,CAAA,EAzFhE,UAyFgE,CAzFrD,QAyFqD,CAzF5C,CAyF4C,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,GAAA,EAAA,MAAA,EAAA,KAAA,EAtFzD,YAsFyD,EAAA,GArF3D,OAqF2D,CArFnD,UAqFmD,CArFxC,QAqFwC,CArF/B,CAqF+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EApFjE,OAoFiE,CApFzD,OAoFyD,CApFjD,UAoFiD,CApFtC,QAoFsC,CApF7B,CAoF6B,CAAA,CAAA,CAAA,EAAA,CAAA;EAAM;AAAP;AAMpE;;;;AAKI;gCAtF2B,iBACnB,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BT,kFAKA,gBAAgB,aAAa,OAAO,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgCrD;SAKW;WAAgB;MAAa;MAAS,QAAQ;;;;;KAMzD,sBAAsB;;;;aAK/B"}
|
package/dist/Factory.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-
|
|
1
|
+
import "./faker-zVCm31nU.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-CUM2767q.cjs";
|
|
3
3
|
export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-
|
|
1
|
+
import { FakerFactory } from "./faker-zVCm31nU.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-CUM2767q.cjs";
|
|
3
3
|
import { ControlledTransaction, Insertable, Kysely, Selectable } from "kysely";
|
|
4
4
|
|
|
5
5
|
//#region src/KyselyFactory.d.ts
|
|
@@ -225,4 +225,4 @@ declare class KyselyFactory<DB, Builders extends Record<string, any>, Seeds exte
|
|
|
225
225
|
//# sourceMappingURL=KyselyFactory.d.ts.map
|
|
226
226
|
//#endregion
|
|
227
227
|
export { KyselyFactory };
|
|
228
|
-
//# sourceMappingURL=KyselyFactory-
|
|
228
|
+
//# sourceMappingURL=KyselyFactory-OMwcuAX_.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KyselyFactory-
|
|
1
|
+
{"version":3,"file":"KyselyFactory-OMwcuAX_.d.cts","names":[],"sources":["../src/KyselyFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GK,cA5GQ,aA4GR,CAAA,EAAA,EAAA,iBA1Ga,MA0Gb,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cAzGU,MAyGV,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAxGK,OAwGL,CAxGa,QAwGb,EAxGuB,KAwGvB,CAAA,CAAA;EAAO,QACoB,QAAA;EAAE,QAAC,KAAA;EAAS,QAAvB,EAAA;EAAU;;;;;;;;;;;;;;;;;;;;;EAwJf,OACK,UAAA,CAAA,aA5OoB,WA4OpB,CAAA,CAAA,MAAA,EA5OyC,IA4OzC,CAAA,EA5OgD,IA4OhD;EAAQ;;;;;;;EAClB,WACuB,CAAA,QAAA,EAlOd,QAkOc,EAAA,KAAA,EAjOjB,KAiOiB,EAAA,EAAA,EAhOpB,MAgOoB,CAhOb,EAgOa,CAAA,GAhOP,qBAgOO,CAhOe,EAgOf,EAAA,EAAA,CAAA;EAAQ;;;;;;;;;;;;;;;;;;;;;;;AApQzB;;;;;;;;;;;;;;;;;;;;;;;;mDA0FS,2BACV,QAAQ,WAAW,GAAG,eAAe,QAClD,WAAW,GAAG,sCAGN,WAAW,GAAG,oBAEhB;WAEC;aACE;QACL,OAAO;WACJ;QAEL,QAAQ,WAAW,GAAG,eACtB,QAAQ,QAAQ,WAAW,GAAG,8CAG1B,gBACE,aACL,OAAO,YACJ,iBACH,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAuEgB,uBACf,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAqEN,sCAEnB,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;6BACN,sCAEnB,+BAGL,iBACH,WAAW,SAAS,SAAS,QAAQ,WAAW,SAAS,UAC5D,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAsDlB,iBACV,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM"}
|
package/dist/KyselyFactory.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./faker-
|
|
2
|
-
import "./Factory-
|
|
3
|
-
import { KyselyFactory } from "./KyselyFactory-
|
|
1
|
+
import "./faker-zVCm31nU.cjs";
|
|
2
|
+
import "./Factory-CUM2767q.cjs";
|
|
3
|
+
import { KyselyFactory } from "./KyselyFactory-OMwcuAX_.cjs";
|
|
4
4
|
export { KyselyFactory };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-
|
|
1
|
+
import { FakerFactory } from "./faker-zVCm31nU.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-CUM2767q.cjs";
|
|
3
3
|
import { Knex } from "knex";
|
|
4
4
|
import { Model } from "objection";
|
|
5
5
|
|
|
@@ -238,4 +238,4 @@ declare class ObjectionFactory<Builders extends Record<string, any>, Seeds exten
|
|
|
238
238
|
//# sourceMappingURL=ObjectionFactory.d.ts.map
|
|
239
239
|
//#endregion
|
|
240
240
|
export { ObjectionFactory };
|
|
241
|
-
//# sourceMappingURL=ObjectionFactory-
|
|
241
|
+
//# sourceMappingURL=ObjectionFactory-DvmZVHhe.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectionFactory-
|
|
1
|
+
{"version":3,"file":"ObjectionFactory-DvmZVHhe.d.cts","names":[],"sources":["../src/ObjectionFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Gc,cA1GD,gBA0GC,CAAA,iBAzGI,MAyGJ,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cAxGC,MAwGD,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAvGJ,OAuGI,CAvGI,QAuGJ,EAvGc,KAuGd,CAAA,CAAA;EAAM,QAAd,QAAA;EAAO,QAqDO,KAAA;EAAQ,QACX,EAAA;EAAK;;;;;;;;;;;;;;;;;;;;;EA2GX,OACuB,UAAA,CAAA,aAnPO,WAmPP,CAAA,CAAA,MAAA,EAnP4B,IAmP5B,CAAA,EAnPmC,IAmPnC;EAAQ;;;;;;;;;;;;;;;;;;;AAzQzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAmFO,qBACR,QAAQ,aAAa,WAAW,QAAQ,aAAa,kCAE1D,aAAa,qBAEV;WAEJ;aACE;QACL;WACG;QAEL,QAAQ,aAAa,WACrB,QAAQ,QAAQ,aAAa,0CAGzB,gBACE,aACL,aACG,iBACH,QAAQ;;;;;;;;wBAqDM,iBACH,WACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAoCgB,uBACf,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA+DN,sCAEnB,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;6BACN,sCAEnB,+BACe,iBAAiB,WAAW,SAAS,SAC/D,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAgFlB,iBACV,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./faker-
|
|
2
|
-
import "./Factory-
|
|
3
|
-
import { ObjectionFactory } from "./ObjectionFactory-
|
|
1
|
+
import "./faker-zVCm31nU.cjs";
|
|
2
|
+
import "./Factory-CUM2767q.cjs";
|
|
3
|
+
import { ObjectionFactory } from "./ObjectionFactory-DvmZVHhe.cjs";
|
|
4
4
|
export { ObjectionFactory };
|
package/dist/{PostgresKyselyMigrator-CTNftoZK.d.cts → PostgresKyselyMigrator-B2M6Gjvv.d.cts}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PostgresMigrator } from "./PostgresMigrator-CeYy-eHF.cjs";
|
|
2
|
-
import { Kysely
|
|
2
|
+
import { Kysely } from "kysely";
|
|
3
|
+
import { MigrationProvider } from "kysely/migration";
|
|
3
4
|
|
|
4
5
|
//#region src/PostgresKyselyMigrator.d.ts
|
|
5
6
|
|
|
@@ -80,4 +81,4 @@ declare class PostgresKyselyMigrator extends PostgresMigrator {
|
|
|
80
81
|
//# sourceMappingURL=PostgresKyselyMigrator.d.ts.map
|
|
81
82
|
//#endregion
|
|
82
83
|
export { PostgresKyselyMigrator };
|
|
83
|
-
//# sourceMappingURL=PostgresKyselyMigrator-
|
|
84
|
+
//# sourceMappingURL=PostgresKyselyMigrator-B2M6Gjvv.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresKyselyMigrator-B2M6Gjvv.d.cts","names":[],"sources":["../src/PostgresKyselyMigrator.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA2DA;;;;;;;AAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA/C,sBAAA,SAA+B,gBAAA;;;;;;;;;;;;;QAarC;cACM;mCACqB;;;;;;;;;aAahB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
2
|
const require_PostgresMigrator = require('./PostgresMigrator-M9jpzOvN.cjs');
|
|
3
|
-
const
|
|
3
|
+
const kysely_migration = require_chunk.__toESM(require("kysely/migration"));
|
|
4
4
|
|
|
5
5
|
//#region src/PostgresKyselyMigrator.ts
|
|
6
6
|
/**
|
|
@@ -77,7 +77,7 @@ var PostgresKyselyMigrator = class extends require_PostgresMigrator.PostgresMigr
|
|
|
77
77
|
* @returns Promise that resolves when all migrations are applied
|
|
78
78
|
*/
|
|
79
79
|
async migrate() {
|
|
80
|
-
const migrator = new
|
|
80
|
+
const migrator = new kysely_migration.Migrator({
|
|
81
81
|
db: this.options.db,
|
|
82
82
|
provider: this.options.provider
|
|
83
83
|
});
|
|
@@ -98,4 +98,4 @@ Object.defineProperty(exports, 'PostgresKyselyMigrator', {
|
|
|
98
98
|
return PostgresKyselyMigrator;
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
-
//# sourceMappingURL=PostgresKyselyMigrator-
|
|
101
|
+
//# sourceMappingURL=PostgresKyselyMigrator-BGBxjnFv.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresKyselyMigrator-BGBxjnFv.cjs","names":["PostgresMigrator","options: {\n\t\t\turi: string;\n\t\t\tdb: Kysely<any>;\n\t\t\tprovider: MigrationProvider;\n\t\t\tafterCreate?: (uri: string) => Promise<void>;\n\t\t}","Migrator"],"sources":["../src/PostgresKyselyMigrator.ts"],"sourcesContent":["import type { Kysely } from 'kysely';\n// `Migrator` and the `MigrationProvider` type moved from the root barrel ('kysely')\n// to the 'kysely/migration' subpath in kysely 0.29+.\nimport { type MigrationProvider, Migrator } from 'kysely/migration';\nimport { PostgresMigrator } from './PostgresMigrator';\n\n/**\n * Default logger instance for migration operations.\n */\nconst logger = console;\n\n/**\n * PostgreSQL migrator implementation for Kysely ORM.\n * Extends PostgresMigrator to provide Kysely-specific migration functionality.\n * Automatically creates test databases and applies migrations for testing environments.\n *\n * @example\n * ```typescript\n * import { FileMigrationProvider } from 'kysely';\n * import { PostgresKyselyMigrator } from '@geekmidas/testkit';\n *\n * // Create migration provider\n * const provider = new FileMigrationProvider({\n * fs: require('fs'),\n * path: require('path'),\n * migrationFolder: path.join(__dirname, 'migrations')\n * });\n *\n * // Create Kysely instance\n * const db = new Kysely<Database>({\n * dialect: new PostgresDialect({\n * pool: new Pool({ connectionString: uri })\n * })\n * });\n *\n * // Create and use migrator\n * const migrator = new PostgresKyselyMigrator({\n * uri: 'postgresql://localhost:5432/test_db',\n * db,\n * provider\n * });\n *\n * const cleanup = await migrator.start();\n * // Run tests...\n * await cleanup();\n *\n * // With afterCreate hook to create per-app users\n * import { runInitScript } from '@geekmidas/testkit/postgres';\n *\n * const migrator = new PostgresKyselyMigrator({\n * uri: 'postgresql://localhost:5432/test_db',\n * db,\n * provider,\n * afterCreate: async (uri) => {\n * await runInitScript('docker/postgres/init.sh', uri, env);\n * },\n * });\n * ```\n */\nexport class PostgresKyselyMigrator extends PostgresMigrator {\n\t/**\n\t * Creates a new PostgresKyselyMigrator instance.\n\t *\n\t * @param options - Configuration options\n\t * @param options.uri - PostgreSQL connection URI\n\t * @param options.db - Kysely database instance\n\t * @param options.provider - Migration provider for locating migration files\n\t * @param options.afterCreate - Optional hook called after database creation but before migrations\n\t */\n\tconstructor(\n\t\tprivate options: {\n\t\t\turi: string;\n\t\t\tdb: Kysely<any>;\n\t\t\tprovider: MigrationProvider;\n\t\t\tafterCreate?: (uri: string) => Promise<void>;\n\t\t},\n\t) {\n\t\tsuper(options.uri, options.afterCreate);\n\t}\n\n\t/**\n\t * Executes Kysely migrations to the latest version.\n\t * Implements the abstract migrate() method from PostgresMigrator.\n\t *\n\t * @throws Error if migrations fail to apply\n\t * @returns Promise that resolves when all migrations are applied\n\t */\n\tasync migrate(): Promise<void> {\n\t\tconst migrator = new Migrator({\n\t\t\tdb: this.options.db,\n\t\t\tprovider: this.options.provider,\n\t\t});\n\t\tconst migrations = await migrator.migrateToLatest();\n\n\t\tif (migrations.error) {\n\t\t\tlogger.error(migrations.error, `Failed to apply migrations`);\n\t\t\tthrow migrations.error;\n\t\t}\n\n\t\tawait this.options.db.destroy();\n\n\t\tlogger.log(`Applied ${migrations.results?.length} migrations successfully`);\n\t}\n}\n"],"mappings":";;;;;;;;AASA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDf,IAAa,yBAAb,cAA4CA,0CAAiB;;;;;;;;;;CAU5D,YACSC,SAMP;AACD,QAAM,QAAQ,KAAK,QAAQ,YAAY;EAP/B;CAQR;;;;;;;;CASD,MAAM,UAAyB;EAC9B,MAAM,WAAW,IAAIC,0BAAS;GAC7B,IAAI,KAAK,QAAQ;GACjB,UAAU,KAAK,QAAQ;EACvB;EACD,MAAM,aAAa,MAAM,SAAS,iBAAiB;AAEnD,MAAI,WAAW,OAAO;AACrB,UAAO,MAAM,WAAW,QAAQ,4BAA4B;AAC5D,SAAM,WAAW;EACjB;AAED,QAAM,KAAK,QAAQ,GAAG,SAAS;AAE/B,SAAO,KAAK,UAAU,WAAW,SAAS,OAAO,0BAA0B;CAC3E;AACD"}
|
package/dist/{PostgresKyselyMigrator-x0uvWs3U.d.mts → PostgresKyselyMigrator-CvwXycJE.d.mts}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PostgresMigrator } from "./PostgresMigrator-C_QQ6q35.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { MigrationProvider } from "kysely/migration";
|
|
3
|
+
import { Kysely } from "kysely";
|
|
3
4
|
|
|
4
5
|
//#region src/PostgresKyselyMigrator.d.ts
|
|
5
6
|
|
|
@@ -80,4 +81,4 @@ declare class PostgresKyselyMigrator extends PostgresMigrator {
|
|
|
80
81
|
//# sourceMappingURL=PostgresKyselyMigrator.d.ts.map
|
|
81
82
|
//#endregion
|
|
82
83
|
export { PostgresKyselyMigrator };
|
|
83
|
-
//# sourceMappingURL=PostgresKyselyMigrator-
|
|
84
|
+
//# sourceMappingURL=PostgresKyselyMigrator-CvwXycJE.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresKyselyMigrator-CvwXycJE.d.mts","names":[],"sources":["../src/PostgresKyselyMigrator.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA2DA;;;;;;;AAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA/C,sBAAA,SAA+B,gBAAA;;;;;;;;;;;;;QAarC;cACM;mCACqB;;;;;;;;;aAahB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PostgresMigrator } from "./PostgresMigrator-DVAY04qN.mjs";
|
|
2
|
-
import { Migrator } from "kysely";
|
|
2
|
+
import { Migrator } from "kysely/migration";
|
|
3
3
|
|
|
4
4
|
//#region src/PostgresKyselyMigrator.ts
|
|
5
5
|
/**
|
|
@@ -92,4 +92,4 @@ var PostgresKyselyMigrator = class extends PostgresMigrator {
|
|
|
92
92
|
|
|
93
93
|
//#endregion
|
|
94
94
|
export { PostgresKyselyMigrator };
|
|
95
|
-
//# sourceMappingURL=PostgresKyselyMigrator-
|
|
95
|
+
//# sourceMappingURL=PostgresKyselyMigrator-PI0QhvB1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresKyselyMigrator-PI0QhvB1.mjs","names":["options: {\n\t\t\turi: string;\n\t\t\tdb: Kysely<any>;\n\t\t\tprovider: MigrationProvider;\n\t\t\tafterCreate?: (uri: string) => Promise<void>;\n\t\t}"],"sources":["../src/PostgresKyselyMigrator.ts"],"sourcesContent":["import type { Kysely } from 'kysely';\n// `Migrator` and the `MigrationProvider` type moved from the root barrel ('kysely')\n// to the 'kysely/migration' subpath in kysely 0.29+.\nimport { type MigrationProvider, Migrator } from 'kysely/migration';\nimport { PostgresMigrator } from './PostgresMigrator';\n\n/**\n * Default logger instance for migration operations.\n */\nconst logger = console;\n\n/**\n * PostgreSQL migrator implementation for Kysely ORM.\n * Extends PostgresMigrator to provide Kysely-specific migration functionality.\n * Automatically creates test databases and applies migrations for testing environments.\n *\n * @example\n * ```typescript\n * import { FileMigrationProvider } from 'kysely';\n * import { PostgresKyselyMigrator } from '@geekmidas/testkit';\n *\n * // Create migration provider\n * const provider = new FileMigrationProvider({\n * fs: require('fs'),\n * path: require('path'),\n * migrationFolder: path.join(__dirname, 'migrations')\n * });\n *\n * // Create Kysely instance\n * const db = new Kysely<Database>({\n * dialect: new PostgresDialect({\n * pool: new Pool({ connectionString: uri })\n * })\n * });\n *\n * // Create and use migrator\n * const migrator = new PostgresKyselyMigrator({\n * uri: 'postgresql://localhost:5432/test_db',\n * db,\n * provider\n * });\n *\n * const cleanup = await migrator.start();\n * // Run tests...\n * await cleanup();\n *\n * // With afterCreate hook to create per-app users\n * import { runInitScript } from '@geekmidas/testkit/postgres';\n *\n * const migrator = new PostgresKyselyMigrator({\n * uri: 'postgresql://localhost:5432/test_db',\n * db,\n * provider,\n * afterCreate: async (uri) => {\n * await runInitScript('docker/postgres/init.sh', uri, env);\n * },\n * });\n * ```\n */\nexport class PostgresKyselyMigrator extends PostgresMigrator {\n\t/**\n\t * Creates a new PostgresKyselyMigrator instance.\n\t *\n\t * @param options - Configuration options\n\t * @param options.uri - PostgreSQL connection URI\n\t * @param options.db - Kysely database instance\n\t * @param options.provider - Migration provider for locating migration files\n\t * @param options.afterCreate - Optional hook called after database creation but before migrations\n\t */\n\tconstructor(\n\t\tprivate options: {\n\t\t\turi: string;\n\t\t\tdb: Kysely<any>;\n\t\t\tprovider: MigrationProvider;\n\t\t\tafterCreate?: (uri: string) => Promise<void>;\n\t\t},\n\t) {\n\t\tsuper(options.uri, options.afterCreate);\n\t}\n\n\t/**\n\t * Executes Kysely migrations to the latest version.\n\t * Implements the abstract migrate() method from PostgresMigrator.\n\t *\n\t * @throws Error if migrations fail to apply\n\t * @returns Promise that resolves when all migrations are applied\n\t */\n\tasync migrate(): Promise<void> {\n\t\tconst migrator = new Migrator({\n\t\t\tdb: this.options.db,\n\t\t\tprovider: this.options.provider,\n\t\t});\n\t\tconst migrations = await migrator.migrateToLatest();\n\n\t\tif (migrations.error) {\n\t\t\tlogger.error(migrations.error, `Failed to apply migrations`);\n\t\t\tthrow migrations.error;\n\t\t}\n\n\t\tawait this.options.db.destroy();\n\n\t\tlogger.log(`Applied ${migrations.results?.length} migrations successfully`);\n\t}\n}\n"],"mappings":";;;;;;;AASA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDf,IAAa,yBAAb,cAA4C,iBAAiB;;;;;;;;;;CAU5D,YACSA,SAMP;AACD,QAAM,QAAQ,KAAK,QAAQ,YAAY;EAP/B;CAQR;;;;;;;;CASD,MAAM,UAAyB;EAC9B,MAAM,WAAW,IAAI,SAAS;GAC7B,IAAI,KAAK,QAAQ;GACjB,UAAU,KAAK,QAAQ;EACvB;EACD,MAAM,aAAa,MAAM,SAAS,iBAAiB;AAEnD,MAAI,WAAW,OAAO;AACrB,UAAO,MAAM,WAAW,QAAQ,4BAA4B;AAC5D,SAAM,WAAW;EACjB;AAED,QAAM,KAAK,QAAQ,GAAG,SAAS;AAE/B,SAAO,KAAK,UAAU,WAAW,SAAS,OAAO,0BAA0B;CAC3E;AACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
require('./PostgresMigrator-M9jpzOvN.cjs');
|
|
2
|
-
const require_PostgresKyselyMigrator = require('./PostgresKyselyMigrator-
|
|
2
|
+
const require_PostgresKyselyMigrator = require('./PostgresKyselyMigrator-BGBxjnFv.cjs');
|
|
3
3
|
|
|
4
4
|
exports.PostgresKyselyMigrator = require_PostgresKyselyMigrator.PostgresKyselyMigrator;
|
package/dist/better-auth.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_auth_adapters6 from "better-auth/adapters";
|
|
2
2
|
import { DBAdapterDebugLogOption } from "better-auth/adapters";
|
|
3
3
|
|
|
4
4
|
//#region src/better-auth.d.ts
|
|
@@ -7,7 +7,7 @@ interface MemoryAdapterConfig {
|
|
|
7
7
|
usePlural?: boolean;
|
|
8
8
|
initialData?: Record<string, any[]>;
|
|
9
9
|
}
|
|
10
|
-
declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) =>
|
|
10
|
+
declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) => better_auth_adapters6.AdapterFactory & {
|
|
11
11
|
clear: () => void;
|
|
12
12
|
getAllData: () => Record<string, any[]>;
|
|
13
13
|
getStore: () => Map<any, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vitest2 from "vitest";
|
|
2
2
|
|
|
3
3
|
//#region src/os/directory.d.ts
|
|
4
|
-
declare const itWithDir:
|
|
4
|
+
declare const itWithDir: vitest2.TestAPI<{
|
|
5
5
|
dir: string;
|
|
6
6
|
}>;
|
|
7
7
|
interface DirectoryFixtures {
|
|
@@ -10,4 +10,4 @@ interface DirectoryFixtures {
|
|
|
10
10
|
//# sourceMappingURL=directory.d.ts.map
|
|
11
11
|
//#endregion
|
|
12
12
|
export { DirectoryFixtures, itWithDir };
|
|
13
|
-
//# sourceMappingURL=directory-
|
|
13
|
+
//# sourceMappingURL=directory-Bpz5c5pj.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory-
|
|
1
|
+
{"version":3,"file":"directory-Bpz5c5pj.d.cts","names":[],"sources":["../src/os/directory.ts"],"sourcesContent":[],"mappings":";;;cAMa,WAeX,OAAA,CAfoB;;;AAAT,UAiBI,iBAAA,CAjBK;EAiBL,GAAA,EAAA,MAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _faker_js_faker5 from "@faker-js/faker";
|
|
2
2
|
|
|
3
3
|
//#region src/faker.d.ts
|
|
4
4
|
|
|
@@ -134,7 +134,7 @@ declare function coordinateOutsideRadius(center: Coordinate, minRadiusMeters: nu
|
|
|
134
134
|
* const productPrice = faker.price();
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
|
-
declare const faker: Readonly<
|
|
137
|
+
declare const faker: Readonly<_faker_js_faker5.Faker & {
|
|
138
138
|
timestamps: typeof timestamps;
|
|
139
139
|
identifier: typeof identifier;
|
|
140
140
|
sequence: typeof sequence;
|
|
@@ -163,4 +163,4 @@ type Timestamps = {
|
|
|
163
163
|
type FakerFactory = typeof faker;
|
|
164
164
|
//#endregion
|
|
165
165
|
export { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
|
|
166
|
-
//# sourceMappingURL=faker-
|
|
166
|
+
//# sourceMappingURL=faker-zVCm31nU.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faker-
|
|
1
|
+
{"version":3,"file":"faker-zVCm31nU.d.cts","names":[],"sources":["../src/faker.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkFA;AA2BA;AAmCA;AA2BA;AA0BA;AAEC;AAca;AASd;;;;AAGa;AA4BZ;;;;AAMY;AA2DA,iBA5OG,UAAA,CAAA,CAyPf,EAzP6B,UAyP7B;;;;;;;;;;;;AAbiB;AAmBlB;;AAEY,iBAtOI,UAAA,CAsOJ,MAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;AAEI;AAOhB;;;;;;;;;;;;;;;;;;iBA5MgB,QAAA;;;;;;;;;;;;;;;;;;;iBA2BA,aAAA;;;;;;;;;;;;;;;;;;iBA0BA,iBAAA,CAAA;;;;;;;;;;;;;iBAgBP,KAAA,CAAA;KAIJ,UAAA;;;;iBAKW,kBAAA,SACP,6BAEN;iBA8BM,uBAAA,SACA,+DAGN;;;;;;;;;;;;;;;;;;;;cA2DU,OAAK,SAajB,gBAAA,CAbiB,KAAA;qBAAA;;;;;;;;;;;;;;;KAmBN,UAAA;;aAEA;;aAEA;;;;;;KAOA,YAAA,UAAsB"}
|
package/dist/faker.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-
|
|
1
|
+
import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-zVCm31nU.cjs";
|
|
2
2
|
export { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
|
package/dist/helpers.cjs
CHANGED
package/dist/helpers.mjs
CHANGED
package/dist/kysely.cjs
CHANGED
|
@@ -2,7 +2,7 @@ require('./Factory-BhjUOBWN.cjs');
|
|
|
2
2
|
const require_faker = require('./faker-B14IEMIN.cjs');
|
|
3
3
|
const require_KyselyFactory = require('./KyselyFactory-BFqVIn_0.cjs');
|
|
4
4
|
require('./PostgresMigrator-M9jpzOvN.cjs');
|
|
5
|
-
const require_PostgresKyselyMigrator = require('./PostgresKyselyMigrator-
|
|
5
|
+
const require_PostgresKyselyMigrator = require('./PostgresKyselyMigrator-BGBxjnFv.cjs');
|
|
6
6
|
const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CtZaOUjH.cjs');
|
|
7
7
|
const require_VitestKyselyTransactionIsolator = require('./VitestKyselyTransactionIsolator-0CqOsuc9.cjs');
|
|
8
8
|
|
package/dist/kysely.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FakerFactory, faker } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, FactorySeed } from "./Factory-
|
|
3
|
-
import { KyselyFactory } from "./KyselyFactory-
|
|
1
|
+
import { FakerFactory, faker } from "./faker-zVCm31nU.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, FactorySeed } from "./Factory-CUM2767q.cjs";
|
|
3
|
+
import { KyselyFactory } from "./KyselyFactory-OMwcuAX_.cjs";
|
|
4
4
|
import "./PostgresMigrator-CeYy-eHF.cjs";
|
|
5
|
-
import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-
|
|
5
|
+
import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-B2M6Gjvv.cjs";
|
|
6
6
|
import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-CSroc7Df.cjs";
|
|
7
7
|
import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-CduJlHoT.cjs";
|
|
8
8
|
import { Kysely, Transaction } from "kysely";
|
package/dist/kysely.d.mts
CHANGED
|
@@ -2,11 +2,11 @@ import { FakerFactory, faker } from "./faker-DHh7xs4u.mjs";
|
|
|
2
2
|
import { ExtractSeedAttrs, FactorySeed } from "./Factory-SFupxRC2.mjs";
|
|
3
3
|
import { KyselyFactory } from "./KyselyFactory-vAxYodck.mjs";
|
|
4
4
|
import "./PostgresMigrator-C_QQ6q35.mjs";
|
|
5
|
-
import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-
|
|
5
|
+
import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-CvwXycJE.mjs";
|
|
6
6
|
import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-BNWJqh9f.mjs";
|
|
7
7
|
import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-Cswnnj0k.mjs";
|
|
8
|
-
import { Kysely, Transaction } from "kysely";
|
|
9
8
|
import { TestAPI } from "vitest";
|
|
9
|
+
import { Kysely, Transaction } from "kysely";
|
|
10
10
|
|
|
11
11
|
//#region src/kysely.d.ts
|
|
12
12
|
|
package/dist/kysely.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import "./Factory-BFVnMMCC.mjs";
|
|
|
2
2
|
import { faker } from "./faker-BGKYFoCT.mjs";
|
|
3
3
|
import { KyselyFactory } from "./KyselyFactory-DMswpwji.mjs";
|
|
4
4
|
import "./PostgresMigrator-DVAY04qN.mjs";
|
|
5
|
-
import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-
|
|
5
|
+
import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-PI0QhvB1.mjs";
|
|
6
6
|
import { IsolationLevel, extendWithFixtures } from "./VitestTransactionIsolator-D6ZxLWys.mjs";
|
|
7
7
|
import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-CfSMOFlN.mjs";
|
|
8
8
|
|
package/dist/objection.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FakerFactory, faker } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, FactorySeed } from "./Factory-
|
|
3
|
-
import { ObjectionFactory } from "./ObjectionFactory-
|
|
1
|
+
import { FakerFactory, faker } from "./faker-zVCm31nU.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, FactorySeed } from "./Factory-CUM2767q.cjs";
|
|
3
|
+
import { ObjectionFactory } from "./ObjectionFactory-DvmZVHhe.cjs";
|
|
4
4
|
import "./PostgresMigrator-CeYy-eHF.cjs";
|
|
5
5
|
import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-DHVC9h_P.cjs";
|
|
6
6
|
import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-CSroc7Df.cjs";
|
package/dist/os/directory.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DirectoryFixtures, itWithDir } from "../directory-
|
|
1
|
+
import { DirectoryFixtures, itWithDir } from "../directory-Bpz5c5pj.cjs";
|
|
2
2
|
export { DirectoryFixtures, itWithDir };
|
package/dist/os/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { itWithDir } from "../directory-
|
|
1
|
+
import { itWithDir } from "../directory-Bpz5c5pj.cjs";
|
|
2
2
|
export { itWithDir };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/testkit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -120,9 +120,9 @@
|
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
122
|
"@types/pg": "~8.15.4",
|
|
123
|
-
"@geekmidas/
|
|
124
|
-
"@geekmidas/
|
|
125
|
-
"@geekmidas/
|
|
123
|
+
"@geekmidas/services": "^2.0.1",
|
|
124
|
+
"@geekmidas/envkit": "^1.1.1",
|
|
125
|
+
"@geekmidas/logger": "^1.0.3"
|
|
126
126
|
},
|
|
127
127
|
"repository": {
|
|
128
128
|
"type": "git",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
|
-
"kysely": "~0.
|
|
136
|
+
"kysely": "~0.29.4",
|
|
137
137
|
"pg": "~8.16.3",
|
|
138
138
|
"knex": "~3.1.0",
|
|
139
139
|
"objection": "~3.1.5",
|
|
@@ -141,9 +141,9 @@
|
|
|
141
141
|
"vitest": "~3.2.4",
|
|
142
142
|
"@types/aws-lambda": ">=8.10.92",
|
|
143
143
|
"better-auth": ">=1.3.34",
|
|
144
|
-
"@geekmidas/envkit": "^1.1.
|
|
145
|
-
"@geekmidas/logger": "^1.0.
|
|
146
|
-
"@geekmidas/services": "^2.0.
|
|
144
|
+
"@geekmidas/envkit": "^1.1.1",
|
|
145
|
+
"@geekmidas/logger": "^1.0.3",
|
|
146
|
+
"@geekmidas/services": "^2.0.1"
|
|
147
147
|
},
|
|
148
148
|
"peerDependenciesMeta": {
|
|
149
149
|
"@geekmidas/envkit": {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
// `Migrator` and the `MigrationProvider` type moved from the root barrel ('kysely')
|
|
3
|
+
// to the 'kysely/migration' subpath in kysely 0.29+.
|
|
4
|
+
import { type MigrationProvider, Migrator } from 'kysely/migration';
|
|
2
5
|
import { PostgresMigrator } from './PostgresMigrator';
|
|
3
6
|
|
|
4
7
|
/**
|
package/test/helpers.ts
CHANGED
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
CamelCasePlugin,
|
|
5
5
|
type ControlledTransaction,
|
|
6
6
|
Kysely,
|
|
7
|
-
type Migrator,
|
|
8
7
|
PostgresDialect,
|
|
9
8
|
sql,
|
|
10
9
|
} from 'kysely';
|
|
10
|
+
// `Migrator` moved to the 'kysely/migration' subpath in kysely 0.29+.
|
|
11
|
+
import type { Migrator } from 'kysely/migration';
|
|
11
12
|
import pg from 'pg';
|
|
12
13
|
import { TEST_DATABASE_CONFIG } from './globalSetup';
|
|
13
14
|
|
|
@@ -254,7 +255,7 @@ export function createTestMigrator(
|
|
|
254
255
|
}
|
|
255
256
|
>,
|
|
256
257
|
): Migrator {
|
|
257
|
-
const { Migrator } = require('kysely');
|
|
258
|
+
const { Migrator } = require('kysely/migration');
|
|
258
259
|
|
|
259
260
|
return new Migrator({
|
|
260
261
|
db,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresKyselyMigrator-BIKd7G5C.mjs","names":["options: {\n\t\t\turi: string;\n\t\t\tdb: Kysely<any>;\n\t\t\tprovider: MigrationProvider;\n\t\t\tafterCreate?: (uri: string) => Promise<void>;\n\t\t}"],"sources":["../src/PostgresKyselyMigrator.ts"],"sourcesContent":["import { type Kysely, type MigrationProvider, Migrator } from 'kysely';\nimport { PostgresMigrator } from './PostgresMigrator';\n\n/**\n * Default logger instance for migration operations.\n */\nconst logger = console;\n\n/**\n * PostgreSQL migrator implementation for Kysely ORM.\n * Extends PostgresMigrator to provide Kysely-specific migration functionality.\n * Automatically creates test databases and applies migrations for testing environments.\n *\n * @example\n * ```typescript\n * import { FileMigrationProvider } from 'kysely';\n * import { PostgresKyselyMigrator } from '@geekmidas/testkit';\n *\n * // Create migration provider\n * const provider = new FileMigrationProvider({\n * fs: require('fs'),\n * path: require('path'),\n * migrationFolder: path.join(__dirname, 'migrations')\n * });\n *\n * // Create Kysely instance\n * const db = new Kysely<Database>({\n * dialect: new PostgresDialect({\n * pool: new Pool({ connectionString: uri })\n * })\n * });\n *\n * // Create and use migrator\n * const migrator = new PostgresKyselyMigrator({\n * uri: 'postgresql://localhost:5432/test_db',\n * db,\n * provider\n * });\n *\n * const cleanup = await migrator.start();\n * // Run tests...\n * await cleanup();\n *\n * // With afterCreate hook to create per-app users\n * import { runInitScript } from '@geekmidas/testkit/postgres';\n *\n * const migrator = new PostgresKyselyMigrator({\n * uri: 'postgresql://localhost:5432/test_db',\n * db,\n * provider,\n * afterCreate: async (uri) => {\n * await runInitScript('docker/postgres/init.sh', uri, env);\n * },\n * });\n * ```\n */\nexport class PostgresKyselyMigrator extends PostgresMigrator {\n\t/**\n\t * Creates a new PostgresKyselyMigrator instance.\n\t *\n\t * @param options - Configuration options\n\t * @param options.uri - PostgreSQL connection URI\n\t * @param options.db - Kysely database instance\n\t * @param options.provider - Migration provider for locating migration files\n\t * @param options.afterCreate - Optional hook called after database creation but before migrations\n\t */\n\tconstructor(\n\t\tprivate options: {\n\t\t\turi: string;\n\t\t\tdb: Kysely<any>;\n\t\t\tprovider: MigrationProvider;\n\t\t\tafterCreate?: (uri: string) => Promise<void>;\n\t\t},\n\t) {\n\t\tsuper(options.uri, options.afterCreate);\n\t}\n\n\t/**\n\t * Executes Kysely migrations to the latest version.\n\t * Implements the abstract migrate() method from PostgresMigrator.\n\t *\n\t * @throws Error if migrations fail to apply\n\t * @returns Promise that resolves when all migrations are applied\n\t */\n\tasync migrate(): Promise<void> {\n\t\tconst migrator = new Migrator({\n\t\t\tdb: this.options.db,\n\t\t\tprovider: this.options.provider,\n\t\t});\n\t\tconst migrations = await migrator.migrateToLatest();\n\n\t\tif (migrations.error) {\n\t\t\tlogger.error(migrations.error, `Failed to apply migrations`);\n\t\t\tthrow migrations.error;\n\t\t}\n\n\t\tawait this.options.db.destroy();\n\n\t\tlogger.log(`Applied ${migrations.results?.length} migrations successfully`);\n\t}\n}\n"],"mappings":";;;;;;;AAMA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDf,IAAa,yBAAb,cAA4C,iBAAiB;;;;;;;;;;CAU5D,YACSA,SAMP;AACD,QAAM,QAAQ,KAAK,QAAQ,YAAY;EAP/B;CAQR;;;;;;;;CASD,MAAM,UAAyB;EAC9B,MAAM,WAAW,IAAI,SAAS;GAC7B,IAAI,KAAK,QAAQ;GACjB,UAAU,KAAK,QAAQ;EACvB;EACD,MAAM,aAAa,MAAM,SAAS,iBAAiB;AAEnD,MAAI,WAAW,OAAO;AACrB,UAAO,MAAM,WAAW,QAAQ,4BAA4B;AAC5D,SAAM,WAAW;EACjB;AAED,QAAM,KAAK,QAAQ,GAAG,SAAS;AAE/B,SAAO,KAAK,UAAU,WAAW,SAAS,OAAO,0BAA0B;CAC3E;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresKyselyMigrator-CTNftoZK.d.cts","names":[],"sources":["../src/PostgresKyselyMigrator.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwDA;;;;;;;AAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA/C,sBAAA,SAA+B,gBAAA;;;;;;;;;;;;;QAarC;cACM;mCACqB;;;;;;;;;aAahB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresKyselyMigrator-CqNs3qX8.cjs","names":["PostgresMigrator","options: {\n\t\t\turi: string;\n\t\t\tdb: Kysely<any>;\n\t\t\tprovider: MigrationProvider;\n\t\t\tafterCreate?: (uri: string) => Promise<void>;\n\t\t}","Migrator"],"sources":["../src/PostgresKyselyMigrator.ts"],"sourcesContent":["import { type Kysely, type MigrationProvider, Migrator } from 'kysely';\nimport { PostgresMigrator } from './PostgresMigrator';\n\n/**\n * Default logger instance for migration operations.\n */\nconst logger = console;\n\n/**\n * PostgreSQL migrator implementation for Kysely ORM.\n * Extends PostgresMigrator to provide Kysely-specific migration functionality.\n * Automatically creates test databases and applies migrations for testing environments.\n *\n * @example\n * ```typescript\n * import { FileMigrationProvider } from 'kysely';\n * import { PostgresKyselyMigrator } from '@geekmidas/testkit';\n *\n * // Create migration provider\n * const provider = new FileMigrationProvider({\n * fs: require('fs'),\n * path: require('path'),\n * migrationFolder: path.join(__dirname, 'migrations')\n * });\n *\n * // Create Kysely instance\n * const db = new Kysely<Database>({\n * dialect: new PostgresDialect({\n * pool: new Pool({ connectionString: uri })\n * })\n * });\n *\n * // Create and use migrator\n * const migrator = new PostgresKyselyMigrator({\n * uri: 'postgresql://localhost:5432/test_db',\n * db,\n * provider\n * });\n *\n * const cleanup = await migrator.start();\n * // Run tests...\n * await cleanup();\n *\n * // With afterCreate hook to create per-app users\n * import { runInitScript } from '@geekmidas/testkit/postgres';\n *\n * const migrator = new PostgresKyselyMigrator({\n * uri: 'postgresql://localhost:5432/test_db',\n * db,\n * provider,\n * afterCreate: async (uri) => {\n * await runInitScript('docker/postgres/init.sh', uri, env);\n * },\n * });\n * ```\n */\nexport class PostgresKyselyMigrator extends PostgresMigrator {\n\t/**\n\t * Creates a new PostgresKyselyMigrator instance.\n\t *\n\t * @param options - Configuration options\n\t * @param options.uri - PostgreSQL connection URI\n\t * @param options.db - Kysely database instance\n\t * @param options.provider - Migration provider for locating migration files\n\t * @param options.afterCreate - Optional hook called after database creation but before migrations\n\t */\n\tconstructor(\n\t\tprivate options: {\n\t\t\turi: string;\n\t\t\tdb: Kysely<any>;\n\t\t\tprovider: MigrationProvider;\n\t\t\tafterCreate?: (uri: string) => Promise<void>;\n\t\t},\n\t) {\n\t\tsuper(options.uri, options.afterCreate);\n\t}\n\n\t/**\n\t * Executes Kysely migrations to the latest version.\n\t * Implements the abstract migrate() method from PostgresMigrator.\n\t *\n\t * @throws Error if migrations fail to apply\n\t * @returns Promise that resolves when all migrations are applied\n\t */\n\tasync migrate(): Promise<void> {\n\t\tconst migrator = new Migrator({\n\t\t\tdb: this.options.db,\n\t\t\tprovider: this.options.provider,\n\t\t});\n\t\tconst migrations = await migrator.migrateToLatest();\n\n\t\tif (migrations.error) {\n\t\t\tlogger.error(migrations.error, `Failed to apply migrations`);\n\t\t\tthrow migrations.error;\n\t\t}\n\n\t\tawait this.options.db.destroy();\n\n\t\tlogger.log(`Applied ${migrations.results?.length} migrations successfully`);\n\t}\n}\n"],"mappings":";;;;;;;;AAMA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDf,IAAa,yBAAb,cAA4CA,0CAAiB;;;;;;;;;;CAU5D,YACSC,SAMP;AACD,QAAM,QAAQ,KAAK,QAAQ,YAAY;EAP/B;CAQR;;;;;;;;CASD,MAAM,UAAyB;EAC9B,MAAM,WAAW,IAAIC,gBAAS;GAC7B,IAAI,KAAK,QAAQ;GACjB,UAAU,KAAK,QAAQ;EACvB;EACD,MAAM,aAAa,MAAM,SAAS,iBAAiB;AAEnD,MAAI,WAAW,OAAO;AACrB,UAAO,MAAM,WAAW,QAAQ,4BAA4B;AAC5D,SAAM,WAAW;EACjB;AAED,QAAM,KAAK,QAAQ,GAAG,SAAS;AAE/B,SAAO,KAAK,UAAU,WAAW,SAAS,OAAO,0BAA0B;CAC3E;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresKyselyMigrator-x0uvWs3U.d.mts","names":[],"sources":["../src/PostgresKyselyMigrator.ts"],"sourcesContent":[],"mappings":";;;;;;;AAwDA;;;;;;;AAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA/C,sBAAA,SAA+B,gBAAA;;;;;;;;;;;;;QAarC;cACM;mCACqB;;;;;;;;;aAahB"}
|