pcu 0.5.6 → 0.6.3

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 (219) hide show
  1. package/bin/pcu.js +1 -1
  2. package/dist/index.js +9559 -32
  3. package/dist/index.js.map +1 -1
  4. package/package.json +36 -84
  5. package/src/cli/commands/checkCommand.ts +227 -0
  6. package/src/cli/commands/initCommand.ts +394 -0
  7. package/src/cli/commands/securityCommand.ts +569 -0
  8. package/src/cli/commands/updateCommand.ts +245 -0
  9. package/src/cli/formatters/outputFormatter.ts +830 -0
  10. package/src/cli/formatters/progressBar.ts +700 -0
  11. package/src/cli/index.ts +565 -0
  12. package/src/cli/interactive/interactivePrompts.ts +517 -0
  13. package/src/cli/options/globalOptions.ts +380 -0
  14. package/src/cli/options/index.ts +5 -0
  15. package/src/cli/themes/colorTheme.ts +379 -0
  16. package/src/cli/validators/commandValidator.ts +395 -0
  17. package/src/cli/validators/index.ts +5 -0
  18. package/src/index.ts +4 -0
  19. package/README.ja.md +0 -582
  20. package/README.md +0 -690
  21. package/README.zh-CN.md +0 -630
  22. package/dist/application/services/CatalogUpdateService.d.ts +0 -209
  23. package/dist/application/services/CatalogUpdateService.d.ts.map +0 -1
  24. package/dist/application/services/CatalogUpdateService.js +0 -836
  25. package/dist/application/services/CatalogUpdateService.js.map +0 -1
  26. package/dist/application/services/WorkspaceService.d.ts +0 -139
  27. package/dist/application/services/WorkspaceService.d.ts.map +0 -1
  28. package/dist/application/services/WorkspaceService.js +0 -340
  29. package/dist/application/services/WorkspaceService.js.map +0 -1
  30. package/dist/cli/commands/CheckCommand.d.ts +0 -40
  31. package/dist/cli/commands/CheckCommand.d.ts.map +0 -1
  32. package/dist/cli/commands/CheckCommand.js +0 -177
  33. package/dist/cli/commands/CheckCommand.js.map +0 -1
  34. package/dist/cli/commands/InitCommand.d.ts +0 -53
  35. package/dist/cli/commands/InitCommand.d.ts.map +0 -1
  36. package/dist/cli/commands/InitCommand.js +0 -338
  37. package/dist/cli/commands/InitCommand.js.map +0 -1
  38. package/dist/cli/commands/SecurityCommand.d.ts +0 -113
  39. package/dist/cli/commands/SecurityCommand.d.ts.map +0 -1
  40. package/dist/cli/commands/SecurityCommand.js +0 -410
  41. package/dist/cli/commands/SecurityCommand.js.map +0 -1
  42. package/dist/cli/commands/UpdateCommand.d.ts +0 -44
  43. package/dist/cli/commands/UpdateCommand.d.ts.map +0 -1
  44. package/dist/cli/commands/UpdateCommand.js +0 -189
  45. package/dist/cli/commands/UpdateCommand.js.map +0 -1
  46. package/dist/cli/formatters/OutputFormatter.d.ts +0 -116
  47. package/dist/cli/formatters/OutputFormatter.d.ts.map +0 -1
  48. package/dist/cli/formatters/OutputFormatter.js +0 -664
  49. package/dist/cli/formatters/OutputFormatter.js.map +0 -1
  50. package/dist/cli/formatters/ProgressBar.d.ts +0 -195
  51. package/dist/cli/formatters/ProgressBar.d.ts.map +0 -1
  52. package/dist/cli/formatters/ProgressBar.js +0 -622
  53. package/dist/cli/formatters/ProgressBar.js.map +0 -1
  54. package/dist/cli/index.d.ts +0 -12
  55. package/dist/cli/index.d.ts.map +0 -1
  56. package/dist/cli/index.js +0 -492
  57. package/dist/cli/index.js.map +0 -1
  58. package/dist/cli/interactive/InteractivePrompts.d.ts +0 -85
  59. package/dist/cli/interactive/InteractivePrompts.d.ts.map +0 -1
  60. package/dist/cli/interactive/InteractivePrompts.js +0 -434
  61. package/dist/cli/interactive/InteractivePrompts.js.map +0 -1
  62. package/dist/cli/options/GlobalOptions.d.ts +0 -117
  63. package/dist/cli/options/GlobalOptions.d.ts.map +0 -1
  64. package/dist/cli/options/GlobalOptions.js +0 -278
  65. package/dist/cli/options/GlobalOptions.js.map +0 -1
  66. package/dist/cli/options/index.d.ts +0 -5
  67. package/dist/cli/options/index.d.ts.map +0 -1
  68. package/dist/cli/options/index.js +0 -5
  69. package/dist/cli/options/index.js.map +0 -1
  70. package/dist/cli/themes/ColorTheme.d.ts +0 -211
  71. package/dist/cli/themes/ColorTheme.d.ts.map +0 -1
  72. package/dist/cli/themes/ColorTheme.js +0 -267
  73. package/dist/cli/themes/ColorTheme.js.map +0 -1
  74. package/dist/cli/validators/CommandValidator.d.ts +0 -60
  75. package/dist/cli/validators/CommandValidator.d.ts.map +0 -1
  76. package/dist/cli/validators/CommandValidator.js +0 -319
  77. package/dist/cli/validators/CommandValidator.js.map +0 -1
  78. package/dist/cli/validators/index.d.ts +0 -5
  79. package/dist/cli/validators/index.d.ts.map +0 -1
  80. package/dist/cli/validators/index.js +0 -5
  81. package/dist/cli/validators/index.js.map +0 -1
  82. package/dist/common/config/Config.d.ts +0 -142
  83. package/dist/common/config/Config.d.ts.map +0 -1
  84. package/dist/common/config/Config.js +0 -382
  85. package/dist/common/config/Config.js.map +0 -1
  86. package/dist/common/config/ConfigLoader.d.ts +0 -49
  87. package/dist/common/config/ConfigLoader.d.ts.map +0 -1
  88. package/dist/common/config/ConfigLoader.js +0 -180
  89. package/dist/common/config/ConfigLoader.js.map +0 -1
  90. package/dist/common/config/PackageFilterConfig.d.ts +0 -56
  91. package/dist/common/config/PackageFilterConfig.d.ts.map +0 -1
  92. package/dist/common/config/PackageFilterConfig.js +0 -94
  93. package/dist/common/config/PackageFilterConfig.js.map +0 -1
  94. package/dist/common/config/index.d.ts +0 -8
  95. package/dist/common/config/index.d.ts.map +0 -1
  96. package/dist/common/config/index.js +0 -8
  97. package/dist/common/config/index.js.map +0 -1
  98. package/dist/common/error-handling/ErrorTracker.d.ts +0 -48
  99. package/dist/common/error-handling/ErrorTracker.d.ts.map +0 -1
  100. package/dist/common/error-handling/ErrorTracker.js +0 -93
  101. package/dist/common/error-handling/ErrorTracker.js.map +0 -1
  102. package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts +0 -74
  103. package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts.map +0 -1
  104. package/dist/common/error-handling/UserFriendlyErrorHandler.js +0 -703
  105. package/dist/common/error-handling/UserFriendlyErrorHandler.js.map +0 -1
  106. package/dist/common/error-handling/index.d.ts +0 -11
  107. package/dist/common/error-handling/index.d.ts.map +0 -1
  108. package/dist/common/error-handling/index.js +0 -9
  109. package/dist/common/error-handling/index.js.map +0 -1
  110. package/dist/common/logger/Logger.d.ts +0 -110
  111. package/dist/common/logger/Logger.d.ts.map +0 -1
  112. package/dist/common/logger/Logger.js +0 -289
  113. package/dist/common/logger/Logger.js.map +0 -1
  114. package/dist/common/logger/index.d.ts +0 -6
  115. package/dist/common/logger/index.d.ts.map +0 -1
  116. package/dist/common/logger/index.js +0 -6
  117. package/dist/common/logger/index.js.map +0 -1
  118. package/dist/common/types/cli.d.ts +0 -265
  119. package/dist/common/types/cli.d.ts.map +0 -1
  120. package/dist/common/types/cli.js +0 -5
  121. package/dist/common/types/cli.js.map +0 -1
  122. package/dist/common/types/core.d.ts +0 -270
  123. package/dist/common/types/core.d.ts.map +0 -1
  124. package/dist/common/types/core.js +0 -32
  125. package/dist/common/types/core.js.map +0 -1
  126. package/dist/common/types/index.d.ts +0 -8
  127. package/dist/common/types/index.d.ts.map +0 -1
  128. package/dist/common/types/index.js +0 -8
  129. package/dist/common/types/index.js.map +0 -1
  130. package/dist/common/utils/VersionChecker.d.ts +0 -54
  131. package/dist/common/utils/VersionChecker.d.ts.map +0 -1
  132. package/dist/common/utils/VersionChecker.js +0 -180
  133. package/dist/common/utils/VersionChecker.js.map +0 -1
  134. package/dist/common/utils/async.d.ts +0 -74
  135. package/dist/common/utils/async.d.ts.map +0 -1
  136. package/dist/common/utils/async.js +0 -228
  137. package/dist/common/utils/async.js.map +0 -1
  138. package/dist/common/utils/format.d.ts +0 -32
  139. package/dist/common/utils/format.d.ts.map +0 -1
  140. package/dist/common/utils/format.js +0 -121
  141. package/dist/common/utils/format.js.map +0 -1
  142. package/dist/common/utils/git.d.ts +0 -44
  143. package/dist/common/utils/git.d.ts.map +0 -1
  144. package/dist/common/utils/git.js +0 -147
  145. package/dist/common/utils/git.js.map +0 -1
  146. package/dist/common/utils/index.d.ts +0 -12
  147. package/dist/common/utils/index.d.ts.map +0 -1
  148. package/dist/common/utils/index.js +0 -12
  149. package/dist/common/utils/index.js.map +0 -1
  150. package/dist/common/utils/string.d.ts +0 -56
  151. package/dist/common/utils/string.d.ts.map +0 -1
  152. package/dist/common/utils/string.js +0 -134
  153. package/dist/common/utils/string.js.map +0 -1
  154. package/dist/common/utils/validation.d.ts +0 -88
  155. package/dist/common/utils/validation.d.ts.map +0 -1
  156. package/dist/common/utils/validation.js +0 -308
  157. package/dist/common/utils/validation.js.map +0 -1
  158. package/dist/domain/entities/Catalog.d.ts +0 -117
  159. package/dist/domain/entities/Catalog.d.ts.map +0 -1
  160. package/dist/domain/entities/Catalog.js +0 -240
  161. package/dist/domain/entities/Catalog.js.map +0 -1
  162. package/dist/domain/entities/Package.d.ts +0 -143
  163. package/dist/domain/entities/Package.d.ts.map +0 -1
  164. package/dist/domain/entities/Package.js +0 -272
  165. package/dist/domain/entities/Package.js.map +0 -1
  166. package/dist/domain/entities/Workspace.d.ts +0 -95
  167. package/dist/domain/entities/Workspace.d.ts.map +0 -1
  168. package/dist/domain/entities/Workspace.js +0 -173
  169. package/dist/domain/entities/Workspace.js.map +0 -1
  170. package/dist/domain/repositories/WorkspaceRepository.d.ts +0 -41
  171. package/dist/domain/repositories/WorkspaceRepository.d.ts.map +0 -1
  172. package/dist/domain/repositories/WorkspaceRepository.js +0 -8
  173. package/dist/domain/repositories/WorkspaceRepository.js.map +0 -1
  174. package/dist/domain/value-objects/CatalogCollection.d.ts +0 -106
  175. package/dist/domain/value-objects/CatalogCollection.d.ts.map +0 -1
  176. package/dist/domain/value-objects/CatalogCollection.js +0 -230
  177. package/dist/domain/value-objects/CatalogCollection.js.map +0 -1
  178. package/dist/domain/value-objects/PackageCollection.d.ts +0 -122
  179. package/dist/domain/value-objects/PackageCollection.d.ts.map +0 -1
  180. package/dist/domain/value-objects/PackageCollection.js +0 -263
  181. package/dist/domain/value-objects/PackageCollection.js.map +0 -1
  182. package/dist/domain/value-objects/Version.d.ts +0 -141
  183. package/dist/domain/value-objects/Version.d.ts.map +0 -1
  184. package/dist/domain/value-objects/Version.js +0 -268
  185. package/dist/domain/value-objects/Version.js.map +0 -1
  186. package/dist/domain/value-objects/WorkspaceConfig.d.ts +0 -144
  187. package/dist/domain/value-objects/WorkspaceConfig.d.ts.map +0 -1
  188. package/dist/domain/value-objects/WorkspaceConfig.js +0 -357
  189. package/dist/domain/value-objects/WorkspaceConfig.js.map +0 -1
  190. package/dist/domain/value-objects/WorkspaceId.d.ts +0 -51
  191. package/dist/domain/value-objects/WorkspaceId.d.ts.map +0 -1
  192. package/dist/domain/value-objects/WorkspaceId.js +0 -104
  193. package/dist/domain/value-objects/WorkspaceId.js.map +0 -1
  194. package/dist/domain/value-objects/WorkspacePath.d.ts +0 -75
  195. package/dist/domain/value-objects/WorkspacePath.d.ts.map +0 -1
  196. package/dist/domain/value-objects/WorkspacePath.js +0 -128
  197. package/dist/domain/value-objects/WorkspacePath.js.map +0 -1
  198. package/dist/index.d.ts +0 -25
  199. package/dist/index.d.ts.map +0 -1
  200. package/dist/infrastructure/cache/Cache.d.ts +0 -161
  201. package/dist/infrastructure/cache/Cache.d.ts.map +0 -1
  202. package/dist/infrastructure/cache/Cache.js +0 -398
  203. package/dist/infrastructure/cache/Cache.js.map +0 -1
  204. package/dist/infrastructure/cache/index.d.ts +0 -6
  205. package/dist/infrastructure/cache/index.d.ts.map +0 -1
  206. package/dist/infrastructure/cache/index.js +0 -6
  207. package/dist/infrastructure/cache/index.js.map +0 -1
  208. package/dist/infrastructure/external-services/NpmRegistryService.d.ts +0 -145
  209. package/dist/infrastructure/external-services/NpmRegistryService.d.ts.map +0 -1
  210. package/dist/infrastructure/external-services/NpmRegistryService.js +0 -466
  211. package/dist/infrastructure/external-services/NpmRegistryService.js.map +0 -1
  212. package/dist/infrastructure/file-system/FileSystemService.d.ts +0 -120
  213. package/dist/infrastructure/file-system/FileSystemService.d.ts.map +0 -1
  214. package/dist/infrastructure/file-system/FileSystemService.js +0 -663
  215. package/dist/infrastructure/file-system/FileSystemService.js.map +0 -1
  216. package/dist/infrastructure/repositories/FileWorkspaceRepository.d.ts +0 -57
  217. package/dist/infrastructure/repositories/FileWorkspaceRepository.d.ts.map +0 -1
  218. package/dist/infrastructure/repositories/FileWorkspaceRepository.js +0 -179
  219. package/dist/infrastructure/repositories/FileWorkspaceRepository.js.map +0 -1
@@ -1,703 +0,0 @@
1
- /**
2
- * User-Friendly Error Handler
3
- *
4
- * Provides user-friendly error messages instead of exposing technical details.
5
- * Categorizes errors and provides helpful suggestions where possible.
6
- */
7
- import chalk from 'chalk';
8
- import { Logger } from '../logger/Logger.js';
9
- import { ErrorTracker } from './ErrorTracker.js';
10
- export class UserFriendlyErrorHandler {
11
- static logger = Logger.getLogger('ErrorHandler');
12
- // Common package name corrections
13
- static packageSuggestions = new Map([
14
- // Framework packages
15
- ['sveltekit', ['@sveltejs/kit']],
16
- ['vue-router', ['vue-router']],
17
- ['vue-cli', ['@vue/cli']],
18
- ['angular-cli', ['@angular/cli']],
19
- ['angular-core', ['@angular/core']],
20
- ['angular-universal', ['@nguniversal/express-engine', '@angular/universal']],
21
- ['react-router', ['react-router-dom']],
22
- ['react-dom', ['react-dom']],
23
- ['nextjs', ['next']],
24
- ['nuxtjs', ['nuxt']],
25
- // UI Libraries
26
- ['material-ui', ['@mui/material', '@material-ui/core']],
27
- ['mui', ['@mui/material']],
28
- ['antd', ['antd']],
29
- ['ant-design', ['antd']],
30
- ['prime-ng', ['primeng']],
31
- ['primeng', ['primeng']],
32
- ['ng-zorro', ['ng-zorro-antd']],
33
- ['bootstrap-vue', ['bootstrap-vue']],
34
- ['vuetify', ['vuetify']],
35
- ['quasar', ['quasar']],
36
- ['onsen-ui', ['onsenui']],
37
- ['ionic', ['@ionic/angular', '@ionic/react', '@ionic/vue']],
38
- // CSS Frameworks
39
- ['tailwindcss', ['tailwindcss']],
40
- ['tailwind', ['tailwindcss']],
41
- ['bulma', ['bulma']],
42
- ['water-css', ['water.css']],
43
- ['holiday-css', ['@holiday-css/main']],
44
- ['wing-css', ['@wing-css/wing']],
45
- ['picnic-css', ['picnicss']],
46
- // Build Tools & Bundlers
47
- ['webpack', ['webpack']],
48
- ['webpack-cli', ['webpack-cli']],
49
- ['rollup', ['rollup']],
50
- ['vite', ['vite']],
51
- ['parcel', ['parcel']],
52
- ['esbuild', ['esbuild']],
53
- ['swc', ['@swc/core']],
54
- // Testing
55
- ['jest', ['jest']],
56
- ['vitest', ['vitest']],
57
- ['mocha', ['mocha']],
58
- ['chai', ['chai']],
59
- ['cypress', ['cypress']],
60
- ['playwright', ['@playwright/test']],
61
- ['puppeteer', ['puppeteer']],
62
- ['selenium', ['selenium-webdriver']],
63
- ['webdriver', ['selenium-webdriver']],
64
- ['lambdatest', ['@lambdatest/selenium-webdriver']],
65
- ['applitools', ['@applitools/eyes-selenium']],
66
- ['experitest', ['@experitest/seetest-client']],
67
- ['kobiton', ['@kobiton/api']],
68
- ['crossbrowsertesting', ['@crossbrowsertesting/selenium']],
69
- // Cloud Services
70
- ['aws-sdk', ['@aws-sdk/client-s3', 'aws-sdk']],
71
- ['aws-device-farm', ['@aws-sdk/client-device-farm']],
72
- ['firebase', ['firebase']],
73
- ['firebase-test-lab', ['@google-cloud/testing']],
74
- ['azure', ['@azure/storage-blob', '@azure/cosmos']],
75
- ['azure-devtest-labs', ['@azure/arm-devtestlabs']],
76
- ['gcp', ['@google-cloud/storage']],
77
- // Databases & ORMs
78
- ['mongoose', ['mongoose']],
79
- ['sequelize', ['sequelize']],
80
- ['typeorm', ['typeorm']],
81
- ['prisma', ['@prisma/client']],
82
- ['knex', ['knex']],
83
- ['pg', ['pg']],
84
- ['mysql', ['mysql2']],
85
- ['sqlite', ['sqlite3']],
86
- ['redis', ['redis']],
87
- ['mongodb', ['mongodb']],
88
- // Utilities
89
- ['lodash', ['lodash']],
90
- ['loadash', ['lodash']],
91
- ['underscore', ['underscore']],
92
- ['ramda', ['ramda']],
93
- ['rxjs', ['rxjs']],
94
- ['axios', ['axios']],
95
- ['axois', ['axios']],
96
- ['fetch', ['node-fetch']],
97
- ['node-fetch', ['node-fetch']],
98
- ['request', ['axios', 'node-fetch']],
99
- ['superagent', ['superagent']],
100
- // Date/Time
101
- ['moment', ['moment']],
102
- ['momentjs', ['moment']],
103
- ['dayjs', ['dayjs']],
104
- ['date-fns', ['date-fns']],
105
- ['luxon', ['luxon']],
106
- // Linting & Formatting
107
- ['eslint', ['eslint']],
108
- ['prettier', ['prettier']],
109
- ['tslint', ['@typescript-eslint/eslint-plugin']],
110
- ['typescript-eslint', ['@typescript-eslint/eslint-plugin', '@typescript-eslint/parser']],
111
- // Type Definitions
112
- ['types-node', ['@types/node']],
113
- ['@types-node', ['@types/node']],
114
- ['types-react', ['@types/react']],
115
- ['types-express', ['@types/express']],
116
- // Backend Frameworks
117
- ['express', ['express']],
118
- ['expressjs', ['express']],
119
- ['fastify', ['fastify']],
120
- ['koa', ['koa']],
121
- ['nestjs', ['@nestjs/core']],
122
- ['nest', ['@nestjs/core']],
123
- ['hapi', ['@hapi/hapi']],
124
- // State Management
125
- ['redux', ['redux']],
126
- ['mobx', ['mobx']],
127
- ['vuex', ['vuex']],
128
- ['pinia', ['pinia']],
129
- ['zustand', ['zustand']],
130
- ['recoil', ['recoil']],
131
- // Styling
132
- ['styled-components', ['styled-components']],
133
- ['styled-component', ['styled-components']],
134
- ['emotion', ['@emotion/react']],
135
- ['sass', ['sass']],
136
- ['node-sass', ['sass']],
137
- ['less', ['less']],
138
- ['stylus', ['stylus']],
139
- // Admin/CMS
140
- ['forestadmin', ['forest-express', 'forest-express-sequelize']],
141
- ['strapi', ['@strapi/strapi']],
142
- ['keystone', ['@keystone-6/core']],
143
- ['ghost', ['ghost']],
144
- // Documentation
145
- ['storybook', ['@storybook/react', '@storybook/vue3']],
146
- ['docusaurus', ['@docusaurus/core']],
147
- ['gitbook', ['@gitbook/cli']],
148
- ['typedoc', ['typedoc']],
149
- // Desktop Apps
150
- ['electron', ['electron']],
151
- ['tauri', ['@tauri-apps/api']],
152
- ['nwjs', ['nw']],
153
- // Mobile Development
154
- ['react-native', ['react-native']],
155
- ['expo', ['expo']],
156
- ['cordova', ['cordova']],
157
- ['phonegap', ['phonegap']],
158
- // Common Misspellings
159
- ['jquery', ['jquery']],
160
- ['boostrap', ['bootstrap']],
161
- ['bootstrap', ['bootstrap']],
162
- ['fontawesome', ['@fortawesome/fontawesome-free']],
163
- ['font-awesome', ['@fortawesome/fontawesome-free']],
164
- // Internationalization
165
- ['react-i18n', ['react-i18next']],
166
- ['i18n', ['i18next']],
167
- ['i18next', ['i18next']],
168
- ['vue-i18n', ['vue-i18n']],
169
- ['react-intl', ['react-intl']],
170
- ['intl', ['intl']],
171
- // Data Visualization & Charts
172
- ['chart', ['chart.js']],
173
- ['chartjs', ['chart.js']],
174
- ['chart.js', ['chart.js']],
175
- ['d3', ['d3']],
176
- ['d3js', ['d3']],
177
- ['plotly', ['plotly.js']],
178
- ['echarts', ['echarts']],
179
- ['highcharts', ['highcharts']],
180
- ['recharts', ['recharts']],
181
- ['victory', ['victory']],
182
- ['nivo', ['@nivo/core']],
183
- ['observable', ['@observablehq/plot']],
184
- // Real-time Communication & WebRTC
185
- ['socket.io', ['socket.io']],
186
- ['socketio', ['socket.io']],
187
- ['websocket', ['ws']],
188
- ['ws', ['ws']],
189
- ['webrtc', ['simple-peer']],
190
- ['peer', ['peerjs']],
191
- ['peerjs', ['peerjs']],
192
- ['signalr', ['@microsoft/signalr']],
193
- // Blockchain & Web3
194
- ['web3', ['web3']],
195
- ['web3js', ['web3']],
196
- ['ethers', ['ethers']],
197
- ['ethersjs', ['ethers']],
198
- ['ethereum', ['web3', 'ethers']],
199
- ['metamask', ['@metamask/sdk']],
200
- ['wagmi', ['wagmi']],
201
- ['rainbow-kit', ['@rainbow-me/rainbowkit']],
202
- ['wallet-connect', ['@walletconnect/client']],
203
- // Machine Learning & AI
204
- ['tensorflow', ['@tensorflow/tfjs']],
205
- ['tensorflowjs', ['@tensorflow/tfjs']],
206
- ['tfjs', ['@tensorflow/tfjs']],
207
- ['brain', ['brain.js']],
208
- ['brainjs', ['brain.js']],
209
- ['synaptic', ['synaptic']],
210
- ['ml-matrix', ['ml-matrix']],
211
- ['opencv', ['opencv4nodejs']],
212
- // Image Processing
213
- ['sharp', ['sharp']],
214
- ['jimp', ['jimp']],
215
- ['canvas', ['canvas']],
216
- ['fabric', ['fabric']],
217
- ['fabricjs', ['fabric']],
218
- ['konva', ['konva']],
219
- ['konvajs', ['konva']],
220
- ['p5', ['p5']],
221
- ['p5js', ['p5']],
222
- ['three', ['three']],
223
- ['threejs', ['three']],
224
- // Audio/Video Processing
225
- ['howler', ['howler']],
226
- ['howlerjs', ['howler']],
227
- ['tone', ['tone']],
228
- ['tonejs', ['tone']],
229
- ['video', ['video.js']],
230
- ['videojs', ['video.js']],
231
- ['hls', ['hls.js']],
232
- ['hlsjs', ['hls.js']],
233
- ['dash', ['dashjs']],
234
- ['dashjs', ['dashjs']],
235
- // Game Development
236
- ['phaser', ['phaser']],
237
- ['phaserjs', ['phaser']],
238
- ['pixijs', ['pixi.js']],
239
- ['pixi', ['pixi.js']],
240
- ['babylonjs', ['babylonjs']],
241
- ['babylon', ['babylonjs']],
242
- ['aframe', ['aframe']],
243
- // IoT & Hardware
244
- ['johnny-five', ['johnny-five']],
245
- ['arduino', ['johnny-five']],
246
- ['raspberry-pi', ['raspi']],
247
- ['raspi', ['raspi']],
248
- ['serialport', ['serialport']],
249
- ['noble', ['noble']],
250
- ['bluetooth', ['noble']],
251
- // Progressive Web Apps
252
- ['workbox', ['workbox-webpack-plugin']],
253
- ['sw-precache', ['workbox-webpack-plugin']],
254
- ['service-worker', ['workbox-webpack-plugin']],
255
- ['pwa', ['workbox-webpack-plugin']],
256
- // Map & Geolocation
257
- ['leaflet', ['leaflet']],
258
- ['mapbox', ['mapbox-gl']],
259
- ['google-maps', ['@googlemaps/js-api-loader']],
260
- ['googlemaps', ['@googlemaps/js-api-loader']],
261
- ['openlayers', ['ol']],
262
- ['ol', ['ol']],
263
- // Animation
264
- ['gsap', ['gsap']],
265
- ['anime', ['animejs']],
266
- ['animejs', ['animejs']],
267
- ['lottie', ['lottie-web']],
268
- ['lottie-web', ['lottie-web']],
269
- ['framer-motion', ['framer-motion']],
270
- ['react-spring', ['react-spring']],
271
- // Form & Validation
272
- ['formik', ['formik']],
273
- ['react-hook-form', ['react-hook-form']],
274
- ['yup', ['yup']],
275
- ['joi', ['joi']],
276
- ['ajv', ['ajv']],
277
- ['zod', ['zod']],
278
- ['superstruct', ['superstruct']],
279
- // Editor & Rich Text
280
- ['quill', ['quill']],
281
- ['quilljs', ['quill']],
282
- ['tinymce', ['tinymce']],
283
- ['ckeditor', ['@ckeditor/ckeditor5-build-classic']],
284
- ['slate', ['slate']],
285
- ['slatejs', ['slate']],
286
- ['draft', ['draft-js']],
287
- ['draftjs', ['draft-js']],
288
- ['monaco', ['monaco-editor']],
289
- ['monaco-editor', ['monaco-editor']],
290
- // HTTP & API
291
- ['apollo', ['@apollo/client']],
292
- ['apollo-client', ['@apollo/client']],
293
- ['graphql', ['graphql']],
294
- ['relay', ['react-relay']],
295
- ['urql', ['urql']],
296
- ['swr', ['swr']],
297
- ['react-query', ['@tanstack/react-query']],
298
- ['tanstack-query', ['@tanstack/react-query']],
299
- // More Common Typos
300
- ['reac', ['react']],
301
- ['reactjs', ['react']],
302
- ['veu', ['vue']],
303
- ['vuejs', ['vue']],
304
- ['angualr', ['@angular/core']],
305
- ['svelt', ['svelte']],
306
- ['sveltte', ['svelte']],
307
- ['typescirpt', ['typescript']],
308
- ['typescript', ['typescript']],
309
- ['javasript', ['node']],
310
- ['javascript', ['node']],
311
- // DevOps & CI/CD
312
- ['docker', ['dockerode']],
313
- ['k8s', ['@kubernetes/client-node']],
314
- ['kubernetes', ['@kubernetes/client-node']],
315
- ['kubectl', ['@kubernetes/client-node']],
316
- ['helm', ['@helm/sdk']],
317
- ['jenkins', ['jenkins']],
318
- ['circleci', ['@circleci/circleci-config-sdk']],
319
- ['github-actions', ['@actions/core', '@actions/github']],
320
- ['gitlab-ci', ['@gitbeaker/node']],
321
- ['travis', ['@travis-ci/travis-yml']],
322
- ['terraform', ['@cdktf/provider-aws']],
323
- ['ansible', ['@ansible/galaxy']],
324
- ['vagrant', ['vagrant']],
325
- ['consul', ['consul']],
326
- ['vault', ['node-vault']],
327
- ['nomad', ['nomad-client']],
328
- // 监控和日志
329
- ['winston', ['winston']],
330
- ['morgan', ['morgan']],
331
- ['pino', ['pino']],
332
- ['bunyan', ['bunyan']],
333
- ['log4js', ['log4js']],
334
- ['sentry', ['@sentry/node', '@sentry/react']],
335
- ['bugsnag', ['@bugsnag/js']],
336
- ['rollbar', ['rollbar']],
337
- ['newrelic', ['newrelic']],
338
- ['datadog', ['@datadog/browser-rum']],
339
- ['prometheus', ['prom-client']],
340
- ['grafana', ['@grafana/toolkit']],
341
- ['elastic', ['@elastic/elasticsearch']],
342
- ['elasticsearch', ['@elastic/elasticsearch']],
343
- ['kibana', ['@elastic/kibana-utils']],
344
- ['logstash', ['@elastic/logstash']],
345
- // 微服务架构
346
- ['microservices', ['express']],
347
- ['service-mesh', ['istio']],
348
- ['envoy', ['envoy']],
349
- ['istio', ['istio']],
350
- ['linkerd', ['linkerd']],
351
- ['consul-connect', ['consul']],
352
- ['eureka', ['eureka-js-client']],
353
- ['zookeeper', ['node-zookeeper-client']],
354
- ['etcd', ['etcd3']],
355
- ['grpc', ['@grpc/grpc-js']],
356
- ['protobuf', ['protobufjs']],
357
- // 缓存系统
358
- ['redis', ['redis']],
359
- ['memcached', ['memcached']],
360
- ['node-cache', ['node-cache']],
361
- ['memory-cache', ['memory-cache']],
362
- ['lru-cache', ['lru-cache']],
363
- ['cache-manager', ['cache-manager']],
364
- ['ioredis', ['ioredis']],
365
- ['hazelcast', ['hazelcast-client']],
366
- // 消息队列
367
- ['rabbitmq', ['amqplib']],
368
- ['kafka', ['kafkajs']],
369
- ['apache-kafka', ['kafkajs']],
370
- ['bull', ['bull']],
371
- ['bullmq', ['bullmq']],
372
- ['bee-queue', ['bee-queue']],
373
- ['kue', ['kue']],
374
- ['agenda', ['agenda']],
375
- ['amqp', ['amqplib']],
376
- ['mqtt', ['mqtt']],
377
- ['nats', ['nats']],
378
- ['zeromq', ['zeromq']],
379
- ['zmq', ['zeromq']],
380
- // 搜索引擎
381
- ['solr', ['solr-client']],
382
- ['algolia', ['algoliasearch']],
383
- ['sphinx', ['sphinxapi']],
384
- ['lucene', ['lucene']],
385
- ['whoosh', ['whoosh']],
386
- ['meilisearch', ['meilisearch']],
387
- ['typesense', ['typesense']],
388
- // 文件上传处理
389
- ['multer', ['multer']],
390
- ['formidable', ['formidable']],
391
- ['busboy', ['busboy']],
392
- ['multiparty', ['multiparty']],
393
- ['file-upload', ['express-fileupload']],
394
- ['cloudinary', ['cloudinary']],
395
- ['aws-s3', ['@aws-sdk/client-s3']],
396
- // 加密和安全
397
- ['bcrypt', ['bcrypt']],
398
- ['bcryptjs', ['bcryptjs']],
399
- ['crypto', ['crypto-js']],
400
- ['crypto-js', ['crypto-js']],
401
- ['jsonwebtoken', ['jsonwebtoken']],
402
- ['jwt', ['jsonwebtoken']],
403
- ['passport', ['passport']],
404
- ['helmet', ['helmet']],
405
- ['cors', ['cors']],
406
- ['express-rate-limit', ['express-rate-limit']],
407
- ['rate-limiter', ['express-rate-limit']],
408
- ['argon2', ['argon2']],
409
- ['scrypt', ['scrypt']],
410
- ['node-rsa', ['node-rsa']],
411
- ['speakeasy', ['speakeasy']],
412
- ['otplib', ['otplib']],
413
- // 邮件服务
414
- ['nodemailer', ['nodemailer']],
415
- ['sendgrid', ['@sendgrid/mail']],
416
- ['mailgun', ['mailgun.js']],
417
- ['ses', ['@aws-sdk/client-ses']],
418
- ['postmark', ['postmark']],
419
- ['sparkpost', ['sparkpost']],
420
- ['mandrill', ['mandrill-api']],
421
- ['mailchimp', ['@mailchimp/mailchimp_marketing']],
422
- ['email-templates', ['email-templates']],
423
- // 模板引擎
424
- ['handlebars', ['handlebars']],
425
- ['hbs', ['hbs']],
426
- ['mustache', ['mustache']],
427
- ['pug', ['pug']],
428
- ['jade', ['pug']], // jade was renamed to pug
429
- ['ejs', ['ejs']],
430
- ['nunjucks', ['nunjucks']],
431
- ['twig', ['twig']],
432
- ['dust', ['dustjs-linkedin']],
433
- // Serverless框架
434
- ['serverless', ['serverless']],
435
- ['sls', ['serverless']],
436
- ['lambda', ['aws-lambda']],
437
- ['azure-functions', ['@azure/functions']],
438
- ['google-functions', ['@google-cloud/functions-framework']],
439
- ['netlify-lambda', ['netlify-lambda']],
440
- ['vercel', ['@vercel/node']],
441
- ['claudia', ['claudia']],
442
- ['apex', ['apex']],
443
- ['sam', ['@aws-cdk/aws-sam']],
444
- // 更多数据库
445
- ['couchdb', ['nano']],
446
- ['pouchdb', ['pouchdb']],
447
- ['neo4j', ['neo4j-driver']],
448
- ['influxdb', ['influx']],
449
- ['cassandra', ['cassandra-driver']],
450
- ['rethinkdb', ['rethinkdb']],
451
- ['orientdb', ['orientjs']],
452
- ['arangodb', ['arangojs']],
453
- ['leveldb', ['level']],
454
- ['rocksdb', ['rocksdb']],
455
- ['sqlite', ['sqlite3', 'better-sqlite3']],
456
- ['mariadb', ['mariadb']],
457
- ['cockroachdb', ['pg']], // uses pg driver
458
- // 更多云服务
459
- ['heroku', ['heroku']],
460
- ['digitalocean', ['@digitalocean/droplet-api']],
461
- ['linode', ['@linode/api-v4']],
462
- ['vultr', ['@vultr/vultr-node']],
463
- ['scaleway', ['@scaleway/sdk']],
464
- ['ovh', ['ovh']],
465
- ['cloudflare', ['cloudflare']],
466
- ['fastly', ['fastly']],
467
- ['maxcdn', ['maxcdn']],
468
- ['bunnycdn', ['bunnycdn']],
469
- // 性能分析和优化
470
- ['lighthouse', ['lighthouse']],
471
- ['webpagetest', ['webpagetest']],
472
- ['clinic', ['clinic']],
473
- ['0x', ['0x']],
474
- ['autocannon', ['autocannon']],
475
- ['loadtest', ['loadtest']],
476
- ['artillery', ['artillery']],
477
- ['k6', ['k6']],
478
- ['benchmark', ['benchmark']],
479
- ['clinic.js', ['clinic']],
480
- // 更多拼写错误和变体
481
- ['expressjs', ['express']],
482
- ['node.js', ['node']],
483
- ['nodejs', ['node']],
484
- ['npm', ['npm']],
485
- ['yarn', ['yarn']],
486
- ['pnpm', ['pnpm']],
487
- ['bun', ['bun']],
488
- ['deno', ['deno']],
489
- ['typescript', ['typescript']],
490
- ['js', ['javascript']],
491
- ['ts', ['typescript']],
492
- ['html', ['html']],
493
- ['css', ['css']],
494
- ['json', ['json']],
495
- ['xml', ['xml2js']],
496
- ['yaml', ['yaml']],
497
- ['toml', ['@iarna/toml']],
498
- ['ini', ['ini']],
499
- ['csv', ['csv-parser', 'papaparse']],
500
- ['pdf', ['pdf2pic', 'pdfkit']],
501
- ['excel', ['xlsx']],
502
- ['word', ['mammoth']],
503
- ['zip', ['node-zip']],
504
- ['tar', ['tar']],
505
- ['gzip', ['zlib']],
506
- // 数据处理和转换
507
- ['cheerio', ['cheerio']],
508
- ['jsdom', ['jsdom']],
509
- ['xml2js', ['xml2js']],
510
- ['csv-parse', ['csv-parse']],
511
- ['papaparse', ['papaparse']],
512
- ['fast-csv', ['fast-csv']],
513
- ['xlsx', ['xlsx']],
514
- ['pdfkit', ['pdfkit']],
515
- ['jspdf', ['jspdf']],
516
- ['mammoth', ['mammoth']],
517
- ['pdf-parse', ['pdf-parse']],
518
- // CLI工具
519
- ['commander', ['commander']],
520
- ['yargs', ['yargs']],
521
- ['inquirer', ['inquirer']],
522
- ['chalk', ['chalk']],
523
- ['ora', ['ora']],
524
- ['cli-progress', ['cli-progress']],
525
- ['figlet', ['figlet']],
526
- ['boxen', ['boxen']],
527
- ['update-notifier', ['update-notifier']],
528
- ['meow', ['meow']],
529
- ['arg', ['arg']],
530
- ['minimist', ['minimist']],
531
- ]);
532
- /**
533
- * Handle package not found errors (404)
534
- */
535
- static handlePackageNotFound(packageName, context) {
536
- const suggestions = this.packageSuggestions.get(packageName);
537
- if (suggestions && suggestions.length > 0) {
538
- console.log(chalk.yellow(`⚠️ 包 "${packageName}" 不存在`));
539
- console.log(chalk.cyan(`💡 可能的正确包名:`));
540
- suggestions.forEach((suggestion) => {
541
- console.log(chalk.cyan(` • ${suggestion}`));
542
- });
543
- }
544
- else {
545
- console.log(chalk.yellow(`⚠️ 包 "${packageName}" 在 npm registry 中不存在`));
546
- console.log(chalk.cyan(`💡 请检查包名是否正确,或者该包可能已被移除`));
547
- }
548
- // Track for summary
549
- ErrorTracker.trackSkippedPackage(packageName, new Error('Package not found (404)'));
550
- // Log technical details for debugging
551
- this.logger.debug('Package not found', { packageName, context });
552
- }
553
- /**
554
- * Handle empty version errors
555
- */
556
- static handleEmptyVersion(packageName, context) {
557
- console.log(chalk.yellow(`⚠️ 包 "${packageName}" 的版本信息为空`));
558
- console.log(chalk.cyan(`💡 这可能是由于:`));
559
- console.log(chalk.cyan(` • 包的 package.json 配置问题`));
560
- console.log(chalk.cyan(` • catalog 配置中的版本格式错误`));
561
- console.log(chalk.cyan(` • npm registry 数据同步问题`));
562
- // Track for summary
563
- ErrorTracker.trackSkippedPackage(packageName, new Error('Version string cannot be empty'));
564
- this.logger.debug('Empty version string', { packageName, context });
565
- }
566
- /**
567
- * Handle network/timeout errors
568
- */
569
- static handleNetworkError(packageName, error, context) {
570
- console.log(chalk.yellow(`⚠️ 检查包 "${packageName}" 时遇到网络问题`));
571
- console.log(chalk.cyan(`💡 请稍后重试,或检查网络连接`));
572
- // Track for summary
573
- ErrorTracker.trackSkippedPackage(packageName, error);
574
- this.logger.debug('Network error', { packageName, error: error.message, context });
575
- }
576
- /**
577
- * Handle security check failures
578
- */
579
- static handleSecurityCheckFailure(packageName, error, context) {
580
- // Track for statistics
581
- ErrorTracker.trackSecurityFailure();
582
- // Only show user-friendly message, don't expose technical details
583
- this.logger.debug(`Security check failed for ${packageName}`, {
584
- error: error.message,
585
- context,
586
- });
587
- // Don't spam the user with security check failures unless it's critical
588
- if (context?.operation === 'update' || context?.operation === 'security-audit') {
589
- console.log(chalk.yellow(`⚠️ 无法检查 "${packageName}" 的安全状态`));
590
- }
591
- }
592
- /**
593
- * Handle retry attempts silently
594
- */
595
- static handleRetryAttempt(packageName, attempt, maxRetries, error) {
596
- // Log for debugging but don't spam users
597
- this.logger.debug(`Retry attempt ${attempt}/${maxRetries} for ${packageName}`, {
598
- error: error.message,
599
- });
600
- // Only show to user on final failure
601
- if (attempt === maxRetries) {
602
- this.handleFinalFailure(packageName, error);
603
- }
604
- }
605
- /**
606
- * Handle final failure after retries
607
- */
608
- static handleFinalFailure(packageName, error) {
609
- if (error.message.includes('404') || error.message.includes('Not found')) {
610
- this.handlePackageNotFound(packageName);
611
- }
612
- else if (error.message.includes('timeout') || error.message.includes('ETIMEDOUT')) {
613
- this.handleNetworkError(packageName, error);
614
- }
615
- else if (error.message.includes('Version string cannot be empty')) {
616
- this.handleEmptyVersion(packageName);
617
- }
618
- else {
619
- // Generic error handling
620
- console.log(chalk.yellow(`⚠️ 跳过包 "${packageName}" (检查失败)`));
621
- this.logger.debug('Package check failed', { packageName, error: error.message });
622
- }
623
- }
624
- /**
625
- * Handle general package query failures
626
- */
627
- static handlePackageQueryFailure(packageName, error, context) {
628
- // Categorize the error and provide appropriate user message
629
- if (error.message.includes('404') || error.message.includes('Not found')) {
630
- this.handlePackageNotFound(packageName, context);
631
- }
632
- else if (error.message.includes('Version string cannot be empty')) {
633
- this.handleEmptyVersion(packageName, context);
634
- }
635
- else if (error.message.includes('timeout') || error.message.includes('ETIMEDOUT')) {
636
- this.handleNetworkError(packageName, error, context);
637
- }
638
- else {
639
- // For other errors, just skip silently and log for debugging
640
- ErrorTracker.trackSkippedPackage(packageName, error);
641
- this.logger.debug(`Package query failed for ${packageName}`, {
642
- error: error.message,
643
- context,
644
- });
645
- }
646
- }
647
- /**
648
- * Show summary of skipped packages
649
- */
650
- static showSkippedPackagesSummary() {
651
- const totalSkipped = ErrorTracker.getTotalSkipped();
652
- if (totalSkipped === 0)
653
- return;
654
- console.log();
655
- console.log(chalk.cyan(`📋 跳过了 ${totalSkipped} 个包的检查:`));
656
- const grouped = ErrorTracker.getSkippedPackages();
657
- if (grouped.notFound.length > 0) {
658
- console.log(chalk.yellow(` 不存在的包 (${grouped.notFound.length}): ${grouped.notFound.join(', ')}`));
659
- }
660
- if (grouped.emptyVersion.length > 0) {
661
- console.log(chalk.yellow(` 版本信息为空 (${grouped.emptyVersion.length}): ${grouped.emptyVersion.join(', ')}`));
662
- }
663
- if (grouped.network.length > 0) {
664
- console.log(chalk.yellow(` 网络问题 (${grouped.network.length}): ${grouped.network.join(', ')}`));
665
- }
666
- if (grouped.other.length > 0) {
667
- console.log(chalk.yellow(` 其他问题 (${grouped.other.length}): ${grouped.other.join(', ')}`));
668
- }
669
- const stats = ErrorTracker.getErrorStats();
670
- if (stats.security > 0) {
671
- console.log(chalk.gray(` 安全检查失败: ${stats.security} 次`));
672
- }
673
- }
674
- /**
675
- * Get statistics for reporting
676
- */
677
- static getStatistics() {
678
- return {
679
- totalSkipped: ErrorTracker.getTotalSkipped(),
680
- errorBreakdown: ErrorTracker.getErrorStats(),
681
- skippedPackages: ErrorTracker.getSkippedPackages(),
682
- };
683
- }
684
- /**
685
- * Reset error tracking (useful for testing)
686
- */
687
- static resetTracking() {
688
- ErrorTracker.reset();
689
- }
690
- /**
691
- * Add a new package suggestion
692
- */
693
- static addPackageSuggestion(originalName, suggestions) {
694
- this.packageSuggestions.set(originalName, suggestions);
695
- }
696
- /**
697
- * Get suggestions for a package name
698
- */
699
- static getPackageSuggestions(packageName) {
700
- return this.packageSuggestions.get(packageName) || [];
701
- }
702
- }
703
- //# sourceMappingURL=UserFriendlyErrorHandler.js.map