@zerotal/devtools 1.8.1 → 1.10.0
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/CHANGELOG.md +10 -0
- package/api-surface.md +9 -19
- package/package.json +3 -3
- package/src/DevtoolsInjectionMiddleware.ts +3 -0
- package/src/TraceStore.ts +3 -3
- package/src/client/index.ts +3 -3
- package/src/redaction.ts +5 -3
- package/src/tracing.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ follows the Zerotal monorepo's unified versioning.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.9.0] — 2026-08-29
|
|
12
|
+
|
|
13
|
+
### Documented
|
|
14
|
+
|
|
15
|
+
- **Every promised export is documented.** The `docs-coverage` gate reads `maturity: stable` as a
|
|
16
|
+
promise about a package's exports, and measures how much of that promise is written down. It
|
|
17
|
+
was 798 gaps across the suite; it is now zero. This package's share is covered on its own
|
|
18
|
+
pages — types named, options shapes described, and the decisions behind them recorded where
|
|
19
|
+
somebody looking for them will find them.
|
|
20
|
+
|
|
11
21
|
## [1.8.1] — 2026-08-26
|
|
12
22
|
|
|
13
23
|
### Fixed
|
package/api-surface.md
CHANGED
|
@@ -45,10 +45,6 @@ class TraceStore = {
|
|
|
45
45
|
subscribe: (fn: Subscriber) => () => void
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const traceSink = TraceSink
|
|
49
|
-
|
|
50
|
-
function attributeBindings = (sql: string, count: number) => Array<string | undefined>
|
|
51
|
-
|
|
52
48
|
function DevtoolsConfig = (options?: Partial<DevtoolsConfigShape>) => DevtoolsConfigShape
|
|
53
49
|
|
|
54
50
|
function devtoolsEnabled = () => boolean
|
|
@@ -61,10 +57,6 @@ function redactCacheKey = (key: string, options?: RedactionOptions) => string
|
|
|
61
57
|
|
|
62
58
|
function redactValue = (value: unknown, options?: RedactionOptions) => unknown
|
|
63
59
|
|
|
64
|
-
function startDevtoolsStream = () => () => void
|
|
65
|
-
|
|
66
|
-
function traceChannels = () => TraceChannelDescriptor[]
|
|
67
|
-
|
|
68
60
|
function traceStore = () => TraceStore
|
|
69
61
|
|
|
70
62
|
interface AuthInfo = {
|
|
@@ -94,8 +86,6 @@ interface DevtoolsConfigShape = {
|
|
|
94
86
|
redact: RedactionOptions
|
|
95
87
|
}
|
|
96
88
|
|
|
97
|
-
interface DevtoolsInjectionOptions = {}
|
|
98
|
-
|
|
99
89
|
interface DevtoolsPanelPlugin = {
|
|
100
90
|
badge?: () => number | string | undefined
|
|
101
91
|
id: string
|
|
@@ -151,9 +141,9 @@ interface QuerySpan = {
|
|
|
151
141
|
}
|
|
152
142
|
|
|
153
143
|
interface RedactionOptions = {
|
|
154
|
-
allow?: string[]
|
|
155
|
-
deny?: string[]
|
|
156
|
-
enabled?: boolean
|
|
144
|
+
allow?: string[] | undefined
|
|
145
|
+
deny?: string[] | undefined
|
|
146
|
+
enabled?: boolean | undefined
|
|
157
147
|
}
|
|
158
148
|
|
|
159
149
|
interface RequestTrace = {
|
|
@@ -228,9 +218,9 @@ interface TraceSink = {
|
|
|
228
218
|
}
|
|
229
219
|
|
|
230
220
|
interface TraceStoreOptions = {
|
|
231
|
-
capacity?: number
|
|
232
|
-
dbPath?: string | null
|
|
233
|
-
pruneHours?: number
|
|
221
|
+
capacity?: number | undefined
|
|
222
|
+
dbPath?: string | null | undefined
|
|
223
|
+
pruneHours?: number | undefined
|
|
234
224
|
}
|
|
235
225
|
|
|
236
226
|
type DevtoolsGate = (request: Request) => boolean | Promise<boolean>
|
|
@@ -262,9 +252,9 @@ function traceGroupKey = (trace: RequestTrace, channels: TraceChannelDescriptor[
|
|
|
262
252
|
function traceMatches = (trace: RequestTrace, query: string, f: Facets) => boolean
|
|
263
253
|
|
|
264
254
|
interface DevtoolsClientOptions = {
|
|
265
|
-
endpoint?: string
|
|
266
|
-
mode?: 'floating' | 'standalone'
|
|
267
|
-
mount?: HTMLElement
|
|
255
|
+
endpoint?: string | undefined
|
|
256
|
+
mode?: 'floating' | 'standalone' | undefined
|
|
257
|
+
mount?: HTMLElement | undefined
|
|
268
258
|
}
|
|
269
259
|
|
|
270
260
|
interface DevtoolsPanelPlugin = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/devtools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"typecheck": "tsc --noEmit"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@zerotal/core": "1.
|
|
34
|
+
"@zerotal/core": "1.10.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"typescript": "^5.8.0",
|
|
38
|
-
"@zerotal/orm": "1.
|
|
38
|
+
"@zerotal/orm": "1.10.0"
|
|
39
39
|
},
|
|
40
40
|
"description": "In-browser developer tools for Zerotal — request traces, an inspector panel, and an extensible tab registry.",
|
|
41
41
|
"keywords": [
|
|
@@ -43,6 +43,7 @@ async function _buildDashboardJs(): Promise<string> {
|
|
|
43
43
|
return _dashboardJs;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/** @internal */
|
|
46
47
|
export interface DevtoolsInjectionOptions {
|
|
47
48
|
// reserved for future use
|
|
48
49
|
}
|
|
@@ -102,6 +103,8 @@ const SSE_HEARTBEAT_MS = 25_000;
|
|
|
102
103
|
* built the one the app's config asks for.
|
|
103
104
|
*
|
|
104
105
|
* @returns A disposer that unsubscribes and closes connected clients.
|
|
106
|
+
*
|
|
107
|
+
* @internal
|
|
105
108
|
*/
|
|
106
109
|
export function startDevtoolsStream(): () => void {
|
|
107
110
|
const unsubscribe = traceStore().subscribe((trace) => {
|
package/src/TraceStore.ts
CHANGED
|
@@ -16,11 +16,11 @@ interface Db {
|
|
|
16
16
|
|
|
17
17
|
export interface TraceStoreOptions {
|
|
18
18
|
/** How many traces to keep in memory and load back on open. */
|
|
19
|
-
capacity?: number;
|
|
19
|
+
capacity?: number | undefined;
|
|
20
20
|
/** SQLite file backing the history. Pass `null` to keep traces in memory only. */
|
|
21
|
-
dbPath?: string | null;
|
|
21
|
+
dbPath?: string | null | undefined;
|
|
22
22
|
/** How long a persisted trace survives, in hours. */
|
|
23
|
-
pruneHours?: number;
|
|
23
|
+
pruneHours?: number | undefined;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
package/src/client/index.ts
CHANGED
|
@@ -33,7 +33,7 @@ import { timelineTab } from "./tabs/timeline.ts";
|
|
|
33
33
|
|
|
34
34
|
export interface DevtoolsClientOptions {
|
|
35
35
|
/** Base URL path for the devtools API. Default: '/__zerotal/devtools' */
|
|
36
|
-
endpoint?: string;
|
|
36
|
+
endpoint?: string | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* How the panel is mounted.
|
|
39
39
|
*
|
|
@@ -42,9 +42,9 @@ export interface DevtoolsClientOptions {
|
|
|
42
42
|
* inspector dashboard. Both run the same renderers, so a tab added for one
|
|
43
43
|
* exists in the other.
|
|
44
44
|
*/
|
|
45
|
-
mode?: "floating" | "standalone";
|
|
45
|
+
mode?: "floating" | "standalone" | undefined;
|
|
46
46
|
/** Element to mount into. Defaults to `document.body`. */
|
|
47
|
-
mount?: HTMLElement;
|
|
47
|
+
mount?: HTMLElement | undefined;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
package/src/redaction.ts
CHANGED
|
@@ -31,17 +31,17 @@ export interface RedactionOptions {
|
|
|
31
31
|
* Turn masking off entirely. Only reasonable when you are debugging the values
|
|
32
32
|
* themselves and nothing sensitive is in the database.
|
|
33
33
|
*/
|
|
34
|
-
enabled?: boolean;
|
|
34
|
+
enabled?: boolean | undefined;
|
|
35
35
|
/**
|
|
36
36
|
* Names whose values are safe to show in full. Matched case-insensitively
|
|
37
37
|
* against the column a binding belongs to, a channel entry's field name, or a
|
|
38
38
|
* cache key's segment.
|
|
39
39
|
*/
|
|
40
|
-
allow?: string[];
|
|
40
|
+
allow?: string[] | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* Extra names to mask, added to the built-in list.
|
|
43
43
|
*/
|
|
44
|
-
deny?: string[];
|
|
44
|
+
deny?: string[] | undefined;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -247,6 +247,8 @@ export function redactBindings(
|
|
|
247
247
|
* `SET col = ?`, and `WHERE col <op> ?` (including `IN (?, ?)`, where every
|
|
248
248
|
* placeholder belongs to the same column). Returns `undefined` at any position it
|
|
249
249
|
* cannot attribute.
|
|
250
|
+
*
|
|
251
|
+
* @internal
|
|
250
252
|
*/
|
|
251
253
|
export function attributeBindings(sql: string, count: number): Array<string | undefined> {
|
|
252
254
|
const out: Array<string | undefined> = new Array(count).fill(undefined);
|
package/src/tracing.ts
CHANGED
|
@@ -99,6 +99,8 @@ const _channels = new Map<string, TraceChannelDescriptor>();
|
|
|
99
99
|
*
|
|
100
100
|
* A `hidden` channel is left out: its entries are still recorded and still reach
|
|
101
101
|
* the panel on the trace, but whatever renders them is not this generic row list.
|
|
102
|
+
*
|
|
103
|
+
* @internal
|
|
102
104
|
*/
|
|
103
105
|
export function traceChannels(): TraceChannelDescriptor[] {
|
|
104
106
|
return [...(_channels.values() as Iterable<TraceChannelDescriptor>)]
|
|
@@ -199,6 +201,7 @@ export interface TraceSink {
|
|
|
199
201
|
// nothing: by the time a panel draws a row, the unredacted copy has already been
|
|
200
202
|
// streamed to the browser and written to `.zerotal/devtools.sqlite`, where it
|
|
201
203
|
// sits for a day. The sink is the last point where "not recorded" is still true.
|
|
204
|
+
/** @internal */
|
|
202
205
|
export const traceSink: TraceSink = {
|
|
203
206
|
channel(descriptor: TraceChannelDescriptor): void {
|
|
204
207
|
_channels.set(descriptor.id, descriptor);
|