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,267 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Color Theme System
|
|
3
|
-
*
|
|
4
|
-
* Provides consistent color schemes and styling across the CLI
|
|
5
|
-
*/
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
export class ThemeManager {
|
|
8
|
-
static currentTheme;
|
|
9
|
-
static themes = {
|
|
10
|
-
default: {
|
|
11
|
-
primary: (text) => chalk.hex('#0ea5e9')(text),
|
|
12
|
-
secondary: (text) => chalk.hex('#8b5cf6')(text),
|
|
13
|
-
accent: (text) => chalk.hex('#f59e0b')(text),
|
|
14
|
-
success: (text) => chalk.green(text),
|
|
15
|
-
warning: (text) => chalk.yellow(text),
|
|
16
|
-
error: (text) => chalk.red(text),
|
|
17
|
-
info: (text) => chalk.blue(text),
|
|
18
|
-
text: (text) => chalk.white(text),
|
|
19
|
-
muted: (text) => chalk.gray(text),
|
|
20
|
-
border: (text) => chalk.dim(text),
|
|
21
|
-
background: (text) => chalk.bgBlack(text),
|
|
22
|
-
pending: (text) => chalk.cyan(text),
|
|
23
|
-
processing: (text) => chalk.blue(text),
|
|
24
|
-
completed: (text) => chalk.green(text),
|
|
25
|
-
major: (text) => chalk.red(text),
|
|
26
|
-
minor: (text) => chalk.yellow(text),
|
|
27
|
-
patch: (text) => chalk.green(text),
|
|
28
|
-
prerelease: (text) => chalk.magenta(text),
|
|
29
|
-
riskHigh: (text) => chalk.red(text),
|
|
30
|
-
riskMedium: (text) => chalk.yellow(text),
|
|
31
|
-
riskLow: (text) => chalk.green(text),
|
|
32
|
-
},
|
|
33
|
-
modern: {
|
|
34
|
-
primary: (text) => chalk.hex('#06b6d4')(text),
|
|
35
|
-
secondary: (text) => chalk.hex('#ec4899')(text),
|
|
36
|
-
accent: (text) => chalk.hex('#10b981')(text),
|
|
37
|
-
success: (text) => chalk.hex('#10b981')(text),
|
|
38
|
-
warning: (text) => chalk.hex('#f59e0b')(text),
|
|
39
|
-
error: (text) => chalk.hex('#ef4444')(text),
|
|
40
|
-
info: (text) => chalk.hex('#06b6d4')(text),
|
|
41
|
-
text: (text) => chalk.hex('#e5e7eb')(text),
|
|
42
|
-
muted: (text) => chalk.hex('#6b7280')(text),
|
|
43
|
-
border: (text) => chalk.hex('#374151')(text),
|
|
44
|
-
background: (text) => chalk.hex('#111827')(text),
|
|
45
|
-
pending: (text) => chalk.hex('#06b6d4')(text),
|
|
46
|
-
processing: (text) => chalk.hex('#3b82f6')(text),
|
|
47
|
-
completed: (text) => chalk.hex('#10b981')(text),
|
|
48
|
-
major: (text) => chalk.hex('#ef4444')(text),
|
|
49
|
-
minor: (text) => chalk.hex('#f59e0b')(text),
|
|
50
|
-
patch: (text) => chalk.hex('#10b981')(text),
|
|
51
|
-
prerelease: (text) => chalk.hex('#8b5cf6')(text),
|
|
52
|
-
riskHigh: (text) => chalk.hex('#ef4444')(text),
|
|
53
|
-
riskMedium: (text) => chalk.hex('#f59e0b')(text),
|
|
54
|
-
riskLow: (text) => chalk.hex('#10b981')(text),
|
|
55
|
-
},
|
|
56
|
-
minimal: {
|
|
57
|
-
primary: (text) => chalk.white(text),
|
|
58
|
-
secondary: (text) => chalk.gray(text),
|
|
59
|
-
accent: (text) => chalk.white(text),
|
|
60
|
-
success: (text) => chalk.green(text),
|
|
61
|
-
warning: (text) => chalk.yellow(text),
|
|
62
|
-
error: (text) => chalk.red(text),
|
|
63
|
-
info: (text) => chalk.blue(text),
|
|
64
|
-
text: (text) => chalk.white(text),
|
|
65
|
-
muted: (text) => chalk.gray(text),
|
|
66
|
-
border: (text) => chalk.gray(text),
|
|
67
|
-
background: (text) => chalk.white(text),
|
|
68
|
-
pending: (text) => chalk.blue(text),
|
|
69
|
-
processing: (text) => chalk.blue(text),
|
|
70
|
-
completed: (text) => chalk.green(text),
|
|
71
|
-
major: (text) => chalk.red(text),
|
|
72
|
-
minor: (text) => chalk.yellow(text),
|
|
73
|
-
patch: (text) => chalk.green(text),
|
|
74
|
-
prerelease: (text) => chalk.magenta(text),
|
|
75
|
-
riskHigh: (text) => chalk.red(text),
|
|
76
|
-
riskMedium: (text) => chalk.yellow(text),
|
|
77
|
-
riskLow: (text) => chalk.green(text),
|
|
78
|
-
},
|
|
79
|
-
neon: {
|
|
80
|
-
primary: (text) => chalk.hex('#00ffff')(text),
|
|
81
|
-
secondary: (text) => chalk.hex('#ff00ff')(text),
|
|
82
|
-
accent: (text) => chalk.hex('#ffff00')(text),
|
|
83
|
-
success: (text) => chalk.hex('#00ff00')(text),
|
|
84
|
-
warning: (text) => chalk.hex('#ffff00')(text),
|
|
85
|
-
error: (text) => chalk.hex('#ff0000')(text),
|
|
86
|
-
info: (text) => chalk.hex('#00ffff')(text),
|
|
87
|
-
text: (text) => chalk.hex('#ffffff')(text),
|
|
88
|
-
muted: (text) => chalk.hex('#808080')(text),
|
|
89
|
-
border: (text) => chalk.hex('#404040')(text),
|
|
90
|
-
background: (text) => chalk.hex('#000000')(text),
|
|
91
|
-
pending: (text) => chalk.hex('#00ffff')(text),
|
|
92
|
-
processing: (text) => chalk.hex('#0080ff')(text),
|
|
93
|
-
completed: (text) => chalk.hex('#00ff00')(text),
|
|
94
|
-
major: (text) => chalk.hex('#ff0000')(text),
|
|
95
|
-
minor: (text) => chalk.hex('#ffff00')(text),
|
|
96
|
-
patch: (text) => chalk.hex('#00ff00')(text),
|
|
97
|
-
prerelease: (text) => chalk.hex('#ff00ff')(text),
|
|
98
|
-
riskHigh: (text) => chalk.hex('#ff0000')(text),
|
|
99
|
-
riskMedium: (text) => chalk.hex('#ffff00')(text),
|
|
100
|
-
riskLow: (text) => chalk.hex('#00ff00')(text),
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
static setTheme(themeName) {
|
|
104
|
-
this.currentTheme = this.themes[themeName];
|
|
105
|
-
}
|
|
106
|
-
static getTheme() {
|
|
107
|
-
return this.currentTheme || this.themes.default;
|
|
108
|
-
}
|
|
109
|
-
static listThemes() {
|
|
110
|
-
return Object.keys(this.themes);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Styled text utilities
|
|
115
|
-
*/
|
|
116
|
-
export class StyledText {
|
|
117
|
-
static theme = ThemeManager.getTheme();
|
|
118
|
-
static updateTheme() {
|
|
119
|
-
this.theme = ThemeManager.getTheme();
|
|
120
|
-
}
|
|
121
|
-
// Brand styles
|
|
122
|
-
static brand(text) {
|
|
123
|
-
return this.theme.primary(text);
|
|
124
|
-
}
|
|
125
|
-
static secondary(text) {
|
|
126
|
-
return this.theme.secondary(text);
|
|
127
|
-
}
|
|
128
|
-
static accent(text) {
|
|
129
|
-
return this.theme.accent(text);
|
|
130
|
-
}
|
|
131
|
-
// Semantic styles
|
|
132
|
-
static success(text) {
|
|
133
|
-
return this.theme.success(text);
|
|
134
|
-
}
|
|
135
|
-
static warning(text) {
|
|
136
|
-
return this.theme.warning(text);
|
|
137
|
-
}
|
|
138
|
-
static error(text) {
|
|
139
|
-
return this.theme.error(text);
|
|
140
|
-
}
|
|
141
|
-
static info(text) {
|
|
142
|
-
return this.theme.info(text);
|
|
143
|
-
}
|
|
144
|
-
// UI styles
|
|
145
|
-
static text(text) {
|
|
146
|
-
return this.theme.text(text);
|
|
147
|
-
}
|
|
148
|
-
static muted(text) {
|
|
149
|
-
return this.theme.muted(text);
|
|
150
|
-
}
|
|
151
|
-
static border(text) {
|
|
152
|
-
return this.theme.border(text);
|
|
153
|
-
}
|
|
154
|
-
// Status styles
|
|
155
|
-
static pending(text) {
|
|
156
|
-
return this.theme.pending(text);
|
|
157
|
-
}
|
|
158
|
-
static processing(text) {
|
|
159
|
-
return this.theme.processing(text);
|
|
160
|
-
}
|
|
161
|
-
static completed(text) {
|
|
162
|
-
return this.theme.completed(text);
|
|
163
|
-
}
|
|
164
|
-
// Version styles
|
|
165
|
-
static versionMajor(text) {
|
|
166
|
-
return this.theme.major(text);
|
|
167
|
-
}
|
|
168
|
-
static versionMinor(text) {
|
|
169
|
-
return this.theme.minor(text);
|
|
170
|
-
}
|
|
171
|
-
static versionPatch(text) {
|
|
172
|
-
return this.theme.patch(text);
|
|
173
|
-
}
|
|
174
|
-
static versionPrerelease(text) {
|
|
175
|
-
return this.theme.prerelease(text);
|
|
176
|
-
}
|
|
177
|
-
// Risk styles
|
|
178
|
-
static riskHigh(text) {
|
|
179
|
-
return this.theme.riskHigh(text);
|
|
180
|
-
}
|
|
181
|
-
static riskMedium(text) {
|
|
182
|
-
return this.theme.riskMedium(text);
|
|
183
|
-
}
|
|
184
|
-
static riskLow(text) {
|
|
185
|
-
return this.theme.riskLow(text);
|
|
186
|
-
}
|
|
187
|
-
// Icons
|
|
188
|
-
static icon(icon, text) {
|
|
189
|
-
return text ? `${icon} ${text}` : icon;
|
|
190
|
-
}
|
|
191
|
-
static iconSuccess(text) {
|
|
192
|
-
return this.icon('✅', text);
|
|
193
|
-
}
|
|
194
|
-
static iconWarning(text) {
|
|
195
|
-
return this.icon('⚠️', text);
|
|
196
|
-
}
|
|
197
|
-
static iconError(text) {
|
|
198
|
-
return this.icon('❌', text);
|
|
199
|
-
}
|
|
200
|
-
static iconInfo(text) {
|
|
201
|
-
return this.icon('ℹ️', text);
|
|
202
|
-
}
|
|
203
|
-
static iconPackage(text) {
|
|
204
|
-
return this.icon('📦', text);
|
|
205
|
-
}
|
|
206
|
-
static iconCatalog(text) {
|
|
207
|
-
return this.icon('📋', text);
|
|
208
|
-
}
|
|
209
|
-
static iconUpdate(text) {
|
|
210
|
-
return this.icon('🔄', text);
|
|
211
|
-
}
|
|
212
|
-
static iconSecurity(text) {
|
|
213
|
-
return this.icon('🔒', text);
|
|
214
|
-
}
|
|
215
|
-
static iconAnalysis(text) {
|
|
216
|
-
return this.icon('🔍', text);
|
|
217
|
-
}
|
|
218
|
-
static iconCheck(text) {
|
|
219
|
-
return this.icon('✅', text);
|
|
220
|
-
}
|
|
221
|
-
static iconProgress(text) {
|
|
222
|
-
return this.icon('⏳', text);
|
|
223
|
-
}
|
|
224
|
-
static iconComplete(text) {
|
|
225
|
-
return this.icon('🎉', text);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Table styling utilities
|
|
230
|
-
*/
|
|
231
|
-
export class TableStyles {
|
|
232
|
-
static createHeaderStyle(color) {
|
|
233
|
-
return (text) => color.bold(text);
|
|
234
|
-
}
|
|
235
|
-
static createBorderStyle(color) {
|
|
236
|
-
return (text) => color.dim(text);
|
|
237
|
-
}
|
|
238
|
-
static createCellStyle(color) {
|
|
239
|
-
return (text) => color(text);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Theme presets for different use cases
|
|
244
|
-
*/
|
|
245
|
-
export const themePresets = {
|
|
246
|
-
development: {
|
|
247
|
-
name: 'development',
|
|
248
|
-
description: 'Bright colors for development environments',
|
|
249
|
-
theme: 'modern',
|
|
250
|
-
},
|
|
251
|
-
production: {
|
|
252
|
-
name: 'production',
|
|
253
|
-
description: 'Subtle colors for production environments',
|
|
254
|
-
theme: 'minimal',
|
|
255
|
-
},
|
|
256
|
-
presentation: {
|
|
257
|
-
name: 'presentation',
|
|
258
|
-
description: 'High contrast colors for presentations',
|
|
259
|
-
theme: 'neon',
|
|
260
|
-
},
|
|
261
|
-
default: {
|
|
262
|
-
name: 'default',
|
|
263
|
-
description: 'Balanced colors for general use',
|
|
264
|
-
theme: 'default',
|
|
265
|
-
},
|
|
266
|
-
};
|
|
267
|
-
//# sourceMappingURL=ColorTheme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorTheme.js","sourceRoot":"","sources":["../../../src/cli/themes/ColorTheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAqC1B,MAAM,OAAO,YAAY;IACf,MAAM,CAAC,YAAY,CAAa;IAExC,MAAM,CAAC,MAAM,GAAG;QACd,OAAO,EAAE;YACP,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;YACrD,SAAS,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAA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WAAW;IACtB,MAAM,CAAC,iBAAiB,CAAC,KAAU;QACjC,OAAO,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,KAAU;QACjC,OAAO,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,KAAU;QAC/B,OAAO,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF;AAYD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,WAAW,EAAE;QACX,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,4CAA4C;QACzD,KAAK,EAAE,QAAQ;KAChB;IACD,UAAU,EAAE;QACV,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,2CAA2C;QACxD,KAAK,EAAE,SAAS;KACjB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,wCAAwC;QACrD,KAAK,EAAE,MAAM;KACd;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,iCAAiC;QAC9C,KAAK,EAAE,SAAS;KACjB;CACF,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Command Validation
|
|
3
|
-
*
|
|
4
|
-
* Validates CLI command options and arguments before execution.
|
|
5
|
-
* Provides detailed error messages and suggestions.
|
|
6
|
-
*/
|
|
7
|
-
import { ValidationResult } from '../../common/utils/validation.js';
|
|
8
|
-
export interface ValidatedOptions {
|
|
9
|
-
workspace?: string;
|
|
10
|
-
catalog?: string;
|
|
11
|
-
format?: string;
|
|
12
|
-
target?: string;
|
|
13
|
-
interactive?: boolean;
|
|
14
|
-
dryRun?: boolean;
|
|
15
|
-
force?: boolean;
|
|
16
|
-
prerelease?: boolean;
|
|
17
|
-
include?: string[];
|
|
18
|
-
exclude?: string[];
|
|
19
|
-
createBackup?: boolean;
|
|
20
|
-
verbose?: boolean;
|
|
21
|
-
color?: boolean;
|
|
22
|
-
registry?: string;
|
|
23
|
-
timeout?: number;
|
|
24
|
-
}
|
|
25
|
-
export declare class CommandValidator {
|
|
26
|
-
private config;
|
|
27
|
-
/**
|
|
28
|
-
* Validate check command options
|
|
29
|
-
*/
|
|
30
|
-
validateCheckOptions(options: any): ValidationResult;
|
|
31
|
-
/**
|
|
32
|
-
* Validate update command options
|
|
33
|
-
*/
|
|
34
|
-
validateUpdateOptions(options: any): ValidationResult;
|
|
35
|
-
/**
|
|
36
|
-
* Validate analyze command arguments
|
|
37
|
-
*/
|
|
38
|
-
validateAnalyzeArgs(catalog: string, packageName: string, version?: string): ValidationResult;
|
|
39
|
-
/**
|
|
40
|
-
* Validate workspace command options
|
|
41
|
-
*/
|
|
42
|
-
validateWorkspaceOptions(options: any): ValidationResult;
|
|
43
|
-
/**
|
|
44
|
-
* Validate global options
|
|
45
|
-
*/
|
|
46
|
-
validateGlobalOptions(options: any): ValidationResult;
|
|
47
|
-
/**
|
|
48
|
-
* Validate configuration object
|
|
49
|
-
*/
|
|
50
|
-
validateConfigFile(configPath: string): ValidationResult;
|
|
51
|
-
/**
|
|
52
|
-
* Sanitize and normalize options
|
|
53
|
-
*/
|
|
54
|
-
sanitizeOptions(options: any): ValidatedOptions;
|
|
55
|
-
/**
|
|
56
|
-
* Get validation suggestions based on common mistakes
|
|
57
|
-
*/
|
|
58
|
-
getSuggestions(command: string, options: any): string[];
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=CommandValidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandValidator.d.ts","sourceRoot":"","sources":["../../../src/cli/validators/CommandValidator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAsB,gBAAgB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AE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,MAAM,EAAE;CA8CxD"}
|
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Command Validation
|
|
3
|
-
*
|
|
4
|
-
* Validates CLI command options and arguments before execution.
|
|
5
|
-
* Provides detailed error messages and suggestions.
|
|
6
|
-
*/
|
|
7
|
-
import { validateCliOptions } from '../../common/utils/validation.js';
|
|
8
|
-
import { getConfig } from '../../common/config/Config.js';
|
|
9
|
-
export class CommandValidator {
|
|
10
|
-
config = getConfig().getConfig();
|
|
11
|
-
/**
|
|
12
|
-
* Validate check command options
|
|
13
|
-
*/
|
|
14
|
-
validateCheckOptions(options) {
|
|
15
|
-
const errors = [];
|
|
16
|
-
const warnings = [];
|
|
17
|
-
// Basic validation using utility
|
|
18
|
-
const basicValidation = validateCliOptions(options);
|
|
19
|
-
errors.push(...basicValidation.errors);
|
|
20
|
-
warnings.push(...basicValidation.warnings);
|
|
21
|
-
// Check-specific validations
|
|
22
|
-
if (options.catalog && typeof options.catalog !== 'string') {
|
|
23
|
-
errors.push('Catalog name must be a string');
|
|
24
|
-
}
|
|
25
|
-
// Validate mutually exclusive options
|
|
26
|
-
if (options.interactive && options.format === 'json') {
|
|
27
|
-
warnings.push('Interactive mode is not useful with JSON output format');
|
|
28
|
-
}
|
|
29
|
-
if (options.verbose && options.silent) {
|
|
30
|
-
errors.push('Cannot use both --verbose and --silent options');
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
isValid: errors.length === 0,
|
|
34
|
-
errors,
|
|
35
|
-
warnings,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Validate update command options
|
|
40
|
-
*/
|
|
41
|
-
validateUpdateOptions(options) {
|
|
42
|
-
const errors = [];
|
|
43
|
-
const warnings = [];
|
|
44
|
-
// Basic validation
|
|
45
|
-
const basicValidation = validateCliOptions(options);
|
|
46
|
-
errors.push(...basicValidation.errors);
|
|
47
|
-
warnings.push(...basicValidation.warnings);
|
|
48
|
-
// Update-specific validations
|
|
49
|
-
if (options.interactive && options.dryRun) {
|
|
50
|
-
errors.push('Cannot use --interactive with --dry-run');
|
|
51
|
-
}
|
|
52
|
-
if (options.force && !options.dryRun && !options.createBackup) {
|
|
53
|
-
warnings.push('Using --force without backup. Consider using --create-backup for safety');
|
|
54
|
-
}
|
|
55
|
-
if (options.target === 'major' && !options.force && !options.interactive) {
|
|
56
|
-
warnings.push('Major updates may contain breaking changes. Consider using --interactive or --force');
|
|
57
|
-
}
|
|
58
|
-
// Validate include/exclude patterns
|
|
59
|
-
if (options.include && options.exclude) {
|
|
60
|
-
const overlapping = options.include.some((inc) => options.exclude.some((exc) => inc === exc));
|
|
61
|
-
if (overlapping) {
|
|
62
|
-
warnings.push('Some patterns appear in both include and exclude lists');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
isValid: errors.length === 0,
|
|
67
|
-
errors,
|
|
68
|
-
warnings,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Validate analyze command arguments
|
|
73
|
-
*/
|
|
74
|
-
validateAnalyzeArgs(catalog, packageName, version) {
|
|
75
|
-
const errors = [];
|
|
76
|
-
const warnings = [];
|
|
77
|
-
// Validate catalog name
|
|
78
|
-
if (!catalog || catalog.trim() === '') {
|
|
79
|
-
errors.push('Catalog name is required');
|
|
80
|
-
}
|
|
81
|
-
else if (catalog.includes('/') || catalog.includes('\\')) {
|
|
82
|
-
errors.push('Catalog name cannot contain path separators');
|
|
83
|
-
}
|
|
84
|
-
// Validate package name
|
|
85
|
-
if (!packageName || packageName.trim() === '') {
|
|
86
|
-
errors.push('Package name is required');
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
// Basic package name validation
|
|
90
|
-
const packageNameRegex = /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/;
|
|
91
|
-
if (!packageNameRegex.test(packageName)) {
|
|
92
|
-
errors.push('Invalid package name format');
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
// Validate version if provided
|
|
96
|
-
if (version) {
|
|
97
|
-
const semverRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
98
|
-
if (!semverRegex.test(version)) {
|
|
99
|
-
errors.push('Invalid version format. Use semantic versioning (e.g., 1.2.3)');
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return {
|
|
103
|
-
isValid: errors.length === 0,
|
|
104
|
-
errors,
|
|
105
|
-
warnings,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Validate workspace command options
|
|
110
|
-
*/
|
|
111
|
-
validateWorkspaceOptions(options) {
|
|
112
|
-
const errors = [];
|
|
113
|
-
const warnings = [];
|
|
114
|
-
// Basic validation
|
|
115
|
-
const basicValidation = validateCliOptions(options);
|
|
116
|
-
errors.push(...basicValidation.errors);
|
|
117
|
-
warnings.push(...basicValidation.warnings);
|
|
118
|
-
// Workspace-specific validations
|
|
119
|
-
const actionCount = [options.validate, options.stats, options.info].filter(Boolean).length;
|
|
120
|
-
if (actionCount > 1) {
|
|
121
|
-
errors.push('Cannot use multiple workspace actions simultaneously');
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
isValid: errors.length === 0,
|
|
125
|
-
errors,
|
|
126
|
-
warnings,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Validate global options
|
|
131
|
-
*/
|
|
132
|
-
validateGlobalOptions(options) {
|
|
133
|
-
const errors = [];
|
|
134
|
-
const warnings = [];
|
|
135
|
-
// Validate workspace path
|
|
136
|
-
if (options.workspace) {
|
|
137
|
-
// Future: Add path validation logic here
|
|
138
|
-
// Currently skipped to avoid TypeScript errors
|
|
139
|
-
}
|
|
140
|
-
// Validate color options
|
|
141
|
-
if (options.noColor && options.color) {
|
|
142
|
-
errors.push('Cannot use both --color and --no-color');
|
|
143
|
-
}
|
|
144
|
-
// Check for deprecated options (future-proofing)
|
|
145
|
-
const deprecatedOptions = ['silent']; // Example
|
|
146
|
-
for (const deprecated of deprecatedOptions) {
|
|
147
|
-
if (options[deprecated]) {
|
|
148
|
-
warnings.push(`Option --${deprecated} is deprecated and will be removed in future versions`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return {
|
|
152
|
-
isValid: errors.length === 0,
|
|
153
|
-
errors,
|
|
154
|
-
warnings,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Validate configuration object
|
|
159
|
-
*/
|
|
160
|
-
validateConfigFile(configPath) {
|
|
161
|
-
const errors = [];
|
|
162
|
-
const warnings = [];
|
|
163
|
-
try {
|
|
164
|
-
const fs = require('fs');
|
|
165
|
-
// const path = require('path'); // Reserved for future use
|
|
166
|
-
if (!fs.existsSync(configPath)) {
|
|
167
|
-
errors.push(`Configuration file not found: ${configPath}`);
|
|
168
|
-
return { isValid: false, errors, warnings };
|
|
169
|
-
}
|
|
170
|
-
let config;
|
|
171
|
-
if (configPath.endsWith('.js')) {
|
|
172
|
-
// JavaScript config file
|
|
173
|
-
try {
|
|
174
|
-
delete require.cache[require.resolve(configPath)];
|
|
175
|
-
config = require(configPath);
|
|
176
|
-
}
|
|
177
|
-
catch (error) {
|
|
178
|
-
errors.push(`Failed to load JavaScript config: ${error}`);
|
|
179
|
-
return { isValid: false, errors, warnings };
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
// JSON config file
|
|
184
|
-
try {
|
|
185
|
-
const content = fs.readFileSync(configPath, 'utf-8');
|
|
186
|
-
config = JSON.parse(content);
|
|
187
|
-
}
|
|
188
|
-
catch (error) {
|
|
189
|
-
errors.push(`Failed to parse JSON config: ${error}`);
|
|
190
|
-
return { isValid: false, errors, warnings };
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
// Validate config structure
|
|
194
|
-
if (typeof config !== 'object' || config === null) {
|
|
195
|
-
errors.push('Configuration must be an object');
|
|
196
|
-
return { isValid: false, errors, warnings };
|
|
197
|
-
}
|
|
198
|
-
// Validate known configuration sections
|
|
199
|
-
if (config.registry && typeof config.registry !== 'object') {
|
|
200
|
-
errors.push('registry configuration must be an object');
|
|
201
|
-
}
|
|
202
|
-
if (config.update && typeof config.update !== 'object') {
|
|
203
|
-
errors.push('update configuration must be an object');
|
|
204
|
-
}
|
|
205
|
-
if (config.output && typeof config.output !== 'object') {
|
|
206
|
-
errors.push('output configuration must be an object');
|
|
207
|
-
}
|
|
208
|
-
// Check for unknown top-level keys
|
|
209
|
-
const knownKeys = ['registry', 'update', 'output', 'workspace', 'notification', 'logging'];
|
|
210
|
-
const unknownKeys = Object.keys(config).filter((key) => !knownKeys.includes(key));
|
|
211
|
-
if (unknownKeys.length > 0) {
|
|
212
|
-
warnings.push(`Unknown configuration keys: ${unknownKeys.join(', ')}`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
catch (error) {
|
|
216
|
-
errors.push(`Failed to validate configuration file: ${error}`);
|
|
217
|
-
}
|
|
218
|
-
return {
|
|
219
|
-
isValid: errors.length === 0,
|
|
220
|
-
errors,
|
|
221
|
-
warnings,
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Sanitize and normalize options
|
|
226
|
-
*/
|
|
227
|
-
sanitizeOptions(options) {
|
|
228
|
-
const sanitized = {};
|
|
229
|
-
// String options
|
|
230
|
-
if (options.workspace) {
|
|
231
|
-
sanitized.workspace = String(options.workspace).trim();
|
|
232
|
-
}
|
|
233
|
-
if (options.catalog) {
|
|
234
|
-
sanitized.catalog = String(options.catalog).trim();
|
|
235
|
-
}
|
|
236
|
-
if (options.format) {
|
|
237
|
-
sanitized.format = String(options.format).toLowerCase().trim();
|
|
238
|
-
}
|
|
239
|
-
if (options.target) {
|
|
240
|
-
sanitized.target = String(options.target).toLowerCase().trim();
|
|
241
|
-
}
|
|
242
|
-
if (options.registry) {
|
|
243
|
-
sanitized.registry = String(options.registry).trim();
|
|
244
|
-
}
|
|
245
|
-
// Boolean options
|
|
246
|
-
sanitized.interactive = Boolean(options.interactive);
|
|
247
|
-
sanitized.dryRun = Boolean(options.dryRun);
|
|
248
|
-
sanitized.force = Boolean(options.force);
|
|
249
|
-
sanitized.prerelease = Boolean(options.prerelease);
|
|
250
|
-
sanitized.createBackup = Boolean(options.createBackup);
|
|
251
|
-
sanitized.verbose = Boolean(options.verbose);
|
|
252
|
-
// Handle color option (tri-state: true, false, or undefined)
|
|
253
|
-
if (options.color !== undefined) {
|
|
254
|
-
sanitized.color = Boolean(options.color);
|
|
255
|
-
}
|
|
256
|
-
else if (options.noColor) {
|
|
257
|
-
sanitized.color = false;
|
|
258
|
-
}
|
|
259
|
-
// Number options
|
|
260
|
-
if (options.timeout) {
|
|
261
|
-
const timeout = parseInt(String(options.timeout), 10);
|
|
262
|
-
if (!isNaN(timeout) && timeout > 0) {
|
|
263
|
-
sanitized.timeout = timeout;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
// Array options
|
|
267
|
-
if (options.include) {
|
|
268
|
-
sanitized.include = Array.isArray(options.include)
|
|
269
|
-
? options.include.map((p) => String(p).trim()).filter(Boolean)
|
|
270
|
-
: [String(options.include).trim()].filter(Boolean);
|
|
271
|
-
}
|
|
272
|
-
if (options.exclude) {
|
|
273
|
-
sanitized.exclude = Array.isArray(options.exclude)
|
|
274
|
-
? options.exclude.map((p) => String(p).trim()).filter(Boolean)
|
|
275
|
-
: [String(options.exclude).trim()].filter(Boolean);
|
|
276
|
-
}
|
|
277
|
-
return sanitized;
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Get validation suggestions based on common mistakes
|
|
281
|
-
*/
|
|
282
|
-
getSuggestions(command, options) {
|
|
283
|
-
const suggestions = [];
|
|
284
|
-
switch (command) {
|
|
285
|
-
case 'check':
|
|
286
|
-
if (!options.workspace) {
|
|
287
|
-
suggestions.push('Consider specifying --workspace for non-standard directory structures');
|
|
288
|
-
}
|
|
289
|
-
if (options.format === 'json' && options.verbose) {
|
|
290
|
-
suggestions.push('JSON output already includes detailed info, --verbose may be redundant');
|
|
291
|
-
}
|
|
292
|
-
break;
|
|
293
|
-
case 'update':
|
|
294
|
-
if (!options.dryRun && !options.createBackup && !options.force) {
|
|
295
|
-
suggestions.push('Consider using --dry-run first to preview changes');
|
|
296
|
-
}
|
|
297
|
-
if (options.target === 'greatest' && !options.prerelease) {
|
|
298
|
-
suggestions.push('Add --prerelease to include pre-release versions with greatest target');
|
|
299
|
-
}
|
|
300
|
-
break;
|
|
301
|
-
case 'analyze':
|
|
302
|
-
if (!options.format) {
|
|
303
|
-
suggestions.push('Use --format json for programmatic consumption of analysis data');
|
|
304
|
-
}
|
|
305
|
-
break;
|
|
306
|
-
case 'workspace':
|
|
307
|
-
if (!options.validate && !options.stats) {
|
|
308
|
-
suggestions.push('Use --validate to check workspace integrity or --stats for detailed information');
|
|
309
|
-
}
|
|
310
|
-
break;
|
|
311
|
-
}
|
|
312
|
-
// General suggestions
|
|
313
|
-
if (this.config.output.verbose && !options.verbose) {
|
|
314
|
-
suggestions.push('Global verbose mode is enabled in config');
|
|
315
|
-
}
|
|
316
|
-
return suggestions;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
//# sourceMappingURL=CommandValidator.js.map
|