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
package/package.json
CHANGED
|
@@ -1,35 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pnpm-catalog-updates",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"access": "public"
|
|
6
|
-
},
|
|
7
|
-
"description": "A CLI tool to check and update pnpm workspace catalog dependencies",
|
|
8
|
-
"keywords": [
|
|
9
|
-
"pnpm",
|
|
10
|
-
"catalog",
|
|
11
|
-
"dependencies",
|
|
12
|
-
"update",
|
|
13
|
-
"workspace",
|
|
14
|
-
"cli",
|
|
15
|
-
"package-manager"
|
|
16
|
-
],
|
|
17
|
-
"author": {
|
|
18
|
-
"name": "Evan Hu",
|
|
19
|
-
"email": "evan@yldm.tech"
|
|
20
|
-
},
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "https://github.com/houko/pnpm-catalog-updates.git"
|
|
25
|
-
},
|
|
26
|
-
"bugs": {
|
|
27
|
-
"url": "https://github.com/houko/pnpm-catalog-updates/issues"
|
|
28
|
-
},
|
|
29
|
-
"homepage": "https://github.com/houko/pnpm-catalog-updates#readme",
|
|
30
|
-
"engines": {
|
|
31
|
-
"node": ">=22.0.0"
|
|
32
|
-
},
|
|
3
|
+
"version": "0.6.6",
|
|
4
|
+
"description": "CLI application for pnpm-catalog-updates",
|
|
33
5
|
"type": "module",
|
|
34
6
|
"main": "./dist/index.js",
|
|
35
7
|
"module": "./dist/index.js",
|
|
@@ -41,84 +13,68 @@
|
|
|
41
13
|
"files": [
|
|
42
14
|
"dist",
|
|
43
15
|
"bin",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
16
|
+
"src",
|
|
17
|
+
"README.md"
|
|
46
18
|
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup && pnpm run build:bin",
|
|
21
|
+
"build:bin": "node ../../scripts/build-bin.js",
|
|
22
|
+
"build:watch": "tsup --watch",
|
|
23
|
+
"dev": "tsx src/index.ts",
|
|
24
|
+
"start": "node dist/index.js",
|
|
25
|
+
"test": "vitest --run --passWithNoTests",
|
|
26
|
+
"test:watch": "vitest --watch",
|
|
27
|
+
"test:coverage": "vitest --run --coverage --passWithNoTests",
|
|
28
|
+
"lint": "eslint src --ext .ts",
|
|
29
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
30
|
+
"format": "prettier --write src",
|
|
31
|
+
"format:check": "prettier --check src",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"clean": "rimraf dist bin/*.js"
|
|
34
|
+
},
|
|
47
35
|
"dependencies": {
|
|
48
|
-
"chalk": "
|
|
49
|
-
"cli-table3": "
|
|
50
|
-
"commander": "
|
|
51
|
-
"fs-extra": "
|
|
52
|
-
"glob": "
|
|
53
|
-
"inquirer": "
|
|
54
|
-
"lodash": "
|
|
55
|
-
"npm-registry-fetch": "
|
|
56
|
-
"ora": "
|
|
57
|
-
"pacote": "
|
|
58
|
-
"rxjs": "
|
|
59
|
-
"semver": "
|
|
60
|
-
"yaml": "
|
|
61
|
-
"zod": "3.25.75"
|
|
36
|
+
"chalk": "catalog:",
|
|
37
|
+
"cli-table3": "catalog:",
|
|
38
|
+
"commander": "catalog:",
|
|
39
|
+
"fs-extra": "catalog:",
|
|
40
|
+
"glob": "catalog:",
|
|
41
|
+
"inquirer": "catalog:",
|
|
42
|
+
"lodash": "catalog:",
|
|
43
|
+
"npm-registry-fetch": "catalog:",
|
|
44
|
+
"ora": "catalog:",
|
|
45
|
+
"pacote": "catalog:",
|
|
46
|
+
"rxjs": "catalog:",
|
|
47
|
+
"semver": "catalog:",
|
|
48
|
+
"yaml": "catalog:"
|
|
62
49
|
},
|
|
63
50
|
"devDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"eslint-plugin-import": "^2.32.0",
|
|
78
|
-
"eslint-plugin-node": "^11.1.0",
|
|
79
|
-
"eslint-plugin-prettier": "^5.5.1",
|
|
80
|
-
"husky": "^9.1.7",
|
|
81
|
-
"lint-staged": "^16.1.2",
|
|
82
|
-
"msw": "^2.10.3",
|
|
83
|
-
"prettier": "3.6.2",
|
|
84
|
-
"rimraf": "^6.0.1",
|
|
85
|
-
"tsx": "^4.20.3",
|
|
86
|
-
"typescript": "5.8.3",
|
|
87
|
-
"vitest": "^3.2.4"
|
|
51
|
+
"@types/inquirer": "catalog:",
|
|
52
|
+
"@types/node": "catalog:node20",
|
|
53
|
+
"@vitest/coverage-v8": "catalog:",
|
|
54
|
+
"@vitest/ui": "catalog:",
|
|
55
|
+
"eslint": "catalog:",
|
|
56
|
+
"fs-extra": "catalog:",
|
|
57
|
+
"msw": "catalog:",
|
|
58
|
+
"prettier": "catalog:",
|
|
59
|
+
"rimraf": "catalog:",
|
|
60
|
+
"tsup": "catalog:",
|
|
61
|
+
"tsx": "catalog:",
|
|
62
|
+
"typescript": "catalog:",
|
|
63
|
+
"vitest": "catalog:"
|
|
88
64
|
},
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
"volta": {
|
|
99
|
-
"node": ">=22",
|
|
100
|
-
"pnpm": ">=10"
|
|
65
|
+
"keywords": [
|
|
66
|
+
"pnpm",
|
|
67
|
+
"catalog",
|
|
68
|
+
"cli"
|
|
69
|
+
],
|
|
70
|
+
"author": {
|
|
71
|
+
"name": "Evan Hu",
|
|
72
|
+
"email": "evan@yldm.tech"
|
|
101
73
|
},
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"build:watch": "tsc --watch",
|
|
108
|
-
"dev": "tsx src/cli/index.ts",
|
|
109
|
-
"start": "node dist/cli/index.js",
|
|
110
|
-
"test": "vitest",
|
|
111
|
-
"test:watch": "vitest --watch",
|
|
112
|
-
"test:coverage": "vitest --coverage",
|
|
113
|
-
"test:e2e": "vitest --config vitest.e2e.config.ts",
|
|
114
|
-
"lint": "eslint src test --ext .ts,.js",
|
|
115
|
-
"lint:fix": "eslint src test --ext .ts,.js --fix",
|
|
116
|
-
"format": "prettier --write src test",
|
|
117
|
-
"format:check": "prettier --check src test",
|
|
118
|
-
"typecheck": "tsc --noEmit",
|
|
119
|
-
"clean": "rimraf dist bin/*.js",
|
|
120
|
-
"changeset": "changeset",
|
|
121
|
-
"version": "changeset version",
|
|
122
|
-
"release": "npm run build && changeset publish"
|
|
74
|
+
"license": "MIT",
|
|
75
|
+
"repository": {
|
|
76
|
+
"type": "git",
|
|
77
|
+
"url": "https://github.com/houko/pnpm-catalog-updates.git",
|
|
78
|
+
"directory": "apps/cli"
|
|
123
79
|
}
|
|
124
80
|
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check Command
|
|
3
|
+
*
|
|
4
|
+
* CLI command to check for outdated catalog dependencies.
|
|
5
|
+
* Provides detailed information about available updates.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { CatalogUpdateService, CheckOptions } from '@pcu/core';
|
|
9
|
+
import { OutputFormatter, OutputFormat } from '../formatters/outputFormatter.js';
|
|
10
|
+
import { StyledText, ThemeManager } from '../themes/colorTheme.js';
|
|
11
|
+
import { ConfigLoader } from '@pcu/utils';
|
|
12
|
+
|
|
13
|
+
export interface CheckCommandOptions {
|
|
14
|
+
workspace?: string;
|
|
15
|
+
catalog?: string;
|
|
16
|
+
format?: OutputFormat;
|
|
17
|
+
target?: 'latest' | 'greatest' | 'minor' | 'patch' | 'newest';
|
|
18
|
+
prerelease?: boolean;
|
|
19
|
+
include?: string[];
|
|
20
|
+
exclude?: string[];
|
|
21
|
+
verbose?: boolean;
|
|
22
|
+
color?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class CheckCommand {
|
|
26
|
+
constructor(private readonly catalogUpdateService: CatalogUpdateService) {}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Execute the check command
|
|
30
|
+
*/
|
|
31
|
+
async execute(options: CheckCommandOptions = {}): Promise<void> {
|
|
32
|
+
try {
|
|
33
|
+
// Initialize theme
|
|
34
|
+
ThemeManager.setTheme('default');
|
|
35
|
+
|
|
36
|
+
if (options.verbose) {
|
|
37
|
+
console.log(StyledText.iconAnalysis('Checking for outdated catalog dependencies'));
|
|
38
|
+
console.log(StyledText.muted(`Workspace: ${options.workspace || process.cwd()}`));
|
|
39
|
+
|
|
40
|
+
if (options.catalog) {
|
|
41
|
+
console.log(StyledText.muted(`Catalog: ${options.catalog}`));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (options.target && options.target !== 'latest') {
|
|
45
|
+
console.log(StyledText.muted(`Target: ${options.target}`));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
console.log('');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Load configuration file first
|
|
52
|
+
const config = ConfigLoader.loadConfig(options.workspace || process.cwd());
|
|
53
|
+
|
|
54
|
+
// Use format from CLI options first, then config file, then default
|
|
55
|
+
const effectiveFormat = options.format || config.defaults?.format || 'table';
|
|
56
|
+
|
|
57
|
+
// Create output formatter with effective format
|
|
58
|
+
const formatter = new OutputFormatter(
|
|
59
|
+
effectiveFormat as OutputFormat,
|
|
60
|
+
options.color !== false
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// Merge CLI options with configuration file settings
|
|
64
|
+
const checkOptions: CheckOptions = {
|
|
65
|
+
workspacePath: options.workspace,
|
|
66
|
+
catalogName: options.catalog,
|
|
67
|
+
target: options.target || config.defaults?.target || 'latest',
|
|
68
|
+
includePrerelease: options.prerelease ?? config.defaults?.includePrerelease ?? false,
|
|
69
|
+
// CLI include/exclude options take priority over config file
|
|
70
|
+
include: options.include?.length ? options.include : config.include,
|
|
71
|
+
exclude: options.exclude?.length ? options.exclude : config.exclude,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// Execute check
|
|
75
|
+
const report = await this.catalogUpdateService.checkOutdatedDependencies(checkOptions);
|
|
76
|
+
|
|
77
|
+
// Format and display results
|
|
78
|
+
const formattedOutput = formatter.formatOutdatedReport(report);
|
|
79
|
+
console.log(formattedOutput);
|
|
80
|
+
|
|
81
|
+
// Show summary
|
|
82
|
+
if (options.verbose || options.format === 'table') {
|
|
83
|
+
this.showSummary(report, options);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Always exit with 0 since this is just a check command
|
|
87
|
+
// and finding updates is not an error condition
|
|
88
|
+
process.exit(0);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error(StyledText.iconError('Error checking dependencies:'));
|
|
91
|
+
console.error(StyledText.error(String(error)));
|
|
92
|
+
|
|
93
|
+
if (options.verbose && error instanceof Error) {
|
|
94
|
+
console.error(StyledText.muted('Stack trace:'));
|
|
95
|
+
console.error(StyledText.muted(error.stack || 'No stack trace available'));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Show command summary
|
|
104
|
+
*/
|
|
105
|
+
private showSummary(report: any, _options: CheckCommandOptions): void {
|
|
106
|
+
const lines: string[] = [];
|
|
107
|
+
const theme = ThemeManager.getTheme();
|
|
108
|
+
|
|
109
|
+
if (!report.hasUpdates) {
|
|
110
|
+
lines.push(StyledText.iconSuccess('All catalog dependencies are up to date!'));
|
|
111
|
+
} else {
|
|
112
|
+
lines.push(StyledText.iconInfo('Summary:'));
|
|
113
|
+
lines.push(` • ${report.totalOutdated} outdated dependencies found`);
|
|
114
|
+
lines.push(` • ${report.catalogs.length} catalogs checked`);
|
|
115
|
+
|
|
116
|
+
const totalPackages = report.catalogs.reduce(
|
|
117
|
+
(sum: number, cat: any) => sum + cat.totalPackages,
|
|
118
|
+
0
|
|
119
|
+
);
|
|
120
|
+
lines.push(` • ${totalPackages} total catalog entries`);
|
|
121
|
+
|
|
122
|
+
// Show breakdown by update type
|
|
123
|
+
const updateTypes = { major: 0, minor: 0, patch: 0 };
|
|
124
|
+
|
|
125
|
+
for (const catalog of report.catalogs) {
|
|
126
|
+
for (const dep of catalog.outdatedDependencies) {
|
|
127
|
+
updateTypes[dep.updateType as keyof typeof updateTypes]++;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (updateTypes.major > 0) {
|
|
132
|
+
lines.push(theme.major(` • ${updateTypes.major} major updates`));
|
|
133
|
+
}
|
|
134
|
+
if (updateTypes.minor > 0) {
|
|
135
|
+
lines.push(theme.minor(` • ${updateTypes.minor} minor updates`));
|
|
136
|
+
}
|
|
137
|
+
if (updateTypes.patch > 0) {
|
|
138
|
+
lines.push(theme.patch(` • ${updateTypes.patch} patch updates`));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Security updates
|
|
142
|
+
const securityUpdates = report.catalogs.reduce((sum: number, cat: any) => {
|
|
143
|
+
return sum + cat.outdatedDependencies.filter((dep: any) => dep.isSecurityUpdate).length;
|
|
144
|
+
}, 0);
|
|
145
|
+
|
|
146
|
+
if (securityUpdates > 0) {
|
|
147
|
+
lines.push(StyledText.iconSecurity(`${securityUpdates} security updates`));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
lines.push('');
|
|
151
|
+
lines.push(StyledText.iconUpdate('Run with --update to apply updates'));
|
|
152
|
+
|
|
153
|
+
if (updateTypes.major > 0) {
|
|
154
|
+
lines.push(StyledText.iconWarning('Major updates may contain breaking changes'));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
console.log(lines.join('\n'));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Validate command options
|
|
163
|
+
*/
|
|
164
|
+
static validateOptions(options: CheckCommandOptions): string[] {
|
|
165
|
+
const errors: string[] = [];
|
|
166
|
+
|
|
167
|
+
// Validate format
|
|
168
|
+
if (options.format && !['table', 'json', 'yaml', 'minimal'].includes(options.format)) {
|
|
169
|
+
errors.push('Invalid format. Must be one of: table, json, yaml, minimal');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Validate target
|
|
173
|
+
if (
|
|
174
|
+
options.target &&
|
|
175
|
+
!['latest', 'greatest', 'minor', 'patch', 'newest'].includes(options.target)
|
|
176
|
+
) {
|
|
177
|
+
errors.push('Invalid target. Must be one of: latest, greatest, minor, patch, newest');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Validate include/exclude patterns
|
|
181
|
+
if (options.include && options.include.some((pattern) => !pattern.trim())) {
|
|
182
|
+
errors.push('Include patterns cannot be empty');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (options.exclude && options.exclude.some((pattern) => !pattern.trim())) {
|
|
186
|
+
errors.push('Exclude patterns cannot be empty');
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return errors;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Get command help text
|
|
194
|
+
*/
|
|
195
|
+
static getHelpText(): string {
|
|
196
|
+
return `
|
|
197
|
+
Check for outdated catalog dependencies
|
|
198
|
+
|
|
199
|
+
Usage:
|
|
200
|
+
pcu check [options]
|
|
201
|
+
|
|
202
|
+
Options:
|
|
203
|
+
--workspace <path> Workspace directory (default: current directory)
|
|
204
|
+
--catalog <name> Check specific catalog only
|
|
205
|
+
--format <type> Output format: table, json, yaml, minimal (default: table)
|
|
206
|
+
--target <type> Update target: latest, greatest, minor, patch, newest (default: latest)
|
|
207
|
+
--prerelease Include prerelease versions
|
|
208
|
+
--include <pattern> Include packages matching pattern (can be used multiple times)
|
|
209
|
+
--exclude <pattern> Exclude packages matching pattern (can be used multiple times)
|
|
210
|
+
--verbose Show detailed information
|
|
211
|
+
--no-color Disable colored output
|
|
212
|
+
|
|
213
|
+
Examples:
|
|
214
|
+
pcu check # Check all catalogs
|
|
215
|
+
pcu check --catalog react17 # Check specific catalog
|
|
216
|
+
pcu check --target minor # Check for minor updates only
|
|
217
|
+
pcu check --format json # Output as JSON
|
|
218
|
+
pcu check --include "react*" # Include only React packages
|
|
219
|
+
pcu check --exclude "@types/*" # Exclude TypeScript types
|
|
220
|
+
|
|
221
|
+
Exit Codes:
|
|
222
|
+
0 All dependencies are up to date
|
|
223
|
+
1 Updates are available
|
|
224
|
+
2 Error occurred
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
227
|
+
}
|