pgsql-test 4.20.0 → 4.21.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/esm/seed/pgpm.js +8 -1
- package/esm/test-client.js +1 -1
- package/package.json +10 -10
- package/seed/pgpm.js +8 -1
- package/test-client.js +1 -1
package/esm/seed/pgpm.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import { existsSync } from 'fs';
|
|
1
2
|
import { deployPgpm } from 'pgsql-seed';
|
|
2
3
|
export function pgpm(cwd, cache = false) {
|
|
3
4
|
return {
|
|
4
5
|
async seed(ctx) {
|
|
5
|
-
|
|
6
|
+
const dir = cwd ?? ctx.connect.cwd;
|
|
7
|
+
if (cwd && !existsSync(cwd)) {
|
|
8
|
+
throw new Error(`seed.pgpm: no pgpm module or workspace found at ${cwd} — if this is an ephemeral fixtures workspace, run \`pgpm install\` (e.g. \`pnpm fixtures:install\`) first.`);
|
|
9
|
+
}
|
|
10
|
+
// Workspace-wide deploys only for an explicitly provided cwd — an
|
|
11
|
+
// implicit process.cwd() inside a workspace stays module-only.
|
|
12
|
+
await deployPgpm(ctx.config, dir, cache, { workspace: Boolean(cwd) });
|
|
6
13
|
}
|
|
7
14
|
};
|
|
8
15
|
}
|
package/esm/test-client.js
CHANGED
|
@@ -70,6 +70,6 @@ export class PgTestClient extends PgClient {
|
|
|
70
70
|
// await this.ctxQuery(); // no point to call ctxQuery() here
|
|
71
71
|
// because deployPgpm() has it's own way of getting the client...
|
|
72
72
|
// so for now, we'll expose this but it's limited
|
|
73
|
-
await deployPgpm(this.config, cwd, cache);
|
|
73
|
+
await deployPgpm(this.config, cwd, cache, { workspace: Boolean(cwd) });
|
|
74
74
|
}
|
|
75
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pgsql-test",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.21.1",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "pgsql-test offers isolated, role-aware, and rollback-friendly PostgreSQL environments for integration tests — giving developers realistic test coverage without external state pollution",
|
|
6
6
|
"main": "index.js",
|
|
@@ -55,21 +55,21 @@
|
|
|
55
55
|
"test:watch": "jest --watch"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@pgpmjs/core": "6.
|
|
58
|
+
"@pgpmjs/core": "6.32.1",
|
|
59
59
|
"@types/pg": "^8.20.0",
|
|
60
60
|
"@types/pg-copy-streams": "^1.2.5",
|
|
61
61
|
"makage": "^0.3.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@pgpmjs/env": "^2.28.
|
|
64
|
+
"@pgpmjs/env": "^2.28.2",
|
|
65
65
|
"@pgpmjs/logger": "^2.14.0",
|
|
66
|
-
"@pgpmjs/server-utils": "^3.15.
|
|
67
|
-
"@pgpmjs/types": "^2.
|
|
66
|
+
"@pgpmjs/server-utils": "^3.15.3",
|
|
67
|
+
"@pgpmjs/types": "^2.35.1",
|
|
68
68
|
"pg": "^8.21.0",
|
|
69
|
-
"pg-cache": "^3.15.
|
|
70
|
-
"pg-env": "^1.18.
|
|
71
|
-
"pgsql-client": "^3.22.
|
|
72
|
-
"pgsql-seed": "^2.
|
|
69
|
+
"pg-cache": "^3.15.2",
|
|
70
|
+
"pg-env": "^1.18.1",
|
|
71
|
+
"pgsql-client": "^3.22.2",
|
|
72
|
+
"pgsql-seed": "^2.21.1"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "e53a570a4a70987e82dc074bd73501971fd82828"
|
|
75
75
|
}
|
package/seed/pgpm.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pgpm = pgpm;
|
|
4
|
+
const fs_1 = require("fs");
|
|
4
5
|
const pgsql_seed_1 = require("pgsql-seed");
|
|
5
6
|
function pgpm(cwd, cache = false) {
|
|
6
7
|
return {
|
|
7
8
|
async seed(ctx) {
|
|
8
|
-
|
|
9
|
+
const dir = cwd ?? ctx.connect.cwd;
|
|
10
|
+
if (cwd && !(0, fs_1.existsSync)(cwd)) {
|
|
11
|
+
throw new Error(`seed.pgpm: no pgpm module or workspace found at ${cwd} — if this is an ephemeral fixtures workspace, run \`pgpm install\` (e.g. \`pnpm fixtures:install\`) first.`);
|
|
12
|
+
}
|
|
13
|
+
// Workspace-wide deploys only for an explicitly provided cwd — an
|
|
14
|
+
// implicit process.cwd() inside a workspace stays module-only.
|
|
15
|
+
await (0, pgsql_seed_1.deployPgpm)(ctx.config, dir, cache, { workspace: Boolean(cwd) });
|
|
9
16
|
}
|
|
10
17
|
};
|
|
11
18
|
}
|
package/test-client.js
CHANGED
|
@@ -73,7 +73,7 @@ class PgTestClient extends pgsql_client_1.PgClient {
|
|
|
73
73
|
// await this.ctxQuery(); // no point to call ctxQuery() here
|
|
74
74
|
// because deployPgpm() has it's own way of getting the client...
|
|
75
75
|
// so for now, we'll expose this but it's limited
|
|
76
|
-
await (0, pgsql_seed_4.deployPgpm)(this.config, cwd, cache);
|
|
76
|
+
await (0, pgsql_seed_4.deployPgpm)(this.config, cwd, cache, { workspace: Boolean(cwd) });
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
exports.PgTestClient = PgTestClient;
|