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.
Files changed (224) hide show
  1. package/README.md +70 -634
  2. package/bin/pcu.js +1 -1
  3. package/dist/index.js +9559 -32
  4. package/dist/index.js.map +1 -1
  5. package/package.json +59 -103
  6. package/src/cli/commands/checkCommand.ts +227 -0
  7. package/src/cli/commands/initCommand.ts +394 -0
  8. package/src/cli/commands/securityCommand.ts +569 -0
  9. package/src/cli/commands/updateCommand.ts +245 -0
  10. package/src/cli/formatters/outputFormatter.ts +830 -0
  11. package/src/cli/formatters/progressBar.ts +700 -0
  12. package/src/cli/index.ts +565 -0
  13. package/src/cli/interactive/interactivePrompts.ts +517 -0
  14. package/src/cli/options/globalOptions.ts +380 -0
  15. package/src/cli/options/index.ts +5 -0
  16. package/src/cli/themes/colorTheme.ts +379 -0
  17. package/src/cli/validators/commandValidator.ts +395 -0
  18. package/src/cli/validators/index.ts +5 -0
  19. package/src/index.ts +4 -0
  20. package/LICENSE +0 -21
  21. package/README.ja.md +0 -587
  22. package/README.zh-CN.md +0 -634
  23. package/dist/application/services/CatalogUpdateService.d.ts +0 -209
  24. package/dist/application/services/CatalogUpdateService.d.ts.map +0 -1
  25. package/dist/application/services/CatalogUpdateService.js +0 -839
  26. package/dist/application/services/CatalogUpdateService.js.map +0 -1
  27. package/dist/application/services/WorkspaceService.d.ts +0 -139
  28. package/dist/application/services/WorkspaceService.d.ts.map +0 -1
  29. package/dist/application/services/WorkspaceService.js +0 -340
  30. package/dist/application/services/WorkspaceService.js.map +0 -1
  31. package/dist/cli/commands/CheckCommand.d.ts +0 -40
  32. package/dist/cli/commands/CheckCommand.d.ts.map +0 -1
  33. package/dist/cli/commands/CheckCommand.js +0 -177
  34. package/dist/cli/commands/CheckCommand.js.map +0 -1
  35. package/dist/cli/commands/InitCommand.d.ts +0 -53
  36. package/dist/cli/commands/InitCommand.d.ts.map +0 -1
  37. package/dist/cli/commands/InitCommand.js +0 -338
  38. package/dist/cli/commands/InitCommand.js.map +0 -1
  39. package/dist/cli/commands/SecurityCommand.d.ts +0 -113
  40. package/dist/cli/commands/SecurityCommand.d.ts.map +0 -1
  41. package/dist/cli/commands/SecurityCommand.js +0 -410
  42. package/dist/cli/commands/SecurityCommand.js.map +0 -1
  43. package/dist/cli/commands/UpdateCommand.d.ts +0 -44
  44. package/dist/cli/commands/UpdateCommand.d.ts.map +0 -1
  45. package/dist/cli/commands/UpdateCommand.js +0 -189
  46. package/dist/cli/commands/UpdateCommand.js.map +0 -1
  47. package/dist/cli/formatters/OutputFormatter.d.ts +0 -116
  48. package/dist/cli/formatters/OutputFormatter.d.ts.map +0 -1
  49. package/dist/cli/formatters/OutputFormatter.js +0 -664
  50. package/dist/cli/formatters/OutputFormatter.js.map +0 -1
  51. package/dist/cli/formatters/ProgressBar.d.ts +0 -195
  52. package/dist/cli/formatters/ProgressBar.d.ts.map +0 -1
  53. package/dist/cli/formatters/ProgressBar.js +0 -622
  54. package/dist/cli/formatters/ProgressBar.js.map +0 -1
  55. package/dist/cli/index.d.ts +0 -12
  56. package/dist/cli/index.d.ts.map +0 -1
  57. package/dist/cli/index.js +0 -492
  58. package/dist/cli/index.js.map +0 -1
  59. package/dist/cli/interactive/InteractivePrompts.d.ts +0 -85
  60. package/dist/cli/interactive/InteractivePrompts.d.ts.map +0 -1
  61. package/dist/cli/interactive/InteractivePrompts.js +0 -434
  62. package/dist/cli/interactive/InteractivePrompts.js.map +0 -1
  63. package/dist/cli/options/GlobalOptions.d.ts +0 -117
  64. package/dist/cli/options/GlobalOptions.d.ts.map +0 -1
  65. package/dist/cli/options/GlobalOptions.js +0 -278
  66. package/dist/cli/options/GlobalOptions.js.map +0 -1
  67. package/dist/cli/options/index.d.ts +0 -5
  68. package/dist/cli/options/index.d.ts.map +0 -1
  69. package/dist/cli/options/index.js +0 -5
  70. package/dist/cli/options/index.js.map +0 -1
  71. package/dist/cli/themes/ColorTheme.d.ts +0 -211
  72. package/dist/cli/themes/ColorTheme.d.ts.map +0 -1
  73. package/dist/cli/themes/ColorTheme.js +0 -267
  74. package/dist/cli/themes/ColorTheme.js.map +0 -1
  75. package/dist/cli/validators/CommandValidator.d.ts +0 -60
  76. package/dist/cli/validators/CommandValidator.d.ts.map +0 -1
  77. package/dist/cli/validators/CommandValidator.js +0 -319
  78. package/dist/cli/validators/CommandValidator.js.map +0 -1
  79. package/dist/cli/validators/index.d.ts +0 -5
  80. package/dist/cli/validators/index.d.ts.map +0 -1
  81. package/dist/cli/validators/index.js +0 -5
  82. package/dist/cli/validators/index.js.map +0 -1
  83. package/dist/common/config/Config.d.ts +0 -142
  84. package/dist/common/config/Config.d.ts.map +0 -1
  85. package/dist/common/config/Config.js +0 -382
  86. package/dist/common/config/Config.js.map +0 -1
  87. package/dist/common/config/ConfigLoader.d.ts +0 -49
  88. package/dist/common/config/ConfigLoader.d.ts.map +0 -1
  89. package/dist/common/config/ConfigLoader.js +0 -180
  90. package/dist/common/config/ConfigLoader.js.map +0 -1
  91. package/dist/common/config/PackageFilterConfig.d.ts +0 -56
  92. package/dist/common/config/PackageFilterConfig.d.ts.map +0 -1
  93. package/dist/common/config/PackageFilterConfig.js +0 -94
  94. package/dist/common/config/PackageFilterConfig.js.map +0 -1
  95. package/dist/common/config/index.d.ts +0 -8
  96. package/dist/common/config/index.d.ts.map +0 -1
  97. package/dist/common/config/index.js +0 -8
  98. package/dist/common/config/index.js.map +0 -1
  99. package/dist/common/error-handling/ErrorTracker.d.ts +0 -48
  100. package/dist/common/error-handling/ErrorTracker.d.ts.map +0 -1
  101. package/dist/common/error-handling/ErrorTracker.js +0 -93
  102. package/dist/common/error-handling/ErrorTracker.js.map +0 -1
  103. package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts +0 -74
  104. package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts.map +0 -1
  105. package/dist/common/error-handling/UserFriendlyErrorHandler.js +0 -703
  106. package/dist/common/error-handling/UserFriendlyErrorHandler.js.map +0 -1
  107. package/dist/common/error-handling/index.d.ts +0 -11
  108. package/dist/common/error-handling/index.d.ts.map +0 -1
  109. package/dist/common/error-handling/index.js +0 -9
  110. package/dist/common/error-handling/index.js.map +0 -1
  111. package/dist/common/logger/Logger.d.ts +0 -110
  112. package/dist/common/logger/Logger.d.ts.map +0 -1
  113. package/dist/common/logger/Logger.js +0 -289
  114. package/dist/common/logger/Logger.js.map +0 -1
  115. package/dist/common/logger/index.d.ts +0 -6
  116. package/dist/common/logger/index.d.ts.map +0 -1
  117. package/dist/common/logger/index.js +0 -6
  118. package/dist/common/logger/index.js.map +0 -1
  119. package/dist/common/types/cli.d.ts +0 -265
  120. package/dist/common/types/cli.d.ts.map +0 -1
  121. package/dist/common/types/cli.js +0 -5
  122. package/dist/common/types/cli.js.map +0 -1
  123. package/dist/common/types/core.d.ts +0 -270
  124. package/dist/common/types/core.d.ts.map +0 -1
  125. package/dist/common/types/core.js +0 -32
  126. package/dist/common/types/core.js.map +0 -1
  127. package/dist/common/types/index.d.ts +0 -8
  128. package/dist/common/types/index.d.ts.map +0 -1
  129. package/dist/common/types/index.js +0 -8
  130. package/dist/common/types/index.js.map +0 -1
  131. package/dist/common/utils/VersionChecker.d.ts +0 -54
  132. package/dist/common/utils/VersionChecker.d.ts.map +0 -1
  133. package/dist/common/utils/VersionChecker.js +0 -180
  134. package/dist/common/utils/VersionChecker.js.map +0 -1
  135. package/dist/common/utils/async.d.ts +0 -74
  136. package/dist/common/utils/async.d.ts.map +0 -1
  137. package/dist/common/utils/async.js +0 -228
  138. package/dist/common/utils/async.js.map +0 -1
  139. package/dist/common/utils/format.d.ts +0 -32
  140. package/dist/common/utils/format.d.ts.map +0 -1
  141. package/dist/common/utils/format.js +0 -121
  142. package/dist/common/utils/format.js.map +0 -1
  143. package/dist/common/utils/git.d.ts +0 -44
  144. package/dist/common/utils/git.d.ts.map +0 -1
  145. package/dist/common/utils/git.js +0 -147
  146. package/dist/common/utils/git.js.map +0 -1
  147. package/dist/common/utils/index.d.ts +0 -12
  148. package/dist/common/utils/index.d.ts.map +0 -1
  149. package/dist/common/utils/index.js +0 -12
  150. package/dist/common/utils/index.js.map +0 -1
  151. package/dist/common/utils/string.d.ts +0 -56
  152. package/dist/common/utils/string.d.ts.map +0 -1
  153. package/dist/common/utils/string.js +0 -134
  154. package/dist/common/utils/string.js.map +0 -1
  155. package/dist/common/utils/validation.d.ts +0 -88
  156. package/dist/common/utils/validation.d.ts.map +0 -1
  157. package/dist/common/utils/validation.js +0 -308
  158. package/dist/common/utils/validation.js.map +0 -1
  159. package/dist/domain/entities/Catalog.d.ts +0 -117
  160. package/dist/domain/entities/Catalog.d.ts.map +0 -1
  161. package/dist/domain/entities/Catalog.js +0 -240
  162. package/dist/domain/entities/Catalog.js.map +0 -1
  163. package/dist/domain/entities/Package.d.ts +0 -143
  164. package/dist/domain/entities/Package.d.ts.map +0 -1
  165. package/dist/domain/entities/Package.js +0 -272
  166. package/dist/domain/entities/Package.js.map +0 -1
  167. package/dist/domain/entities/Workspace.d.ts +0 -95
  168. package/dist/domain/entities/Workspace.d.ts.map +0 -1
  169. package/dist/domain/entities/Workspace.js +0 -173
  170. package/dist/domain/entities/Workspace.js.map +0 -1
  171. package/dist/domain/repositories/WorkspaceRepository.d.ts +0 -41
  172. package/dist/domain/repositories/WorkspaceRepository.d.ts.map +0 -1
  173. package/dist/domain/repositories/WorkspaceRepository.js +0 -8
  174. package/dist/domain/repositories/WorkspaceRepository.js.map +0 -1
  175. package/dist/domain/value-objects/CatalogCollection.d.ts +0 -106
  176. package/dist/domain/value-objects/CatalogCollection.d.ts.map +0 -1
  177. package/dist/domain/value-objects/CatalogCollection.js +0 -230
  178. package/dist/domain/value-objects/CatalogCollection.js.map +0 -1
  179. package/dist/domain/value-objects/PackageCollection.d.ts +0 -122
  180. package/dist/domain/value-objects/PackageCollection.d.ts.map +0 -1
  181. package/dist/domain/value-objects/PackageCollection.js +0 -263
  182. package/dist/domain/value-objects/PackageCollection.js.map +0 -1
  183. package/dist/domain/value-objects/Version.d.ts +0 -141
  184. package/dist/domain/value-objects/Version.d.ts.map +0 -1
  185. package/dist/domain/value-objects/Version.js +0 -268
  186. package/dist/domain/value-objects/Version.js.map +0 -1
  187. package/dist/domain/value-objects/WorkspaceConfig.d.ts +0 -144
  188. package/dist/domain/value-objects/WorkspaceConfig.d.ts.map +0 -1
  189. package/dist/domain/value-objects/WorkspaceConfig.js +0 -357
  190. package/dist/domain/value-objects/WorkspaceConfig.js.map +0 -1
  191. package/dist/domain/value-objects/WorkspaceId.d.ts +0 -51
  192. package/dist/domain/value-objects/WorkspaceId.d.ts.map +0 -1
  193. package/dist/domain/value-objects/WorkspaceId.js +0 -104
  194. package/dist/domain/value-objects/WorkspaceId.js.map +0 -1
  195. package/dist/domain/value-objects/WorkspacePath.d.ts +0 -75
  196. package/dist/domain/value-objects/WorkspacePath.d.ts.map +0 -1
  197. package/dist/domain/value-objects/WorkspacePath.js +0 -128
  198. package/dist/domain/value-objects/WorkspacePath.js.map +0 -1
  199. package/dist/index.d.ts +0 -25
  200. package/dist/index.d.ts.map +0 -1
  201. package/dist/infrastructure/cache/Cache.d.ts +0 -161
  202. package/dist/infrastructure/cache/Cache.d.ts.map +0 -1
  203. package/dist/infrastructure/cache/Cache.js +0 -398
  204. package/dist/infrastructure/cache/Cache.js.map +0 -1
  205. package/dist/infrastructure/cache/index.d.ts +0 -6
  206. package/dist/infrastructure/cache/index.d.ts.map +0 -1
  207. package/dist/infrastructure/cache/index.js +0 -6
  208. package/dist/infrastructure/cache/index.js.map +0 -1
  209. package/dist/infrastructure/external-services/NpmRegistryService.d.ts +0 -153
  210. package/dist/infrastructure/external-services/NpmRegistryService.d.ts.map +0 -1
  211. package/dist/infrastructure/external-services/NpmRegistryService.js +0 -511
  212. package/dist/infrastructure/external-services/NpmRegistryService.js.map +0 -1
  213. package/dist/infrastructure/file-system/FileSystemService.d.ts +0 -120
  214. package/dist/infrastructure/file-system/FileSystemService.d.ts.map +0 -1
  215. package/dist/infrastructure/file-system/FileSystemService.js +0 -663
  216. package/dist/infrastructure/file-system/FileSystemService.js.map +0 -1
  217. package/dist/infrastructure/repositories/FileWorkspaceRepository.d.ts +0 -57
  218. package/dist/infrastructure/repositories/FileWorkspaceRepository.d.ts.map +0 -1
  219. package/dist/infrastructure/repositories/FileWorkspaceRepository.js +0 -179
  220. package/dist/infrastructure/repositories/FileWorkspaceRepository.js.map +0 -1
  221. package/dist/infrastructure/utils/NpmrcParser.d.ts +0 -40
  222. package/dist/infrastructure/utils/NpmrcParser.d.ts.map +0 -1
  223. package/dist/infrastructure/utils/NpmrcParser.js +0 -157
  224. package/dist/infrastructure/utils/NpmrcParser.js.map +0 -1
package/README.md CHANGED
@@ -1,694 +1,130 @@
1
- # pnpm-catalog-updates
2
-
3
- A powerful CLI tool to check and update pnpm workspace catalog dependencies,
4
- inspired by
5
- [npm-check-updates](https://github.com/raineorshine/npm-check-updates).
6
-
7
- **📖 Documentation Languages**: [English](README.md) | [中文](README.zh-CN.md) |
8
- [日本語](README.ja.md)
9
-
10
- [![CI](https://img.shields.io/github/actions/workflow/status/houko/pnpm-catalog-updates/ci.yml?label=CI&logo=github)](https://github.com/houko/pnpm-catalog-updates/actions)
11
- [![npm](https://img.shields.io/npm/v/pnpm-catalog-updates)](https://www.npmjs.com/package/pnpm-catalog-updates)
12
- [![Coverage](https://img.shields.io/coveralls/github/houko/pnpm-catalog-updates/main)](https://coveralls.io/github/houko/pnpm-catalog-updates)
13
-
14
- ## ✨ Features
15
-
16
- - 🏗️ **One-Command Setup**: Initialize complete PNPM workspace with `pcu init`
17
- - 🔍 **Smart Detection**: Automatically discovers pnpm workspaces and catalog
18
- configurations
19
- - 🎯 **Catalog Focused**: Specialized for pnpm catalog dependency management
20
- - 🚀 **Interactive Mode**: Choose which dependencies to update with an intuitive
21
- interface
22
- - 📊 **Impact Analysis**: Understand which packages will be affected by catalog
23
- changes
24
- - 🔒 **Safe Updates**: Dry-run mode and backup options for safe dependency
25
- updates
26
- - ⚡ **High Performance**: Parallel API queries and intelligent caching
27
- - 🛡️ **Security Aware**: Built-in security vulnerability scanning
28
- - 🎨 **Beautiful UI**: Enhanced progress bars with 6 visual styles, color
29
- themes, and interactive prompts
30
- - 🌈 **Progress Bar Styles**: Choose from gradient, fancy, minimal, rainbow,
31
- neon, or blocks styles
32
- - 🎭 **Customizable Themes**: Multiple color themes (default, modern, minimal,
33
- neon)
34
- - 📈 **Real-time Progress**: Live progress tracking with speed indicators and
35
- time estimates
36
- - 🔄 **Smart Version Check**: Automatic update notifications with --version
37
- command
38
- - 🔧 **Configurable**: Flexible configuration options and update strategies
39
- - 🔐 **Private Registry Support**: Automatically reads `.npmrc` and `.pnpmrc`
40
- configurations for scoped registries and authentication
41
- - 📦 **Multi-Registry**: Supports different registries for different package
42
- scopes (e.g., GitHub Packages, private npm registries)
1
+ # pcu
43
2
 
44
- ## 🚀 Quick Start
45
-
46
- ```bash
47
- # Initialize a new PNPM workspace with PCU configuration
48
- pcu init
3
+ A powerful CLI tool for managing pnpm workspace catalog dependencies with ease.
49
4
 
50
- # Or check for updates in existing workspace
51
- pcu -c
52
- ```
53
-
54
- ![Image](https://github.com/user-attachments/assets/f05a970e-c58c-44f1-b3f1-351ae30b4a35)
5
+ ## 🚀 Quick Start
55
6
 
56
7
  ### Installation
57
8
 
58
9
  ```bash
59
- # Global installation
60
- npm install -g pnpm-catalog-updates
61
- # or
10
+ # Install globally
62
11
  npm install -g pcu
63
12
 
64
- # Or use with npx
65
- npx pnpm-catalog-updates
66
- # or
67
- npx pcu
13
+ # Or use with pnpm
14
+ pnpm add -g pcu
68
15
 
69
- # Or use the short alias
70
- pcu
16
+ # Or use legacy package name
17
+ npm install -g pnpm-catalog-updates
71
18
  ```
72
19
 
73
- ### Basic Usage
20
+ ### Usage
74
21
 
75
22
  ```bash
76
- # Initialize PNPM workspace and PCU configuration
77
- pcu init
78
-
79
- # Quick check for updates
23
+ # Check for outdated catalog dependencies
24
+ pcu check
25
+ # or
80
26
  pcu -c
81
27
 
82
- # Quick update (interactive)
28
+ # Update catalog dependencies interactively
29
+ pcu update --interactive
30
+ # or
83
31
  pcu -i
84
32
 
85
- # Quick update (dry run)
86
- pcu -u -d
33
+ # Update to latest versions
34
+ pcu update
35
+ # or
36
+ pcu -u
37
+
38
+ # Analyze impact of updates
39
+ pcu analyze
40
+ # or
41
+ pcu -a
87
42
 
88
- # Get workspace info
43
+ # Show workspace information
44
+ pcu workspace
45
+ # or
89
46
  pcu -s
90
47
  ```
91
48
 
92
- ### Common Commands
93
-
94
- | Command | Description | Example |
95
- | ---------- | -------------------------------------- | ------------------------- |
96
- | `pcu init` | Initialize workspace and configuration | `pcu init --verbose` |
97
- | `pcu -c` | Check for updates | `pcu -c --catalog node18` |
98
- | `pcu -i` | Update dependencies (interactive) | `pcu -i -b` |
99
- | `pcu -a` | Analyze impact | `pcu -a default react` |
100
- | `pcu -s` | Workspace info | `pcu -s --validate` |
101
- | `pcu -t` | Configure color theme | `pcu -t --set modern` |
102
- | `pcu -h` | Show help | `pcu -h update` |
103
-
104
- ## 📖 Complete Usage Guide
105
-
106
- ### All Commands & Shortcuts
49
+ ## 📋 Commands
107
50
 
108
- | Full Command | Shorthand | Description |
51
+ | Command | Shorthand | Description |
109
52
  | --------------- | --------- | ----------------------------------------------- |
110
- | `pcu init` | `pcu i` | Initialize PNPM workspace and PCU configuration |
111
53
  | `pcu check` | `pcu -c` | Check for outdated catalog dependencies |
112
54
  | `pcu update` | `pcu -u` | Update catalog dependencies |
113
55
  | `pcu analyze` | `pcu -a` | Analyze impact of dependency updates |
114
56
  | `pcu workspace` | `pcu -s` | Show workspace information and validation |
115
- | `pcu theme` | `pcu -t` | Configure color themes and UI settings |
57
+ | `pcu init` | | Initialize workspace with catalog configuration |
116
58
  | `pcu help` | `pcu -h` | Display help information |
117
59
 
118
- ### Commands
119
-
120
- #### `pcu init` / `pcu i`
121
-
122
- Initialize a complete PNPM workspace environment with PCU configuration.
123
-
124
- ```bash
125
- pcu init [options]
126
- pcu i [options]
127
-
128
- Options:
129
- --force Overwrite existing configuration file
130
- --create-workspace Create PNPM workspace structure if missing (default: true)
131
- --no-create-workspace Skip creating PNPM workspace structure
132
- -w, --workspace <path> Workspace directory (default: current directory)
133
- -v, --verbose Show detailed information
134
- --no-color Disable colored output
135
-
136
- Description:
137
- Creates a complete PNPM workspace environment with:
138
- - Basic .pcurc.json configuration file with sensible defaults
139
- - package.json for workspace root (if missing)
140
- - pnpm-workspace.yaml configuration (if missing)
141
- - packages/ directory structure (if missing)
142
-
143
- The configuration includes package update rules for React, TypeScript,
144
- ESLint, and other common dependencies with appropriate security settings.
145
-
146
- Examples:
147
- pcu init # Initialize complete workspace in current directory
148
- pcu init --workspace ./my-project # Initialize in specific directory
149
- pcu init --force # Overwrite existing configuration
150
- pcu init --no-create-workspace # Only create .pcurc.json configuration
151
-
152
- Files Created:
153
- .pcurc.json PCU configuration with package rules and settings
154
- package.json Workspace root package.json (if missing)
155
- pnpm-workspace.yaml PNPM workspace configuration (if missing)
156
- packages/ Directory for workspace packages (if missing)
157
- ```
158
-
159
- #### `pcu check` / `pcu -c` / `pcu chk`
160
-
161
- Check for outdated dependencies in your pnpm workspace catalogs.
162
-
163
- ```bash
164
- pcu check [options]
165
- pcu -c [options]
166
- pcu chk [options]
167
-
168
- Options:
169
- --catalog <name> Check specific catalog only
170
- -f, --format <type> Output format: table, json, yaml, minimal (default: table)
171
- - table: Rich table format with colors and details
172
- - minimal: Simple npm-check-updates style (package → version)
173
- - json: JSON output for programmatic use
174
- - yaml: YAML output for configuration files
175
- -t, --target <type> Update target: latest, greatest, minor, patch, newest (default: latest)
176
- --prerelease Include prerelease versions
177
- --include <pattern> Include packages matching pattern
178
- --exclude <pattern> Exclude packages matching pattern
179
- -w, --workspace <path> Workspace directory (default: current directory)
180
- -v, --verbose Show detailed information
181
- ```
182
-
183
- #### `pcu update` / `pcu -u`
184
-
185
- Update catalog dependencies to newer versions.
186
-
187
- ```bash
188
- pcu update [options]
189
- pcu -u [options]
190
- pcu u [options]
191
-
192
- Options:
193
- -i, --interactive Interactive mode to choose updates
194
- -d, --dry-run Preview changes without writing files
195
- -t, --target <type> Update target: latest, greatest, minor, patch, newest (default: latest)
196
- --catalog <name> Update specific catalog only
197
- --include <pattern> Include packages matching pattern
198
- --exclude <pattern> Exclude packages matching pattern
199
- --force Force updates even if risky
200
- --prerelease Include prerelease versions
201
- -b, --create-backup Create backup files before updating
202
- -f, --format <type> Output format: table, json, yaml, minimal (default: table)
203
- - table: Rich table format with colors and details
204
- - minimal: Simple npm-check-updates style (package → version)
205
- - json: JSON output for programmatic use
206
- - yaml: YAML output for configuration files
207
- -w, --workspace <path> Workspace directory (default: current directory)
208
- -v, --verbose Show detailed information
209
- ```
210
-
211
- #### `pcu analyze` / `pcu -a`
212
-
213
- Analyze the impact of updating a specific dependency.
214
-
215
- ```bash
216
- pcu analyze <catalog> <package> [version]
217
- pcu -a <catalog> <package> [version]
218
- pcu a <catalog> <package> [version]
219
-
220
- Arguments:
221
- catalog Catalog name (e.g., 'default', 'react17')
222
- package Package name (e.g., 'react', '@types/node')
223
- version New version (optional, defaults to latest)
224
-
225
- Options:
226
- -f, --format <type> Output format: table, json, yaml, minimal (default: table)
227
- -w, --workspace <path> Workspace directory (default: current directory)
228
- -v, --verbose Show detailed information
229
-
230
- Examples:
231
- pcu analyze default react
232
- pcu a default react 18.3.0
233
- pcu -a react17 @types/react
234
- ```
235
-
236
- #### `pcu workspace` / `pcu -s`
237
-
238
- Show workspace information and validation.
239
-
240
- ```bash
241
- pcu workspace [options]
242
- pcu -s [options]
243
- pcu w [options]
244
-
245
- Options:
246
- --validate Validate workspace configuration
247
- -s, --stats Show workspace statistics
248
- -f, --format <type> Output format: table, json, yaml, minimal (default: table)
249
- -w, --workspace <path> Workspace directory (default: current directory)
250
- -v, --verbose Show detailed information
251
-
252
- Examples:
253
- pcu workspace # Show basic workspace info
254
- pcu -s --stats # Show detailed statistics
255
- pcu w --validate # Validate workspace configuration
256
- ```
257
-
258
- #### `pcu help` / `pcu -h`
259
-
260
- Display help information.
261
-
262
- ```bash
263
- pcu help [command]
264
- pcu -h [command]
265
-
266
- Examples:
267
- pcu help # Show general help
268
- pcu help update # Show help for update command
269
- pcu -h check # Show help for check command
270
- ```
271
-
272
- #### `pcu theme` / `pcu -t`
273
-
274
- Configure color themes and UI appearance.
275
-
276
- ```bash
277
- pcu theme [options]
278
- pcu -t [options]
279
-
280
- Options:
281
- -s, --set <theme> Set color theme: default, modern, minimal, neon
282
- -l, --list List all available themes
283
- -i, --interactive Interactive theme configuration wizard
284
-
285
- Examples:
286
- pcu theme # Show current theme info
287
- pcu -t --list # List all available themes
288
- pcu theme --set modern # Set to modern theme
289
- pcu -t --interactive # Launch theme configuration wizard
290
- ```
291
-
292
- **Available Themes:**
293
-
294
- - `default` - Balanced colors for general use
295
- - `modern` - Vibrant colors for development environments
296
- - `minimal` - Clean and simple for production environments
297
- - `neon` - High contrast colors for presentations
298
-
299
- ### Global Options
300
-
301
- These options work with all commands:
302
-
303
- ```bash
304
- -w, --workspace <path> Workspace directory path
305
- -v, --verbose Enable verbose logging
306
- --no-color Disable colored output
307
- -V, --version Output the version number
308
- -h, --help Display help for command
309
- ```
310
-
311
- ### Common Usage Patterns
60
+ ## 🎯 Common Examples
312
61
 
313
62
  ```bash
314
- # Initialize new workspace
315
- pcu init # Create complete workspace structure
316
- pcu init --no-create-workspace # Only create .pcurc.json configuration
317
-
318
- # Quick check for updates
319
- pcu -c
320
-
321
- # Check with simple output (like npm-check-updates)
322
- pcu -c --format minimal
323
-
324
63
  # Interactive update with backup
325
- pcu -i -b
64
+ pcu update --interactive --backup
326
65
 
327
- # Update only minor and patch versions
328
- pcu -u --target minor
66
+ # Update only minor versions
67
+ pcu update --target minor
329
68
 
330
69
  # Check specific catalog
331
- pcu -c --catalog node18
332
-
333
- # Update excluding certain packages
334
- pcu -u --exclude "eslint*"
70
+ pcu check --catalog node18
335
71
 
336
- # Dry run with verbose output
337
- pcu -u -d -v
72
+ # Analyze before updating
73
+ pcu analyze default react
338
74
 
339
- # Update with simple output format
340
- pcu -u --format minimal
75
+ # Validate workspace
76
+ pcu workspace --validate
341
77
 
342
- # Analyze impact before updating
343
- pcu -a default react
344
- pcu -u --catalog default --include react
345
-
346
- # Validate workspace configuration
347
- pcu -s --validate
348
-
349
- # Theme customization
350
- pcu -t --list # List available themes
351
- pcu -t --set modern # Set modern theme
352
- pcu -t --interactive # Interactive theme setup
78
+ # Dry run update
79
+ pcu update --dry-run
353
80
  ```
354
81
 
355
- ### Configuration
356
-
357
- Create a `.pcurc.json` file (PCU configuration file) in your project root:
358
-
359
- ```json
360
- {
361
- "defaults": {
362
- "target": "latest",
363
- "timeout": 30000,
364
- "parallel": 5
365
- },
366
- "workspace": {
367
- "autoDiscover": true,
368
- "catalogMode": "strict"
369
- },
370
- "update": {
371
- "interactive": true,
372
- "dryRunFirst": true,
373
- "skipPrereleases": false
374
- },
375
- "output": {
376
- "format": "table",
377
- "color": true,
378
- "verbose": false
379
- },
380
- "ui": {
381
- "theme": "default",
382
- "progressBars": true,
383
- "animations": true
384
- }
385
- }
386
- ```
387
-
388
- #### Package Filtering Configuration
389
-
390
- You can also configure package-specific update rules by creating a `.pcurc.json`
391
- (PCU configuration file) with filtering options:
392
-
393
- ```json
394
- {
395
- // Exclude packages you never want to update
396
- "exclude": ["typescript", "@types/node", "react", "react-dom"],
397
-
398
- // Only update specific packages (optional - if not specified, all packages are considered)
399
- "include": ["lodash*", "chalk", "commander"],
400
-
401
- // Package-specific update rules
402
- "packageRules": [
403
- {
404
- "patterns": ["react", "react-dom"],
405
- "target": "minor", // Only minor updates for React
406
- "requireConfirmation": true, // Always ask before updating
407
- "relatedPackages": ["@types/react", "@types/react-dom"] // Related packages automatically follow same strategy
408
- },
409
- {
410
- "patterns": ["vue"],
411
- "target": "minor",
412
- "relatedPackages": ["@vue/compiler-sfc", "@vue/runtime-core"] // Vue ecosystem packages
413
- },
414
- {
415
- "patterns": ["@types/node"],
416
- "target": "minor", // Conservative updates for Node.js type definitions
417
- "requireConfirmation": true
418
- },
419
- {
420
- "patterns": ["@types/*"],
421
- "target": "latest", // Other type definitions can update more freely
422
- "autoUpdate": true
423
- },
424
- {
425
- "patterns": ["eslint*", "prettier"],
426
- "target": "minor", // Minor updates for dev tools
427
- "groupUpdate": true // Update related packages together
428
- }
429
- ],
430
-
431
- // Security configuration
432
- "security": {
433
- "autoFixVulnerabilities": true, // Automatically check and fix security vulnerabilities
434
- "allowMajorForSecurity": true, // Allow major version upgrades for security fixes
435
- "notifyOnSecurityUpdate": true // Show notifications on security updates
436
- },
437
-
438
- // Advanced configuration
439
- "advanced": {
440
- "concurrency": 5, // Number of concurrent network requests (default: 5)
441
- "timeout": 30000, // Network request timeout in ms (default: 30000)
442
- "retries": 3, // Number of retries on failure (default: 3)
443
- "cacheValidityMinutes": 60, // Cache validity period in minutes (default: 60, set to 0 to disable caching)
444
- "checkForUpdates": true // Check for tool updates on startup (default: true)
445
- },
446
-
447
- // Monorepo configuration
448
- "monorepo": {
449
- "syncVersions": ["react", "react-dom"], // Packages that need version sync across multiple catalogs
450
- "catalogPriority": ["default", "latest", "react17"] // Catalog priority order
451
- },
452
-
453
- // Override defaults
454
- "defaults": {
455
- "target": "minor",
456
- "createBackup": true
457
- }
458
- }
459
- ```
460
-
461
- **Related Packages Feature**: `relatedPackages` allows related packages to
462
- automatically follow the same version strategy
463
-
464
- - When you configure `react` with `target: "minor"`, `@types/react` will
465
- automatically apply the same strategy
466
- - Avoid manually duplicating update rules for related packages
467
- - Ensures version consistency across ecosystem packages
468
-
469
- **Configuration priority**: relatedPackages > direct pattern matching > CLI
470
- options > default configuration
471
-
472
- **Priority Examples**:
473
-
474
- ```bash
475
- @types/react → matches react rule's relatedPackages → uses "minor" strategy
476
- @types/node → matches @types/node specific rule → uses "minor" strategy
477
- @types/lodash → matches @types/* general rule → uses "latest" strategy
478
- ```
479
-
480
- **Pattern matching**: Supports glob patterns like `react*`, `@types/*`,
481
- `eslint*`
482
-
483
- ## 📁 Project Structure
484
-
485
- This project follows Domain-Driven Design (DDD) principles:
486
-
487
- ```text
488
- src/
489
- ├── cli/ # CLI interface layer
490
- │ ├── commands/ # Command handlers
491
- │ ├── options/ # Option parsers
492
- │ ├── formatters/ # Output formatters & progress bars
493
- │ ├── interactive/ # Interactive prompts & UI
494
- │ ├── themes/ # Color themes & styling
495
- │ └── validators/ # Input validation
496
- ├── application/ # Application services
497
- │ ├── services/ # Application services
498
- │ ├── handlers/ # Command handlers
499
- │ └── mappers/ # Data mappers
500
- ├── domain/ # Domain model
501
- │ ├── entities/ # Domain entities
502
- │ ├── value-objects/ # Value objects
503
- │ ├── aggregates/ # Aggregate roots
504
- │ ├── services/ # Domain services
505
- │ └── repositories/ # Repository interfaces
506
- ├── infrastructure/ # Infrastructure layer
507
- │ ├── repositories/ # Repository implementations
508
- │ ├── external-services/ # External service clients
509
- │ └── file-system/ # File system operations
510
- ├── adapters/ # Adapter layer
511
- │ ├── registry/ # Package registry adapters
512
- │ └── package-managers/ # Package manager adapters
513
- └── common/ # Common utilities
514
- ├── types/ # Type definitions
515
- ├── utils/ # Utility functions
516
- ├── config/ # Configuration
517
- └── logger/ # Logging
518
- ```
519
-
520
- ## 🧪 Development
521
-
522
- ### Prerequisites
523
-
524
- - Node.js >= 18.0.0
525
- - pnpm >= 8.15.0
526
-
527
- ### Setup
82
+ ## ⚙️ Options
528
83
 
529
- ```bash
530
- # Clone the repository
531
- git clone https://github.com/houko/pnpm-catalog-updates.git
532
- cd pnpm-catalog-updates
533
-
534
- # Install dependencies
535
- pnpm install
536
-
537
- # Build the project
538
- pnpm build
539
-
540
- # Run tests
541
- pnpm test
542
-
543
- # Run in development mode
544
- pnpm dev --help
545
- ```
546
-
547
- ### Scripts
548
-
549
- ```bash
550
- # Development
551
- pnpm dev # Run in development mode
552
- pnpm build # Build the project
553
- pnpm build:watch # Build in watch mode
554
-
555
- # Testing
556
- pnpm test # Run unit tests
557
- pnpm test:watch # Run tests in watch mode
558
- pnpm test:coverage # Run tests with coverage
559
- pnpm test:e2e # Run E2E tests
560
-
561
- # Code Quality
562
- pnpm lint # Lint code
563
- pnpm lint:fix # Fix linting issues
564
- pnpm format # Format code
565
- pnpm typecheck # Type checking
566
-
567
- # Utilities
568
- pnpm clean # Clean build artifacts
569
- ```
570
-
571
- ### Testing
572
-
573
- The project uses a comprehensive testing strategy:
574
-
575
- - **Unit Tests**: Test individual components in isolation
576
- - **Integration Tests**: Test component interactions
577
- - **E2E Tests**: Test the complete CLI workflow
578
-
579
- ```bash
580
- # Run all tests
581
- pnpm test
582
-
583
- # Run tests with coverage
584
- pnpm test:coverage
585
-
586
- # Run E2E tests
587
- pnpm test:e2e
588
-
589
- # Run tests in watch mode
590
- pnpm test:watch
591
- ```
592
-
593
- ## 📊 Examples
84
+ ### Global Options
594
85
 
595
- ### Basic Workspace
86
+ - `--help, -h`: Show help
87
+ - `--version, -v`: Show version
88
+ - `--verbose`: Enable verbose logging
89
+ - `--quiet`: Suppress non-error output
596
90
 
597
- ```yaml
598
- # pnpm-workspace.yaml
599
- packages:
600
- - 'packages/*'
91
+ ### Update Options
601
92
 
602
- catalog:
603
- react: ^18.2.0
604
- lodash: ^4.17.21
605
- typescript: ^5.0.0
606
- ```
93
+ - `--interactive, -i`: Interactive mode
94
+ - `--dry-run, -d`: Show what would be updated without making changes
95
+ - `--backup, -b`: Create backup before updating
96
+ - `--target <level>`: Update target (patch|minor|major|latest)
97
+ - `--catalog <name>`: Target specific catalog
607
98
 
608
- ### Multi-Catalog Setup
609
-
610
- ```yaml
611
- # pnpm-workspace.yaml
612
- packages:
613
- - "apps/*"
614
- - "packages/*"
615
-
616
- catalog:
617
- # Default catalog
618
- react: ^18.2.0
619
- typescript: ^5.0.0
620
-
621
- catalogs:
622
- # Legacy versions
623
- react17:
624
- react: ^17.0.2
625
- @types/react: ^17.0.62
626
-
627
- # Latest versions
628
- latest:
629
- react: ^18.2.0
630
- typescript: ^5.2.0
631
- ```
99
+ ## 📁 Configuration
632
100
 
633
- ### Usage in package.json
101
+ Create a `.pcurc.json` file in your project root:
634
102
 
635
103
  ```json
636
104
  {
637
- "dependencies": {
638
- "react": "catalog:",
639
- "lodash": "catalog:",
640
- "legacy-lib": "catalog:react17"
641
- }
105
+ "catalogs": ["default", "node18", "dev"],
106
+ "updateTarget": "minor",
107
+ "backup": true,
108
+ "interactive": false
642
109
  }
643
110
  ```
644
111
 
645
- ## 🤝 Contributing
646
-
647
- We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md)
648
- for details.
112
+ ## 🔧 Requirements
649
113
 
650
- ### Development Workflow
114
+ - Node.js >= 22.0.0
115
+ - pnpm workspace with catalog configuration
116
+ - pnpm-workspace.yaml with catalog entries
651
117
 
652
- 1. Fork the repository
653
- 2. Create a feature branch: `git checkout -b feature/amazing-feature`
654
- 3. Make your changes
655
- 4. Add tests for your changes
656
- 5. Ensure all tests pass: `pnpm test`
657
- 6. Lint your code: `pnpm lint:fix`
658
- 7. Commit your changes: `git commit -m 'feat: add amazing feature'`
659
- 8. Push to the branch: `git push origin feature/amazing-feature`
660
- 9. Open a Pull Request
118
+ ## 📚 Documentation
661
119
 
662
- ### Commit Message Convention
120
+ For complete documentation, visit:
121
+ [pnpm-catalog-updates](https://github.com/houko/pnpm-catalog-updates#readme)
663
122
 
664
- We use [Conventional Commits](https://conventionalcommits.org/):
123
+ ## 🤝 Contributing
665
124
 
666
- - `feat`: A new feature
667
- - `fix`: A bug fix
668
- - `docs`: Documentation only changes
669
- - `style`: Changes that do not affect the meaning of the code
670
- - `refactor`: A code change that neither fixes a bug nor adds a feature
671
- - `test`: Adding missing tests or correcting existing tests
672
- - `chore`: Changes to the build process or auxiliary tools
125
+ Found a bug or want to contribute? Visit our
126
+ [GitHub repository](https://github.com/houko/pnpm-catalog-updates).
673
127
 
674
128
  ## 📄 License
675
129
 
676
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
677
- for details.
678
-
679
- ## 🙏 Acknowledgments
680
-
681
- - Inspired by
682
- [npm-check-updates](https://github.com/raineorshine/npm-check-updates)
683
- - Built with love for the pnpm community
684
- - Thanks to all contributors and users
685
-
686
- ## 📞 Support
687
-
688
- - 📖 [Documentation](https://github.com/houko/pnpm-catalog-updates#readme)
689
- - 🐛 [Issue Tracker](https://github.com/houko/pnpm-catalog-updates/issues)
690
- - 💬 [Discussions](https://github.com/houko/pnpm-catalog-updates/discussions)
691
-
692
- ---
693
-
694
- Made with ❤️ for the pnpm community
130
+ MIT © [Evan Hu](https://github.com/houko)