@hg-ts/knex 0.5.22 → 0.5.24

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.
@@ -32,8 +32,8 @@ export class PostgresTestcontainerService {
32
32
  .withDatabase(this.config.database)
33
33
  .withUsername(this.config.user)
34
34
  .withPassword(this.config.password)
35
- .withReuse()
36
- .withExposedPorts({ container: 5432, host: this.config.port });
35
+ .withExposedPorts({ container: 5432, host: this.config.port })
36
+ .withReuse();
37
37
  this.container = await container.start();
38
38
  }
39
39
  async stopContainer() {
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-testcontainer.service.js","sourceRoot":"","sources":["../../src/test-containers/postgres-testcontainer.service.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,MAAM,GAIN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,mBAAmB,GAEnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,4BAA4B;IAEvB,MAAM,CAAa;IAEnB,QAAQ,CAAc;IAE/B,SAAS,CAA6B;IAEtC,WAAW,GAA4B,IAAI,CAAC;IAEpD;QACC,IAAI,CAAC,YAAY,EAAE,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,YAAY;QACxB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1C,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,sBAAsB;QAClC,MAAM,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,IAAG,EAAE;YAC9C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;YAE/C,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YAC3B,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,eAAe;QAC3B,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAC5B,CAAC;IAEO,KAAK,CAAC,cAAc;QAC3B,MAAM,SAAS,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC;aACnD,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;aAClC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;aAC9B,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;aAClC,SAAS,EAAE;aACX,gBAAgB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAEhE,IAAI,CAAC,SAAS,GAAG,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IAC1C,CAAC;IAEO,KAAK,CAAC,aAAa;QAC1B,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAEO,YAAY;QAEnB,MAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC;QAE5D,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,WAAW,CAAC,SAAS,CAAC,YAAY,GAAG,KAAK;YACzC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1B,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC;IACH,CAAC;CACD;AA3DiB;IADhB,MAAM,EAAE;8BACgB,UAAU;4DAAC;AAEnB;IADhB,MAAM,EAAE;8BACkB,WAAW;8DAAC"}
1
+ {"version":3,"file":"postgres-testcontainer.service.js","sourceRoot":"","sources":["../../src/test-containers/postgres-testcontainer.service.ts"],"names":[],"mappings":";AAA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AC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;aAC7D,SAAS,EAAE,CAAC;QAEd,IAAI,CAAC,SAAS,GAAG,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IAC1C,CAAC;IAEO,KAAK,CAAC,aAAa;QAC1B,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAEO,YAAY;QAEnB,MAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC;QAE5D,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,WAAW,CAAC,SAAS,CAAC,YAAY,GAAG,KAAK;YACzC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1B,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC;IACH,CAAC;CACD;AA3DiB;IADhB,MAAM,EAAE;8BACgB,UAAU;4DAAC;AAEnB;IADhB,MAAM,EAAE;8BACkB,WAAW;8DAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"repository.testing.module.d.ts","sourceRoot":"","sources":["../../src/tests/repository.testing.module.ts"],"names":[],"mappings":"AAOA,qBASa,uBAAuB;CAAG"}
1
+ {"version":3,"file":"repository.testing.module.d.ts","sourceRoot":"","sources":["../../src/tests/repository.testing.module.ts"],"names":[],"mappings":"AAMA,qBAQa,uBAAuB;CAAG"}
@@ -4,7 +4,6 @@ import { ExecutionModeModule } from '@hg-ts/execution-mode';
4
4
  import { LoggerModule } from '@hg-ts/logger';
5
5
  import { Module } from '@nestjs/common';
6
6
  import { KnexModule } from '../knex.module.js';
7
- import { PostgresTestcontainerModule } from '../test-containers/index.js';
8
7
  let RepositoryTestingModule = class RepositoryTestingModule {
9
8
  };
10
9
  RepositoryTestingModule = __decorate([
@@ -13,7 +12,6 @@ RepositoryTestingModule = __decorate([
13
12
  ExecutionModeModule,
14
13
  LoggerModule,
15
14
  ConfigModule,
16
- PostgresTestcontainerModule,
17
15
  KnexModule,
18
16
  ],
19
17
  })
@@ -1 +1 @@
1
- {"version":3,"file":"repository.testing.module.js","sourceRoot":"","sources":["../../src/tests/repository.testing.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAWnE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAAG,CAAA;AAA1B,uBAAuB;IATnC,MAAM,CAAC;QACP,OAAO,EAAE;YACR,mBAAmB;YACnB,YAAY;YACZ,YAAY;YACZ,2BAA2B;YAC3B,UAAU;SACV;KACD,CAAC;GACW,uBAAuB,CAAG"}
1
+ {"version":3,"file":"repository.testing.module.js","sourceRoot":"","sources":["../../src/tests/repository.testing.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAUxC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAAG,CAAA;AAA1B,uBAAuB;IARnC,MAAM,CAAC;QACP,OAAO,EAAE;YACR,mBAAmB;YACnB,YAAY;YACZ,YAAY;YACZ,UAAU;SACV;KACD,CAAC;GACW,uBAAuB,CAAG"}
@@ -0,0 +1,3 @@
1
+ export declare function setup(): Promise<void>;
2
+ export declare function teardown(): Promise<void>;
3
+ //# sourceMappingURL=vitest.setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.setup.d.ts","sourceRoot":"","sources":["../src/vitest.setup.ts"],"names":[],"mappings":"AAuBA,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAO3C;AAED,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAI9C"}
@@ -0,0 +1,32 @@
1
+ import { __decorate } from "tslib";
2
+ import { ConfigModule } from '@hg-ts/config-loader';
3
+ import { LoggerModule } from '@hg-ts/logger';
4
+ import { Module, } from '@nestjs/common';
5
+ import { NestFactory } from '@nestjs/core';
6
+ import { PostgresTestcontainerModule } from './test-containers/index.js';
7
+ process.env['HG_ENV'] = 'test';
8
+ let nestContext = null;
9
+ let VitestModule = class VitestModule {
10
+ };
11
+ VitestModule = __decorate([
12
+ Module({
13
+ imports: [
14
+ PostgresTestcontainerModule,
15
+ LoggerModule,
16
+ ConfigModule,
17
+ ],
18
+ })
19
+ ], VitestModule);
20
+ export async function setup() {
21
+ nestContext = await NestFactory.createApplicationContext(VitestModule, {
22
+ bufferLogs: true,
23
+ abortOnError: false,
24
+ });
25
+ await nestContext.init();
26
+ }
27
+ export async function teardown() {
28
+ if (nestContext) {
29
+ await nestContext.close();
30
+ }
31
+ }
32
+ //# sourceMappingURL=vitest.setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.setup.js","sourceRoot":"","sources":["../src/vitest.setup.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAEN,MAAM,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAEzE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;AAC/B,IAAI,WAAW,GAAmC,IAAI,CAAC;AASvD,IAAM,YAAY,GAAlB,MAAM,YAAY;CACjB,CAAA;AADK,YAAY;IAPjB,MAAM,CAAC;QACP,OAAO,EAAE;YACR,2BAA2B;YAC3B,YAAY;YACZ,YAAY;SACZ;KACD,CAAC;GACI,YAAY,CACjB;AAED,MAAM,CAAC,KAAK,UAAU,KAAK;IAC1B,WAAW,GAAG,MAAM,WAAW,CAAC,wBAAwB,CAAC,YAAY,EAAE;QACtE,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC7B,IAAI,WAAW,EAAE,CAAC;QACjB,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@hg-ts/knex",
3
- "version": "0.5.22",
3
+ "version": "0.5.24",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": "./dist/index.js"
7
+ ".": "./dist/index.js",
8
+ "./vitest.setup": "./dist/vitest.setup.js"
8
9
  },
9
10
  "repository": "git@gitlab.com:hyper-graph/framework.git",
10
11
  "scripts": {
@@ -18,19 +19,19 @@
18
19
  "test:dev": "vitest watch"
19
20
  },
20
21
  "devDependencies": {
21
- "@hg-ts-config/typescript": "0.5.22",
22
- "@hg-ts/async-context": "0.5.22",
23
- "@hg-ts/config-loader": "0.5.22",
24
- "@hg-ts/domain": "0.5.22",
25
- "@hg-ts/events": "0.5.22",
26
- "@hg-ts/exception": "0.5.22",
27
- "@hg-ts/execution-mode": "0.5.22",
28
- "@hg-ts/linter": "0.5.22",
29
- "@hg-ts/logger": "0.5.22",
30
- "@hg-ts/repository": "0.5.22",
31
- "@hg-ts/tests": "0.5.22",
32
- "@hg-ts/types": "0.5.22",
33
- "@hg-ts/validation": "0.5.22",
22
+ "@hg-ts-config/typescript": "0.5.24",
23
+ "@hg-ts/async-context": "0.5.24",
24
+ "@hg-ts/config-loader": "0.5.24",
25
+ "@hg-ts/domain": "0.5.24",
26
+ "@hg-ts/events": "0.5.24",
27
+ "@hg-ts/exception": "0.5.24",
28
+ "@hg-ts/execution-mode": "0.5.24",
29
+ "@hg-ts/linter": "0.5.24",
30
+ "@hg-ts/logger": "0.5.24",
31
+ "@hg-ts/repository": "0.5.24",
32
+ "@hg-ts/tests": "0.5.24",
33
+ "@hg-ts/types": "0.5.24",
34
+ "@hg-ts/validation": "0.5.24",
34
35
  "@nestjs/common": "11.1.0",
35
36
  "@nestjs/core": "11.1.0",
36
37
  "@nestjs/testing": "11.1.0",
@@ -47,16 +48,16 @@
47
48
  "vitest": "4.0.14"
48
49
  },
49
50
  "peerDependencies": {
50
- "@hg-ts/async-context": "0.5.22",
51
- "@hg-ts/config-loader": "0.5.22",
52
- "@hg-ts/domain": "0.5.22",
53
- "@hg-ts/events": "0.5.22",
54
- "@hg-ts/exception": "0.5.22",
55
- "@hg-ts/execution-mode": "0.5.22",
56
- "@hg-ts/logger": "0.5.22",
57
- "@hg-ts/repository": "0.5.22",
58
- "@hg-ts/tests": "0.5.22",
59
- "@hg-ts/validation": "0.5.22",
51
+ "@hg-ts/async-context": "0.5.24",
52
+ "@hg-ts/config-loader": "0.5.24",
53
+ "@hg-ts/domain": "0.5.24",
54
+ "@hg-ts/events": "0.5.24",
55
+ "@hg-ts/exception": "0.5.24",
56
+ "@hg-ts/execution-mode": "0.5.24",
57
+ "@hg-ts/logger": "0.5.24",
58
+ "@hg-ts/repository": "0.5.24",
59
+ "@hg-ts/tests": "0.5.24",
60
+ "@hg-ts/validation": "0.5.24",
60
61
  "@nestjs/common": "*",
61
62
  "@nestjs/core": "*",
62
63
  "@nestjs/testing": "*",
@@ -53,8 +53,8 @@ export class PostgresTestcontainerService implements OnModuleInit, OnApplication
53
53
  .withDatabase(this.config.database)
54
54
  .withUsername(this.config.user)
55
55
  .withPassword(this.config.password)
56
- .withReuse()
57
- .withExposedPorts({ container: 5432, host: this.config.port });
56
+ .withExposedPorts({ container: 5432, host: this.config.port })
57
+ .withReuse();
58
58
 
59
59
  this.container = await container.start();
60
60
  }
@@ -3,14 +3,12 @@ import { ExecutionModeModule } from '@hg-ts/execution-mode';
3
3
  import { LoggerModule } from '@hg-ts/logger';
4
4
  import { Module } from '@nestjs/common';
5
5
  import { KnexModule } from '../knex.module.js';
6
- import { PostgresTestcontainerModule } from '../test-containers/index.js';
7
6
 
8
7
  @Module({
9
8
  imports: [
10
9
  ExecutionModeModule,
11
10
  LoggerModule,
12
11
  ConfigModule,
13
- PostgresTestcontainerModule,
14
12
  KnexModule,
15
13
  ],
16
14
  })
@@ -0,0 +1,37 @@
1
+ import { ConfigModule } from '@hg-ts/config-loader';
2
+ import { LoggerModule } from '@hg-ts/logger';
3
+ import {
4
+ INestApplicationContext,
5
+ Module,
6
+ } from '@nestjs/common';
7
+ import { NestFactory } from '@nestjs/core';
8
+
9
+ import { PostgresTestcontainerModule } from './test-containers/index.js';
10
+
11
+ process.env['HG_ENV'] = 'test';
12
+ let nestContext: INestApplicationContext | null = null;
13
+
14
+ @Module({
15
+ imports: [
16
+ PostgresTestcontainerModule,
17
+ LoggerModule,
18
+ ConfigModule,
19
+ ],
20
+ })
21
+ class VitestModule {
22
+ }
23
+
24
+ export async function setup(): Promise<void> {
25
+ nestContext = await NestFactory.createApplicationContext(VitestModule, {
26
+ bufferLogs: true,
27
+ abortOnError: false,
28
+ });
29
+
30
+ await nestContext.init();
31
+ }
32
+
33
+ export async function teardown(): Promise<void> {
34
+ if (nestContext) {
35
+ await nestContext.close();
36
+ }
37
+ }
package/tsconfig.json CHANGED
@@ -5,5 +5,6 @@
5
5
  "rootDir": "src",
6
6
  "outDir": "dist"
7
7
  },
8
- "exclude": ["dist"]
8
+ "exclude": ["dist"],
9
+ "include": ["src"]
9
10
  }