pgsql-seed 2.20.0 → 2.21.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.
package/esm/pgpm.d.ts CHANGED
@@ -5,6 +5,9 @@ import type { PgConfig } from 'pg-env';
5
5
  * @param config - PostgreSQL configuration (host, port, database, user, password)
6
6
  * @param cwd - Current working directory containing the pgpm package (defaults to process.cwd())
7
7
  * @param cache - Whether to enable caching (defaults to false)
8
+ * @param options.workspace - When cwd is a workspace root (not a module), deploy
9
+ * every installed module in the workspace in dependency order. Off by default
10
+ * so an implicit process.cwd() inside a workspace never triggers a full deploy.
8
11
  *
9
12
  * @example
10
13
  * ```typescript
@@ -26,7 +29,9 @@ import type { PgConfig } from 'pg-env';
26
29
  * await deployPgpm(config, '/path/to/package');
27
30
  * ```
28
31
  */
29
- export declare function deployPgpm(config: PgConfig, cwd?: string, cache?: boolean): Promise<void>;
32
+ export declare function deployPgpm(config: PgConfig, cwd?: string, cache?: boolean, options?: {
33
+ workspace?: boolean;
34
+ }): Promise<void>;
30
35
  /**
31
36
  * Load/deploy a pgpm package - alias for deployPgpm for consistency with other load* functions.
32
37
  *
@@ -34,4 +39,6 @@ export declare function deployPgpm(config: PgConfig, cwd?: string, cache?: boole
34
39
  * @param cwd - Current working directory containing the pgpm package
35
40
  * @param cache - Whether to enable caching
36
41
  */
37
- export declare function loadPgpm(config: PgConfig, cwd?: string, cache?: boolean): Promise<void>;
42
+ export declare function loadPgpm(config: PgConfig, cwd?: string, cache?: boolean, options?: {
43
+ workspace?: boolean;
44
+ }): Promise<void>;
package/esm/pgpm.js CHANGED
@@ -6,6 +6,9 @@ import { getEnvOptions } from '@pgpmjs/env';
6
6
  * @param config - PostgreSQL configuration (host, port, database, user, password)
7
7
  * @param cwd - Current working directory containing the pgpm package (defaults to process.cwd())
8
8
  * @param cache - Whether to enable caching (defaults to false)
9
+ * @param options.workspace - When cwd is a workspace root (not a module), deploy
10
+ * every installed module in the workspace in dependency order. Off by default
11
+ * so an implicit process.cwd() inside a workspace never triggers a full deploy.
9
12
  *
10
13
  * @example
11
14
  * ```typescript
@@ -27,9 +30,10 @@ import { getEnvOptions } from '@pgpmjs/env';
27
30
  * await deployPgpm(config, '/path/to/package');
28
31
  * ```
29
32
  */
30
- export async function deployPgpm(config, cwd, cache = false) {
33
+ export async function deployPgpm(config, cwd, cache = false, options = {}) {
31
34
  const proj = new PgpmPackage(cwd ?? process.cwd());
32
- if (!proj.isInModule())
35
+ const inModule = proj.isInModule();
36
+ if (!inModule && !(options.workspace && proj.isInWorkspace()))
33
37
  return;
34
38
  await proj.deploy(getEnvOptions({
35
39
  pg: config,
@@ -38,7 +42,9 @@ export async function deployPgpm(config, cwd, cache = false) {
38
42
  usePlan: true,
39
43
  cache
40
44
  }
41
- }), proj.getModuleName());
45
+ }),
46
+ // At a workspace root, deploy all modules in the workspace
47
+ inModule ? proj.getModuleName() : undefined);
42
48
  }
43
49
  /**
44
50
  * Load/deploy a pgpm package - alias for deployPgpm for consistency with other load* functions.
@@ -47,6 +53,6 @@ export async function deployPgpm(config, cwd, cache = false) {
47
53
  * @param cwd - Current working directory containing the pgpm package
48
54
  * @param cache - Whether to enable caching
49
55
  */
50
- export async function loadPgpm(config, cwd, cache = false) {
51
- return deployPgpm(config, cwd, cache);
56
+ export async function loadPgpm(config, cwd, cache = false, options = {}) {
57
+ return deployPgpm(config, cwd, cache, options);
52
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgsql-seed",
3
- "version": "2.20.0",
3
+ "version": "2.21.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PostgreSQL seeding utilities with pgpm integration - batteries included",
6
6
  "main": "index.js",
@@ -46,11 +46,11 @@
46
46
  "makage": "^0.3.0"
47
47
  },
48
48
  "dependencies": {
49
- "@pgpmjs/core": "^6.31.0",
50
- "@pgpmjs/env": "^2.28.0",
49
+ "@pgpmjs/core": "^6.32.0",
50
+ "@pgpmjs/env": "^2.28.1",
51
51
  "pg": "^8.21.0",
52
52
  "pg-env": "^1.18.0",
53
53
  "pg-seed": "^0.17.0"
54
54
  },
55
- "gitHead": "ff6c442b789cbe8803f33036110f6e09124e65df"
55
+ "gitHead": "dd2accb683fe20c7278a0d58fd36a04a3b07ac63"
56
56
  }
package/pgpm.d.ts CHANGED
@@ -5,6 +5,9 @@ import type { PgConfig } from 'pg-env';
5
5
  * @param config - PostgreSQL configuration (host, port, database, user, password)
6
6
  * @param cwd - Current working directory containing the pgpm package (defaults to process.cwd())
7
7
  * @param cache - Whether to enable caching (defaults to false)
8
+ * @param options.workspace - When cwd is a workspace root (not a module), deploy
9
+ * every installed module in the workspace in dependency order. Off by default
10
+ * so an implicit process.cwd() inside a workspace never triggers a full deploy.
8
11
  *
9
12
  * @example
10
13
  * ```typescript
@@ -26,7 +29,9 @@ import type { PgConfig } from 'pg-env';
26
29
  * await deployPgpm(config, '/path/to/package');
27
30
  * ```
28
31
  */
29
- export declare function deployPgpm(config: PgConfig, cwd?: string, cache?: boolean): Promise<void>;
32
+ export declare function deployPgpm(config: PgConfig, cwd?: string, cache?: boolean, options?: {
33
+ workspace?: boolean;
34
+ }): Promise<void>;
30
35
  /**
31
36
  * Load/deploy a pgpm package - alias for deployPgpm for consistency with other load* functions.
32
37
  *
@@ -34,4 +39,6 @@ export declare function deployPgpm(config: PgConfig, cwd?: string, cache?: boole
34
39
  * @param cwd - Current working directory containing the pgpm package
35
40
  * @param cache - Whether to enable caching
36
41
  */
37
- export declare function loadPgpm(config: PgConfig, cwd?: string, cache?: boolean): Promise<void>;
42
+ export declare function loadPgpm(config: PgConfig, cwd?: string, cache?: boolean, options?: {
43
+ workspace?: boolean;
44
+ }): Promise<void>;
package/pgpm.js CHANGED
@@ -10,6 +10,9 @@ const env_1 = require("@pgpmjs/env");
10
10
  * @param config - PostgreSQL configuration (host, port, database, user, password)
11
11
  * @param cwd - Current working directory containing the pgpm package (defaults to process.cwd())
12
12
  * @param cache - Whether to enable caching (defaults to false)
13
+ * @param options.workspace - When cwd is a workspace root (not a module), deploy
14
+ * every installed module in the workspace in dependency order. Off by default
15
+ * so an implicit process.cwd() inside a workspace never triggers a full deploy.
13
16
  *
14
17
  * @example
15
18
  * ```typescript
@@ -31,9 +34,10 @@ const env_1 = require("@pgpmjs/env");
31
34
  * await deployPgpm(config, '/path/to/package');
32
35
  * ```
33
36
  */
34
- async function deployPgpm(config, cwd, cache = false) {
37
+ async function deployPgpm(config, cwd, cache = false, options = {}) {
35
38
  const proj = new core_1.PgpmPackage(cwd ?? process.cwd());
36
- if (!proj.isInModule())
39
+ const inModule = proj.isInModule();
40
+ if (!inModule && !(options.workspace && proj.isInWorkspace()))
37
41
  return;
38
42
  await proj.deploy((0, env_1.getEnvOptions)({
39
43
  pg: config,
@@ -42,7 +46,9 @@ async function deployPgpm(config, cwd, cache = false) {
42
46
  usePlan: true,
43
47
  cache
44
48
  }
45
- }), proj.getModuleName());
49
+ }),
50
+ // At a workspace root, deploy all modules in the workspace
51
+ inModule ? proj.getModuleName() : undefined);
46
52
  }
47
53
  /**
48
54
  * Load/deploy a pgpm package - alias for deployPgpm for consistency with other load* functions.
@@ -51,6 +57,6 @@ async function deployPgpm(config, cwd, cache = false) {
51
57
  * @param cwd - Current working directory containing the pgpm package
52
58
  * @param cache - Whether to enable caching
53
59
  */
54
- async function loadPgpm(config, cwd, cache = false) {
55
- return deployPgpm(config, cwd, cache);
60
+ async function loadPgpm(config, cwd, cache = false, options = {}) {
61
+ return deployPgpm(config, cwd, cache, options);
56
62
  }