pgpm 0.0.1 → 0.1.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.
Files changed (70) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +111 -116
  3. package/commands/add.js +7 -7
  4. package/commands/admin-users/add.js +8 -8
  5. package/commands/admin-users/bootstrap.js +7 -7
  6. package/commands/admin-users/remove.js +7 -7
  7. package/commands/admin-users.js +5 -5
  8. package/commands/analyze.js +1 -1
  9. package/commands/clear.js +3 -3
  10. package/commands/deploy.js +7 -7
  11. package/commands/export.js +4 -4
  12. package/commands/extension.js +3 -3
  13. package/commands/init/index.js +8 -8
  14. package/commands/install.js +6 -6
  15. package/commands/kill.js +6 -6
  16. package/commands/migrate/init.js +1 -1
  17. package/commands/migrate.js +1 -1
  18. package/commands/package.js +4 -4
  19. package/commands/plan.js +5 -5
  20. package/commands/remove.js +2 -2
  21. package/commands/rename.js +1 -1
  22. package/commands/revert.js +7 -7
  23. package/commands/tag.js +6 -6
  24. package/commands/verify.js +7 -7
  25. package/commands.d.ts +1 -0
  26. package/commands.js +7 -16
  27. package/esm/commands/add.js +7 -7
  28. package/esm/commands/admin-users/add.js +8 -8
  29. package/esm/commands/admin-users/bootstrap.js +7 -7
  30. package/esm/commands/admin-users/remove.js +7 -7
  31. package/esm/commands/admin-users.js +5 -5
  32. package/esm/commands/analyze.js +1 -1
  33. package/esm/commands/clear.js +3 -3
  34. package/esm/commands/deploy.js +7 -7
  35. package/esm/commands/export.js +4 -4
  36. package/esm/commands/extension.js +3 -3
  37. package/esm/commands/init/index.js +8 -8
  38. package/esm/commands/init/workspace.js +1 -1
  39. package/esm/commands/install.js +6 -6
  40. package/esm/commands/kill.js +6 -6
  41. package/esm/commands/migrate/init.js +1 -1
  42. package/esm/commands/migrate.js +1 -1
  43. package/esm/commands/package.js +4 -4
  44. package/esm/commands/plan.js +5 -5
  45. package/esm/commands/remove.js +2 -2
  46. package/esm/commands/rename.js +1 -1
  47. package/esm/commands/revert.js +7 -7
  48. package/esm/commands/tag.js +6 -6
  49. package/esm/commands/verify.js +7 -7
  50. package/esm/commands.js +5 -15
  51. package/esm/index.js +36 -10
  52. package/esm/utils/cli-error.js +1 -1
  53. package/esm/utils/display.js +13 -13
  54. package/esm/utils/index.js +3 -0
  55. package/index.d.ts +20 -0
  56. package/index.js +70 -10
  57. package/package.json +15 -18
  58. package/utils/cli-error.js +1 -1
  59. package/utils/display.d.ts +1 -1
  60. package/utils/display.js +13 -13
  61. package/utils/index.d.ts +3 -0
  62. package/utils/index.js +3 -0
  63. package/commands/explorer.d.ts +0 -3
  64. package/commands/explorer.js +0 -94
  65. package/commands/server.d.ts +0 -3
  66. package/commands/server.js +0 -187
  67. package/dist/README.md +0 -416
  68. package/dist/package.json +0 -77
  69. package/esm/commands/explorer.js +0 -92
  70. package/esm/commands/server.js +0 -185
package/commands/clear.js CHANGED
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const core_1 = require("@launchql/core");
7
- const logger_1 = require("@launchql/logger");
8
- const env_1 = require("@launchql/env");
9
- const pg_env_1 = require("pg-env");
10
7
  const core_2 = require("@launchql/core");
8
+ const env_1 = require("@launchql/env");
9
+ const logger_1 = require("@launchql/logger");
11
10
  const types_1 = require("@launchql/types");
12
11
  const path_1 = __importDefault(require("path"));
12
+ const pg_env_1 = require("pg-env");
13
13
  const utils_1 = require("../utils");
14
14
  const log = new logger_1.Logger('clear');
15
15
  exports.default = async (argv, prompter, _options) => {
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@launchql/core");
4
- const logger_1 = require("@launchql/logger");
5
4
  const env_1 = require("@launchql/env");
5
+ const logger_1 = require("@launchql/logger");
6
6
  const child_process_1 = require("child_process");
7
7
  const pg_env_1 = require("pg-env");
8
8
  const utils_1 = require("../utils");
9
9
  const module_utils_1 = require("../utils/module-utils");
10
10
  const deployUsageText = `
11
- LaunchQL Deploy Command:
11
+ Deploy Command:
12
12
 
13
- lql deploy [OPTIONS]
13
+ pgpm deploy [OPTIONS]
14
14
 
15
15
  Deploy database changes and migrations to target database.
16
16
 
@@ -28,10 +28,10 @@ Options:
28
28
  --cwd <directory> Working directory (default: current directory)
29
29
 
30
30
  Examples:
31
- lql deploy Deploy to selected database
32
- lql deploy --createdb Deploy with database creation
33
- lql deploy --package mypackage --to @v1.0.0 Deploy specific package to tag
34
- lql deploy --fast --no-tx Fast deployment without transactions
31
+ pgpm deploy Deploy to selected database
32
+ pgpm deploy --createdb Deploy with database creation
33
+ pgpm deploy --package mypackage --to @v1.0.0 Deploy specific package to tag
34
+ pgpm deploy --fast --no-tx Fast deployment without transactions
35
35
  `;
36
36
  exports.default = async (argv, prompter, _options) => {
37
37
  // Show usage if explicitly requested
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@launchql/core");
4
- const types_1 = require("@launchql/types");
5
4
  const env_1 = require("@launchql/env");
5
+ const types_1 = require("@launchql/types");
6
6
  const path_1 = require("path");
7
7
  const pg_cache_1 = require("pg-cache");
8
8
  const exportUsageText = `
9
- LaunchQL Export Command:
9
+ Export Command:
10
10
 
11
- lql export [OPTIONS]
11
+ pgpm export [OPTIONS]
12
12
 
13
13
  Export database migrations from existing databases.
14
14
 
@@ -20,7 +20,7 @@ Options:
20
20
  --cwd <directory> Working directory (default: current directory)
21
21
 
22
22
  Examples:
23
- lql export Export migrations from selected database
23
+ pgpm export Export migrations from selected database
24
24
  `;
25
25
  exports.default = async (argv, prompter, _options) => {
26
26
  // Show usage if explicitly requested
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@launchql/core");
4
4
  const extensionUsageText = `
5
- LaunchQL Extension Command:
5
+ Extension Command:
6
6
 
7
- lql extension [OPTIONS]
7
+ pgpm extension [OPTIONS]
8
8
 
9
9
  Manage module dependencies.
10
10
 
@@ -13,7 +13,7 @@ Options:
13
13
  --cwd <directory> Working directory (default: current directory)
14
14
 
15
15
  Examples:
16
- lql extension Manage dependencies for current module
16
+ pgpm extension Manage dependencies for current module
17
17
  `;
18
18
  exports.default = async (argv, prompter, _options) => {
19
19
  // Show usage if explicitly requested
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const module_1 = __importDefault(require("./module"));
7
7
  const workspace_1 = __importDefault(require("./workspace"));
8
8
  const initUsageText = `
9
- LaunchQL Init Command:
9
+ Init Command:
10
10
 
11
- lql init [OPTIONS]
11
+ pgpm init [OPTIONS]
12
12
 
13
- Initialize LaunchQL workspace or module.
13
+ Initialize pgpm workspace or module.
14
14
 
15
15
  Options:
16
16
  --help, -h Show this help message
@@ -21,11 +21,11 @@ Options:
21
21
  --from-branch <branch> Specify branch when using --repo (default: main)
22
22
 
23
23
  Examples:
24
- lql init Initialize new module in existing workspace
25
- lql init --workspace Initialize new workspace
26
- lql init --repo owner/repo Use templates from GitHub repository
27
- lql init --template-path ./custom-templates Use templates from local path
28
- lql init --repo owner/repo --from-branch develop Use specific branch
24
+ pgpm init Initialize new module in existing workspace
25
+ pgpm init --workspace Initialize new workspace
26
+ pgpm init --repo owner/repo Use templates from GitHub repository
27
+ pgpm init --template-path ./custom-templates Use templates from local path
28
+ pgpm init --repo owner/repo --from-branch develop Use specific branch
29
29
  `;
30
30
  exports.default = async (argv, prompter, _options) => {
31
31
  // Show usage if explicitly requested
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@launchql/core");
4
4
  const installUsageText = `
5
- LaunchQL Install Command:
5
+ Install Command:
6
6
 
7
- lql install <package>...
7
+ pgpm install <package>...
8
8
 
9
- Install LaunchQL modules into current module.
9
+ Install pgpm modules into current module.
10
10
 
11
11
  Arguments:
12
12
  package One or more package names to install
@@ -16,8 +16,8 @@ Options:
16
16
  --cwd <directory> Working directory (default: current directory)
17
17
 
18
18
  Examples:
19
- lql install @launchql/base32 Install single package
20
- lql install @launchql/base32 @launchql/utils Install multiple packages
19
+ pgpm install @pgpm/base32 Install single package
20
+ pgpm install @pgpm/base32 @pgpm/utils Install multiple packages
21
21
  `;
22
22
  exports.default = async (argv, prompter, _options) => {
23
23
  // Show usage if explicitly requested
@@ -31,7 +31,7 @@ exports.default = async (argv, prompter, _options) => {
31
31
  throw new Error('You must run this command inside a LaunchQL module.');
32
32
  }
33
33
  if (argv._.length === 0) {
34
- throw new Error('You must provide a package name to install, e.g. `@launchql/base32`');
34
+ throw new Error('You must provide a package name to install, e.g. `@pgpm/base32`');
35
35
  }
36
36
  await project.installModules(...argv._);
37
37
  };
package/commands/kill.js CHANGED
@@ -4,9 +4,9 @@ const logger_1 = require("@launchql/logger");
4
4
  const pg_cache_1 = require("pg-cache");
5
5
  const log = new logger_1.Logger('db-kill');
6
6
  const killUsageText = `
7
- LaunchQL Kill Command:
7
+ Kill Command:
8
8
 
9
- lql kill [OPTIONS]
9
+ pgpm kill [OPTIONS]
10
10
 
11
11
  Terminate database connections and optionally drop databases.
12
12
 
@@ -18,10 +18,10 @@ Options:
18
18
  --cwd <directory> Working directory (default: current directory)
19
19
 
20
20
  Examples:
21
- lql kill Kill connections and drop selected databases (interactive)
22
- lql kill --no-drop Only kill connections, preserve databases (interactive)
23
- lql kill --pattern test_% Kill connections to databases matching 'test_%' pattern
24
- lql kill --pattern %dev --no-drop Kill connections to databases ending with 'dev' but don't drop
21
+ pgpm kill Kill connections and drop selected databases (interactive)
22
+ pgpm kill --no-drop Only kill connections, preserve databases (interactive)
23
+ pgpm kill --pattern test_% Kill connections to databases matching 'test_%' pattern
24
+ pgpm kill --pattern %dev --no-drop Kill connections to databases ending with 'dev' but don't drop
25
25
  `;
26
26
  exports.default = async (argv, prompter, _options) => {
27
27
  // Show usage if explicitly requested
@@ -15,7 +15,7 @@ exports.default = async (argv, prompter, _options) => {
15
15
  {
16
16
  name: 'yes',
17
17
  type: 'confirm',
18
- message: `Initialize LaunchQL migration schema in database "${database}"?`,
18
+ message: `Initialize pgpm migration schema in database "${database}"?`,
19
19
  required: true
20
20
  }
21
21
  ];
@@ -16,7 +16,7 @@ const subcommandMap = {
16
16
  deps: deps_1.default
17
17
  };
18
18
  const migrateUsageText = `
19
- LaunchQL Migrate Commands:
19
+ Migrate Commands:
20
20
 
21
21
  launchql migrate init Initialize migration tracking in database
22
22
  launchql migrate status Show current migration status
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@launchql/core");
4
4
  const packageUsageText = `
5
- LaunchQL Package Command:
5
+ Package Command:
6
6
 
7
- lql package [OPTIONS]
7
+ pgpm package [OPTIONS]
8
8
 
9
9
  Package module for distribution.
10
10
 
@@ -16,8 +16,8 @@ Options:
16
16
  --cwd <directory> Working directory (default: current directory)
17
17
 
18
18
  Examples:
19
- lql package Package with defaults
20
- lql package --no-plan Package without plan
19
+ pgpm package Package with defaults
20
+ pgpm package --no-plan Package without plan
21
21
  `;
22
22
  exports.default = async (argv, prompter, _options) => {
23
23
  // Show usage if explicitly requested
package/commands/plan.js CHANGED
@@ -4,9 +4,9 @@ const core_1 = require("@launchql/core");
4
4
  const logger_1 = require("@launchql/logger");
5
5
  const log = new logger_1.Logger('plan');
6
6
  const planUsageText = `
7
- LaunchQL Plan Command:
7
+ Plan Command:
8
8
 
9
- lql plan [OPTIONS]
9
+ pgpm plan [OPTIONS]
10
10
 
11
11
  Generate module deployment plans.
12
12
 
@@ -17,9 +17,9 @@ Options:
17
17
  --cwd <directory> Working directory (default: current directory)
18
18
 
19
19
  Examples:
20
- lql plan Generate deployment plan for current module with defaults
21
- lql plan --includePackages false Disable including external packages
22
- lql plan --includeTags false Do not prefer tags for external packages
20
+ pgpm plan Generate deployment plan for current module with defaults
21
+ pgpm plan --includePackages false Disable including external packages
22
+ pgpm plan --includeTags false Do not prefer tags for external packages
23
23
  `;
24
24
  exports.default = async (argv, prompter, _options) => {
25
25
  // Show usage if explicitly requested
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@launchql/core");
4
- const logger_1 = require("@launchql/logger");
5
4
  const env_1 = require("@launchql/env");
5
+ const logger_1 = require("@launchql/logger");
6
6
  const pg_env_1 = require("pg-env");
7
7
  const utils_1 = require("../utils");
8
8
  const cli_error_1 = require("../utils/cli-error");
9
9
  const log = new logger_1.Logger('remove');
10
10
  exports.default = async (argv, prompter, _options) => {
11
11
  if (!argv.to) {
12
- await (0, cli_error_1.cliExitWithError)('No change specified. Usage: lql remove --to <change>');
12
+ await (0, cli_error_1.cliExitWithError)('No change specified. Usage: pgpm remove --to <change>');
13
13
  }
14
14
  const database = await (0, utils_1.getTargetDatabase)(argv, prompter, {
15
15
  message: 'Select database'
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const path_1 = __importDefault(require("path"));
7
6
  const core_1 = require("@launchql/core");
7
+ const path_1 = __importDefault(require("path"));
8
8
  const cli_error_1 = require("../utils/cli-error");
9
9
  exports.default = async (argv, _prompter) => {
10
10
  const cwd = argv.cwd || process.cwd();
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@launchql/core");
4
- const logger_1 = require("@launchql/logger");
5
4
  const env_1 = require("@launchql/env");
5
+ const logger_1 = require("@launchql/logger");
6
6
  const pg_env_1 = require("pg-env");
7
7
  const utils_1 = require("../utils");
8
- const deployed_changes_1 = require("../utils/deployed-changes");
9
8
  const cli_error_1 = require("../utils/cli-error");
9
+ const deployed_changes_1 = require("../utils/deployed-changes");
10
10
  const log = new logger_1.Logger('revert');
11
11
  const revertUsageText = `
12
- LaunchQL Revert Command:
12
+ Revert Command:
13
13
 
14
- lql revert [OPTIONS]
14
+ pgpm revert [OPTIONS]
15
15
 
16
16
  Revert database changes and migrations.
17
17
 
@@ -25,9 +25,9 @@ Options:
25
25
  --cwd <directory> Working directory (default: current directory)
26
26
 
27
27
  Examples:
28
- lql revert Revert latest changes
29
- lql revert --to @v1.0.0 Revert to specific tag
30
- lql revert --to Interactive selection from deployed changes
28
+ pgpm revert Revert latest changes
29
+ pgpm revert --to @v1.0.0 Revert to specific tag
30
+ pgpm revert --to Interactive selection from deployed changes
31
31
  `;
32
32
  exports.default = async (argv, prompter, _options) => {
33
33
  // Show usage if explicitly requested
package/commands/tag.js CHANGED
@@ -36,14 +36,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const core_1 = require("@launchql/core");
37
37
  const logger_1 = require("@launchql/logger");
38
38
  const types_1 = require("@launchql/types");
39
+ const path = __importStar(require("path"));
39
40
  const argv_1 = require("../utils/argv");
40
41
  const module_utils_1 = require("../utils/module-utils");
41
- const path = __importStar(require("path"));
42
42
  const log = new logger_1.Logger('tag');
43
43
  const tagUsageText = `
44
- LaunchQL Tag Command:
44
+ Tag Command:
45
45
 
46
- lql tag [tag_name] [OPTIONS]
46
+ pgpm tag [tag_name] [OPTIONS]
47
47
 
48
48
  Add tags to changes for versioning.
49
49
 
@@ -58,9 +58,9 @@ Options:
58
58
  --cwd <directory> Working directory (default: current directory)
59
59
 
60
60
  Examples:
61
- lql tag v1.0.0 Add tag to latest change
62
- lql tag v1.0.0 --comment "Initial release" Add tag with comment
63
- lql tag v1.1.0 --package mypackage --changeName my-change Tag specific change in package
61
+ pgpm tag v1.0.0 Add tag to latest change
62
+ pgpm tag v1.0.0 --comment "Initial release" Add tag with comment
63
+ pgpm tag v1.1.0 --package mypackage --changeName my-change Tag specific change in package
64
64
  `;
65
65
  exports.default = async (argv, prompter, _options) => {
66
66
  // Show usage if explicitly requested
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@launchql/core");
4
- const logger_1 = require("@launchql/logger");
5
4
  const env_1 = require("@launchql/env");
5
+ const logger_1 = require("@launchql/logger");
6
6
  const pg_env_1 = require("pg-env");
7
7
  const utils_1 = require("../utils");
8
- const deployed_changes_1 = require("../utils/deployed-changes");
9
8
  const cli_error_1 = require("../utils/cli-error");
9
+ const deployed_changes_1 = require("../utils/deployed-changes");
10
10
  const log = new logger_1.Logger('verify');
11
11
  const verifyUsageText = `
12
- LaunchQL Verify Command:
12
+ Verify Command:
13
13
 
14
- lql verify [OPTIONS]
14
+ pgpm verify [OPTIONS]
15
15
 
16
16
  Verify database state matches expected migrations.
17
17
 
@@ -24,9 +24,9 @@ Options:
24
24
  --cwd <directory> Working directory (default: current directory)
25
25
 
26
26
  Examples:
27
- lql verify Verify current database state
28
- lql verify --package mypackage Verify specific package
29
- lql verify --to Interactive selection from deployed changes
27
+ pgpm verify Verify current database state
28
+ pgpm verify --package mypackage Verify specific package
29
+ pgpm verify --to Interactive selection from deployed changes
30
30
  `;
31
31
  exports.default = async (argv, prompter, _options) => {
32
32
  // Show usage if explicitly requested
package/commands.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { CLIOptions, Inquirerer } from 'inquirerer';
2
2
  import { ParsedArgs } from 'minimist';
3
+ export declare const createPgpmCommandMap: (skipPgTeardown?: boolean) => Record<string, Function>;
3
4
  export declare const commands: (argv: Partial<ParsedArgs>, prompter: Inquirerer, options: CLIOptions & {
4
5
  skipPgTeardown?: boolean;
5
6
  }) => Promise<Partial<ParsedArgs>>;
package/commands.js CHANGED
@@ -3,14 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.commands = void 0;
6
+ exports.commands = exports.createPgpmCommandMap = void 0;
7
7
  const pg_cache_1 = require("pg-cache");
8
- // Commands
9
8
  const add_1 = __importDefault(require("./commands/add"));
10
9
  const admin_users_1 = __importDefault(require("./commands/admin-users"));
10
+ const analyze_1 = __importDefault(require("./commands/analyze"));
11
11
  const clear_1 = __importDefault(require("./commands/clear"));
12
12
  const deploy_1 = __importDefault(require("./commands/deploy"));
13
- const explorer_1 = __importDefault(require("./commands/explorer"));
14
13
  const export_1 = __importDefault(require("./commands/export"));
15
14
  const extension_1 = __importDefault(require("./commands/extension"));
16
15
  const init_1 = __importDefault(require("./commands/init"));
@@ -20,12 +19,10 @@ const migrate_1 = __importDefault(require("./commands/migrate"));
20
19
  const package_1 = __importDefault(require("./commands/package"));
21
20
  const plan_1 = __importDefault(require("./commands/plan"));
22
21
  const remove_1 = __importDefault(require("./commands/remove"));
22
+ const rename_1 = __importDefault(require("./commands/rename"));
23
23
  const revert_1 = __importDefault(require("./commands/revert"));
24
- const server_1 = __importDefault(require("./commands/server"));
25
24
  const tag_1 = __importDefault(require("./commands/tag"));
26
25
  const verify_1 = __importDefault(require("./commands/verify"));
27
- const analyze_1 = __importDefault(require("./commands/analyze"));
28
- const rename_1 = __importDefault(require("./commands/rename"));
29
26
  const package_2 = require("./package");
30
27
  const utils_1 = require("./utils");
31
28
  const cli_error_1 = require("./utils/cli-error");
@@ -39,7 +36,7 @@ const withPgTeardown = (fn, skipTeardown = false) => async (...args) => {
39
36
  }
40
37
  }
41
38
  };
42
- const createCommandMap = (skipPgTeardown = false) => {
39
+ const createPgpmCommandMap = (skipPgTeardown = false) => {
43
40
  const pgt = (fn) => withPgTeardown(fn, skipPgTeardown);
44
41
  return {
45
42
  add: add_1.default,
@@ -59,12 +56,10 @@ const createCommandMap = (skipPgTeardown = false) => {
59
56
  install: pgt(install_1.default),
60
57
  migrate: pgt(migrate_1.default),
61
58
  analyze: pgt(analyze_1.default),
62
- rename: pgt(rename_1.default),
63
- // These manage their own connection lifecycles
64
- server: server_1.default,
65
- explorer: explorer_1.default
59
+ rename: pgt(rename_1.default)
66
60
  };
67
61
  };
62
+ exports.createPgpmCommandMap = createPgpmCommandMap;
68
63
  const commands = async (argv, prompter, options) => {
69
64
  if (argv.version || argv.v) {
70
65
  const pkg = (0, package_2.readAndParsePackageJson)();
@@ -72,18 +67,15 @@ const commands = async (argv, prompter, options) => {
72
67
  process.exit(0);
73
68
  }
74
69
  let { first: command, newArgv } = (0, utils_1.extractFirst)(argv);
75
- // Show usage if explicitly requested but no command specified
76
70
  if ((argv.help || argv.h || command === 'help') && !command) {
77
71
  console.log(utils_1.usageText);
78
72
  process.exit(0);
79
73
  }
80
- // Show usage for help command specifically
81
74
  if (command === 'help') {
82
75
  console.log(utils_1.usageText);
83
76
  process.exit(0);
84
77
  }
85
- const commandMap = createCommandMap(options?.skipPgTeardown);
86
- // Prompt if no command provided
78
+ const commandMap = (0, exports.createPgpmCommandMap)(options?.skipPgTeardown);
87
79
  if (!command) {
88
80
  const answer = await prompter.prompt(argv, [
89
81
  {
@@ -95,7 +87,6 @@ const commands = async (argv, prompter, options) => {
95
87
  ]);
96
88
  command = answer.command;
97
89
  }
98
- // Prompt for working directory
99
90
  newArgv = await prompter.prompt(newArgv, [
100
91
  {
101
92
  type: 'text',
@@ -1,10 +1,10 @@
1
1
  import { LaunchQLPackage } from '@launchql/core';
2
- import { extractFirst } from '../utils/argv';
3
2
  import * as path from 'path';
3
+ import { extractFirst } from '../utils/argv';
4
4
  const addUsageText = `
5
- LaunchQL Add Command:
5
+ Add Command:
6
6
 
7
- lql add [change] [OPTIONS]
7
+ pgpm add [change] [OPTIONS]
8
8
 
9
9
  Add a database change to plans and create deploy/revert/verify SQL files.
10
10
 
@@ -18,10 +18,10 @@ Options:
18
18
  --cwd <directory> Working directory (default: current directory)
19
19
 
20
20
  Examples:
21
- lql add organizations Add change named 'organizations'
22
- lql add brands --note "Adds the brands table" Add change with note
23
- lql add contacts --requires users --note "Adds contacts table" Add with dependency
24
- lql add be/a/path/like/this Add change with nested path
21
+ pgpm add organizations Add change named 'organizations'
22
+ pgpm add brands --note "Adds the brands table" Add change with note
23
+ pgpm add contacts --requires users --note "Adds contacts table" Add with dependency
24
+ pgpm add be/a/path/like/this Add change with nested path
25
25
  `;
26
26
  export default async (argv, prompter, _options) => {
27
27
  // Show usage if explicitly requested
@@ -3,12 +3,12 @@ import { Logger } from '@launchql/logger';
3
3
  import { getPgEnvOptions } from 'pg-env';
4
4
  const log = new Logger('admin-users-add');
5
5
  const addUsageText = `
6
- LaunchQL Admin Users Add Command:
6
+ Admin Users Add Command:
7
7
 
8
- lql admin-users add [OPTIONS]
8
+ pgpm admin-users add [OPTIONS]
9
9
 
10
- Add database users with LaunchQL roles.
11
- Note: You must run 'lql admin-users bootstrap' first to initialize roles.
10
+ Add database users with postgres roles.
11
+ Note: You must run 'pgpm admin-users bootstrap' first to initialize roles.
12
12
 
13
13
  Options:
14
14
  --help, -h Show this help message
@@ -18,9 +18,9 @@ Options:
18
18
  --cwd <directory> Working directory (default: current directory)
19
19
 
20
20
  Examples:
21
- lql admin-users add --username myuser --password mypass
22
- lql admin-users add --test # Add test users (requires bootstrap first)
23
- lql admin-users add # Will prompt for username and password
21
+ pgpm admin-users add --username myuser --password mypass
22
+ pgpm admin-users add --test # Add test users (requires bootstrap first)
23
+ pgpm admin-users add # Will prompt for username and password
24
24
  `;
25
25
  export default async (argv, prompter, _options) => {
26
26
  // Show usage if explicitly requested
@@ -37,7 +37,7 @@ export default async (argv, prompter, _options) => {
37
37
  {
38
38
  type: 'confirm',
39
39
  name: 'yes',
40
- message: 'Are you sure you want to add LaunchQL test users? (WARNING: Should NEVER be run on production!)',
40
+ message: 'Are you sure you want to add test users? (WARNING: Should NEVER be run on production!)',
41
41
  default: false
42
42
  }
43
43
  ]);
@@ -3,19 +3,19 @@ import { Logger } from '@launchql/logger';
3
3
  import { getPgEnvOptions } from 'pg-env';
4
4
  const log = new Logger('admin-users-bootstrap');
5
5
  const bootstrapUsageText = `
6
- LaunchQL Admin Users Bootstrap Command:
6
+ Admin Users Bootstrap Command:
7
7
 
8
- lql admin-users bootstrap [OPTIONS]
8
+ pgpm admin-users bootstrap [OPTIONS]
9
9
 
10
- Initialize LaunchQL roles and permissions. This command must be run before adding users.
11
- Creates the standard LaunchQL roles: anonymous, authenticated, administrator.
10
+ Initialize postgres roles and permissions. This command must be run before adding users.
11
+ Creates the standard postgres roles: anonymous, authenticated, administrator.
12
12
 
13
13
  Options:
14
14
  --help, -h Show this help message
15
15
  --cwd <directory> Working directory (default: current directory)
16
16
 
17
17
  Examples:
18
- lql admin-users bootstrap # Initialize LaunchQL roles
18
+ pgpm admin-users bootstrap # Initialize postgres roles
19
19
  `;
20
20
  export default async (argv, prompter, _options) => {
21
21
  // Show usage if explicitly requested
@@ -28,7 +28,7 @@ export default async (argv, prompter, _options) => {
28
28
  {
29
29
  type: 'confirm',
30
30
  name: 'yes',
31
- message: 'Are you sure you want to initialize LaunchQL roles and permissions?',
31
+ message: 'Are you sure you want to initialize postgres roles and permissions?',
32
32
  default: false
33
33
  }
34
34
  ]);
@@ -39,7 +39,7 @@ export default async (argv, prompter, _options) => {
39
39
  const init = new LaunchQLInit(pgEnv);
40
40
  try {
41
41
  await init.bootstrapRoles();
42
- log.success('LaunchQL roles and permissions initialized successfully.');
42
+ log.success('postgres roles and permissions initialized successfully.');
43
43
  }
44
44
  finally {
45
45
  await init.close();
@@ -3,11 +3,11 @@ import { Logger } from '@launchql/logger';
3
3
  import { getPgEnvOptions } from 'pg-env';
4
4
  const log = new Logger('admin-users-remove');
5
5
  const removeUsageText = `
6
- LaunchQL Admin Users Remove Command:
6
+ Admin Users Remove Command:
7
7
 
8
- lql admin-users remove [OPTIONS]
8
+ pgpm admin-users remove [OPTIONS]
9
9
 
10
- Remove database users and revoke their LaunchQL roles.
10
+ Remove database users and revoke their postgres roles.
11
11
 
12
12
  Options:
13
13
  --help, -h Show this help message
@@ -16,9 +16,9 @@ Options:
16
16
  --cwd <directory> Working directory (default: current directory)
17
17
 
18
18
  Examples:
19
- lql admin-users remove --username myuser
20
- lql admin-users remove --test # Remove test users
21
- lql admin-users remove # Will prompt for username
19
+ pgpm admin-users remove --username myuser
20
+ pgpm admin-users remove --test # Remove test users
21
+ pgpm admin-users remove # Will prompt for username
22
22
  `;
23
23
  export default async (argv, prompter, _options) => {
24
24
  // Show usage if explicitly requested
@@ -35,7 +35,7 @@ export default async (argv, prompter, _options) => {
35
35
  {
36
36
  type: 'confirm',
37
37
  name: 'yes',
38
- message: 'Are you sure you want to remove LaunchQL test users (app_user, app_admin)?',
38
+ message: 'Are you sure you want to remove test users (app_user, app_admin)?',
39
39
  default: false
40
40
  }
41
41
  ]);