@constructive-io/cli 5.1.14 → 5.1.15

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/README.md CHANGED
@@ -98,6 +98,9 @@ cnc server
98
98
 
99
99
  # Custom port and options
100
100
  cnc server --port 8080 --no-postgis
101
+
102
+ # With custom CORS origin
103
+ cnc server --origin http://localhost:3000
101
104
  ```
102
105
 
103
106
  #### `cnc explorer`
@@ -112,6 +115,33 @@ cnc explorer
112
115
  cnc explorer --origin http://localhost:3000
113
116
  ```
114
117
 
118
+ #### `cnc docker`
119
+
120
+ Manage PostgreSQL Docker containers for local development.
121
+
122
+ ```bash
123
+ # Start PostgreSQL container
124
+ cnc docker start
125
+
126
+ # Stop PostgreSQL container
127
+ cnc docker stop
128
+ ```
129
+
130
+ #### `cnc env`
131
+
132
+ Display environment configuration for PostgreSQL connection.
133
+
134
+ ```bash
135
+ # Print environment variables for shell export
136
+ cnc env
137
+
138
+ # Use with eval to set environment
139
+ eval "$(cnc env)"
140
+
141
+ # Print Supabase local development environment
142
+ cnc env --supabase
143
+ ```
144
+
115
145
  ## 🔄 Updates
116
146
 
117
147
  The CLI performs a lightweight npm version check at most once per week (skipped in CI or when `PGPM_SKIP_UPDATE_CHECK` is set). Use `cnc update` to install the latest release (installs `pgpm` by default; pass `--package @constructive-io/cli` to target the CLI package).
@@ -202,6 +232,35 @@ Interactively manage module dependencies.
202
232
  cnc extension
203
233
  ```
204
234
 
235
+ #### `cnc upgrade-modules`
236
+
237
+ Upgrade installed pgpm modules to their latest versions from npm.
238
+
239
+ ```bash
240
+ # Interactive selection of modules to upgrade
241
+ cnc upgrade-modules
242
+
243
+ # Upgrade all installed modules without prompting
244
+ cnc upgrade-modules --all
245
+
246
+ # Preview available upgrades without making changes
247
+ cnc upgrade-modules --dry-run
248
+
249
+ # Upgrade specific modules
250
+ cnc upgrade-modules --modules @pgpm/base32,@pgpm/faker
251
+
252
+ # Upgrade modules across all packages in the workspace
253
+ cnc upgrade-modules --workspace --all
254
+ ```
255
+
256
+ **Options:**
257
+
258
+ - `--all` - Upgrade all modules without prompting
259
+ - `--dry-run` - Show what would be upgraded without making changes
260
+ - `--modules <names>` - Comma-separated list of specific modules to upgrade
261
+ - `--workspace` - Upgrade modules across all packages in the workspace
262
+ - `--cwd <directory>` - Working directory (default: current directory)
263
+
205
264
  #### `cnc tag`
206
265
 
207
266
  Version your changes with tags.
@@ -241,6 +300,18 @@ cnc package --no-plan
241
300
 
242
301
  ### Utilities
243
302
 
303
+ #### `cnc add`
304
+
305
+ Add a new database change to your module.
306
+
307
+ ```bash
308
+ # Add a new change
309
+ cnc add my_change
310
+
311
+ # Add with specific type
312
+ cnc add my_function --type function
313
+ ```
314
+
244
315
  #### `cnc export`
245
316
 
246
317
  Export migrations from existing databases.
@@ -261,6 +332,53 @@ cnc kill
261
332
  cnc kill --no-drop
262
333
  ```
263
334
 
335
+ #### `cnc clear`
336
+
337
+ Clear database state.
338
+
339
+ ```bash
340
+ cnc clear
341
+ ```
342
+
343
+ #### `cnc remove`
344
+
345
+ Remove database changes.
346
+
347
+ ```bash
348
+ cnc remove my_change
349
+ ```
350
+
351
+ #### `cnc analyze`
352
+
353
+ Analyze database structure.
354
+
355
+ ```bash
356
+ cnc analyze
357
+ ```
358
+
359
+ #### `cnc rename`
360
+
361
+ Rename database changes.
362
+
363
+ ```bash
364
+ cnc rename old_name new_name
365
+ ```
366
+
367
+ #### `cnc admin-users`
368
+
369
+ Manage admin users for your database.
370
+
371
+ ```bash
372
+ # Bootstrap admin users
373
+ cnc admin-users bootstrap
374
+
375
+ # Add an admin user
376
+ cnc admin-users add
377
+
378
+ # Remove an admin user
379
+ cnc admin-users remove
380
+ ```
381
+
264
382
  ### Testing
265
383
 
266
384
  #### `cnc test-packages`
@@ -274,20 +392,20 @@ cnc test-packages
274
392
  # Run full deploy/verify/revert/deploy cycle
275
393
  cnc test-packages --full-cycle
276
394
 
277
- # Stop on first failure
278
- cnc test-packages --stop-on-fail
395
+ # Continue testing all packages even after failures
396
+ cnc test-packages --continue-on-fail
279
397
 
280
398
  # Exclude specific modules
281
399
  cnc test-packages --exclude my-module,another-module
282
400
 
283
401
  # Combine options
284
- cnc test-packages --full-cycle --stop-on-fail --exclude legacy-module
402
+ cnc test-packages --full-cycle --continue-on-fail --exclude legacy-module
285
403
  ```
286
404
 
287
405
  **Options:**
288
406
 
289
407
  - `--full-cycle` - Run full deploy/verify/revert/deploy cycle (default: deploy only)
290
- - `--stop-on-fail` - Stop testing immediately when a module fails
408
+ - `--continue-on-fail` - Continue testing all packages even after failures (default: stop on first failure)
291
409
  - `--exclude <modules>` - Comma-separated module names to exclude
292
410
  - `--cwd <directory>` - Working directory (default: current directory)
293
411
 
@@ -545,7 +663,6 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
545
663
  * [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): **🏷️ TypeScript enums** for PostgreSQL AST for safe and ergonomic parsing logic.
546
664
  * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
547
665
  * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
548
- * [pg-ast](https://www.npmjs.com/package/pg-ast): **🔍 Low-level AST tools** and transformations for Postgres query structures.
549
666
 
550
667
  ### 🚀 API & Dev Tools
551
668
 
@@ -15,6 +15,7 @@ Constructive GraphQL Server:
15
15
  Options:
16
16
  --help, -h Show this help message
17
17
  --port <number> Server port (default: 5555)
18
+ --origin <url> CORS origin URL (exact URL or * for wildcard)
18
19
  --simpleInflection Use simple inflection (default: true)
19
20
  --oppositeBaseNames Use opposite base names (default: false)
20
21
  --postgis Enable PostGIS extension (default: true)
@@ -25,6 +26,7 @@ Examples:
25
26
  cnc server Start server with defaults
26
27
  cnc server --port 8080 Start server on custom port
27
28
  cnc server --no-postgis Start server without PostGIS
29
+ cnc server --origin http://localhost:3000 Set CORS origin
28
30
  `;
29
31
  const questions = [
30
32
  {
@@ -13,6 +13,7 @@ Constructive GraphQL Server:
13
13
  Options:
14
14
  --help, -h Show this help message
15
15
  --port <number> Server port (default: 5555)
16
+ --origin <url> CORS origin URL (exact URL or * for wildcard)
16
17
  --simpleInflection Use simple inflection (default: true)
17
18
  --oppositeBaseNames Use opposite base names (default: false)
18
19
  --postgis Enable PostGIS extension (default: true)
@@ -23,6 +24,7 @@ Examples:
23
24
  cnc server Start server with defaults
24
25
  cnc server --port 8080 Start server on custom port
25
26
  cnc server --no-postgis Start server without PostGIS
27
+ cnc server --origin http://localhost:3000 Set CORS origin
26
28
  `;
27
29
  const questions = [
28
30
  {
@@ -1,13 +1,13 @@
1
1
  export const usageText = `
2
2
  Usage: cnc <command> [options]
3
3
  constructive <command> [options]
4
-
4
+
5
5
  Core Database Operations:
6
6
  add Add database changes to plans and create SQL files
7
7
  deploy Deploy database changes and migrations
8
8
  verify Verify database state and migrations
9
9
  revert Revert database changes and migrations
10
-
10
+
11
11
  Project Management:
12
12
  init Initialize pgpm workspace or module
13
13
  extension Manage module dependencies
@@ -15,34 +15,48 @@ export const usageText = `
15
15
  package Package module for distribution
16
16
  update Update CLI/pgpm (installs pgpm by default)
17
17
  cache Manage cached templates (clean)
18
-
18
+ upgrade-modules Upgrade installed pgpm modules to latest versions
19
+
19
20
  Development Tools:
20
21
  server Start a GraphQL server
21
22
  explorer Launch GraphiQL explorer interface
22
23
  docker Manage PostgreSQL Docker containers (start/stop)
23
24
  export Export database migrations from existing databases
24
-
25
+ env Display environment configuration
26
+
27
+ Code Generation:
28
+ codegen Generate TypeScript types and SDK from GraphQL schema
29
+ get-graphql-schema Fetch or build GraphQL schema SDL
30
+
25
31
  Database Administration:
26
32
  kill Terminate database connections and optionally drop databases
27
33
  install Install pgpm modules
28
34
  tag Add tags to changes for versioning
29
-
35
+ clear Clear database state
36
+ remove Remove database changes
37
+ analyze Analyze database structure
38
+ rename Rename database changes
39
+ admin-users Manage admin users
40
+
41
+ Testing:
42
+ test-packages Run integration tests on all workspace packages
43
+
30
44
  Migration Tools:
31
45
  migrate Migration management subcommands
32
46
  init Initialize migration tracking
33
47
  status Show migration status
34
48
  list List all changes
35
49
  deps Show change dependencies
36
-
50
+
37
51
  Global Options:
38
52
  -h, --help Display this help information
39
53
  -v, --version Display version information
40
54
  --cwd <directory> Working directory (default: current directory)
41
-
55
+
42
56
  Individual Command Help:
43
57
  constructive <command> --help Display detailed help for specific command
44
58
  constructive <command> -h Display detailed help for specific command
45
-
59
+
46
60
  Examples:
47
61
  cnc deploy --help Show deploy command options
48
62
  cnc server --port 8080 Start server on port 8080
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/cli",
3
- "version": "5.1.14",
3
+ "version": "5.1.15",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Constructive CLI",
6
6
  "main": "index.js",
@@ -46,21 +46,21 @@
46
46
  "ts-node": "^10.9.2"
47
47
  },
48
48
  "dependencies": {
49
- "@constructive-io/graphql-codegen": "^2.17.22",
49
+ "@constructive-io/graphql-codegen": "^2.17.23",
50
50
  "@constructive-io/graphql-env": "^2.8.8",
51
- "@constructive-io/graphql-explorer": "^2.10.16",
52
- "@constructive-io/graphql-server": "^2.10.16",
53
- "@pgpmjs/core": "^3.2.0",
51
+ "@constructive-io/graphql-explorer": "^2.10.17",
52
+ "@constructive-io/graphql-server": "^2.10.17",
53
+ "@pgpmjs/core": "^3.2.1",
54
54
  "@pgpmjs/logger": "^1.3.5",
55
- "@pgpmjs/server-utils": "^2.8.8",
55
+ "@pgpmjs/server-utils": "^2.8.9",
56
56
  "@pgpmjs/types": "^2.12.6",
57
57
  "find-and-require-package-json": "^0.8.2",
58
- "inquirerer": "^2.2.0",
58
+ "inquirerer": "^2.3.0",
59
59
  "js-yaml": "^4.1.0",
60
60
  "minimist": "^1.2.8",
61
61
  "pg-cache": "^1.6.9",
62
62
  "pg-env": "^1.2.4",
63
- "pgpm": "^1.3.0",
63
+ "pgpm": "^1.4.0",
64
64
  "shelljs": "^0.10.0",
65
65
  "yanse": "^0.1.8"
66
66
  },
@@ -75,5 +75,5 @@
75
75
  "postgres",
76
76
  "graphile"
77
77
  ],
78
- "gitHead": "f041cbb1c54277b1b408af5b44d5a8cae933bae7"
78
+ "gitHead": "976cc9e0e09201c7df40518a1797f4178fc21c2c"
79
79
  }
@@ -1 +1 @@
1
- export declare const usageText = "\n Usage: cnc <command> [options]\n constructive <command> [options]\n \n Core Database Operations:\n add Add database changes to plans and create SQL files\n deploy Deploy database changes and migrations\n verify Verify database state and migrations\n revert Revert database changes and migrations\n \n Project Management:\n init Initialize pgpm workspace or module\n extension Manage module dependencies\n plan Generate module deployment plans\n package Package module for distribution\n update Update CLI/pgpm (installs pgpm by default)\n cache Manage cached templates (clean)\n \n Development Tools:\n server Start a GraphQL server\n explorer Launch GraphiQL explorer interface\n docker Manage PostgreSQL Docker containers (start/stop)\n export Export database migrations from existing databases\n \n Database Administration:\n kill Terminate database connections and optionally drop databases\n install Install pgpm modules\n tag Add tags to changes for versioning\n \n Migration Tools:\n migrate Migration management subcommands\n init Initialize migration tracking\n status Show migration status\n list List all changes\n deps Show change dependencies\n \n Global Options:\n -h, --help Display this help information\n -v, --version Display version information\n --cwd <directory> Working directory (default: current directory)\n \n Individual Command Help:\n constructive <command> --help Display detailed help for specific command\n constructive <command> -h Display detailed help for specific command\n \n Examples:\n cnc deploy --help Show deploy command options\n cnc server --port 8080 Start server on port 8080\n cnc init workspace Initialize new workspace\n ";
1
+ export declare const usageText = "\n Usage: cnc <command> [options]\n constructive <command> [options]\n\n Core Database Operations:\n add Add database changes to plans and create SQL files\n deploy Deploy database changes and migrations\n verify Verify database state and migrations\n revert Revert database changes and migrations\n\n Project Management:\n init Initialize pgpm workspace or module\n extension Manage module dependencies\n plan Generate module deployment plans\n package Package module for distribution\n update Update CLI/pgpm (installs pgpm by default)\n cache Manage cached templates (clean)\n upgrade-modules Upgrade installed pgpm modules to latest versions\n\n Development Tools:\n server Start a GraphQL server\n explorer Launch GraphiQL explorer interface\n docker Manage PostgreSQL Docker containers (start/stop)\n export Export database migrations from existing databases\n env Display environment configuration\n\n Code Generation:\n codegen Generate TypeScript types and SDK from GraphQL schema\n get-graphql-schema Fetch or build GraphQL schema SDL\n\n Database Administration:\n kill Terminate database connections and optionally drop databases\n install Install pgpm modules\n tag Add tags to changes for versioning\n clear Clear database state\n remove Remove database changes\n analyze Analyze database structure\n rename Rename database changes\n admin-users Manage admin users\n\n Testing:\n test-packages Run integration tests on all workspace packages\n\n Migration Tools:\n migrate Migration management subcommands\n init Initialize migration tracking\n status Show migration status\n list List all changes\n deps Show change dependencies\n\n Global Options:\n -h, --help Display this help information\n -v, --version Display version information\n --cwd <directory> Working directory (default: current directory)\n\n Individual Command Help:\n constructive <command> --help Display detailed help for specific command\n constructive <command> -h Display detailed help for specific command\n\n Examples:\n cnc deploy --help Show deploy command options\n cnc server --port 8080 Start server on port 8080\n cnc init workspace Initialize new workspace\n ";
package/utils/display.js CHANGED
@@ -4,13 +4,13 @@ exports.usageText = void 0;
4
4
  exports.usageText = `
5
5
  Usage: cnc <command> [options]
6
6
  constructive <command> [options]
7
-
7
+
8
8
  Core Database Operations:
9
9
  add Add database changes to plans and create SQL files
10
10
  deploy Deploy database changes and migrations
11
11
  verify Verify database state and migrations
12
12
  revert Revert database changes and migrations
13
-
13
+
14
14
  Project Management:
15
15
  init Initialize pgpm workspace or module
16
16
  extension Manage module dependencies
@@ -18,34 +18,48 @@ exports.usageText = `
18
18
  package Package module for distribution
19
19
  update Update CLI/pgpm (installs pgpm by default)
20
20
  cache Manage cached templates (clean)
21
-
21
+ upgrade-modules Upgrade installed pgpm modules to latest versions
22
+
22
23
  Development Tools:
23
24
  server Start a GraphQL server
24
25
  explorer Launch GraphiQL explorer interface
25
26
  docker Manage PostgreSQL Docker containers (start/stop)
26
27
  export Export database migrations from existing databases
27
-
28
+ env Display environment configuration
29
+
30
+ Code Generation:
31
+ codegen Generate TypeScript types and SDK from GraphQL schema
32
+ get-graphql-schema Fetch or build GraphQL schema SDL
33
+
28
34
  Database Administration:
29
35
  kill Terminate database connections and optionally drop databases
30
36
  install Install pgpm modules
31
37
  tag Add tags to changes for versioning
32
-
38
+ clear Clear database state
39
+ remove Remove database changes
40
+ analyze Analyze database structure
41
+ rename Rename database changes
42
+ admin-users Manage admin users
43
+
44
+ Testing:
45
+ test-packages Run integration tests on all workspace packages
46
+
33
47
  Migration Tools:
34
48
  migrate Migration management subcommands
35
49
  init Initialize migration tracking
36
50
  status Show migration status
37
51
  list List all changes
38
52
  deps Show change dependencies
39
-
53
+
40
54
  Global Options:
41
55
  -h, --help Display this help information
42
56
  -v, --version Display version information
43
57
  --cwd <directory> Working directory (default: current directory)
44
-
58
+
45
59
  Individual Command Help:
46
60
  constructive <command> --help Display detailed help for specific command
47
61
  constructive <command> -h Display detailed help for specific command
48
-
62
+
49
63
  Examples:
50
64
  cnc deploy --help Show deploy command options
51
65
  cnc server --port 8080 Start server on port 8080