pnpm-catalog-updates 0.5.7 → 0.6.5
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/bin/pcu.js +1 -1
- package/dist/index.js +9559 -32
- package/dist/index.js.map +1 -1
- package/package.json +61 -103
- package/src/cli/commands/checkCommand.ts +227 -0
- package/src/cli/commands/initCommand.ts +394 -0
- package/src/cli/commands/securityCommand.ts +569 -0
- package/src/cli/commands/updateCommand.ts +245 -0
- package/src/cli/formatters/outputFormatter.ts +830 -0
- package/src/cli/formatters/progressBar.ts +700 -0
- package/src/cli/index.ts +565 -0
- package/src/cli/interactive/interactivePrompts.ts +517 -0
- package/src/cli/options/globalOptions.ts +380 -0
- package/src/cli/options/index.ts +5 -0
- package/src/cli/themes/colorTheme.ts +379 -0
- package/src/cli/validators/commandValidator.ts +395 -0
- package/src/cli/validators/index.ts +5 -0
- package/src/index.ts +4 -0
- package/LICENSE +0 -21
- package/README.ja.md +0 -587
- package/README.md +0 -694
- package/README.zh-CN.md +0 -634
- package/dist/application/services/CatalogUpdateService.d.ts +0 -209
- package/dist/application/services/CatalogUpdateService.d.ts.map +0 -1
- package/dist/application/services/CatalogUpdateService.js +0 -839
- package/dist/application/services/CatalogUpdateService.js.map +0 -1
- package/dist/application/services/WorkspaceService.d.ts +0 -139
- package/dist/application/services/WorkspaceService.d.ts.map +0 -1
- package/dist/application/services/WorkspaceService.js +0 -340
- package/dist/application/services/WorkspaceService.js.map +0 -1
- package/dist/cli/commands/CheckCommand.d.ts +0 -40
- package/dist/cli/commands/CheckCommand.d.ts.map +0 -1
- package/dist/cli/commands/CheckCommand.js +0 -177
- package/dist/cli/commands/CheckCommand.js.map +0 -1
- package/dist/cli/commands/InitCommand.d.ts +0 -53
- package/dist/cli/commands/InitCommand.d.ts.map +0 -1
- package/dist/cli/commands/InitCommand.js +0 -338
- package/dist/cli/commands/InitCommand.js.map +0 -1
- package/dist/cli/commands/SecurityCommand.d.ts +0 -113
- package/dist/cli/commands/SecurityCommand.d.ts.map +0 -1
- package/dist/cli/commands/SecurityCommand.js +0 -410
- package/dist/cli/commands/SecurityCommand.js.map +0 -1
- package/dist/cli/commands/UpdateCommand.d.ts +0 -44
- package/dist/cli/commands/UpdateCommand.d.ts.map +0 -1
- package/dist/cli/commands/UpdateCommand.js +0 -189
- package/dist/cli/commands/UpdateCommand.js.map +0 -1
- package/dist/cli/formatters/OutputFormatter.d.ts +0 -116
- package/dist/cli/formatters/OutputFormatter.d.ts.map +0 -1
- package/dist/cli/formatters/OutputFormatter.js +0 -664
- package/dist/cli/formatters/OutputFormatter.js.map +0 -1
- package/dist/cli/formatters/ProgressBar.d.ts +0 -195
- package/dist/cli/formatters/ProgressBar.d.ts.map +0 -1
- package/dist/cli/formatters/ProgressBar.js +0 -622
- package/dist/cli/formatters/ProgressBar.js.map +0 -1
- package/dist/cli/index.d.ts +0 -12
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -492
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/interactive/InteractivePrompts.d.ts +0 -85
- package/dist/cli/interactive/InteractivePrompts.d.ts.map +0 -1
- package/dist/cli/interactive/InteractivePrompts.js +0 -434
- package/dist/cli/interactive/InteractivePrompts.js.map +0 -1
- package/dist/cli/options/GlobalOptions.d.ts +0 -117
- package/dist/cli/options/GlobalOptions.d.ts.map +0 -1
- package/dist/cli/options/GlobalOptions.js +0 -278
- package/dist/cli/options/GlobalOptions.js.map +0 -1
- package/dist/cli/options/index.d.ts +0 -5
- package/dist/cli/options/index.d.ts.map +0 -1
- package/dist/cli/options/index.js +0 -5
- package/dist/cli/options/index.js.map +0 -1
- package/dist/cli/themes/ColorTheme.d.ts +0 -211
- package/dist/cli/themes/ColorTheme.d.ts.map +0 -1
- package/dist/cli/themes/ColorTheme.js +0 -267
- package/dist/cli/themes/ColorTheme.js.map +0 -1
- package/dist/cli/validators/CommandValidator.d.ts +0 -60
- package/dist/cli/validators/CommandValidator.d.ts.map +0 -1
- package/dist/cli/validators/CommandValidator.js +0 -319
- package/dist/cli/validators/CommandValidator.js.map +0 -1
- package/dist/cli/validators/index.d.ts +0 -5
- package/dist/cli/validators/index.d.ts.map +0 -1
- package/dist/cli/validators/index.js +0 -5
- package/dist/cli/validators/index.js.map +0 -1
- package/dist/common/config/Config.d.ts +0 -142
- package/dist/common/config/Config.d.ts.map +0 -1
- package/dist/common/config/Config.js +0 -382
- package/dist/common/config/Config.js.map +0 -1
- package/dist/common/config/ConfigLoader.d.ts +0 -49
- package/dist/common/config/ConfigLoader.d.ts.map +0 -1
- package/dist/common/config/ConfigLoader.js +0 -180
- package/dist/common/config/ConfigLoader.js.map +0 -1
- package/dist/common/config/PackageFilterConfig.d.ts +0 -56
- package/dist/common/config/PackageFilterConfig.d.ts.map +0 -1
- package/dist/common/config/PackageFilterConfig.js +0 -94
- package/dist/common/config/PackageFilterConfig.js.map +0 -1
- package/dist/common/config/index.d.ts +0 -8
- package/dist/common/config/index.d.ts.map +0 -1
- package/dist/common/config/index.js +0 -8
- package/dist/common/config/index.js.map +0 -1
- package/dist/common/error-handling/ErrorTracker.d.ts +0 -48
- package/dist/common/error-handling/ErrorTracker.d.ts.map +0 -1
- package/dist/common/error-handling/ErrorTracker.js +0 -93
- package/dist/common/error-handling/ErrorTracker.js.map +0 -1
- package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts +0 -74
- package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts.map +0 -1
- package/dist/common/error-handling/UserFriendlyErrorHandler.js +0 -703
- package/dist/common/error-handling/UserFriendlyErrorHandler.js.map +0 -1
- package/dist/common/error-handling/index.d.ts +0 -11
- package/dist/common/error-handling/index.d.ts.map +0 -1
- package/dist/common/error-handling/index.js +0 -9
- package/dist/common/error-handling/index.js.map +0 -1
- package/dist/common/logger/Logger.d.ts +0 -110
- package/dist/common/logger/Logger.d.ts.map +0 -1
- package/dist/common/logger/Logger.js +0 -289
- package/dist/common/logger/Logger.js.map +0 -1
- package/dist/common/logger/index.d.ts +0 -6
- package/dist/common/logger/index.d.ts.map +0 -1
- package/dist/common/logger/index.js +0 -6
- package/dist/common/logger/index.js.map +0 -1
- package/dist/common/types/cli.d.ts +0 -265
- package/dist/common/types/cli.d.ts.map +0 -1
- package/dist/common/types/cli.js +0 -5
- package/dist/common/types/cli.js.map +0 -1
- package/dist/common/types/core.d.ts +0 -270
- package/dist/common/types/core.d.ts.map +0 -1
- package/dist/common/types/core.js +0 -32
- package/dist/common/types/core.js.map +0 -1
- package/dist/common/types/index.d.ts +0 -8
- package/dist/common/types/index.d.ts.map +0 -1
- package/dist/common/types/index.js +0 -8
- package/dist/common/types/index.js.map +0 -1
- package/dist/common/utils/VersionChecker.d.ts +0 -54
- package/dist/common/utils/VersionChecker.d.ts.map +0 -1
- package/dist/common/utils/VersionChecker.js +0 -180
- package/dist/common/utils/VersionChecker.js.map +0 -1
- package/dist/common/utils/async.d.ts +0 -74
- package/dist/common/utils/async.d.ts.map +0 -1
- package/dist/common/utils/async.js +0 -228
- package/dist/common/utils/async.js.map +0 -1
- package/dist/common/utils/format.d.ts +0 -32
- package/dist/common/utils/format.d.ts.map +0 -1
- package/dist/common/utils/format.js +0 -121
- package/dist/common/utils/format.js.map +0 -1
- package/dist/common/utils/git.d.ts +0 -44
- package/dist/common/utils/git.d.ts.map +0 -1
- package/dist/common/utils/git.js +0 -147
- package/dist/common/utils/git.js.map +0 -1
- package/dist/common/utils/index.d.ts +0 -12
- package/dist/common/utils/index.d.ts.map +0 -1
- package/dist/common/utils/index.js +0 -12
- package/dist/common/utils/index.js.map +0 -1
- package/dist/common/utils/string.d.ts +0 -56
- package/dist/common/utils/string.d.ts.map +0 -1
- package/dist/common/utils/string.js +0 -134
- package/dist/common/utils/string.js.map +0 -1
- package/dist/common/utils/validation.d.ts +0 -88
- package/dist/common/utils/validation.d.ts.map +0 -1
- package/dist/common/utils/validation.js +0 -308
- package/dist/common/utils/validation.js.map +0 -1
- package/dist/domain/entities/Catalog.d.ts +0 -117
- package/dist/domain/entities/Catalog.d.ts.map +0 -1
- package/dist/domain/entities/Catalog.js +0 -240
- package/dist/domain/entities/Catalog.js.map +0 -1
- package/dist/domain/entities/Package.d.ts +0 -143
- package/dist/domain/entities/Package.d.ts.map +0 -1
- package/dist/domain/entities/Package.js +0 -272
- package/dist/domain/entities/Package.js.map +0 -1
- package/dist/domain/entities/Workspace.d.ts +0 -95
- package/dist/domain/entities/Workspace.d.ts.map +0 -1
- package/dist/domain/entities/Workspace.js +0 -173
- package/dist/domain/entities/Workspace.js.map +0 -1
- package/dist/domain/repositories/WorkspaceRepository.d.ts +0 -41
- package/dist/domain/repositories/WorkspaceRepository.d.ts.map +0 -1
- package/dist/domain/repositories/WorkspaceRepository.js +0 -8
- package/dist/domain/repositories/WorkspaceRepository.js.map +0 -1
- package/dist/domain/value-objects/CatalogCollection.d.ts +0 -106
- package/dist/domain/value-objects/CatalogCollection.d.ts.map +0 -1
- package/dist/domain/value-objects/CatalogCollection.js +0 -230
- package/dist/domain/value-objects/CatalogCollection.js.map +0 -1
- package/dist/domain/value-objects/PackageCollection.d.ts +0 -122
- package/dist/domain/value-objects/PackageCollection.d.ts.map +0 -1
- package/dist/domain/value-objects/PackageCollection.js +0 -263
- package/dist/domain/value-objects/PackageCollection.js.map +0 -1
- package/dist/domain/value-objects/Version.d.ts +0 -141
- package/dist/domain/value-objects/Version.d.ts.map +0 -1
- package/dist/domain/value-objects/Version.js +0 -268
- package/dist/domain/value-objects/Version.js.map +0 -1
- package/dist/domain/value-objects/WorkspaceConfig.d.ts +0 -144
- package/dist/domain/value-objects/WorkspaceConfig.d.ts.map +0 -1
- package/dist/domain/value-objects/WorkspaceConfig.js +0 -357
- package/dist/domain/value-objects/WorkspaceConfig.js.map +0 -1
- package/dist/domain/value-objects/WorkspaceId.d.ts +0 -51
- package/dist/domain/value-objects/WorkspaceId.d.ts.map +0 -1
- package/dist/domain/value-objects/WorkspaceId.js +0 -104
- package/dist/domain/value-objects/WorkspaceId.js.map +0 -1
- package/dist/domain/value-objects/WorkspacePath.d.ts +0 -75
- package/dist/domain/value-objects/WorkspacePath.d.ts.map +0 -1
- package/dist/domain/value-objects/WorkspacePath.js +0 -128
- package/dist/domain/value-objects/WorkspacePath.js.map +0 -1
- package/dist/index.d.ts +0 -25
- package/dist/index.d.ts.map +0 -1
- package/dist/infrastructure/cache/Cache.d.ts +0 -161
- package/dist/infrastructure/cache/Cache.d.ts.map +0 -1
- package/dist/infrastructure/cache/Cache.js +0 -398
- package/dist/infrastructure/cache/Cache.js.map +0 -1
- package/dist/infrastructure/cache/index.d.ts +0 -6
- package/dist/infrastructure/cache/index.d.ts.map +0 -1
- package/dist/infrastructure/cache/index.js +0 -6
- package/dist/infrastructure/cache/index.js.map +0 -1
- package/dist/infrastructure/external-services/NpmRegistryService.d.ts +0 -153
- package/dist/infrastructure/external-services/NpmRegistryService.d.ts.map +0 -1
- package/dist/infrastructure/external-services/NpmRegistryService.js +0 -511
- package/dist/infrastructure/external-services/NpmRegistryService.js.map +0 -1
- package/dist/infrastructure/file-system/FileSystemService.d.ts +0 -120
- package/dist/infrastructure/file-system/FileSystemService.d.ts.map +0 -1
- package/dist/infrastructure/file-system/FileSystemService.js +0 -663
- package/dist/infrastructure/file-system/FileSystemService.js.map +0 -1
- package/dist/infrastructure/repositories/FileWorkspaceRepository.d.ts +0 -57
- package/dist/infrastructure/repositories/FileWorkspaceRepository.d.ts.map +0 -1
- package/dist/infrastructure/repositories/FileWorkspaceRepository.js +0 -179
- package/dist/infrastructure/repositories/FileWorkspaceRepository.js.map +0 -1
- package/dist/infrastructure/utils/NpmrcParser.d.ts +0 -40
- package/dist/infrastructure/utils/NpmrcParser.d.ts.map +0 -1
- package/dist/infrastructure/utils/NpmrcParser.js +0 -157
- package/dist/infrastructure/utils/NpmrcParser.js.map +0 -1
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Update Command
|
|
3
|
-
*
|
|
4
|
-
* CLI command to update catalog dependencies.
|
|
5
|
-
* Supports interactive mode, dry-run, and various update strategies.
|
|
6
|
-
*/
|
|
7
|
-
import { OutputFormatter } from '../formatters/OutputFormatter.js';
|
|
8
|
-
import { ProgressBar } from '../formatters/ProgressBar.js';
|
|
9
|
-
import { InteractivePrompts } from '../interactive/InteractivePrompts.js';
|
|
10
|
-
import { StyledText, ThemeManager } from '../themes/ColorTheme.js';
|
|
11
|
-
import { ConfigLoader } from '../../common/config/ConfigLoader.js';
|
|
12
|
-
export class UpdateCommand {
|
|
13
|
-
updateService;
|
|
14
|
-
constructor(updateService) {
|
|
15
|
-
this.updateService = updateService;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Execute the update command
|
|
19
|
-
*/
|
|
20
|
-
async execute(options = {}) {
|
|
21
|
-
let progressBar;
|
|
22
|
-
try {
|
|
23
|
-
// Initialize theme
|
|
24
|
-
ThemeManager.setTheme('default');
|
|
25
|
-
// Create progress bar for the update process
|
|
26
|
-
progressBar = new ProgressBar({
|
|
27
|
-
text: '正在规划更新...',
|
|
28
|
-
total: 4, // 4 main steps
|
|
29
|
-
});
|
|
30
|
-
progressBar.start('正在加载工作区配置...');
|
|
31
|
-
// Load configuration file first
|
|
32
|
-
const config = ConfigLoader.loadConfig(options.workspace || process.cwd());
|
|
33
|
-
// Use format from CLI options first, then config file, then default
|
|
34
|
-
const effectiveFormat = options.format || config.defaults?.format || 'table';
|
|
35
|
-
// Create output formatter with effective format
|
|
36
|
-
const formatter = new OutputFormatter(effectiveFormat, options.color !== false);
|
|
37
|
-
// Merge CLI options with configuration file settings
|
|
38
|
-
const updateOptions = {
|
|
39
|
-
workspacePath: options.workspace,
|
|
40
|
-
catalogName: options.catalog,
|
|
41
|
-
target: options.target || config.defaults?.target,
|
|
42
|
-
includePrerelease: options.prerelease ?? config.defaults?.includePrerelease ?? false,
|
|
43
|
-
// CLI include/exclude options take priority over config file
|
|
44
|
-
include: options.include?.length ? options.include : config.include,
|
|
45
|
-
exclude: options.exclude?.length ? options.exclude : config.exclude,
|
|
46
|
-
interactive: options.interactive ?? config.defaults?.interactive ?? false,
|
|
47
|
-
dryRun: options.dryRun ?? config.defaults?.dryRun ?? false,
|
|
48
|
-
force: options.force ?? false,
|
|
49
|
-
createBackup: options.createBackup ?? config.defaults?.createBackup ?? false,
|
|
50
|
-
};
|
|
51
|
-
// Step 1: Planning updates
|
|
52
|
-
progressBar.update('正在检查包版本...', 1, 4);
|
|
53
|
-
const plan = await this.updateService.planUpdates(updateOptions);
|
|
54
|
-
// Step 2: Check if any updates found
|
|
55
|
-
progressBar.update('正在分析更新...', 2, 4);
|
|
56
|
-
if (!plan.updates.length) {
|
|
57
|
-
progressBar.succeed('所有依赖包都是最新的');
|
|
58
|
-
console.log(StyledText.iconSuccess('All dependencies are up to date!'));
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
console.log(StyledText.iconPackage(`Found ${plan.totalUpdates} update${plan.totalUpdates === 1 ? '' : 's'} available`));
|
|
62
|
-
// Interactive selection if enabled
|
|
63
|
-
let finalPlan = plan;
|
|
64
|
-
if (options.interactive) {
|
|
65
|
-
finalPlan = await this.interactiveSelection(plan);
|
|
66
|
-
if (!finalPlan.updates.length) {
|
|
67
|
-
progressBar.warn('未选择任何更新');
|
|
68
|
-
console.log(StyledText.iconWarning('No updates selected'));
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// Step 3: Apply updates
|
|
73
|
-
progressBar.update('正在准备应用更新...', 3, 4);
|
|
74
|
-
if (!options.dryRun) {
|
|
75
|
-
// Replace the progress bar with one for applying updates
|
|
76
|
-
progressBar.stop();
|
|
77
|
-
progressBar = new ProgressBar({
|
|
78
|
-
text: 'Applying updates...',
|
|
79
|
-
total: finalPlan.updates.length,
|
|
80
|
-
});
|
|
81
|
-
progressBar.start('正在应用更新...');
|
|
82
|
-
const result = await this.updateService.executeUpdates(finalPlan, updateOptions);
|
|
83
|
-
progressBar.succeed(`Applied ${finalPlan.updates.length} updates`);
|
|
84
|
-
console.log(formatter.formatUpdateResult(result));
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
progressBar.update('正在生成预览...', 4, 4);
|
|
88
|
-
progressBar.succeed('更新预览完成');
|
|
89
|
-
console.log(StyledText.iconInfo('Dry run - no changes made'));
|
|
90
|
-
console.log(JSON.stringify(finalPlan, null, 2));
|
|
91
|
-
}
|
|
92
|
-
console.log(StyledText.iconComplete('Update process completed!'));
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
if (progressBar) {
|
|
96
|
-
progressBar.fail('Operation failed');
|
|
97
|
-
}
|
|
98
|
-
if (error instanceof Error) {
|
|
99
|
-
console.error(StyledText.iconError(`Error: ${error.message}`));
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
console.error(StyledText.iconError('Unknown error occurred'));
|
|
103
|
-
}
|
|
104
|
-
throw error;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Interactive update selection
|
|
109
|
-
*/
|
|
110
|
-
async interactiveSelection(plan) {
|
|
111
|
-
const interactivePrompts = new InteractivePrompts();
|
|
112
|
-
// Transform PlannedUpdate to the format expected by InteractivePrompts
|
|
113
|
-
const packages = plan.updates.map((update) => ({
|
|
114
|
-
name: update.packageName,
|
|
115
|
-
current: update.currentVersion,
|
|
116
|
-
latest: update.newVersion,
|
|
117
|
-
type: update.updateType,
|
|
118
|
-
}));
|
|
119
|
-
const selectedPackageNames = await interactivePrompts.selectPackages(packages);
|
|
120
|
-
// Filter the plan to only include selected packages
|
|
121
|
-
const selectedUpdates = plan.updates.filter((update) => selectedPackageNames.includes(update.packageName));
|
|
122
|
-
return {
|
|
123
|
-
...plan,
|
|
124
|
-
updates: selectedUpdates,
|
|
125
|
-
totalUpdates: selectedUpdates.length,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Validate command options
|
|
130
|
-
*/
|
|
131
|
-
static validateOptions(options) {
|
|
132
|
-
const errors = [];
|
|
133
|
-
// Validate format
|
|
134
|
-
if (options.format && !['table', 'json', 'yaml', 'minimal'].includes(options.format)) {
|
|
135
|
-
errors.push('Invalid format. Must be one of: table, json, yaml, minimal');
|
|
136
|
-
}
|
|
137
|
-
// Validate target
|
|
138
|
-
if (options.target &&
|
|
139
|
-
!['latest', 'greatest', 'minor', 'patch', 'newest'].includes(options.target)) {
|
|
140
|
-
errors.push('Invalid target. Must be one of: latest, greatest, minor, patch, newest');
|
|
141
|
-
}
|
|
142
|
-
// Interactive and dry-run conflict
|
|
143
|
-
if (options.interactive && options.dryRun) {
|
|
144
|
-
errors.push('Cannot use --interactive with --dry-run');
|
|
145
|
-
}
|
|
146
|
-
return errors;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Get command help text
|
|
150
|
-
*/
|
|
151
|
-
static getHelpText() {
|
|
152
|
-
return `
|
|
153
|
-
Update catalog dependencies
|
|
154
|
-
|
|
155
|
-
Usage:
|
|
156
|
-
pcu update [options]
|
|
157
|
-
|
|
158
|
-
Options:
|
|
159
|
-
--workspace <path> Workspace directory (default: current directory)
|
|
160
|
-
--catalog <name> Update specific catalog only
|
|
161
|
-
--format <type> Output format: table, json, yaml, minimal (default: table)
|
|
162
|
-
--target <type> Update target: latest, greatest, minor, patch, newest (default: latest)
|
|
163
|
-
-i, --interactive Interactive mode to choose updates
|
|
164
|
-
-d, --dry-run Preview changes without writing files
|
|
165
|
-
--force Force updates even if conflicts exist
|
|
166
|
-
--prerelease Include prerelease versions
|
|
167
|
-
--include <pattern> Include packages matching pattern (can be used multiple times)
|
|
168
|
-
--exclude <pattern> Exclude packages matching pattern (can be used multiple times)
|
|
169
|
-
--create-backup Create backup files before updating
|
|
170
|
-
--verbose Show detailed information
|
|
171
|
-
--no-color Disable colored output
|
|
172
|
-
|
|
173
|
-
Examples:
|
|
174
|
-
pcu update # Update all catalogs
|
|
175
|
-
pcu update --interactive # Interactive update selection
|
|
176
|
-
pcu update --dry-run # Preview updates without applying
|
|
177
|
-
pcu update --catalog react17 # Update specific catalog
|
|
178
|
-
pcu update --target minor # Update to latest minor versions only
|
|
179
|
-
pcu update --force # Force updates despite conflicts
|
|
180
|
-
pcu update --include "react*" # Update only React packages
|
|
181
|
-
|
|
182
|
-
Exit Codes:
|
|
183
|
-
0 Updates completed successfully
|
|
184
|
-
1 Updates failed or were cancelled
|
|
185
|
-
2 Error occurred
|
|
186
|
-
`;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
//# sourceMappingURL=UpdateCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateCommand.js","sourceRoot":"","sources":["../../../src/cli/commands/UpdateCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAgB,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAkBnE,MAAM,OAAO,aAAa;IACP,aAAa,CAAuB;IAErD,YAAY,aAAmC;QAC7C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,UAAgC,EAAE;QAC9C,IAAI,WAAoC,CAAC;QAEzC,IAAI,CAAC;YACH,mBAAmB;YACnB,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAEjC,6CAA6C;YAC7C,WAAW,GAAG,IAAI,WAAW,CAAC;gBAC5B,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,CAAC,EAAE,eAAe;aAC1B,CAAC,CAAC;YACH,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;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AAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAC5E,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC;QACxF,CAAC;QAED,mCAAmC;QACnC,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW;QAChB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkCN,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Output Formatter
|
|
3
|
-
*
|
|
4
|
-
* Provides formatted output for CLI commands in various formats.
|
|
5
|
-
* Supports table, JSON, YAML, and minimal output formats.
|
|
6
|
-
*/
|
|
7
|
-
import { ImpactAnalysis, OutdatedReport, UpdateResult } from '../../application/services/CatalogUpdateService.js';
|
|
8
|
-
import { WorkspaceStats, WorkspaceValidationReport } from '../../application/services/WorkspaceService.js';
|
|
9
|
-
import { SecurityReport } from '../commands/SecurityCommand.js';
|
|
10
|
-
export type OutputFormat = 'table' | 'json' | 'yaml' | 'minimal';
|
|
11
|
-
export declare class OutputFormatter {
|
|
12
|
-
private readonly format;
|
|
13
|
-
private readonly useColor;
|
|
14
|
-
constructor(format?: OutputFormat, useColor?: boolean);
|
|
15
|
-
/**
|
|
16
|
-
* Format outdated dependencies report
|
|
17
|
-
*/
|
|
18
|
-
formatOutdatedReport(report: OutdatedReport): string;
|
|
19
|
-
/**
|
|
20
|
-
* Format update result
|
|
21
|
-
*/
|
|
22
|
-
formatUpdateResult(result: UpdateResult): string;
|
|
23
|
-
/**
|
|
24
|
-
* Format impact analysis
|
|
25
|
-
*/
|
|
26
|
-
formatImpactAnalysis(analysis: ImpactAnalysis): string;
|
|
27
|
-
/**
|
|
28
|
-
* Format workspace validation report
|
|
29
|
-
*/
|
|
30
|
-
formatValidationReport(report: WorkspaceValidationReport): string;
|
|
31
|
-
/**
|
|
32
|
-
* Format workspace statistics
|
|
33
|
-
*/
|
|
34
|
-
formatWorkspaceStats(stats: WorkspaceStats): string;
|
|
35
|
-
/**
|
|
36
|
-
* Format security report
|
|
37
|
-
*/
|
|
38
|
-
formatSecurityReport(report: SecurityReport): string;
|
|
39
|
-
/**
|
|
40
|
-
* Format simple message with optional styling
|
|
41
|
-
*/
|
|
42
|
-
formatMessage(message: string, type?: 'success' | 'error' | 'warning' | 'info'): string;
|
|
43
|
-
/**
|
|
44
|
-
* Format outdated dependencies as table
|
|
45
|
-
*/
|
|
46
|
-
private formatOutdatedTable;
|
|
47
|
-
/**
|
|
48
|
-
* Format outdated dependencies minimally (npm-check-updates style)
|
|
49
|
-
*/
|
|
50
|
-
private formatOutdatedMinimal;
|
|
51
|
-
/**
|
|
52
|
-
* Format update result as table
|
|
53
|
-
*/
|
|
54
|
-
private formatUpdateTable;
|
|
55
|
-
/**
|
|
56
|
-
* Format update result minimally (npm-check-updates style)
|
|
57
|
-
*/
|
|
58
|
-
private formatUpdateMinimal;
|
|
59
|
-
/**
|
|
60
|
-
* Format impact analysis as table
|
|
61
|
-
*/
|
|
62
|
-
private formatImpactTable;
|
|
63
|
-
/**
|
|
64
|
-
* Format impact analysis minimally
|
|
65
|
-
*/
|
|
66
|
-
private formatImpactMinimal;
|
|
67
|
-
/**
|
|
68
|
-
* Format validation report as table
|
|
69
|
-
*/
|
|
70
|
-
private formatValidationTable;
|
|
71
|
-
/**
|
|
72
|
-
* Format validation report minimally
|
|
73
|
-
*/
|
|
74
|
-
private formatValidationMinimal;
|
|
75
|
-
/**
|
|
76
|
-
* Format workspace statistics as table
|
|
77
|
-
*/
|
|
78
|
-
private formatStatsTable;
|
|
79
|
-
/**
|
|
80
|
-
* Format workspace statistics minimally
|
|
81
|
-
*/
|
|
82
|
-
private formatStatsMinimal;
|
|
83
|
-
/**
|
|
84
|
-
* Format security report as table
|
|
85
|
-
*/
|
|
86
|
-
private formatSecurityTable;
|
|
87
|
-
/**
|
|
88
|
-
* Format security report minimally
|
|
89
|
-
*/
|
|
90
|
-
private formatSecurityMinimal;
|
|
91
|
-
/**
|
|
92
|
-
* Get color for severity level
|
|
93
|
-
*/
|
|
94
|
-
private getSeverityColor;
|
|
95
|
-
/**
|
|
96
|
-
* Apply color if color is enabled
|
|
97
|
-
*/
|
|
98
|
-
private colorize;
|
|
99
|
-
/**
|
|
100
|
-
* Colorize table headers
|
|
101
|
-
*/
|
|
102
|
-
private colorizeHeaders;
|
|
103
|
-
/**
|
|
104
|
-
* Get color for update type
|
|
105
|
-
*/
|
|
106
|
-
private getUpdateTypeColor;
|
|
107
|
-
/**
|
|
108
|
-
* Get color for risk level
|
|
109
|
-
*/
|
|
110
|
-
private getRiskColor;
|
|
111
|
-
/**
|
|
112
|
-
* Colorize version differences between current and latest
|
|
113
|
-
*/
|
|
114
|
-
private colorizeVersionDiff;
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=OutputFormatter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OutputFormatter.d.ts","sourceRoot":"","sources":["../../../src/cli/formatters/OutputFormatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACb,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,yBAAyB,EAC1B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAMhE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAMjE,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR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