pnpm-catalog-updates 0.4.3 → 0.5.1
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/dist/application/services/CatalogUpdateService.d.ts +1 -1
- package/dist/application/services/CatalogUpdateService.d.ts.map +1 -1
- package/dist/application/services/CatalogUpdateService.js +47 -7
- package/dist/application/services/CatalogUpdateService.js.map +1 -1
- package/dist/cli/commands/CheckCommand.js +2 -2
- package/dist/cli/commands/CheckCommand.js.map +1 -1
- package/dist/cli/commands/SecurityCommand.js +2 -2
- package/dist/cli/commands/SecurityCommand.js.map +1 -1
- package/dist/cli/commands/UpdateCommand.js +3 -3
- package/dist/cli/commands/UpdateCommand.js.map +1 -1
- package/dist/cli/formatters/ProgressBar.d.ts +3 -3
- package/dist/cli/formatters/ProgressBar.d.ts.map +1 -1
- package/dist/cli/formatters/ProgressBar.js +2 -2
- package/dist/cli/formatters/ProgressBar.js.map +1 -1
- package/dist/common/error-handling/ErrorTracker.d.ts +48 -0
- package/dist/common/error-handling/ErrorTracker.d.ts.map +1 -0
- package/dist/common/error-handling/ErrorTracker.js +93 -0
- package/dist/common/error-handling/ErrorTracker.js.map +1 -0
- package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts +74 -0
- package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts.map +1 -0
- package/dist/common/error-handling/UserFriendlyErrorHandler.js +703 -0
- package/dist/common/error-handling/UserFriendlyErrorHandler.js.map +1 -0
- package/dist/common/error-handling/index.d.ts +11 -0
- package/dist/common/error-handling/index.d.ts.map +1 -0
- package/dist/common/error-handling/index.js +9 -0
- package/dist/common/error-handling/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/external-services/NpmRegistryService.d.ts +2 -2
- package/dist/infrastructure/external-services/NpmRegistryService.d.ts.map +1 -1
- package/dist/infrastructure/external-services/NpmRegistryService.js +30 -7
- package/dist/infrastructure/external-services/NpmRegistryService.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Tracker
|
|
3
|
+
*
|
|
4
|
+
* Tracks skipped packages and error statistics for summary reporting.
|
|
5
|
+
*/
|
|
6
|
+
export class ErrorTracker {
|
|
7
|
+
static skippedPackages = [];
|
|
8
|
+
static errorCounts = {
|
|
9
|
+
notFound: 0,
|
|
10
|
+
network: 0,
|
|
11
|
+
emptyVersion: 0,
|
|
12
|
+
security: 0,
|
|
13
|
+
other: 0,
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Track a skipped package
|
|
17
|
+
*/
|
|
18
|
+
static trackSkippedPackage(packageName, error) {
|
|
19
|
+
let reason = 'other';
|
|
20
|
+
if (error.message.includes('404') || error.message.includes('Not found')) {
|
|
21
|
+
reason = 'not-found';
|
|
22
|
+
this.errorCounts.notFound++;
|
|
23
|
+
}
|
|
24
|
+
else if (error.message.includes('Version string cannot be empty')) {
|
|
25
|
+
reason = 'empty-version';
|
|
26
|
+
this.errorCounts.emptyVersion++;
|
|
27
|
+
}
|
|
28
|
+
else if (error.message.includes('timeout') || error.message.includes('ETIMEDOUT')) {
|
|
29
|
+
reason = 'network';
|
|
30
|
+
this.errorCounts.network++;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.errorCounts.other++;
|
|
34
|
+
}
|
|
35
|
+
this.skippedPackages.push({
|
|
36
|
+
name: packageName,
|
|
37
|
+
reason,
|
|
38
|
+
originalError: error.message,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Track a security check failure
|
|
43
|
+
*/
|
|
44
|
+
static trackSecurityFailure() {
|
|
45
|
+
this.errorCounts.security++;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get skipped packages by reason
|
|
49
|
+
*/
|
|
50
|
+
static getSkippedPackages() {
|
|
51
|
+
const grouped = {
|
|
52
|
+
notFound: this.skippedPackages.filter((p) => p.reason === 'not-found').map((p) => p.name),
|
|
53
|
+
network: this.skippedPackages.filter((p) => p.reason === 'network').map((p) => p.name),
|
|
54
|
+
emptyVersion: this.skippedPackages
|
|
55
|
+
.filter((p) => p.reason === 'empty-version')
|
|
56
|
+
.map((p) => p.name),
|
|
57
|
+
other: this.skippedPackages.filter((p) => p.reason === 'other').map((p) => p.name),
|
|
58
|
+
};
|
|
59
|
+
return grouped;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get error statistics
|
|
63
|
+
*/
|
|
64
|
+
static getErrorStats() {
|
|
65
|
+
return { ...this.errorCounts };
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get total skipped count
|
|
69
|
+
*/
|
|
70
|
+
static getTotalSkipped() {
|
|
71
|
+
return this.skippedPackages.length;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Reset all tracking data
|
|
75
|
+
*/
|
|
76
|
+
static reset() {
|
|
77
|
+
this.skippedPackages = [];
|
|
78
|
+
this.errorCounts = {
|
|
79
|
+
notFound: 0,
|
|
80
|
+
network: 0,
|
|
81
|
+
emptyVersion: 0,
|
|
82
|
+
security: 0,
|
|
83
|
+
other: 0,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get all skipped package details
|
|
88
|
+
*/
|
|
89
|
+
static getAllSkippedPackages() {
|
|
90
|
+
return [...this.skippedPackages];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=ErrorTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorTracker.js","sourceRoot":"","sources":["../../../src/common/error-handling/ErrorTracker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,OAAO,YAAY;IACf,MAAM,CAAC,eAAe,GAAqB,EAAE,CAAC;IAC9C,MAAM,CAAC,WAAW,G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C;SACT,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,qBAAqB;QAC1B,OAAO,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC;IACnC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { ErrorTracker } from './ErrorTracker.js';
|
|
8
|
+
export interface ErrorContext {
|
|
9
|
+
packageName?: string;
|
|
10
|
+
operation?: string;
|
|
11
|
+
details?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PackageSuggestion {
|
|
14
|
+
original: string;
|
|
15
|
+
suggestions: string[];
|
|
16
|
+
reason: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class UserFriendlyErrorHandler {
|
|
19
|
+
private static logger;
|
|
20
|
+
private static packageSuggestions;
|
|
21
|
+
/**
|
|
22
|
+
* Handle package not found errors (404)
|
|
23
|
+
*/
|
|
24
|
+
static handlePackageNotFound(packageName: string, context?: ErrorContext): void;
|
|
25
|
+
/**
|
|
26
|
+
* Handle empty version errors
|
|
27
|
+
*/
|
|
28
|
+
static handleEmptyVersion(packageName: string, context?: ErrorContext): void;
|
|
29
|
+
/**
|
|
30
|
+
* Handle network/timeout errors
|
|
31
|
+
*/
|
|
32
|
+
static handleNetworkError(packageName: string, error: Error, context?: ErrorContext): void;
|
|
33
|
+
/**
|
|
34
|
+
* Handle security check failures
|
|
35
|
+
*/
|
|
36
|
+
static handleSecurityCheckFailure(packageName: string, error: Error, context?: ErrorContext): void;
|
|
37
|
+
/**
|
|
38
|
+
* Handle retry attempts silently
|
|
39
|
+
*/
|
|
40
|
+
static handleRetryAttempt(packageName: string, attempt: number, maxRetries: number, error: Error): void;
|
|
41
|
+
/**
|
|
42
|
+
* Handle final failure after retries
|
|
43
|
+
*/
|
|
44
|
+
static handleFinalFailure(packageName: string, error: Error): void;
|
|
45
|
+
/**
|
|
46
|
+
* Handle general package query failures
|
|
47
|
+
*/
|
|
48
|
+
static handlePackageQueryFailure(packageName: string, error: Error, context?: ErrorContext): void;
|
|
49
|
+
/**
|
|
50
|
+
* Show summary of skipped packages
|
|
51
|
+
*/
|
|
52
|
+
static showSkippedPackagesSummary(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Get statistics for reporting
|
|
55
|
+
*/
|
|
56
|
+
static getStatistics(): {
|
|
57
|
+
totalSkipped: number;
|
|
58
|
+
errorBreakdown: ReturnType<typeof ErrorTracker.getErrorStats>;
|
|
59
|
+
skippedPackages: ReturnType<typeof ErrorTracker.getSkippedPackages>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Reset error tracking (useful for testing)
|
|
63
|
+
*/
|
|
64
|
+
static resetTracking(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Add a new package suggestion
|
|
67
|
+
*/
|
|
68
|
+
static addPackageSuggestion(originalName: string, suggestions: string[]): void;
|
|
69
|
+
/**
|
|
70
|
+
* Get suggestions for a package name
|
|
71
|
+
*/
|
|
72
|
+
static getPackageSuggestions(packageName: string): string[];
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=UserFriendlyErrorHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserFriendlyErrorHandler.d.ts","sourceRoot":"","sources":["../../../src/common/error-handling/UserFriendlyErrorHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IAC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