pnpm-catalog-updates 0.5.7 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -634
- package/bin/pcu.js +1 -1
- package/dist/index.js +9559 -32
- package/dist/index.js.map +1 -1
- package/package.json +59 -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.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
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color Theme System
|
|
3
|
+
*
|
|
4
|
+
* Provides consistent color schemes and styling across the CLI
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
|
|
9
|
+
export interface ColorTheme {
|
|
10
|
+
// Brand colors
|
|
11
|
+
primary: (text: string) => string;
|
|
12
|
+
secondary: (text: string) => string;
|
|
13
|
+
accent: (text: string) => string;
|
|
14
|
+
|
|
15
|
+
// Semantic colors
|
|
16
|
+
success: (text: string) => string;
|
|
17
|
+
warning: (text: string) => string;
|
|
18
|
+
error: (text: string) => string;
|
|
19
|
+
info: (text: string) => string;
|
|
20
|
+
|
|
21
|
+
// UI colors
|
|
22
|
+
text: (text: string) => string;
|
|
23
|
+
muted: (text: string) => string;
|
|
24
|
+
border: (text: string) => string;
|
|
25
|
+
background: (text: string) => string;
|
|
26
|
+
|
|
27
|
+
// Status colors
|
|
28
|
+
pending: (text: string) => string;
|
|
29
|
+
processing: (text: string) => string;
|
|
30
|
+
completed: (text: string) => string;
|
|
31
|
+
|
|
32
|
+
// Version colors
|
|
33
|
+
major: (text: string) => string;
|
|
34
|
+
minor: (text: string) => string;
|
|
35
|
+
patch: (text: string) => string;
|
|
36
|
+
prerelease: (text: string) => string;
|
|
37
|
+
|
|
38
|
+
// Risk levels
|
|
39
|
+
riskHigh: (text: string) => string;
|
|
40
|
+
riskMedium: (text: string) => string;
|
|
41
|
+
riskLow: (text: string) => string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class ThemeManager {
|
|
45
|
+
private static currentTheme: ColorTheme;
|
|
46
|
+
|
|
47
|
+
static themes = {
|
|
48
|
+
default: {
|
|
49
|
+
primary: (text: string) => chalk.hex('#0ea5e9')(text),
|
|
50
|
+
secondary: (text: string) => chalk.hex('#8b5cf6')(text),
|
|
51
|
+
accent: (text: string) => chalk.hex('#f59e0b')(text),
|
|
52
|
+
|
|
53
|
+
success: (text: string) => chalk.green(text),
|
|
54
|
+
warning: (text: string) => chalk.yellow(text),
|
|
55
|
+
error: (text: string) => chalk.red(text),
|
|
56
|
+
info: (text: string) => chalk.blue(text),
|
|
57
|
+
|
|
58
|
+
text: (text: string) => chalk.white(text),
|
|
59
|
+
muted: (text: string) => chalk.gray(text),
|
|
60
|
+
border: (text: string) => chalk.dim(text),
|
|
61
|
+
background: (text: string) => chalk.bgBlack(text),
|
|
62
|
+
|
|
63
|
+
pending: (text: string) => chalk.cyan(text),
|
|
64
|
+
processing: (text: string) => chalk.blue(text),
|
|
65
|
+
completed: (text: string) => chalk.green(text),
|
|
66
|
+
|
|
67
|
+
major: (text: string) => chalk.red(text),
|
|
68
|
+
minor: (text: string) => chalk.yellow(text),
|
|
69
|
+
patch: (text: string) => chalk.green(text),
|
|
70
|
+
prerelease: (text: string) => chalk.magenta(text),
|
|
71
|
+
|
|
72
|
+
riskHigh: (text: string) => chalk.red(text),
|
|
73
|
+
riskMedium: (text: string) => chalk.yellow(text),
|
|
74
|
+
riskLow: (text: string) => chalk.green(text),
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
modern: {
|
|
78
|
+
primary: (text: string) => chalk.hex('#06b6d4')(text),
|
|
79
|
+
secondary: (text: string) => chalk.hex('#ec4899')(text),
|
|
80
|
+
accent: (text: string) => chalk.hex('#10b981')(text),
|
|
81
|
+
|
|
82
|
+
success: (text: string) => chalk.hex('#10b981')(text),
|
|
83
|
+
warning: (text: string) => chalk.hex('#f59e0b')(text),
|
|
84
|
+
error: (text: string) => chalk.hex('#ef4444')(text),
|
|
85
|
+
info: (text: string) => chalk.hex('#06b6d4')(text),
|
|
86
|
+
|
|
87
|
+
text: (text: string) => chalk.hex('#e5e7eb')(text),
|
|
88
|
+
muted: (text: string) => chalk.hex('#6b7280')(text),
|
|
89
|
+
border: (text: string) => chalk.hex('#374151')(text),
|
|
90
|
+
background: (text: string) => chalk.hex('#111827')(text),
|
|
91
|
+
|
|
92
|
+
pending: (text: string) => chalk.hex('#06b6d4')(text),
|
|
93
|
+
processing: (text: string) => chalk.hex('#3b82f6')(text),
|
|
94
|
+
completed: (text: string) => chalk.hex('#10b981')(text),
|
|
95
|
+
|
|
96
|
+
major: (text: string) => chalk.hex('#ef4444')(text),
|
|
97
|
+
minor: (text: string) => chalk.hex('#f59e0b')(text),
|
|
98
|
+
patch: (text: string) => chalk.hex('#10b981')(text),
|
|
99
|
+
prerelease: (text: string) => chalk.hex('#8b5cf6')(text),
|
|
100
|
+
|
|
101
|
+
riskHigh: (text: string) => chalk.hex('#ef4444')(text),
|
|
102
|
+
riskMedium: (text: string) => chalk.hex('#f59e0b')(text),
|
|
103
|
+
riskLow: (text: string) => chalk.hex('#10b981')(text),
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
minimal: {
|
|
107
|
+
primary: (text: string) => chalk.white(text),
|
|
108
|
+
secondary: (text: string) => chalk.gray(text),
|
|
109
|
+
accent: (text: string) => chalk.white(text),
|
|
110
|
+
|
|
111
|
+
success: (text: string) => chalk.green(text),
|
|
112
|
+
warning: (text: string) => chalk.yellow(text),
|
|
113
|
+
error: (text: string) => chalk.red(text),
|
|
114
|
+
info: (text: string) => chalk.blue(text),
|
|
115
|
+
|
|
116
|
+
text: (text: string) => chalk.white(text),
|
|
117
|
+
muted: (text: string) => chalk.gray(text),
|
|
118
|
+
border: (text: string) => chalk.gray(text),
|
|
119
|
+
background: (text: string) => chalk.white(text),
|
|
120
|
+
|
|
121
|
+
pending: (text: string) => chalk.blue(text),
|
|
122
|
+
processing: (text: string) => chalk.blue(text),
|
|
123
|
+
completed: (text: string) => chalk.green(text),
|
|
124
|
+
|
|
125
|
+
major: (text: string) => chalk.red(text),
|
|
126
|
+
minor: (text: string) => chalk.yellow(text),
|
|
127
|
+
patch: (text: string) => chalk.green(text),
|
|
128
|
+
prerelease: (text: string) => chalk.magenta(text),
|
|
129
|
+
|
|
130
|
+
riskHigh: (text: string) => chalk.red(text),
|
|
131
|
+
riskMedium: (text: string) => chalk.yellow(text),
|
|
132
|
+
riskLow: (text: string) => chalk.green(text),
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
neon: {
|
|
136
|
+
primary: (text: string) => chalk.hex('#00ffff')(text),
|
|
137
|
+
secondary: (text: string) => chalk.hex('#ff00ff')(text),
|
|
138
|
+
accent: (text: string) => chalk.hex('#ffff00')(text),
|
|
139
|
+
|
|
140
|
+
success: (text: string) => chalk.hex('#00ff00')(text),
|
|
141
|
+
warning: (text: string) => chalk.hex('#ffff00')(text),
|
|
142
|
+
error: (text: string) => chalk.hex('#ff0000')(text),
|
|
143
|
+
info: (text: string) => chalk.hex('#00ffff')(text),
|
|
144
|
+
|
|
145
|
+
text: (text: string) => chalk.hex('#ffffff')(text),
|
|
146
|
+
muted: (text: string) => chalk.hex('#808080')(text),
|
|
147
|
+
border: (text: string) => chalk.hex('#404040')(text),
|
|
148
|
+
background: (text: string) => chalk.hex('#000000')(text),
|
|
149
|
+
|
|
150
|
+
pending: (text: string) => chalk.hex('#00ffff')(text),
|
|
151
|
+
processing: (text: string) => chalk.hex('#0080ff')(text),
|
|
152
|
+
completed: (text: string) => chalk.hex('#00ff00')(text),
|
|
153
|
+
|
|
154
|
+
major: (text: string) => chalk.hex('#ff0000')(text),
|
|
155
|
+
minor: (text: string) => chalk.hex('#ffff00')(text),
|
|
156
|
+
patch: (text: string) => chalk.hex('#00ff00')(text),
|
|
157
|
+
prerelease: (text: string) => chalk.hex('#ff00ff')(text),
|
|
158
|
+
|
|
159
|
+
riskHigh: (text: string) => chalk.hex('#ff0000')(text),
|
|
160
|
+
riskMedium: (text: string) => chalk.hex('#ffff00')(text),
|
|
161
|
+
riskLow: (text: string) => chalk.hex('#00ff00')(text),
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
static setTheme(themeName: keyof typeof ThemeManager.themes): void {
|
|
166
|
+
this.currentTheme = this.themes[themeName];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
static getTheme(): ColorTheme {
|
|
170
|
+
return this.currentTheme || this.themes.default;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static listThemes(): string[] {
|
|
174
|
+
return Object.keys(this.themes);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Styled text utilities
|
|
180
|
+
*/
|
|
181
|
+
export class StyledText {
|
|
182
|
+
private static theme = ThemeManager.getTheme();
|
|
183
|
+
|
|
184
|
+
static updateTheme(): void {
|
|
185
|
+
this.theme = ThemeManager.getTheme();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Brand styles
|
|
189
|
+
static brand(text: string): string {
|
|
190
|
+
return this.theme.primary(text);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
static secondary(text: string): string {
|
|
194
|
+
return this.theme.secondary(text);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
static accent(text: string): string {
|
|
198
|
+
return this.theme.accent(text);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Semantic styles
|
|
202
|
+
static success(text: string): string {
|
|
203
|
+
return this.theme.success(text);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static warning(text: string): string {
|
|
207
|
+
return this.theme.warning(text);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
static error(text: string): string {
|
|
211
|
+
return this.theme.error(text);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
static info(text: string): string {
|
|
215
|
+
return this.theme.info(text);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// UI styles
|
|
219
|
+
static text(text: string): string {
|
|
220
|
+
return this.theme.text(text);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
static muted(text: string): string {
|
|
224
|
+
return this.theme.muted(text);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
static border(text: string): string {
|
|
228
|
+
return this.theme.border(text);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Status styles
|
|
232
|
+
static pending(text: string): string {
|
|
233
|
+
return this.theme.pending(text);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
static processing(text: string): string {
|
|
237
|
+
return this.theme.processing(text);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
static completed(text: string): string {
|
|
241
|
+
return this.theme.completed(text);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Version styles
|
|
245
|
+
static versionMajor(text: string): string {
|
|
246
|
+
return this.theme.major(text);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
static versionMinor(text: string): string {
|
|
250
|
+
return this.theme.minor(text);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
static versionPatch(text: string): string {
|
|
254
|
+
return this.theme.patch(text);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
static versionPrerelease(text: string): string {
|
|
258
|
+
return this.theme.prerelease(text);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Risk styles
|
|
262
|
+
static riskHigh(text: string): string {
|
|
263
|
+
return this.theme.riskHigh(text);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
static riskMedium(text: string): string {
|
|
267
|
+
return this.theme.riskMedium(text);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
static riskLow(text: string): string {
|
|
271
|
+
return this.theme.riskLow(text);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Icons
|
|
275
|
+
static icon(icon: string, text?: string): string {
|
|
276
|
+
return text ? `${icon} ${text}` : icon;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
static iconSuccess(text?: string): string {
|
|
280
|
+
return this.icon('✅', text);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
static iconWarning(text?: string): string {
|
|
284
|
+
return this.icon('⚠️', text);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
static iconError(text?: string): string {
|
|
288
|
+
return this.icon('❌', text);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
static iconInfo(text?: string): string {
|
|
292
|
+
return this.icon('ℹ️', text);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
static iconPackage(text?: string): string {
|
|
296
|
+
return this.icon('📦', text);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
static iconCatalog(text?: string): string {
|
|
300
|
+
return this.icon('📋', text);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
static iconUpdate(text?: string): string {
|
|
304
|
+
return this.icon('🔄', text);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
static iconSecurity(text?: string): string {
|
|
308
|
+
return this.icon('🔒', text);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
static iconAnalysis(text?: string): string {
|
|
312
|
+
return this.icon('🔍', text);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
static iconCheck(text?: string): string {
|
|
316
|
+
return this.icon('✅', text);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
static iconProgress(text?: string): string {
|
|
320
|
+
return this.icon('⏳', text);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
static iconComplete(text?: string): string {
|
|
324
|
+
return this.icon('🎉', text);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Table styling utilities
|
|
330
|
+
*/
|
|
331
|
+
export class TableStyles {
|
|
332
|
+
static createHeaderStyle(color: any) {
|
|
333
|
+
return (text: string) => color.bold(text);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
static createBorderStyle(color: any) {
|
|
337
|
+
return (text: string) => color.dim(text);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
static createCellStyle(color: any) {
|
|
341
|
+
return (text: string) => color(text);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Theme configuration interface
|
|
347
|
+
*/
|
|
348
|
+
export interface ThemeConfig {
|
|
349
|
+
name: string;
|
|
350
|
+
colors: Partial<ColorTheme>;
|
|
351
|
+
icons: Record<string, string>;
|
|
352
|
+
styles: Record<string, any>;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Theme presets for different use cases
|
|
357
|
+
*/
|
|
358
|
+
export const themePresets = {
|
|
359
|
+
development: {
|
|
360
|
+
name: 'development',
|
|
361
|
+
description: 'Bright colors for development environments',
|
|
362
|
+
theme: 'modern',
|
|
363
|
+
},
|
|
364
|
+
production: {
|
|
365
|
+
name: 'production',
|
|
366
|
+
description: 'Subtle colors for production environments',
|
|
367
|
+
theme: 'minimal',
|
|
368
|
+
},
|
|
369
|
+
presentation: {
|
|
370
|
+
name: 'presentation',
|
|
371
|
+
description: 'High contrast colors for presentations',
|
|
372
|
+
theme: 'neon',
|
|
373
|
+
},
|
|
374
|
+
default: {
|
|
375
|
+
name: 'default',
|
|
376
|
+
description: 'Balanced colors for general use',
|
|
377
|
+
theme: 'default',
|
|
378
|
+
},
|
|
379
|
+
};
|