@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,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Development Tools System
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive debugging and development tools for TachUI.
|
|
5
|
+
* Provides component tree inspection, performance analysis,
|
|
6
|
+
* and runtime debugging capabilities.
|
|
7
|
+
*/
|
|
8
|
+
import type { ComponentInstance } from '@tachui/core';
|
|
9
|
+
/**
|
|
10
|
+
* Component tree node for debugging
|
|
11
|
+
*/
|
|
12
|
+
export interface ComponentTreeNode {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
type: 'component' | 'element' | 'text' | 'fragment';
|
|
16
|
+
props: Record<string, any>;
|
|
17
|
+
children: ComponentTreeNode[];
|
|
18
|
+
parent: ComponentTreeNode | null;
|
|
19
|
+
depth: number;
|
|
20
|
+
renderCount: number;
|
|
21
|
+
lastRenderTime: number;
|
|
22
|
+
memoryUsage: number;
|
|
23
|
+
warnings: string[];
|
|
24
|
+
errors: string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Development environment state
|
|
28
|
+
*/
|
|
29
|
+
export interface DevState {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
performanceTracking: boolean;
|
|
32
|
+
componentInspection: boolean;
|
|
33
|
+
reactiveDebugging: boolean;
|
|
34
|
+
memoryTracking: boolean;
|
|
35
|
+
warningsEnabled: boolean;
|
|
36
|
+
logLevel: 'error' | 'warn' | 'info' | 'debug';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Development tools configuration
|
|
40
|
+
*/
|
|
41
|
+
export interface DevToolsConfig {
|
|
42
|
+
autoEnable: boolean;
|
|
43
|
+
trackAllComponents: boolean;
|
|
44
|
+
trackMemoryUsage: boolean;
|
|
45
|
+
enableWarnings: boolean;
|
|
46
|
+
enableErrors: boolean;
|
|
47
|
+
maxTreeDepth: number;
|
|
48
|
+
updateInterval: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Runtime debugging event
|
|
52
|
+
*/
|
|
53
|
+
export interface DebugEvent {
|
|
54
|
+
type: 'component_mount' | 'component_unmount' | 'component_update' | 'reactive_create' | 'reactive_update' | 'context_change' | 'performance_warning' | 'error';
|
|
55
|
+
timestamp: number;
|
|
56
|
+
componentId?: string;
|
|
57
|
+
componentName?: string;
|
|
58
|
+
data: any;
|
|
59
|
+
stack?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Development tools manager
|
|
63
|
+
*/
|
|
64
|
+
export declare class DevTools {
|
|
65
|
+
private static instance;
|
|
66
|
+
private config;
|
|
67
|
+
private state;
|
|
68
|
+
private componentTree;
|
|
69
|
+
private componentRegistry;
|
|
70
|
+
private debugEvents;
|
|
71
|
+
private activeComponents;
|
|
72
|
+
private treeSignal;
|
|
73
|
+
private setTree;
|
|
74
|
+
private eventsSignal;
|
|
75
|
+
private setEvents;
|
|
76
|
+
private stateSignal;
|
|
77
|
+
private setState;
|
|
78
|
+
private updateTimer;
|
|
79
|
+
constructor();
|
|
80
|
+
static getInstance(): DevTools;
|
|
81
|
+
/**
|
|
82
|
+
* Configure development tools
|
|
83
|
+
*/
|
|
84
|
+
configure(config: Partial<DevToolsConfig>): void;
|
|
85
|
+
/**
|
|
86
|
+
* Enable development tools
|
|
87
|
+
*/
|
|
88
|
+
enable(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Disable development tools
|
|
91
|
+
*/
|
|
92
|
+
disable(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Check if dev tools are enabled
|
|
95
|
+
*/
|
|
96
|
+
isEnabled(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Register a component instance
|
|
99
|
+
*/
|
|
100
|
+
registerComponent(componentId: string, instance: ComponentInstance, parentId?: string): void;
|
|
101
|
+
/**
|
|
102
|
+
* Unregister a component instance
|
|
103
|
+
*/
|
|
104
|
+
unregisterComponent(componentId: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* Update component data
|
|
107
|
+
*/
|
|
108
|
+
updateComponent(componentId: string, updates: Partial<ComponentTreeNode>): void;
|
|
109
|
+
/**
|
|
110
|
+
* Track reactive operation
|
|
111
|
+
*/
|
|
112
|
+
trackReactiveOperation(type: string, operation: string, componentId?: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Track context changes
|
|
115
|
+
*/
|
|
116
|
+
trackContextChange(contextName: string, newValue: any, componentId?: string): void;
|
|
117
|
+
/**
|
|
118
|
+
* Add warning to component
|
|
119
|
+
*/
|
|
120
|
+
addWarning(componentId: string, message: string): void;
|
|
121
|
+
/**
|
|
122
|
+
* Add error to component
|
|
123
|
+
*/
|
|
124
|
+
addError(componentId: string, error: Error | string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Get component tree
|
|
127
|
+
*/
|
|
128
|
+
getComponentTree(): Map<string, ComponentTreeNode>;
|
|
129
|
+
/**
|
|
130
|
+
* Get component tree signal
|
|
131
|
+
*/
|
|
132
|
+
getComponentTreeSignal(): () => Map<string, ComponentTreeNode>;
|
|
133
|
+
/**
|
|
134
|
+
* Get root components
|
|
135
|
+
*/
|
|
136
|
+
getRootComponents(): ComponentTreeNode[];
|
|
137
|
+
/**
|
|
138
|
+
* Get component by ID
|
|
139
|
+
*/
|
|
140
|
+
getComponent(componentId: string): ComponentTreeNode | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Find components by name
|
|
143
|
+
*/
|
|
144
|
+
findComponentsByName(name: string): ComponentTreeNode[];
|
|
145
|
+
/**
|
|
146
|
+
* Get debug events
|
|
147
|
+
*/
|
|
148
|
+
getDebugEvents(): DebugEvent[];
|
|
149
|
+
/**
|
|
150
|
+
* Get debug events signal
|
|
151
|
+
*/
|
|
152
|
+
getDebugEventsSignal(): () => DebugEvent[];
|
|
153
|
+
/**
|
|
154
|
+
* Get development state
|
|
155
|
+
*/
|
|
156
|
+
getDevState(): DevState;
|
|
157
|
+
/**
|
|
158
|
+
* Get development state signal
|
|
159
|
+
*/
|
|
160
|
+
getDevStateSignal(): () => DevState;
|
|
161
|
+
/**
|
|
162
|
+
* Get performance summary
|
|
163
|
+
*/
|
|
164
|
+
getPerformanceSummary(): {
|
|
165
|
+
componentCount: number;
|
|
166
|
+
averageRenderTime: number;
|
|
167
|
+
memoryUsage: number;
|
|
168
|
+
warningCount: number;
|
|
169
|
+
errorCount: number;
|
|
170
|
+
slowComponents: {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
renderTime: number;
|
|
174
|
+
}[];
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Export debug data
|
|
178
|
+
*/
|
|
179
|
+
exportDebugData(): string;
|
|
180
|
+
/**
|
|
181
|
+
* Clear debug data
|
|
182
|
+
*/
|
|
183
|
+
clear(): void;
|
|
184
|
+
private getComponentName;
|
|
185
|
+
private removeNodeAndDescendants;
|
|
186
|
+
private addDebugEvent;
|
|
187
|
+
private startUpdateTimer;
|
|
188
|
+
private stopUpdateTimer;
|
|
189
|
+
private updateComponentMetrics;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Global dev tools instance
|
|
193
|
+
*/
|
|
194
|
+
export declare const globalDevTools: DevTools;
|
|
195
|
+
/**
|
|
196
|
+
* Enable performance tracking
|
|
197
|
+
*/
|
|
198
|
+
export declare function enablePerformanceTracking(): void;
|
|
199
|
+
/**
|
|
200
|
+
* Get component tree
|
|
201
|
+
*/
|
|
202
|
+
export declare function getComponentTree(): Map<string, ComponentTreeNode>;
|
|
203
|
+
/**
|
|
204
|
+
* Enable development mode with full debugging
|
|
205
|
+
*/
|
|
206
|
+
export declare function enableDevelopmentMode(config?: Partial<DevToolsConfig>): void;
|
|
207
|
+
/**
|
|
208
|
+
* Get development tools instance
|
|
209
|
+
*/
|
|
210
|
+
export declare function getDevTools(): DevTools;
|
|
211
|
+
/**
|
|
212
|
+
* Development utilities
|
|
213
|
+
*/
|
|
214
|
+
export declare const devUtils: {
|
|
215
|
+
/**
|
|
216
|
+
* Log component tree to console
|
|
217
|
+
*/
|
|
218
|
+
logComponentTree(): void;
|
|
219
|
+
/**
|
|
220
|
+
* Log performance summary
|
|
221
|
+
*/
|
|
222
|
+
logPerformanceSummary(): void;
|
|
223
|
+
/**
|
|
224
|
+
* Find component by name
|
|
225
|
+
*/
|
|
226
|
+
findComponent(name: string): ComponentTreeNode[];
|
|
227
|
+
/**
|
|
228
|
+
* Inspect component
|
|
229
|
+
*/
|
|
230
|
+
inspectComponent(componentId: string): ComponentTreeNode | undefined;
|
|
231
|
+
};
|
|
232
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inspector/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAA;IACnD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,mBAAmB,EAAE,OAAO,CAAA;IAC5B,iBAAiB,EAAE,OAAO,CAAA;IAC1B,cAAc,EAAE,OAAO,CAAA;IACvB,eAAe,EAAE,OAAO,CAAA;IACxB,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,OAAO,CAAA;IACnB,k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