@tachui/devtools 0.8.0-alpha
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/LICENSE +363 -0
- package/README.md +189 -0
- package/dist/build-time/detection.d.ts +32 -0
- package/dist/build-time/detection.d.ts.map +1 -0
- package/dist/build-time/index.d.ts +84 -0
- package/dist/build-time/index.d.ts.map +1 -0
- package/dist/build-time/plugins.d.ts +75 -0
- package/dist/build-time/plugins.d.ts.map +1 -0
- package/dist/build-time/rules.d.ts +73 -0
- package/dist/build-time/rules.d.ts.map +1 -0
- package/dist/build-time/transformer.d.ts +23 -0
- package/dist/build-time/transformer.d.ts.map +1 -0
- package/dist/build-time/types.d.ts +212 -0
- package/dist/build-time/types.d.ts.map +1 -0
- package/dist/debug/advanced-debugging.d.ts +327 -0
- package/dist/debug/advanced-debugging.d.ts.map +1 -0
- package/dist/debug/debug.d.ts +61 -0
- package/dist/debug/debug.d.ts.map +1 -0
- package/dist/debug/developer-experience.d.ts +261 -0
- package/dist/debug/developer-experience.d.ts.map +1 -0
- package/dist/debug/development-warnings.d.ts +42 -0
- package/dist/debug/development-warnings.d.ts.map +1 -0
- package/dist/debug/documentation-integration.d.ts +269 -0
- package/dist/debug/documentation-integration.d.ts.map +1 -0
- package/dist/debug/enhanced-errors.d.ts +176 -0
- package/dist/debug/enhanced-errors.d.ts.map +1 -0
- package/dist/debug/enhanced-types.d.ts +284 -0
- package/dist/debug/enhanced-types.d.ts.map +1 -0
- package/dist/debug/ide-integration.d.ts +328 -0
- package/dist/debug/ide-integration.d.ts.map +1 -0
- package/dist/debug/index.d.ts +12 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +1251 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/validation-debug-tools.d.ts +228 -0
- package/dist/debug/validation-debug-tools.d.ts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +216229 -0
- package/dist/index.js.map +1 -0
- package/dist/inspector/index.d.ts +232 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +525 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/plugins/simplified-error-handler.d.ts +83 -0
- package/dist/plugins/simplified-error-handler.d.ts.map +1 -0
- package/dist/profiler/index.d.ts +21 -0
- package/dist/profiler/index.d.ts.map +1 -0
- package/dist/profiler/index.js +519 -0
- package/dist/profiler/index.js.map +1 -0
- package/dist/profiler/performance-optimizer.d.ts +115 -0
- package/dist/profiler/performance-optimizer.d.ts.map +1 -0
- package/dist/profiler/production-monitoring.d.ts +150 -0
- package/dist/profiler/production-monitoring.d.ts.map +1 -0
- package/dist/runtime/error-boundary.d.ts +302 -0
- package/dist/runtime/error-boundary.d.ts.map +1 -0
- package/dist/runtime/error-recovery.d.ts +267 -0
- package/dist/runtime/error-recovery.d.ts.map +1 -0
- package/dist/runtime/error-reporting.d.ts +287 -0
- package/dist/runtime/error-reporting.d.ts.map +1 -0
- package/dist/runtime/error-utils.d.ts +204 -0
- package/dist/runtime/error-utils.d.ts.map +1 -0
- package/dist/runtime/performance.d.ts +217 -0
- package/dist/runtime/performance.d.ts.map +1 -0
- package/dist/testing/index.d.ts +29 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +47 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/validation/debug-tools-stub.d.ts +67 -0
- package/dist/validation/debug-tools-stub.d.ts.map +1 -0
- package/dist/validation/enhanced-runtime.d.ts +310 -0
- package/dist/validation/enhanced-runtime.d.ts.map +1 -0
- package/dist/validation/error-reporting.d.ts +186 -0
- package/dist/validation/error-reporting.d.ts.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Runtime Validation System - Phase 1C
|
|
3
|
+
*
|
|
4
|
+
* Smart error recovery, performance optimization, enhanced error reporting,
|
|
5
|
+
* and component lifecycle validation for production-ready validation.
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentInstance } from '@tachui/core';
|
|
8
|
+
export declare class TachUIValidationError extends Error {
|
|
9
|
+
context: {
|
|
10
|
+
component: string;
|
|
11
|
+
property?: string;
|
|
12
|
+
suggestion?: string;
|
|
13
|
+
documentation?: string;
|
|
14
|
+
example?: {
|
|
15
|
+
wrong: string;
|
|
16
|
+
correct: string;
|
|
17
|
+
};
|
|
18
|
+
package?: string;
|
|
19
|
+
};
|
|
20
|
+
constructor(message: string, context: {
|
|
21
|
+
component: string;
|
|
22
|
+
property?: string;
|
|
23
|
+
suggestion?: string;
|
|
24
|
+
documentation?: string;
|
|
25
|
+
example?: {
|
|
26
|
+
wrong: string;
|
|
27
|
+
correct: string;
|
|
28
|
+
};
|
|
29
|
+
package?: string;
|
|
30
|
+
});
|
|
31
|
+
getFormattedMessage(): string;
|
|
32
|
+
}
|
|
33
|
+
export interface ValidationConfig {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
errorLevel: 'off' | 'warn' | 'error';
|
|
36
|
+
packages: Record<string, boolean>;
|
|
37
|
+
strictMode?: boolean;
|
|
38
|
+
excludeFiles?: string[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Recovery strategy for validation errors
|
|
42
|
+
*/
|
|
43
|
+
export type RecoveryStrategy = 'ignore' | 'fallback' | 'fix' | 'throw';
|
|
44
|
+
/**
|
|
45
|
+
* Enhanced validation error with recovery options
|
|
46
|
+
*/
|
|
47
|
+
export declare class EnhancedValidationError extends TachUIValidationError {
|
|
48
|
+
context: {
|
|
49
|
+
component: string;
|
|
50
|
+
property?: string;
|
|
51
|
+
suggestion?: string;
|
|
52
|
+
documentation?: string;
|
|
53
|
+
example?: {
|
|
54
|
+
wrong: string;
|
|
55
|
+
correct: string;
|
|
56
|
+
};
|
|
57
|
+
package?: string;
|
|
58
|
+
recoveryStrategy?: RecoveryStrategy;
|
|
59
|
+
fallbackValue?: any;
|
|
60
|
+
autoFix?: () => any;
|
|
61
|
+
};
|
|
62
|
+
constructor(message: string, context: {
|
|
63
|
+
component: string;
|
|
64
|
+
property?: string;
|
|
65
|
+
suggestion?: string;
|
|
66
|
+
documentation?: string;
|
|
67
|
+
example?: {
|
|
68
|
+
wrong: string;
|
|
69
|
+
correct: string;
|
|
70
|
+
};
|
|
71
|
+
package?: string;
|
|
72
|
+
recoveryStrategy?: RecoveryStrategy;
|
|
73
|
+
fallbackValue?: any;
|
|
74
|
+
autoFix?: () => any;
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Get recovery strategy with proper typing
|
|
78
|
+
*/
|
|
79
|
+
private getRecoveryStrategyFromContext;
|
|
80
|
+
/**
|
|
81
|
+
* Get fallback value with proper typing
|
|
82
|
+
*/
|
|
83
|
+
private getFallbackValueFromContext;
|
|
84
|
+
/**
|
|
85
|
+
* Get auto fix with proper typing
|
|
86
|
+
*/
|
|
87
|
+
private getAutoFixFromContext;
|
|
88
|
+
/**
|
|
89
|
+
* Get suggested recovery action
|
|
90
|
+
*/
|
|
91
|
+
getRecoveryStrategy(): RecoveryStrategy;
|
|
92
|
+
/**
|
|
93
|
+
* Get fallback value for graceful degradation
|
|
94
|
+
*/
|
|
95
|
+
getFallbackValue(): any;
|
|
96
|
+
/**
|
|
97
|
+
* Apply automatic fix if available
|
|
98
|
+
*/
|
|
99
|
+
applyAutoFix(): any;
|
|
100
|
+
/**
|
|
101
|
+
* Enhanced formatted message with recovery options
|
|
102
|
+
*/
|
|
103
|
+
getFormattedMessage(): string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Enhanced validation configuration
|
|
107
|
+
*/
|
|
108
|
+
export interface EnhancedValidationConfig extends ValidationConfig {
|
|
109
|
+
performance: {
|
|
110
|
+
enableCaching: boolean;
|
|
111
|
+
maxCacheSize: number;
|
|
112
|
+
performanceThreshold: number;
|
|
113
|
+
};
|
|
114
|
+
recovery: {
|
|
115
|
+
enableRecovery: boolean;
|
|
116
|
+
defaultStrategy: RecoveryStrategy;
|
|
117
|
+
maxRecoveryAttempts: number;
|
|
118
|
+
};
|
|
119
|
+
lifecycle: {
|
|
120
|
+
validateOnMount: boolean;
|
|
121
|
+
validateOnUpdate: boolean;
|
|
122
|
+
validateOnUnmount: boolean;
|
|
123
|
+
};
|
|
124
|
+
reporting: {
|
|
125
|
+
enhancedMessages: boolean;
|
|
126
|
+
includeStackTrace: boolean;
|
|
127
|
+
reportToConsole: boolean;
|
|
128
|
+
reportToExternal?: (error: EnhancedValidationError) => void;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Global enhanced validation configuration
|
|
133
|
+
*/
|
|
134
|
+
declare let enhancedConfig: EnhancedValidationConfig;
|
|
135
|
+
/**
|
|
136
|
+
* Validation cache for performance optimization
|
|
137
|
+
*/
|
|
138
|
+
declare class ValidationCache {
|
|
139
|
+
private cache;
|
|
140
|
+
private maxSize;
|
|
141
|
+
private ttl;
|
|
142
|
+
constructor(maxSize?: number);
|
|
143
|
+
get(key: string): boolean | null;
|
|
144
|
+
set(key: string, result: boolean): void;
|
|
145
|
+
clear(): void;
|
|
146
|
+
getSize(): number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Performance monitor for validation overhead
|
|
150
|
+
*/
|
|
151
|
+
declare class ValidationPerformanceMonitor {
|
|
152
|
+
private measurements;
|
|
153
|
+
private maxMeasurements;
|
|
154
|
+
startMeasurement(): () => void;
|
|
155
|
+
private recordMeasurement;
|
|
156
|
+
getAverageTime(): number;
|
|
157
|
+
isPerformanceAcceptable(): boolean;
|
|
158
|
+
getStats(): {
|
|
159
|
+
averageTime: number;
|
|
160
|
+
measurements: number;
|
|
161
|
+
acceptable: boolean;
|
|
162
|
+
threshold: number;
|
|
163
|
+
};
|
|
164
|
+
reset(): void;
|
|
165
|
+
}
|
|
166
|
+
declare const validationCache: ValidationCache;
|
|
167
|
+
declare const performanceMonitor: ValidationPerformanceMonitor;
|
|
168
|
+
/**
|
|
169
|
+
* Configure enhanced validation
|
|
170
|
+
*/
|
|
171
|
+
export declare function configureEnhancedValidation(config: Partial<EnhancedValidationConfig>): void;
|
|
172
|
+
/**
|
|
173
|
+
* Check if enhanced validation is enabled
|
|
174
|
+
*/
|
|
175
|
+
export declare function isEnhancedValidationEnabled(): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Smart validation executor with error recovery
|
|
178
|
+
*/
|
|
179
|
+
export declare class SmartValidationExecutor {
|
|
180
|
+
private recoveryAttempts;
|
|
181
|
+
/**
|
|
182
|
+
* Execute validation with recovery options
|
|
183
|
+
*/
|
|
184
|
+
executeWithRecovery<T>(validationKey: string, validator: () => T, recoveryOptions?: {
|
|
185
|
+
strategy?: RecoveryStrategy;
|
|
186
|
+
fallbackValue?: T;
|
|
187
|
+
autoFix?: () => T;
|
|
188
|
+
}): T;
|
|
189
|
+
/**
|
|
190
|
+
* Handle validation error with recovery
|
|
191
|
+
*/
|
|
192
|
+
private handleValidationError;
|
|
193
|
+
/**
|
|
194
|
+
* Report validation error
|
|
195
|
+
*/
|
|
196
|
+
private reportError;
|
|
197
|
+
/**
|
|
198
|
+
* Reset recovery attempts
|
|
199
|
+
*/
|
|
200
|
+
resetRecoveryAttempts(): void;
|
|
201
|
+
/**
|
|
202
|
+
* Get recovery stats
|
|
203
|
+
*/
|
|
204
|
+
getRecoveryStats(): {
|
|
205
|
+
totalAttempts: number;
|
|
206
|
+
keysWithAttempts: number;
|
|
207
|
+
attempts: {
|
|
208
|
+
[k: string]: number;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
declare const smartValidator: SmartValidationExecutor;
|
|
213
|
+
/**
|
|
214
|
+
* Component lifecycle validator
|
|
215
|
+
*/
|
|
216
|
+
export declare class ComponentLifecycleValidator {
|
|
217
|
+
private mountedComponents;
|
|
218
|
+
private componentStates;
|
|
219
|
+
/**
|
|
220
|
+
* Validate component on mount
|
|
221
|
+
*/
|
|
222
|
+
validateOnMount(component: ComponentInstance, props: any): void;
|
|
223
|
+
/**
|
|
224
|
+
* Validate component on update
|
|
225
|
+
*/
|
|
226
|
+
validateOnUpdate(component: ComponentInstance, newProps: any, oldProps: any): void;
|
|
227
|
+
/**
|
|
228
|
+
* Validate component on unmount
|
|
229
|
+
*/
|
|
230
|
+
validateOnUnmount(component: ComponentInstance): void;
|
|
231
|
+
/**
|
|
232
|
+
* Get lifecycle validation stats
|
|
233
|
+
*/
|
|
234
|
+
getStats(): {
|
|
235
|
+
mountedComponents: number;
|
|
236
|
+
enabled: {
|
|
237
|
+
validateOnMount: boolean;
|
|
238
|
+
validateOnUpdate: boolean;
|
|
239
|
+
validateOnUnmount: boolean;
|
|
240
|
+
};
|
|
241
|
+
config: {
|
|
242
|
+
validateOnMount: boolean;
|
|
243
|
+
validateOnUpdate: boolean;
|
|
244
|
+
validateOnUnmount: boolean;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
declare const lifecycleValidator: ComponentLifecycleValidator;
|
|
249
|
+
/**
|
|
250
|
+
* Enhanced validation utilities
|
|
251
|
+
*/
|
|
252
|
+
export declare const EnhancedValidationUtils: {
|
|
253
|
+
/**
|
|
254
|
+
* Configure enhanced validation
|
|
255
|
+
*/
|
|
256
|
+
configure: typeof configureEnhancedValidation;
|
|
257
|
+
/**
|
|
258
|
+
* Get performance statistics
|
|
259
|
+
*/
|
|
260
|
+
getPerformanceStats(): {
|
|
261
|
+
monitor: {
|
|
262
|
+
averageTime: number;
|
|
263
|
+
measurements: number;
|
|
264
|
+
acceptable: boolean;
|
|
265
|
+
threshold: number;
|
|
266
|
+
};
|
|
267
|
+
cache: {
|
|
268
|
+
size: number;
|
|
269
|
+
maxSize: number;
|
|
270
|
+
};
|
|
271
|
+
recovery: {
|
|
272
|
+
totalAttempts: number;
|
|
273
|
+
keysWithAttempts: number;
|
|
274
|
+
attempts: {
|
|
275
|
+
[k: string]: number;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
lifecycle: {
|
|
279
|
+
mountedComponents: number;
|
|
280
|
+
enabled: {
|
|
281
|
+
validateOnMount: boolean;
|
|
282
|
+
validateOnUpdate: boolean;
|
|
283
|
+
validateOnUnmount: boolean;
|
|
284
|
+
};
|
|
285
|
+
config: {
|
|
286
|
+
validateOnMount: boolean;
|
|
287
|
+
validateOnUpdate: boolean;
|
|
288
|
+
validateOnUnmount: boolean;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* Reset all caches and stats
|
|
294
|
+
*/
|
|
295
|
+
reset(): void;
|
|
296
|
+
/**
|
|
297
|
+
* Test enhanced validation system
|
|
298
|
+
*/
|
|
299
|
+
test(): void;
|
|
300
|
+
/**
|
|
301
|
+
* Enable production bypass mode
|
|
302
|
+
*/
|
|
303
|
+
enableProductionBypass(): void;
|
|
304
|
+
/**
|
|
305
|
+
* Create validated component with enhanced features
|
|
306
|
+
*/
|
|
307
|
+
createEnhancedValidatedComponent<T extends ComponentInstance>(originalConstructor: (...args: any[]) => T, validator: (args: unknown[]) => void, componentType: string, packageName?: string): (...args: any[]) => T;
|
|
308
|
+
};
|
|
309
|
+
export { smartValidator, lifecycleValidator, validationCache, performanceMonitor, enhancedConfig, };
|
|
310
|
+
//# sourceMappingURL=enhanced-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhanced-runtime.d.ts","sourceRoot":"","sources":["../../src/validation/enhanced-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD,qBAAa,qBAAsB,SAAQ,KAAK;IAGrC,OAAO,EAAE;QACd,SAAS,EAAE,MAAM,CAAA;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,OAAO,CAAC,EAAE;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iBACrB,MAAM,gBACR,MAAM,GAClB,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC;CAkDzB,CAAA;AAGD,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,cAAc,GACf,CAAA"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Error Reporting System - Phase 1C
|
|
3
|
+
*
|
|
4
|
+
* Rich error message templates, contextual suggestions, fix examples,
|
|
5
|
+
* and comprehensive developer guidance for validation errors.
|
|
6
|
+
*/
|
|
7
|
+
import type { RecoveryStrategy } from './enhanced-runtime';
|
|
8
|
+
import { EnhancedValidationError } from './enhanced-runtime';
|
|
9
|
+
/**
|
|
10
|
+
* Error severity levels
|
|
11
|
+
*/
|
|
12
|
+
export type ValidationErrorSeverity = 'critical' | 'error' | 'warning' | 'info';
|
|
13
|
+
/**
|
|
14
|
+
* Error category for classification
|
|
15
|
+
*/
|
|
16
|
+
export type ValidationErrorCategory = 'component-construction' | 'modifier-usage' | 'prop-validation' | 'lifecycle' | 'performance' | 'accessibility' | 'best-practices';
|
|
17
|
+
/**
|
|
18
|
+
* Fix suggestion with automated repair capability
|
|
19
|
+
*/
|
|
20
|
+
export interface FixSuggestion {
|
|
21
|
+
description: string;
|
|
22
|
+
code: string;
|
|
23
|
+
autoFix?: () => string;
|
|
24
|
+
difficulty: 'easy' | 'medium' | 'hard';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Enhanced error context with rich metadata
|
|
28
|
+
*/
|
|
29
|
+
export interface EnhancedErrorContext {
|
|
30
|
+
component: string;
|
|
31
|
+
package?: string;
|
|
32
|
+
property?: string;
|
|
33
|
+
category: ValidationErrorCategory;
|
|
34
|
+
severity: ValidationErrorSeverity;
|
|
35
|
+
errorCode: string;
|
|
36
|
+
suggestion: string;
|
|
37
|
+
documentation: string;
|
|
38
|
+
fixes: FixSuggestion[];
|
|
39
|
+
examples: {
|
|
40
|
+
wrong: string[];
|
|
41
|
+
correct: string[];
|
|
42
|
+
};
|
|
43
|
+
recoveryStrategy: RecoveryStrategy;
|
|
44
|
+
fallbackValue?: any;
|
|
45
|
+
autoFix?: () => any;
|
|
46
|
+
location?: {
|
|
47
|
+
file?: string;
|
|
48
|
+
line?: number;
|
|
49
|
+
column?: number;
|
|
50
|
+
};
|
|
51
|
+
relatedErrors?: string[];
|
|
52
|
+
commonMistakes?: string[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Error message template for consistent formatting
|
|
56
|
+
*/
|
|
57
|
+
export interface ErrorMessageTemplate {
|
|
58
|
+
title: string;
|
|
59
|
+
description: string;
|
|
60
|
+
impact: string;
|
|
61
|
+
quickFix?: string;
|
|
62
|
+
detailedSolution?: string;
|
|
63
|
+
prevention?: string;
|
|
64
|
+
emoji: string;
|
|
65
|
+
color: 'red' | 'yellow' | 'blue' | 'gray';
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Comprehensive error templates database
|
|
69
|
+
*/
|
|
70
|
+
export declare const ErrorTemplates: Record<string, ErrorMessageTemplate>;
|
|
71
|
+
/**
|
|
72
|
+
* Error code generator for consistent error identification
|
|
73
|
+
*/
|
|
74
|
+
export declare class ErrorCodeGenerator {
|
|
75
|
+
private static categories;
|
|
76
|
+
static generate(category: ValidationErrorCategory, component: string, specific?: string): string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Enhanced error reporter with rich formatting
|
|
80
|
+
*/
|
|
81
|
+
export declare class EnhancedErrorReporter {
|
|
82
|
+
private static instance;
|
|
83
|
+
private errorHistory;
|
|
84
|
+
private maxHistorySize;
|
|
85
|
+
static getInstance(): EnhancedErrorReporter;
|
|
86
|
+
/**
|
|
87
|
+
* Create enhanced validation error with rich context
|
|
88
|
+
*/
|
|
89
|
+
createError(message: string, context: Partial<EnhancedErrorContext>): EnhancedValidationError;
|
|
90
|
+
/**
|
|
91
|
+
* Format error message with rich context
|
|
92
|
+
*/
|
|
93
|
+
formatError(error: EnhancedValidationError): string;
|
|
94
|
+
/**
|
|
95
|
+
* Get error template by code or fallback to default
|
|
96
|
+
*/
|
|
97
|
+
private getTemplate;
|
|
98
|
+
/**
|
|
99
|
+
* Substitute variables in template strings
|
|
100
|
+
*/
|
|
101
|
+
private substituteVariables;
|
|
102
|
+
/**
|
|
103
|
+
* Get recovery strategy description
|
|
104
|
+
*/
|
|
105
|
+
private getRecoveryDescription;
|
|
106
|
+
/**
|
|
107
|
+
* Record error in history for analytics
|
|
108
|
+
*/
|
|
109
|
+
private recordError;
|
|
110
|
+
/**
|
|
111
|
+
* Get error statistics
|
|
112
|
+
*/
|
|
113
|
+
getErrorStats(): {
|
|
114
|
+
totalErrors: number;
|
|
115
|
+
categories: {
|
|
116
|
+
[k: string]: number;
|
|
117
|
+
};
|
|
118
|
+
severities: {
|
|
119
|
+
[k: string]: number;
|
|
120
|
+
};
|
|
121
|
+
components: {
|
|
122
|
+
[k: string]: number;
|
|
123
|
+
};
|
|
124
|
+
recentErrors: {
|
|
125
|
+
code: string;
|
|
126
|
+
component: string;
|
|
127
|
+
message: string;
|
|
128
|
+
timestamp: number;
|
|
129
|
+
}[];
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Clear error history
|
|
133
|
+
*/
|
|
134
|
+
clearHistory(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Export error report for debugging
|
|
137
|
+
*/
|
|
138
|
+
exportErrorReport(): string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Error suggestion engine for intelligent fixes
|
|
142
|
+
*/
|
|
143
|
+
export declare class ErrorSuggestionEngine {
|
|
144
|
+
/**
|
|
145
|
+
* Generate fix suggestions for common component errors
|
|
146
|
+
*/
|
|
147
|
+
static generateComponentFixSuggestions(component: string, error: string, _args: unknown[]): FixSuggestion[];
|
|
148
|
+
/**
|
|
149
|
+
* Generate fix for missing parameters
|
|
150
|
+
*/
|
|
151
|
+
private static generateParameterFix;
|
|
152
|
+
/**
|
|
153
|
+
* Generate fix for type mismatches
|
|
154
|
+
*/
|
|
155
|
+
private static generateTypeFix;
|
|
156
|
+
/**
|
|
157
|
+
* Generate fix for null/undefined values
|
|
158
|
+
*/
|
|
159
|
+
private static generateNullCheckFix;
|
|
160
|
+
}
|
|
161
|
+
export declare const errorReporter: EnhancedErrorReporter;
|
|
162
|
+
export declare const ErrorReportingUtils: {
|
|
163
|
+
createError: (message: string, context: Partial<EnhancedErrorContext>) => EnhancedValidationError;
|
|
164
|
+
formatError: (error: EnhancedValidationError) => string;
|
|
165
|
+
getStats: () => {
|
|
166
|
+
totalErrors: number;
|
|
167
|
+
categories: {
|
|
168
|
+
[k: string]: number;
|
|
169
|
+
};
|
|
170
|
+
severities: {
|
|
171
|
+
[k: string]: number;
|
|
172
|
+
};
|
|
173
|
+
components: {
|
|
174
|
+
[k: string]: number;
|
|
175
|
+
};
|
|
176
|
+
recentErrors: {
|
|
177
|
+
code: string;
|
|
178
|
+
component: string;
|
|
179
|
+
message: string;
|
|
180
|
+
timestamp: number;
|
|
181
|
+
}[];
|
|
182
|
+
};
|
|
183
|
+
exportReport: () => string;
|
|
184
|
+
generateSuggestions: typeof ErrorSuggestionEngine.generateComponentFixSuggestions;
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=error-reporting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-reporting.d.ts","sourceRoot":"","sources":["../../src/validation/error-reporting.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAE5D;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAE/E;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,wBAAwB,GACxB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,EAAE,OAAO,EAAE,GACf,aAAa,EAAE;IAkClB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAmBnC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAa9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAMpC;AAGD,eAAO,MAAM,aAAa,uBAAsC,CAAA;AAGhE,eAAO,MAAM,mBAAmB;2BACP,MAAM,WAAW,OAAO,CAAC,oBAAoB,CAAC;yBAGhD,uBAAuB;;;;;;;;;;;;;;;;;;;;;CAQ7C,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tachui/devtools",
|
|
3
|
+
"version": "0.8.0-alpha",
|
|
4
|
+
"description": "Development & debugging tools for tachUI framework",
|
|
5
|
+
"homepage": "https://tachui.dev/",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./inspector": {
|
|
16
|
+
"types": "./dist/inspector/index.d.ts",
|
|
17
|
+
"import": "./dist/inspector/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./profiler": {
|
|
20
|
+
"types": "./dist/profiler/index.d.ts",
|
|
21
|
+
"import": "./dist/profiler/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./debug": {
|
|
24
|
+
"types": "./dist/debug/index.d.ts",
|
|
25
|
+
"import": "./dist/debug/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./testing": {
|
|
28
|
+
"types": "./dist/testing/index.d.ts",
|
|
29
|
+
"import": "./dist/testing/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@tachui/primitives": "0.8.0-alpha",
|
|
37
|
+
"@tachui/core": "0.8.0-alpha"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^20.0.0",
|
|
41
|
+
"@types/jsdom": "^21.1.6",
|
|
42
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
43
|
+
"jsdom": "^23.2.0",
|
|
44
|
+
"typescript": "^5.8.0",
|
|
45
|
+
"vite": "^7.1.1",
|
|
46
|
+
"vitest": "^3.2.4"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"tachui",
|
|
50
|
+
"devtools",
|
|
51
|
+
"debugging",
|
|
52
|
+
"development",
|
|
53
|
+
"inspector",
|
|
54
|
+
"profiler",
|
|
55
|
+
"testing"
|
|
56
|
+
],
|
|
57
|
+
"author": "tachUI Team",
|
|
58
|
+
"license": "MPL-2.0",
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "https://github.com/tach-UI/tachUI",
|
|
62
|
+
"directory": "packages/devtools"
|
|
63
|
+
},
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=20.0.0"
|
|
66
|
+
},
|
|
67
|
+
"sideEffects": false,
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
|
70
|
+
"dev": "vite build --watch",
|
|
71
|
+
"clean": "rm -rf dist",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"valid": "clear && vitest run && pnpm type-check && pnpm lint && pnpm build",
|
|
74
|
+
"test:watch": "vitest",
|
|
75
|
+
"type-check": "tsc --noEmit",
|
|
76
|
+
"lint": "oxlint src"
|
|
77
|
+
}
|
|
78
|
+
}
|