pgpm 2.6.0 → 2.7.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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@pgpmjs/core");
4
4
  const logger_1 = require("@pgpmjs/logger");
5
+ const inquirerer_1 = require("inquirerer");
5
6
  const logger = new logger_1.Logger('pgpm');
6
7
  const installUsageText = `
7
8
  Install Command:
@@ -38,17 +39,25 @@ exports.default = async (argv, prompter, _options) => {
38
39
  }
39
40
  // If no packages specified, install missing modules from .control file
40
41
  if (argv._.length === 0) {
42
+ const checkSpinner = (0, inquirerer_1.createSpinner)('Checking for missing modules...');
43
+ checkSpinner.start();
41
44
  const requiredExtensions = project.getRequiredModules();
42
45
  const installedModules = project.getWorkspaceInstalledModules();
43
46
  const missingModules = (0, core_1.getMissingInstallableModules)(requiredExtensions, installedModules);
44
47
  if (missingModules.length === 0) {
45
- logger.success('All modules are already installed.');
48
+ checkSpinner.succeed('All modules are already installed.');
46
49
  return;
47
50
  }
48
51
  const missingNames = missingModules.map(m => m.npmName);
49
- logger.info(`Installing missing modules: ${missingNames.join(', ')}`);
52
+ checkSpinner.succeed(`Found ${missingModules.length} missing module(s): ${missingNames.join(', ')}`);
53
+ const installSpinner = (0, inquirerer_1.createSpinner)(`Installing ${missingModules.length} module(s)...`);
54
+ installSpinner.start();
50
55
  await project.installModules(...missingNames);
56
+ installSpinner.succeed(`Installed ${missingModules.length} module(s) successfully.`);
51
57
  return;
52
58
  }
59
+ const installSpinner = (0, inquirerer_1.createSpinner)(`Installing ${argv._.length} module(s)...`);
60
+ installSpinner.start();
53
61
  await project.installModules(...argv._);
62
+ installSpinner.succeed(`Installed ${argv._.length} module(s) successfully.`);
54
63
  };
@@ -13,11 +13,13 @@ Options:
13
13
  --plan Include deployment plan (default: true)
14
14
  --pretty Pretty-print output (default: true)
15
15
  --functionDelimiter <delimiter> Function delimiter (default: $EOFCODE$)
16
+ --outputDiff Export AST diff files when round-trip mismatch detected (default: false)
16
17
  --cwd <directory> Working directory (default: current directory)
17
18
 
18
19
  Examples:
19
20
  pgpm package Package with defaults
20
21
  pgpm package --no-plan Package without plan
22
+ pgpm package --outputDiff Package and export AST diff files if mismatch detected
21
23
  `;
22
24
  exports.default = async (argv, prompter, _options) => {
23
25
  // Show usage if explicitly requested
@@ -46,9 +48,16 @@ exports.default = async (argv, prompter, _options) => {
46
48
  default: '$EOFCODE$',
47
49
  useDefault: true,
48
50
  required: false
51
+ },
52
+ {
53
+ type: 'confirm',
54
+ name: 'outputDiff',
55
+ default: false,
56
+ useDefault: true,
57
+ required: false
49
58
  }
50
59
  ];
51
- let { cwd, plan, pretty, functionDelimiter } = await prompter.prompt(argv, questions);
60
+ let { cwd, plan, pretty, functionDelimiter, outputDiff } = await prompter.prompt(argv, questions);
52
61
  const project = new core_1.PgpmPackage(cwd);
53
62
  project.ensureModule();
54
63
  const info = project.getModuleInfo();
@@ -59,7 +68,8 @@ exports.default = async (argv, prompter, _options) => {
59
68
  usePlan: plan,
60
69
  packageDir: project.modulePath,
61
70
  pretty,
62
- functionDelimiter
71
+ functionDelimiter,
72
+ outputDiff
63
73
  });
64
74
  return argv;
65
75
  };
@@ -18,7 +18,7 @@ Options:
18
18
  --cwd <directory> Working directory (default: current directory)
19
19
  -i, --interactive Show outdated modules and select which ones to upgrade
20
20
  --dry-run Show what would be upgraded without making changes
21
- --workspace Upgrade modules across all packages in the workspace
21
+ -w, --workspace Upgrade modules across all packages in the workspace
22
22
 
23
23
  Examples:
24
24
  pgpm upgrade Upgrade all installed modules
@@ -118,7 +118,7 @@ exports.default = async (argv, prompter, _options) => {
118
118
  const { cwd = process.cwd() } = argv;
119
119
  const dryRun = Boolean(argv['dry-run']);
120
120
  const interactive = Boolean(argv.i || argv.interactive);
121
- const workspaceMode = Boolean(argv.workspace);
121
+ const workspaceMode = Boolean(argv.w || argv.workspace);
122
122
  // Get specific modules from positional arguments (argv._)
123
123
  const specificModules = argv._ && argv._.length > 0
124
124
  ? argv._.map((m) => String(m).trim())
@@ -1,5 +1,6 @@
1
1
  import { getMissingInstallableModules, PgpmPackage } from '@pgpmjs/core';
2
2
  import { Logger } from '@pgpmjs/logger';
3
+ import { createSpinner } from 'inquirerer';
3
4
  const logger = new Logger('pgpm');
4
5
  const installUsageText = `
5
6
  Install Command:
@@ -36,17 +37,25 @@ export default async (argv, prompter, _options) => {
36
37
  }
37
38
  // If no packages specified, install missing modules from .control file
38
39
  if (argv._.length === 0) {
40
+ const checkSpinner = createSpinner('Checking for missing modules...');
41
+ checkSpinner.start();
39
42
  const requiredExtensions = project.getRequiredModules();
40
43
  const installedModules = project.getWorkspaceInstalledModules();
41
44
  const missingModules = getMissingInstallableModules(requiredExtensions, installedModules);
42
45
  if (missingModules.length === 0) {
43
- logger.success('All modules are already installed.');
46
+ checkSpinner.succeed('All modules are already installed.');
44
47
  return;
45
48
  }
46
49
  const missingNames = missingModules.map(m => m.npmName);
47
- logger.info(`Installing missing modules: ${missingNames.join(', ')}`);
50
+ checkSpinner.succeed(`Found ${missingModules.length} missing module(s): ${missingNames.join(', ')}`);
51
+ const installSpinner = createSpinner(`Installing ${missingModules.length} module(s)...`);
52
+ installSpinner.start();
48
53
  await project.installModules(...missingNames);
54
+ installSpinner.succeed(`Installed ${missingModules.length} module(s) successfully.`);
49
55
  return;
50
56
  }
57
+ const installSpinner = createSpinner(`Installing ${argv._.length} module(s)...`);
58
+ installSpinner.start();
51
59
  await project.installModules(...argv._);
60
+ installSpinner.succeed(`Installed ${argv._.length} module(s) successfully.`);
52
61
  };
@@ -11,11 +11,13 @@ Options:
11
11
  --plan Include deployment plan (default: true)
12
12
  --pretty Pretty-print output (default: true)
13
13
  --functionDelimiter <delimiter> Function delimiter (default: $EOFCODE$)
14
+ --outputDiff Export AST diff files when round-trip mismatch detected (default: false)
14
15
  --cwd <directory> Working directory (default: current directory)
15
16
 
16
17
  Examples:
17
18
  pgpm package Package with defaults
18
19
  pgpm package --no-plan Package without plan
20
+ pgpm package --outputDiff Package and export AST diff files if mismatch detected
19
21
  `;
20
22
  export default async (argv, prompter, _options) => {
21
23
  // Show usage if explicitly requested
@@ -44,9 +46,16 @@ export default async (argv, prompter, _options) => {
44
46
  default: '$EOFCODE$',
45
47
  useDefault: true,
46
48
  required: false
49
+ },
50
+ {
51
+ type: 'confirm',
52
+ name: 'outputDiff',
53
+ default: false,
54
+ useDefault: true,
55
+ required: false
47
56
  }
48
57
  ];
49
- let { cwd, plan, pretty, functionDelimiter } = await prompter.prompt(argv, questions);
58
+ let { cwd, plan, pretty, functionDelimiter, outputDiff } = await prompter.prompt(argv, questions);
50
59
  const project = new PgpmPackage(cwd);
51
60
  project.ensureModule();
52
61
  const info = project.getModuleInfo();
@@ -57,7 +66,8 @@ export default async (argv, prompter, _options) => {
57
66
  usePlan: plan,
58
67
  packageDir: project.modulePath,
59
68
  pretty,
60
- functionDelimiter
69
+ functionDelimiter,
70
+ outputDiff
61
71
  });
62
72
  return argv;
63
73
  };
@@ -16,7 +16,7 @@ Options:
16
16
  --cwd <directory> Working directory (default: current directory)
17
17
  -i, --interactive Show outdated modules and select which ones to upgrade
18
18
  --dry-run Show what would be upgraded without making changes
19
- --workspace Upgrade modules across all packages in the workspace
19
+ -w, --workspace Upgrade modules across all packages in the workspace
20
20
 
21
21
  Examples:
22
22
  pgpm upgrade Upgrade all installed modules
@@ -116,7 +116,7 @@ export default async (argv, prompter, _options) => {
116
116
  const { cwd = process.cwd() } = argv;
117
117
  const dryRun = Boolean(argv['dry-run']);
118
118
  const interactive = Boolean(argv.i || argv.interactive);
119
- const workspaceMode = Boolean(argv.workspace);
119
+ const workspaceMode = Boolean(argv.w || argv.workspace);
120
120
  // Get specific modules from positional arguments (argv._)
121
121
  const specificModules = argv._ && argv._.length > 0
122
122
  ? argv._.map((m) => String(m).trim())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgpm",
3
- "version": "2.6.0",
3
+ "version": "2.7.1",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PostgreSQL Package Manager - Database migration and package management CLI",
6
6
  "main": "index.js",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@inquirerer/utils": "^3.1.1",
50
- "@pgpmjs/core": "^4.5.0",
50
+ "@pgpmjs/core": "^4.5.1",
51
51
  "@pgpmjs/env": "^2.8.11",
52
52
  "@pgpmjs/logger": "^1.3.5",
53
53
  "@pgpmjs/types": "^2.12.8",
@@ -75,5 +75,5 @@
75
75
  "pg",
76
76
  "pgsql"
77
77
  ],
78
- "gitHead": "09721f934b339bd8c55d2e633abaded6d20b0f65"
78
+ "gitHead": "6883e3b93da28078483bc6aa25862613ef4405b2"
79
79
  }