@coherent.js/devtools 1.0.0-beta.8 → 1.0.0-rc.2

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.
@@ -0,0 +1,423 @@
1
+ // src/performance-dashboard.js
2
+ var PerformanceDashboard = class {
3
+ constructor(options = {}) {
4
+ this.options = {
5
+ updateInterval: options.updateInterval || 5e3,
6
+ maxHistoryPoints: options.maxHistoryPoints || 100,
7
+ enableAlerts: options.enableAlerts !== false,
8
+ enableRecommendations: options.enableRecommendations !== false,
9
+ colorOutput: options.colorOutput !== false,
10
+ ...options
11
+ };
12
+ this.metrics = {
13
+ api: {
14
+ requests: 0,
15
+ averageTime: 0,
16
+ cacheHits: 0,
17
+ cacheMisses: 0,
18
+ staticRoutes: 0,
19
+ dynamicRoutes: 0,
20
+ history: []
21
+ },
22
+ components: {
23
+ renders: 0,
24
+ averageTime: 0,
25
+ cacheHits: 0,
26
+ cacheMisses: 0,
27
+ staticComponents: 0,
28
+ dynamicComponents: 0,
29
+ memoryUsage: 0,
30
+ history: []
31
+ },
32
+ fullstack: {
33
+ totalRequests: 0,
34
+ averageTime: 0,
35
+ errors: 0,
36
+ bottlenecks: [],
37
+ history: []
38
+ }
39
+ };
40
+ this.alerts = [];
41
+ this.recommendations = [];
42
+ this.startTime = Date.now();
43
+ this.updateTimer = null;
44
+ }
45
+ /**
46
+ * Start monitoring performance
47
+ */
48
+ startMonitoring() {
49
+ if (this.updateTimer) return;
50
+ this.updateTimer = setInterval(() => {
51
+ this.updateMetrics();
52
+ this.generateAlerts();
53
+ this.generateRecommendations();
54
+ }, this.options.updateInterval);
55
+ }
56
+ /**
57
+ * Stop monitoring
58
+ */
59
+ stopMonitoring() {
60
+ if (this.updateTimer) {
61
+ clearInterval(this.updateTimer);
62
+ this.updateTimer = null;
63
+ }
64
+ }
65
+ /**
66
+ * Record API request metrics
67
+ */
68
+ recordAPIRequest(duration, routeType, cacheHit = false) {
69
+ this.metrics.api.requests++;
70
+ this.metrics.api.averageTime = this.updateAverage(
71
+ this.metrics.api.averageTime,
72
+ duration,
73
+ this.metrics.api.requests
74
+ );
75
+ if (cacheHit) {
76
+ this.metrics.api.cacheHits++;
77
+ } else {
78
+ this.metrics.api.cacheMisses++;
79
+ }
80
+ if (routeType === "static") {
81
+ this.metrics.api.staticRoutes++;
82
+ } else {
83
+ this.metrics.api.dynamicRoutes++;
84
+ }
85
+ this.addToHistory("api", {
86
+ timestamp: Date.now(),
87
+ duration,
88
+ routeType,
89
+ cacheHit
90
+ });
91
+ }
92
+ /**
93
+ * Record component render metrics
94
+ */
95
+ recordComponentRender(duration, componentType, cacheHit = false, memoryDelta = 0) {
96
+ this.metrics.components.renders++;
97
+ this.metrics.components.averageTime = this.updateAverage(
98
+ this.metrics.components.averageTime,
99
+ duration,
100
+ this.metrics.components.renders
101
+ );
102
+ if (cacheHit) {
103
+ this.metrics.components.cacheHits++;
104
+ } else {
105
+ this.metrics.components.cacheMisses++;
106
+ }
107
+ if (componentType === "static") {
108
+ this.metrics.components.staticComponents++;
109
+ } else {
110
+ this.metrics.components.dynamicComponents++;
111
+ }
112
+ this.metrics.components.memoryUsage += memoryDelta;
113
+ this.addToHistory("components", {
114
+ timestamp: Date.now(),
115
+ duration,
116
+ componentType,
117
+ cacheHit,
118
+ memoryDelta
119
+ });
120
+ }
121
+ /**
122
+ * Record full-stack request metrics
123
+ */
124
+ recordFullStackRequest(duration, error = null, bottlenecks = []) {
125
+ this.metrics.fullstack.totalRequests++;
126
+ this.metrics.fullstack.averageTime = this.updateAverage(
127
+ this.metrics.fullstack.averageTime,
128
+ duration,
129
+ this.metrics.fullstack.totalRequests
130
+ );
131
+ if (error) {
132
+ this.metrics.fullstack.errors++;
133
+ }
134
+ this.metrics.fullstack.bottlenecks = bottlenecks;
135
+ this.addToHistory("fullstack", {
136
+ timestamp: Date.now(),
137
+ duration,
138
+ error,
139
+ bottlenecks
140
+ });
141
+ }
142
+ /**
143
+ * Update metrics from external sources
144
+ */
145
+ updateMetrics() {
146
+ const now = Date.now();
147
+ const uptime = now - this.startTime;
148
+ const apiRate = this.metrics.api.requests / (uptime / 1e3);
149
+ const componentRate = this.metrics.components.renders / (uptime / 1e3);
150
+ const fullStackRate = this.metrics.fullstack.totalRequests / (uptime / 1e3);
151
+ return {
152
+ apiRate,
153
+ componentRate,
154
+ fullStackRate,
155
+ uptime
156
+ };
157
+ }
158
+ /**
159
+ * Generate performance alerts
160
+ */
161
+ generateAlerts() {
162
+ this.alerts = [];
163
+ if (this.metrics.api.averageTime > 50) {
164
+ this.alerts.push({
165
+ type: "warning",
166
+ category: "api",
167
+ message: `API response time is high: ${this.metrics.api.averageTime.toFixed(2)}ms`,
168
+ threshold: 50,
169
+ current: this.metrics.api.averageTime
170
+ });
171
+ }
172
+ const apiCacheHitRate = this.getCacheHitRate("api");
173
+ if (apiCacheHitRate < 80) {
174
+ this.alerts.push({
175
+ type: "warning",
176
+ category: "api",
177
+ message: `API cache hit rate is low: ${apiCacheHitRate.toFixed(1)}%`,
178
+ threshold: 80,
179
+ current: apiCacheHitRate
180
+ });
181
+ }
182
+ if (this.metrics.components.averageTime > 20) {
183
+ this.alerts.push({
184
+ type: "warning",
185
+ category: "components",
186
+ message: `Component render time is high: ${this.metrics.components.averageTime.toFixed(2)}ms`,
187
+ threshold: 20,
188
+ current: this.metrics.components.averageTime
189
+ });
190
+ }
191
+ const componentCacheHitRate = this.getCacheHitRate("components");
192
+ if (componentCacheHitRate < 90) {
193
+ this.alerts.push({
194
+ type: "warning",
195
+ category: "components",
196
+ message: `Component cache hit rate is low: ${componentCacheHitRate.toFixed(1)}%`,
197
+ threshold: 90,
198
+ current: componentCacheHitRate
199
+ });
200
+ }
201
+ if (this.metrics.fullstack.errors > 0) {
202
+ this.alerts.push({
203
+ type: "error",
204
+ category: "fullstack",
205
+ message: `${this.metrics.fullstack.errors} errors detected`,
206
+ threshold: 0,
207
+ current: this.metrics.fullstack.errors
208
+ });
209
+ }
210
+ }
211
+ /**
212
+ * Generate performance recommendations
213
+ */
214
+ generateRecommendations() {
215
+ this.recommendations = [];
216
+ const staticRouteRatio = this.metrics.api.staticRoutes / Math.max(this.metrics.api.requests, 1);
217
+ if (staticRouteRatio < 0.7) {
218
+ this.recommendations.push({
219
+ type: "optimization",
220
+ category: "api",
221
+ message: "Consider adding more static routes to improve smart routing efficiency",
222
+ impact: "high",
223
+ effort: "low"
224
+ });
225
+ }
226
+ const apiCacheHitRate = this.getCacheHitRate("api");
227
+ if (apiCacheHitRate < 90) {
228
+ this.recommendations.push({
229
+ type: "optimization",
230
+ category: "api",
231
+ message: "Increase API cache size or TTL to improve cache hit rate",
232
+ impact: "medium",
233
+ effort: "low"
234
+ });
235
+ }
236
+ const staticComponentRatio = this.metrics.components.staticComponents / Math.max(this.metrics.components.renders, 1);
237
+ if (staticComponentRatio < 0.8) {
238
+ this.recommendations.push({
239
+ type: "optimization",
240
+ category: "components",
241
+ message: "More components could be optimized as static for better caching",
242
+ impact: "high",
243
+ effort: "medium"
244
+ });
245
+ }
246
+ if (this.metrics.components.memoryUsage > 100 * 1024 * 1024) {
247
+ this.recommendations.push({
248
+ type: "optimization",
249
+ category: "memory",
250
+ message: "Memory usage is high. Consider reducing cache size or implementing memory cleanup",
251
+ impact: "medium",
252
+ effort: "medium"
253
+ });
254
+ }
255
+ }
256
+ /**
257
+ * Get cache hit rate for category
258
+ */
259
+ getCacheHitRate(category) {
260
+ const metrics = this.metrics[category];
261
+ if (!metrics || !metrics.cacheHits) return 0;
262
+ const total = metrics.cacheHits + metrics.cacheMisses;
263
+ return total > 0 ? metrics.cacheHits / total * 100 : 0;
264
+ }
265
+ /**
266
+ * Update running average
267
+ */
268
+ updateAverage(current, newValue, count) {
269
+ return (current * (count - 1) + newValue) / count;
270
+ }
271
+ /**
272
+ * Add data point to history
273
+ */
274
+ addToHistory(category, data) {
275
+ if (!this.metrics[category].history) {
276
+ this.metrics[category].history = [];
277
+ }
278
+ this.metrics[category].history.push(data);
279
+ if (this.metrics[category].history.length > this.options.maxHistoryPoints) {
280
+ this.metrics[category].history = this.metrics[category].history.slice(-this.options.maxHistoryPoints);
281
+ }
282
+ }
283
+ /**
284
+ * Generate dashboard visualization
285
+ */
286
+ generateDashboard() {
287
+ const lines = [];
288
+ if (this.options.colorOutput) {
289
+ lines.push(this.colorize("\u{1F4CA} Coherent.js Performance Dashboard", "cyan"));
290
+ lines.push(this.colorize("\u2550".repeat(50), "cyan"));
291
+ } else {
292
+ lines.push("\u{1F4CA} Coherent.js Performance Dashboard");
293
+ lines.push("\u2550".repeat(50));
294
+ }
295
+ const uptime = (Date.now() - this.startTime) / 1e3;
296
+ lines.push(`\u23F1\uFE0F Uptime: ${uptime.toFixed(1)}s`);
297
+ lines.push("");
298
+ lines.push("\u{1F680} API Performance");
299
+ lines.push("\u2500".repeat(20));
300
+ const apiCacheHitRate = this.getCacheHitRate("api");
301
+ lines.push(` Requests: ${this.metrics.api.requests} (${(this.metrics.api.requests / uptime).toFixed(1)} req/s)`);
302
+ lines.push(` Avg Time: ${this.metrics.api.averageTime.toFixed(2)}ms`);
303
+ lines.push(` Cache Hit Rate: ${apiCacheHitRate.toFixed(1)}%`);
304
+ lines.push(` Static Routes: ${this.metrics.api.staticRoutes}/${this.metrics.api.requests} (${(this.metrics.api.staticRoutes / Math.max(this.metrics.api.requests, 1) * 100).toFixed(1)}%)`);
305
+ lines.push("");
306
+ lines.push("\u{1F3D7}\uFE0F Component Performance");
307
+ lines.push("\u2500".repeat(25));
308
+ const componentCacheHitRate = this.getCacheHitRate("components");
309
+ lines.push(` Renders: ${this.metrics.components.renders} (${(this.metrics.components.renders / uptime).toFixed(1)} renders/s)`);
310
+ lines.push(` Avg Time: ${this.metrics.components.averageTime.toFixed(2)}ms`);
311
+ lines.push(` Cache Hit Rate: ${componentCacheHitRate.toFixed(1)}%`);
312
+ lines.push(` Static Components: ${this.metrics.components.staticComponents}/${this.metrics.components.renders} (${(this.metrics.components.staticComponents / Math.max(this.metrics.components.renders, 1) * 100).toFixed(1)}%)`);
313
+ lines.push(` Memory Usage: ${(this.metrics.components.memoryUsage / 1024 / 1024).toFixed(1)}MB`);
314
+ lines.push("");
315
+ lines.push("\u{1F310} Full-Stack Performance");
316
+ lines.push("\u2500".repeat(26));
317
+ lines.push(` Total Requests: ${this.metrics.fullstack.totalRequests} (${(this.metrics.fullstack.totalRequests / uptime).toFixed(1)} req/s)`);
318
+ lines.push(` Avg Time: ${this.metrics.fullstack.averageTime.toFixed(2)}ms`);
319
+ lines.push(` Errors: ${this.metrics.fullstack.errors}`);
320
+ lines.push("");
321
+ if (this.alerts.length > 0) {
322
+ lines.push("\u26A0\uFE0F Performance Alerts");
323
+ lines.push("\u2500".repeat(22));
324
+ this.alerts.forEach((alert) => {
325
+ const icon = alert.type === "error" ? "\u274C" : "\u26A0\uFE0F";
326
+ lines.push(` ${icon} ${alert.message}`);
327
+ });
328
+ lines.push("");
329
+ }
330
+ if (this.recommendations.length > 0) {
331
+ lines.push("\u{1F4A1} Optimization Recommendations");
332
+ lines.push("\u2500".repeat(30));
333
+ this.recommendations.forEach((rec) => {
334
+ const impact = rec.impact === "high" ? "\u{1F525}" : rec.impact === "medium" ? "\u26A1" : "\u{1F4A4}";
335
+ lines.push(` ${impact} ${rec.message} (${rec.effort} effort)`);
336
+ });
337
+ lines.push("");
338
+ }
339
+ const score = this.calculatePerformanceScore();
340
+ const scoreColor = score >= 90 ? "green" : score >= 70 ? "yellow" : "red";
341
+ lines.push(`Performance Score: ${this.colorize(`${score.toFixed(1)}/100`, scoreColor)}`);
342
+ return lines.join("\n");
343
+ }
344
+ /**
345
+ * Calculate overall performance score
346
+ */
347
+ calculatePerformanceScore() {
348
+ let score = 100;
349
+ if (this.metrics.api.averageTime > 50) score -= 10;
350
+ if (this.metrics.api.averageTime > 100) score -= 10;
351
+ if (this.getCacheHitRate("api") < 90) score -= 10;
352
+ if (this.metrics.components.averageTime > 20) score -= 10;
353
+ if (this.metrics.components.averageTime > 50) score -= 10;
354
+ if (this.getCacheHitRate("components") < 95) score -= 10;
355
+ if (this.metrics.fullstack.errors > 0) score -= Math.min(20, this.metrics.fullstack.errors * 5);
356
+ return Math.max(0, score);
357
+ }
358
+ /**
359
+ * Add color to text
360
+ */
361
+ colorize(text, color) {
362
+ if (!this.options.colorOutput) return text;
363
+ const colors = {
364
+ black: "\x1B[30m",
365
+ red: "\x1B[31m",
366
+ green: "\x1B[32m",
367
+ yellow: "\x1B[33m",
368
+ blue: "\x1B[34m",
369
+ magenta: "\x1B[35m",
370
+ cyan: "\x1B[36m",
371
+ white: "\x1B[37m",
372
+ gray: "\x1B[90m"
373
+ };
374
+ const reset = "\x1B[0m";
375
+ return `${colors[color] || ""}${text}${reset}`;
376
+ }
377
+ /**
378
+ * Export metrics as JSON
379
+ */
380
+ exportMetrics() {
381
+ return {
382
+ timestamp: Date.now(),
383
+ uptime: Date.now() - this.startTime,
384
+ metrics: { ...this.metrics },
385
+ alerts: [...this.alerts],
386
+ recommendations: [...this.recommendations],
387
+ performanceScore: this.calculatePerformanceScore()
388
+ };
389
+ }
390
+ /**
391
+ * Reset all metrics
392
+ */
393
+ reset() {
394
+ this.metrics = {
395
+ api: { requests: 0, averageTime: 0, cacheHits: 0, cacheMisses: 0, staticRoutes: 0, dynamicRoutes: 0, history: [] },
396
+ components: { renders: 0, averageTime: 0, cacheHits: 0, cacheMisses: 0, staticComponents: 0, dynamicComponents: 0, memoryUsage: 0, history: [] },
397
+ fullstack: { totalRequests: 0, averageTime: 0, errors: 0, bottlenecks: [], history: [] }
398
+ };
399
+ this.alerts = [];
400
+ this.recommendations = [];
401
+ this.startTime = Date.now();
402
+ }
403
+ };
404
+ function createPerformanceDashboard(options = {}) {
405
+ return new PerformanceDashboard(options);
406
+ }
407
+ function showPerformanceDashboard(dashboard) {
408
+ const output = dashboard.generateDashboard();
409
+ console.log(output);
410
+ return dashboard;
411
+ }
412
+ var performance_dashboard_default = {
413
+ PerformanceDashboard,
414
+ createPerformanceDashboard,
415
+ showPerformanceDashboard
416
+ };
417
+ export {
418
+ PerformanceDashboard,
419
+ createPerformanceDashboard,
420
+ performance_dashboard_default as default,
421
+ showPerformanceDashboard
422
+ };
423
+ //# sourceMappingURL=performance-dashboard.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/performance-dashboard.js"],
4
+ "sourcesContent": ["/**\n * Performance Insights Dashboard for Coherent.js\n *\n * Provides real-time performance metrics and insights for:\n * - API routing performance (smart routing, LRU cache)\n * - Component rendering performance (caching, optimization)\n * - Full-stack request flow analysis\n *\n * @module PerformanceDashboard\n */\n\nexport class PerformanceDashboard {\n constructor(options = {}) {\n this.options = {\n updateInterval: options.updateInterval || 5000,\n maxHistoryPoints: options.maxHistoryPoints || 100,\n enableAlerts: options.enableAlerts !== false,\n enableRecommendations: options.enableRecommendations !== false,\n colorOutput: options.colorOutput !== false,\n ...options\n };\n\n this.metrics = {\n api: {\n requests: 0,\n averageTime: 0,\n cacheHits: 0,\n cacheMisses: 0,\n staticRoutes: 0,\n dynamicRoutes: 0,\n history: []\n },\n components: {\n renders: 0,\n averageTime: 0,\n cacheHits: 0,\n cacheMisses: 0,\n staticComponents: 0,\n dynamicComponents: 0,\n memoryUsage: 0,\n history: []\n },\n fullstack: {\n totalRequests: 0,\n averageTime: 0,\n errors: 0,\n bottlenecks: [],\n history: []\n }\n };\n\n this.alerts = [];\n this.recommendations = [];\n this.startTime = Date.now();\n this.updateTimer = null;\n }\n\n /**\n * Start monitoring performance\n */\n startMonitoring() {\n if (this.updateTimer) return;\n\n this.updateTimer = setInterval(() => {\n this.updateMetrics();\n this.generateAlerts();\n this.generateRecommendations();\n }, this.options.updateInterval);\n }\n\n /**\n * Stop monitoring\n */\n stopMonitoring() {\n if (this.updateTimer) {\n clearInterval(this.updateTimer);\n this.updateTimer = null;\n }\n }\n\n /**\n * Record API request metrics\n */\n recordAPIRequest(duration, routeType, cacheHit = false) {\n this.metrics.api.requests++;\n this.metrics.api.averageTime = this.updateAverage(\n this.metrics.api.averageTime,\n duration,\n this.metrics.api.requests\n );\n\n if (cacheHit) {\n this.metrics.api.cacheHits++;\n } else {\n this.metrics.api.cacheMisses++;\n }\n\n if (routeType === 'static') {\n this.metrics.api.staticRoutes++;\n } else {\n this.metrics.api.dynamicRoutes++;\n }\n\n this.addToHistory('api', {\n timestamp: Date.now(),\n duration,\n routeType,\n cacheHit\n });\n }\n\n /**\n * Record component render metrics\n */\n recordComponentRender(duration, componentType, cacheHit = false, memoryDelta = 0) {\n this.metrics.components.renders++;\n this.metrics.components.averageTime = this.updateAverage(\n this.metrics.components.averageTime,\n duration,\n this.metrics.components.renders\n );\n\n if (cacheHit) {\n this.metrics.components.cacheHits++;\n } else {\n this.metrics.components.cacheMisses++;\n }\n\n if (componentType === 'static') {\n this.metrics.components.staticComponents++;\n } else {\n this.metrics.components.dynamicComponents++;\n }\n\n this.metrics.components.memoryUsage += memoryDelta;\n\n this.addToHistory('components', {\n timestamp: Date.now(),\n duration,\n componentType,\n cacheHit,\n memoryDelta\n });\n }\n\n /**\n * Record full-stack request metrics\n */\n recordFullStackRequest(duration, error = null, bottlenecks = []) {\n this.metrics.fullstack.totalRequests++;\n this.metrics.fullstack.averageTime = this.updateAverage(\n this.metrics.fullstack.averageTime,\n duration,\n this.metrics.fullstack.totalRequests\n );\n\n if (error) {\n this.metrics.fullstack.errors++;\n }\n\n this.metrics.fullstack.bottlenecks = bottlenecks;\n\n this.addToHistory('fullstack', {\n timestamp: Date.now(),\n duration,\n error,\n bottlenecks\n });\n }\n\n /**\n * Update metrics from external sources\n */\n updateMetrics() {\n // This would integrate with actual performance monitors\n // For now, we'll simulate some metrics updates\n const now = Date.now();\n const uptime = now - this.startTime;\n\n // Calculate rates\n const apiRate = this.metrics.api.requests / (uptime / 1000);\n const componentRate = this.metrics.components.renders / (uptime / 1000);\n const fullStackRate = this.metrics.fullstack.totalRequests / (uptime / 1000);\n\n return {\n apiRate,\n componentRate,\n fullStackRate,\n uptime\n };\n }\n\n /**\n * Generate performance alerts\n */\n generateAlerts() {\n this.alerts = [];\n\n // API performance alerts\n if (this.metrics.api.averageTime > 50) {\n this.alerts.push({\n type: 'warning',\n category: 'api',\n message: `API response time is high: ${this.metrics.api.averageTime.toFixed(2)}ms`,\n threshold: 50,\n current: this.metrics.api.averageTime\n });\n }\n\n const apiCacheHitRate = this.getCacheHitRate('api');\n if (apiCacheHitRate < 80) {\n this.alerts.push({\n type: 'warning',\n category: 'api',\n message: `API cache hit rate is low: ${apiCacheHitRate.toFixed(1)}%`,\n threshold: 80,\n current: apiCacheHitRate\n });\n }\n\n // Component performance alerts\n if (this.metrics.components.averageTime > 20) {\n this.alerts.push({\n type: 'warning',\n category: 'components',\n message: `Component render time is high: ${this.metrics.components.averageTime.toFixed(2)}ms`,\n threshold: 20,\n current: this.metrics.components.averageTime\n });\n }\n\n const componentCacheHitRate = this.getCacheHitRate('components');\n if (componentCacheHitRate < 90) {\n this.alerts.push({\n type: 'warning',\n category: 'components',\n message: `Component cache hit rate is low: ${componentCacheHitRate.toFixed(1)}%`,\n threshold: 90,\n current: componentCacheHitRate\n });\n }\n\n // Full-stack alerts\n if (this.metrics.fullstack.errors > 0) {\n this.alerts.push({\n type: 'error',\n category: 'fullstack',\n message: `${this.metrics.fullstack.errors} errors detected`,\n threshold: 0,\n current: this.metrics.fullstack.errors\n });\n }\n }\n\n /**\n * Generate performance recommendations\n */\n generateRecommendations() {\n this.recommendations = [];\n\n // API recommendations\n const staticRouteRatio = this.metrics.api.staticRoutes / Math.max(this.metrics.api.requests, 1);\n if (staticRouteRatio < 0.7) {\n this.recommendations.push({\n type: 'optimization',\n category: 'api',\n message: 'Consider adding more static routes to improve smart routing efficiency',\n impact: 'high',\n effort: 'low'\n });\n }\n\n const apiCacheHitRate = this.getCacheHitRate('api');\n if (apiCacheHitRate < 90) {\n this.recommendations.push({\n type: 'optimization',\n category: 'api',\n message: 'Increase API cache size or TTL to improve cache hit rate',\n impact: 'medium',\n effort: 'low'\n });\n }\n\n // Component recommendations\n const staticComponentRatio = this.metrics.components.staticComponents / Math.max(this.metrics.components.renders, 1);\n if (staticComponentRatio < 0.8) {\n this.recommendations.push({\n type: 'optimization',\n category: 'components',\n message: 'More components could be optimized as static for better caching',\n impact: 'high',\n effort: 'medium'\n });\n }\n\n // Memory recommendations\n if (this.metrics.components.memoryUsage > 100 * 1024 * 1024) { // 100MB\n this.recommendations.push({\n type: 'optimization',\n category: 'memory',\n message: 'Memory usage is high. Consider reducing cache size or implementing memory cleanup',\n impact: 'medium',\n effort: 'medium'\n });\n }\n }\n\n /**\n * Get cache hit rate for category\n */\n getCacheHitRate(category) {\n const metrics = this.metrics[category];\n if (!metrics || !metrics.cacheHits) return 0;\n\n const total = metrics.cacheHits + metrics.cacheMisses;\n return total > 0 ? (metrics.cacheHits / total) * 100 : 0;\n }\n\n /**\n * Update running average\n */\n updateAverage(current, newValue, count) {\n return ((current * (count - 1)) + newValue) / count;\n }\n\n /**\n * Add data point to history\n */\n addToHistory(category, data) {\n if (!this.metrics[category].history) {\n this.metrics[category].history = [];\n }\n\n this.metrics[category].history.push(data);\n\n // Limit history size\n if (this.metrics[category].history.length > this.options.maxHistoryPoints) {\n this.metrics[category].history = this.metrics[category].history.slice(-this.options.maxHistoryPoints);\n }\n }\n\n /**\n * Generate dashboard visualization\n */\n generateDashboard() {\n const lines = [];\n\n if (this.options.colorOutput) {\n lines.push(this.colorize('\uD83D\uDCCA Coherent.js Performance Dashboard', 'cyan'));\n lines.push(this.colorize('\u2550'.repeat(50), 'cyan'));\n } else {\n lines.push('\uD83D\uDCCA Coherent.js Performance Dashboard');\n lines.push('\u2550'.repeat(50));\n }\n\n const uptime = (Date.now() - this.startTime) / 1000;\n lines.push(`\u23F1\uFE0F Uptime: ${uptime.toFixed(1)}s`);\n lines.push('');\n\n // API Performance Section\n lines.push('\uD83D\uDE80 API Performance');\n lines.push('\u2500'.repeat(20));\n const apiCacheHitRate = this.getCacheHitRate('api');\n lines.push(` Requests: ${this.metrics.api.requests} (${(this.metrics.api.requests / uptime).toFixed(1)} req/s)`);\n lines.push(` Avg Time: ${this.metrics.api.averageTime.toFixed(2)}ms`);\n lines.push(` Cache Hit Rate: ${apiCacheHitRate.toFixed(1)}%`);\n lines.push(` Static Routes: ${this.metrics.api.staticRoutes}/${this.metrics.api.requests} (${((this.metrics.api.staticRoutes / Math.max(this.metrics.api.requests, 1)) * 100).toFixed(1)}%)`);\n lines.push('');\n\n // Component Performance Section\n lines.push('\uD83C\uDFD7\uFE0F Component Performance');\n lines.push('\u2500'.repeat(25));\n const componentCacheHitRate = this.getCacheHitRate('components');\n lines.push(` Renders: ${this.metrics.components.renders} (${(this.metrics.components.renders / uptime).toFixed(1)} renders/s)`);\n lines.push(` Avg Time: ${this.metrics.components.averageTime.toFixed(2)}ms`);\n lines.push(` Cache Hit Rate: ${componentCacheHitRate.toFixed(1)}%`);\n lines.push(` Static Components: ${this.metrics.components.staticComponents}/${this.metrics.components.renders} (${((this.metrics.components.staticComponents / Math.max(this.metrics.components.renders, 1)) * 100).toFixed(1)}%)`);\n lines.push(` Memory Usage: ${(this.metrics.components.memoryUsage / 1024 / 1024).toFixed(1)}MB`);\n lines.push('');\n\n // Full-Stack Performance Section\n lines.push('\uD83C\uDF10 Full-Stack Performance');\n lines.push('\u2500'.repeat(26));\n lines.push(` Total Requests: ${this.metrics.fullstack.totalRequests} (${(this.metrics.fullstack.totalRequests / uptime).toFixed(1)} req/s)`);\n lines.push(` Avg Time: ${this.metrics.fullstack.averageTime.toFixed(2)}ms`);\n lines.push(` Errors: ${this.metrics.fullstack.errors}`);\n lines.push('');\n\n // Alerts Section\n if (this.alerts.length > 0) {\n lines.push('\u26A0\uFE0F Performance Alerts');\n lines.push('\u2500'.repeat(22));\n this.alerts.forEach(alert => {\n const icon = alert.type === 'error' ? '\u274C' : '\u26A0\uFE0F';\n lines.push(` ${icon} ${alert.message}`);\n });\n lines.push('');\n }\n\n // Recommendations Section\n if (this.recommendations.length > 0) {\n lines.push('\uD83D\uDCA1 Optimization Recommendations');\n lines.push('\u2500'.repeat(30));\n this.recommendations.forEach(rec => {\n const impact = rec.impact === 'high' ? '\uD83D\uDD25' : rec.impact === 'medium' ? '\u26A1' : '\uD83D\uDCA4';\n lines.push(` ${impact} ${rec.message} (${rec.effort} effort)`);\n });\n lines.push('');\n }\n\n // Performance Score\n const score = this.calculatePerformanceScore();\n const scoreColor = score >= 90 ? 'green' : score >= 70 ? 'yellow' : 'red';\n lines.push(`Performance Score: ${this.colorize(`${score.toFixed(1)}/100`, scoreColor)}`);\n\n return lines.join('\\n');\n }\n\n /**\n * Calculate overall performance score\n */\n calculatePerformanceScore() {\n let score = 100;\n\n // API performance factors\n if (this.metrics.api.averageTime > 50) score -= 10;\n if (this.metrics.api.averageTime > 100) score -= 10;\n if (this.getCacheHitRate('api') < 90) score -= 10;\n\n // Component performance factors\n if (this.metrics.components.averageTime > 20) score -= 10;\n if (this.metrics.components.averageTime > 50) score -= 10;\n if (this.getCacheHitRate('components') < 95) score -= 10;\n\n // Error penalty\n if (this.metrics.fullstack.errors > 0) score -= Math.min(20, this.metrics.fullstack.errors * 5);\n\n return Math.max(0, score);\n }\n\n /**\n * Add color to text\n */\n colorize(text, color) {\n if (!this.options.colorOutput) return text;\n\n const colors = {\n black: '\\x1b[30m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m',\n gray: '\\x1b[90m'\n };\n\n const reset = '\\x1b[0m';\n return `${colors[color] || ''}${text}${reset}`;\n }\n\n /**\n * Export metrics as JSON\n */\n exportMetrics() {\n return {\n timestamp: Date.now(),\n uptime: Date.now() - this.startTime,\n metrics: { ...this.metrics },\n alerts: [...this.alerts],\n recommendations: [...this.recommendations],\n performanceScore: this.calculatePerformanceScore()\n };\n }\n\n /**\n * Reset all metrics\n */\n reset() {\n this.metrics = {\n api: { requests: 0, averageTime: 0, cacheHits: 0, cacheMisses: 0, staticRoutes: 0, dynamicRoutes: 0, history: [] },\n components: { renders: 0, averageTime: 0, cacheHits: 0, cacheMisses: 0, staticComponents: 0, dynamicComponents: 0, memoryUsage: 0, history: [] },\n fullstack: { totalRequests: 0, averageTime: 0, errors: 0, bottlenecks: [], history: [] }\n };\n this.alerts = [];\n this.recommendations = [];\n this.startTime = Date.now();\n }\n}\n\n/**\n * Create a performance dashboard\n */\nexport function createPerformanceDashboard(options = {}) {\n return new PerformanceDashboard(options);\n}\n\n/**\n * Get dashboard and print to console\n */\nexport function showPerformanceDashboard(dashboard) {\n const output = dashboard.generateDashboard();\n console.log(output);\n return dashboard;\n}\n\nexport default {\n PerformanceDashboard,\n createPerformanceDashboard,\n showPerformanceDashboard\n};\n"],
5
+ "mappings": ";AAWO,IAAM,uBAAN,MAA2B;AAAA,EAChC,YAAY,UAAU,CAAC,GAAG;AACxB,SAAK,UAAU;AAAA,MACb,gBAAgB,QAAQ,kBAAkB;AAAA,MAC1C,kBAAkB,QAAQ,oBAAoB;AAAA,MAC9C,cAAc,QAAQ,iBAAiB;AAAA,MACvC,uBAAuB,QAAQ,0BAA0B;AAAA,MACzD,aAAa,QAAQ,gBAAgB;AAAA,MACrC,GAAG;AAAA,IACL;AAEA,SAAK,UAAU;AAAA,MACb,KAAK;AAAA,QACH,UAAU;AAAA,QACV,aAAa;AAAA,QACb,WAAW;AAAA,QACX,aAAa;AAAA,QACb,cAAc;AAAA,QACd,eAAe;AAAA,QACf,SAAS,CAAC;AAAA,MACZ;AAAA,MACA,YAAY;AAAA,QACV,SAAS;AAAA,QACT,aAAa;AAAA,QACb,WAAW;AAAA,QACX,aAAa;AAAA,QACb,kBAAkB;AAAA,QAClB,mBAAmB;AAAA,QACnB,aAAa;AAAA,QACb,SAAS,CAAC;AAAA,MACZ;AAAA,MACA,WAAW;AAAA,QACT,eAAe;AAAA,QACf,aAAa;AAAA,QACb,QAAQ;AAAA,QACR,aAAa,CAAC;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aAAa,GAAG,QAAQ,GAAG,aAAa,CAAC,GAAG,SAAS,CAAC,EAAE;AAAA,IACzF;AACA,SAAK,SAAS,CAAC;AACf,SAAK,kBAAkB,CAAC;AACxB,SAAK,YAAY,KAAK,IAAI;AAAA,EAC5B;AACF;AAKO,SAAS,2BAA2B,UAAU,CAAC,GAAG;AACvD,SAAO,IAAI,qBAAqB,OAAO;AACzC;AAKO,SAAS,yBAAyB,WAAW;AAClD,QAAM,SAAS,UAAU,kBAAkB;AAC3C,UAAQ,IAAI,MAAM;AAClB,SAAO;AACT;AAEA,IAAO,gCAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coherent.js/devtools",
3
- "version": "1.0.0-beta.8",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "Developer tools for Coherent.js applications - tree-shakable modular exports",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,6 +17,26 @@
17
17
  "require": "./dist/component-visualizer.cjs"
18
18
  },
19
19
  "./performance": {
20
+ "development": "./src/performance/index.js",
21
+ "import": "./dist/performance/index.js",
22
+ "require": "./dist/performance/index.cjs"
23
+ },
24
+ "./performance/cache": {
25
+ "development": "./src/performance/cache.js",
26
+ "import": "./dist/performance/cache.js",
27
+ "require": "./dist/performance/cache.cjs"
28
+ },
29
+ "./performance/code-splitting": {
30
+ "development": "./src/performance/code-splitting.js",
31
+ "import": "./dist/performance/code-splitting.js",
32
+ "require": "./dist/performance/code-splitting.cjs"
33
+ },
34
+ "./performance/lazy-loading": {
35
+ "development": "./src/performance/lazy-loading.js",
36
+ "import": "./dist/performance/lazy-loading.js",
37
+ "require": "./dist/performance/lazy-loading.cjs"
38
+ },
39
+ "./performance/dashboard": {
20
40
  "development": "./src/performance-dashboard.js",
21
41
  "import": "./dist/performance-dashboard.js",
22
42
  "require": "./dist/performance-dashboard.cjs"
@@ -65,7 +85,7 @@
65
85
  "author": "Coherent.js Team",
66
86
  "license": "MIT",
67
87
  "peerDependencies": {
68
- "@coherent.js/core": "1.0.0-beta.8"
88
+ "@coherent.js/core": "1.0.0-rc.2"
69
89
  },
70
90
  "repository": {
71
91
  "type": "git",
@@ -79,7 +99,7 @@
79
99
  "access": "public"
80
100
  },
81
101
  "engines": {
82
- "node": ">=20.0.0"
102
+ "node": ">=22.0.0"
83
103
  },
84
104
  "sideEffects": false,
85
105
  "scripts": {