@concavejs/devtools 0.0.1-alpha.14 → 0.0.1-alpha.16
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/README.md +23 -7
- package/dist/{client-Bnix0wGg.js → client-C-ZM0PBC.js} +1371 -1224
- package/dist/client.js +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/interceptor/index.d.ts +2 -2
- package/dist/interceptor/websocket-interceptor.d.ts +1 -1
- package/dist/overlay/PerformancePanel.d.ts +2 -1
- package/dist/store/event-store.d.ts +42 -2
- package/package.json +3 -3
package/dist/client.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Client-side development tools for Convex/Concave applications
|
|
5
5
|
*/
|
|
6
|
-
export type { DevToolsEvent, QueryEvent, MutationEvent, ActionEvent, SubscriptionEvent, LogEvent, AuthEvent, ActiveSubscription, PerformanceMetrics, EventType, EventStatus, SubscriptionStatus, } from "./types";
|
|
7
|
-
export { EventStore, getGlobalEventStore } from "./store/event-store";
|
|
8
|
-
export type { EventListener, StoreSnapshot,
|
|
9
|
-
export { WebSocketInterceptor } from "./interceptor/websocket-interceptor";
|
|
6
|
+
export type { DevToolsEvent, QueryEvent, MutationEvent, ActionEvent, SubscriptionEvent, LogEvent, AuthEvent, ActiveSubscription, PerformanceMetrics, EventType, EventStatus, SubscriptionStatus, } from "./types.js";
|
|
7
|
+
export { EventStore, getGlobalEventStore } from "./store/event-store.js";
|
|
8
|
+
export type { BatchListener, EventListener, ExportedSession, FunctionStats, StoreSnapshot, } from "./store/event-store.js";
|
|
9
|
+
export { WebSocketInterceptor } from "./interceptor/websocket-interceptor.js";
|
|
10
10
|
export { DevToolbar } from "./overlay/DevToolbar";
|
|
11
11
|
export { SubscriptionsPanel } from "./overlay/SubscriptionsPanel";
|
|
12
12
|
export { PerformancePanel } from "./overlay/PerformancePanel";
|
|
@@ -14,5 +14,5 @@ export { LogsPanel } from "./overlay/LogsPanel";
|
|
|
14
14
|
export { SettingsPanel } from "./overlay/SettingsPanel";
|
|
15
15
|
export { DataInspector } from "./overlay/DataInspector";
|
|
16
16
|
export { initDevTools } from "./client";
|
|
17
|
-
export { default as concaveDevTools } from "./vite-plugin/index";
|
|
18
|
-
export type { DevToolsOptions } from "./vite-plugin/index";
|
|
17
|
+
export { default as concaveDevTools } from "./vite-plugin/index.js";
|
|
18
|
+
export type { DevToolsOptions } from "./vite-plugin/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as k, D as L, E as A, L as D, P as C, a as x, S as Q, g as R, i as $ } from "./client-
|
|
1
|
+
import { b as k, D as L, E as A, L as D, P as C, a as x, S as Q, g as R, i as $ } from "./client-C-ZM0PBC.js";
|
|
2
2
|
import { concaveDevTools as O } from "./vite-plugin.js";
|
|
3
3
|
function q(c) {
|
|
4
4
|
const e = c.split(".");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WebSocket Interceptor exports
|
|
3
3
|
*/
|
|
4
|
-
export { WebSocketInterceptor } from "./websocket-interceptor";
|
|
5
|
-
export { getGlobalEventStore } from "../store/event-store";
|
|
4
|
+
export { WebSocketInterceptor } from "./websocket-interceptor.js";
|
|
5
|
+
export { getGlobalEventStore } from "../store/event-store.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Intercepts WebSocket messages to capture queries, mutations, actions, subscriptions,
|
|
5
5
|
* and authentication protocol events.
|
|
6
6
|
*/
|
|
7
|
-
import type { EventStore } from "../store/event-store";
|
|
7
|
+
import type { EventStore } from "../store/event-store.js";
|
|
8
8
|
export declare class WebSocketInterceptor {
|
|
9
9
|
private eventStore;
|
|
10
10
|
private originalWebSocket;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Performance Panel - Shows performance metrics with sparkline trends
|
|
2
|
+
* Performance Panel - Shows performance metrics with sparkline trends,
|
|
3
|
+
* percentile tables, per-function breakdown, and slowest operations.
|
|
3
4
|
*/
|
|
4
5
|
import type { EventStore } from "../store/event-store";
|
|
5
6
|
interface PerformancePanelProps {
|
|
@@ -4,10 +4,27 @@
|
|
|
4
4
|
* Maintains a circular buffer of events captured from WebSocket interception
|
|
5
5
|
* with persistence, export/import, and time-travel capabilities
|
|
6
6
|
*/
|
|
7
|
-
import type { DevToolsEvent, ActiveSubscription, PerformanceMetrics } from "../types";
|
|
7
|
+
import type { DevToolsEvent, ActiveSubscription, PerformanceMetrics } from "../types.js";
|
|
8
8
|
export type EventListener = (event: DevToolsEvent) => void;
|
|
9
|
+
export type BatchListener = (events: DevToolsEvent[]) => void;
|
|
9
10
|
export type FocusListener = (eventId: string | null) => void;
|
|
10
11
|
export type SettingsListener = (settings: DevToolsSettings) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Per-function aggregate statistics for the performance panel.
|
|
14
|
+
*/
|
|
15
|
+
export interface FunctionStats {
|
|
16
|
+
udfPath: string;
|
|
17
|
+
type: "query" | "mutation" | "action";
|
|
18
|
+
calls: number;
|
|
19
|
+
errors: number;
|
|
20
|
+
/** Percentage in [0, 100]. */
|
|
21
|
+
errorRate: number;
|
|
22
|
+
avgDuration: number;
|
|
23
|
+
p50Duration: number;
|
|
24
|
+
p95Duration: number;
|
|
25
|
+
maxDuration: number;
|
|
26
|
+
lastInvoked: number;
|
|
27
|
+
}
|
|
11
28
|
export interface DevToolsSettings {
|
|
12
29
|
persistEvents: boolean;
|
|
13
30
|
maxEvents: number;
|
|
@@ -40,6 +57,10 @@ export declare class EventStore {
|
|
|
40
57
|
private events;
|
|
41
58
|
private maxEvents;
|
|
42
59
|
private listeners;
|
|
60
|
+
private batchListeners;
|
|
61
|
+
private pendingBatch;
|
|
62
|
+
private batchTimer;
|
|
63
|
+
private eventsSnapshot;
|
|
43
64
|
private focusListeners;
|
|
44
65
|
private settingsListeners;
|
|
45
66
|
private subscriptions;
|
|
@@ -61,10 +82,21 @@ export declare class EventStore {
|
|
|
61
82
|
* Add an event to the store
|
|
62
83
|
*/
|
|
63
84
|
addEvent(event: DevToolsEvent): void;
|
|
85
|
+
/**
|
|
86
|
+
* Notify per-event listeners immediately and enqueue for batched listeners.
|
|
87
|
+
*/
|
|
88
|
+
private emit;
|
|
89
|
+
private flushBatch;
|
|
64
90
|
/**
|
|
65
91
|
* Subscribe to new events
|
|
66
92
|
*/
|
|
67
93
|
subscribe(listener: EventListener): () => void;
|
|
94
|
+
/**
|
|
95
|
+
* Subscribe to events in coalesced batches (at most one delivery per
|
|
96
|
+
* ~80ms window). Prefer this for UI rendering: per-event subscriptions
|
|
97
|
+
* re-render once per event, which is too often for chatty apps.
|
|
98
|
+
*/
|
|
99
|
+
subscribeBatched(listener: BatchListener): () => void;
|
|
68
100
|
/**
|
|
69
101
|
* Subscribe to focus/navigation changes across panels
|
|
70
102
|
*/
|
|
@@ -82,7 +114,9 @@ export declare class EventStore {
|
|
|
82
114
|
*/
|
|
83
115
|
getFocusedEventId(): string | null;
|
|
84
116
|
/**
|
|
85
|
-
* Get all events
|
|
117
|
+
* Get all events. The returned array is cached until the store changes,
|
|
118
|
+
* so repeated calls between updates are free and referentially stable
|
|
119
|
+
* (safe for React dependency comparisons).
|
|
86
120
|
*/
|
|
87
121
|
getAllEvents(): DevToolsEvent[];
|
|
88
122
|
/**
|
|
@@ -109,6 +143,12 @@ export declare class EventStore {
|
|
|
109
143
|
* Calculate performance metrics
|
|
110
144
|
*/
|
|
111
145
|
getPerformanceMetrics(): PerformanceMetrics;
|
|
146
|
+
/**
|
|
147
|
+
* Per-function aggregates over the recorded events, sorted by call count.
|
|
148
|
+
* Pending operations are excluded; errors count toward calls and errorRate
|
|
149
|
+
* but not toward duration percentiles (no meaningful duration).
|
|
150
|
+
*/
|
|
151
|
+
getFunctionStats(): FunctionStats[];
|
|
112
152
|
/**
|
|
113
153
|
* Clear all events
|
|
114
154
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@concavejs/devtools",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.16",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"type-check": "tsc --noEmit"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@concavejs/brand": "0.0.1-alpha.
|
|
42
|
-
"@concavejs/core": "0.0.1-alpha.
|
|
41
|
+
"@concavejs/brand": "0.0.1-alpha.15",
|
|
42
|
+
"@concavejs/core": "0.0.1-alpha.15"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "^18.0.0",
|