vite-devtools-svelte 0.4.1 → 0.6.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/README.md +19 -7
- package/dist/analyzers/api.d.ts +17 -4
- package/dist/analyzers/assets.d.ts +0 -1
- package/dist/analyzers/build.d.ts +7 -1
- package/dist/analyzers/http.d.ts +9 -0
- package/dist/analyzers/module-graph.d.ts +9 -0
- package/dist/analyzers/og.d.ts +21 -4
- package/dist/analyzers/routes.d.ts +16 -1
- package/dist/client/assets/ApiPlayground-qRDX0tRk.js +3 -0
- package/dist/client/assets/Assets-yTFLB7w2.js +1 -0
- package/dist/client/assets/BuildAnalysis-C6yO6EJN.js +1 -0
- package/dist/client/assets/CaptureNotice-DykEK0Kp.js +1 -0
- package/dist/client/assets/Components-BTG8jKec.js +2 -0
- package/dist/client/assets/DataTable-C5C0HrMd.js +1 -0
- package/dist/client/assets/DataTable-gMBzprA7.css +1 -0
- package/dist/client/assets/ErrorDashboard-DHdptxQP.js +1 -0
- package/dist/client/assets/FpsMonitor-G1xRBjK3.js +1 -0
- package/dist/client/assets/Inspect-Ba_b5o73.js +4 -0
- package/dist/client/assets/{Inspector-DGmAzhki.js → Inspector-mTvtYmwt.js} +1 -1
- package/dist/client/assets/{versions-Co596WUJ.css → LiveControls-CMau2xlU.css} +1 -1
- package/dist/client/assets/LiveControls-nrc1-cBk.js +1 -0
- package/dist/client/assets/LoadProfiler-eYXaLPba.js +1 -0
- package/dist/client/assets/ModuleGraph-Dp-bJUnD.js +1 -0
- package/dist/client/assets/OGPreview-BzZ_MAg7.js +1 -0
- package/dist/client/assets/Overview-Cbi5ayT1.js +1 -0
- package/dist/client/assets/Overview-Neh721Uf.css +1 -0
- package/dist/client/assets/Panel-CKQaY_Qq.js +1 -0
- package/dist/client/assets/Panel-b1jDvzob.css +1 -0
- package/dist/client/assets/ReactiveGraph-CQpsrwa7.js +19 -0
- package/dist/client/assets/RenderProfiler-CCG8KJ2a.js +1 -0
- package/dist/client/assets/Routes-Dg3ZrLhJ.js +1 -0
- package/dist/client/assets/SearchField-B5EQ5IIf.js +1 -0
- package/dist/client/assets/Segmented-Dz1OdcPr.js +1 -0
- package/dist/client/assets/SplitView-CxRUXpY5.js +1 -0
- package/dist/client/assets/StateTimeline-CLt2yN8k.js +1 -0
- package/dist/client/assets/TreeView-BYOJBzxO.js +1 -0
- package/dist/client/assets/VirtualList-Bfn8is0p.js +1 -0
- package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-D9g7mT9G.js → browser-agent-rpc-BXhoSh1z-CuoUGU_3.js} +1 -1
- package/dist/client/assets/capture.svelte-BLIttZ2Z.js +1 -0
- package/dist/client/assets/collections-uqk9p1aQ.js +1 -0
- package/dist/client/assets/format-BEILGi1v.js +1 -0
- package/dist/client/assets/{index-eZHqMk0z.css → index-BmEfdt6W.css} +1 -1
- package/dist/client/assets/{index-BzMw8R8l.js → index-Cf5oAFpK.js} +6 -6
- package/dist/client/assets/{reactive-C2hv2QLH.js → reactive-DuxZv-g7.js} +1 -1
- package/dist/client/assets/reactive-selection.svelte-iv05jhlt.js +1 -0
- package/dist/client/assets/versions-Bd19hz8p.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/index.mjs +1655 -1353
- package/dist/index.mjs.map +1 -1
- package/dist/mcp/issues.d.ts +19 -6
- package/dist/mcp/server.d.ts +0 -5
- package/dist/mcp/sessions.d.ts +8 -1
- package/dist/plugin.d.ts +20 -0
- package/dist/runtime/ids.d.ts +3 -0
- package/dist/runtime/index.d.ts +18 -0
- package/dist/runtime/transform.d.ts +22 -0
- package/dist/{collector.d.ts → server/collector.d.ts} +11 -16
- package/dist/{devframe.d.ts → server/devframe.d.ts} +10 -10
- package/dist/{mount.d.ts → server/mount.d.ts} +4 -9
- package/dist/{security.d.ts → server/security.d.ts} +10 -2
- package/dist/types.d.ts +26 -2
- package/package.json +12 -4
- package/skills/vite-devtools-svelte-perf-audit/SKILL.md +2 -2
- package/skills/vite-devtools-svelte-perf-fix/SKILL.md +3 -3
- package/dist/client/assets/ApiPlayground-BMx5j-7t.js +0 -3
- package/dist/client/assets/Assets-BHhg5Smm.js +0 -1
- package/dist/client/assets/Badge-BBLKgCiU.css +0 -1
- package/dist/client/assets/Badge-CBVv8IFU.js +0 -1
- package/dist/client/assets/BuildAnalysis-BdVCnWpb.js +0 -1
- package/dist/client/assets/CaptureNotice-BeXCVhO0.js +0 -1
- package/dist/client/assets/Components-D_qDgEUt.js +0 -1
- package/dist/client/assets/DataTable-C6-tmcTQ.js +0 -1
- package/dist/client/assets/DataTable-CdVIFm8T.css +0 -1
- package/dist/client/assets/ErrorDashboard-CfUhPzue.js +0 -1
- package/dist/client/assets/FpsMonitor-B_AuHgyu.js +0 -1
- package/dist/client/assets/Inspect-BOgmKm6W.js +0 -3
- package/dist/client/assets/LoadProfiler-5xhnDLjR.js +0 -1
- package/dist/client/assets/ModuleGraph-Cp7f0Nz0.js +0 -1
- package/dist/client/assets/OGPreview-CjBhXSgn.js +0 -1
- package/dist/client/assets/Overview-B8hvIsIM.css +0 -1
- package/dist/client/assets/Overview-Kbpkgsas.js +0 -1
- package/dist/client/assets/ReactiveGraph-w2TK82c8.js +0 -5
- package/dist/client/assets/RenderProfiler-CeF8_j3b.js +0 -1
- package/dist/client/assets/Routes-DArWZtzC.js +0 -1
- package/dist/client/assets/SearchField-eocQu1eB.js +0 -1
- package/dist/client/assets/Segmented-JGNuI5EZ.js +0 -1
- package/dist/client/assets/SplitView-B8lYXXEm.js +0 -1
- package/dist/client/assets/StateTimeline-HpyvgoK1.js +0 -1
- package/dist/client/assets/TreeView-fty5aCC5.js +0 -1
- package/dist/client/assets/VirtualList-BvOBTnYJ.js +0 -1
- package/dist/client/assets/capture.svelte-CUhwdJwX.js +0 -1
- package/dist/client/assets/format-CW_NXiBg.js +0 -1
- package/dist/client/assets/reactive-selection.svelte-Dfd9zWsh.js +0 -1
- package/dist/client/assets/versions-CZjRj40E.js +0 -1
- package/dist/runtime.d.ts +0 -19
- /package/dist/{template-injector.d.ts → server/template-injector.d.ts} +0 -0
package/dist/mcp/issues.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RenderProfile, ReactiveGraph, LoadProfile, FpsSample } from '../types.js';
|
|
2
|
-
|
|
2
|
+
type IssueKind = 'slow-component-render' | 'over-rendered-component' | 'slow-load' | 'fps-drop' | 'effect-overconnected';
|
|
3
3
|
export interface PerformanceIssue {
|
|
4
4
|
id: string;
|
|
5
5
|
kind: IssueKind;
|
|
@@ -12,15 +12,18 @@ export interface PerformanceIssue {
|
|
|
12
12
|
suggestedTool: string;
|
|
13
13
|
}
|
|
14
14
|
export interface IssueThresholds {
|
|
15
|
-
/** Per-render time (ms) above which a component render is considered slow. */
|
|
15
|
+
/** Per-render time (ms) at or above which a component render is considered slow. */
|
|
16
16
|
avgRenderTimeMs?: number;
|
|
17
|
-
/** Render count above which a component is considered over-rendered. */
|
|
17
|
+
/** Render count at or above which a component is considered over-rendered. */
|
|
18
18
|
renderCount?: number;
|
|
19
|
-
/** Load duration (ms) above which a SvelteKit load is slow. */
|
|
19
|
+
/** Load duration (ms) at or above which a SvelteKit load is slow. */
|
|
20
20
|
loadDurationMs?: number;
|
|
21
|
-
/** FPS below which we record a drop. */
|
|
21
|
+
/** FPS strictly below which we record a drop. */
|
|
22
22
|
fpsDropThreshold?: number;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Dependency count (incoming edges: what the effect reads) at or above
|
|
25
|
+
* which an effect is over-connected.
|
|
26
|
+
*/
|
|
24
27
|
effectMaxDeps?: number;
|
|
25
28
|
}
|
|
26
29
|
export interface IssueInputs {
|
|
@@ -37,11 +40,20 @@ export interface ReactiveProblems {
|
|
|
37
40
|
file: string;
|
|
38
41
|
depCount: number;
|
|
39
42
|
}>;
|
|
43
|
+
/**
|
|
44
|
+
* `$derived` values nothing has read so far (never evaluated). A derived
|
|
45
|
+
* read only imperatively (event handler, plain function) is evaluated and
|
|
46
|
+
* is not listed: having no effect/markup reader is not "unused".
|
|
47
|
+
*/
|
|
40
48
|
orphanDeriveds: Array<{
|
|
41
49
|
id: string;
|
|
42
50
|
name: string;
|
|
43
51
|
file: string;
|
|
44
52
|
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Nodes without any dependency or tracked reader (markup reads included).
|
|
55
|
+
* A node depending only on untracked signals (`untrackedDeps`) is not listed.
|
|
56
|
+
*/
|
|
45
57
|
isolatedNodes: Array<{
|
|
46
58
|
id: string;
|
|
47
59
|
name: string;
|
|
@@ -50,3 +62,4 @@ export interface ReactiveProblems {
|
|
|
50
62
|
}>;
|
|
51
63
|
}
|
|
52
64
|
export declare function summarizeReactiveProblems(graph: ReactiveGraph, t?: IssueThresholds): ReactiveProblems;
|
|
65
|
+
export {};
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -29,10 +29,5 @@ export interface McpDeps {
|
|
|
29
29
|
}
|
|
30
30
|
/** Most timeline entries one `get_state_timeline` call returns. */
|
|
31
31
|
export declare const MCP_TIMELINE_LIMIT = 500;
|
|
32
|
-
/** Default / largest JSON size of one old/new value in `get_state_timeline` output. */
|
|
33
|
-
export declare const MCP_VALUE_CHARS: {
|
|
34
|
-
readonly default: 2048;
|
|
35
|
-
readonly max: 32768;
|
|
36
|
-
};
|
|
37
32
|
export declare function buildMcpServer(deps: McpDeps): McpServer;
|
|
38
33
|
export { StreamableHTTPServerTransport };
|
package/dist/mcp/sessions.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RenderProfile, LoadProfile, FpsSample } from '../types.js';
|
|
2
|
-
|
|
2
|
+
interface SessionSnapshot {
|
|
3
3
|
/** componentId -> { renderCount, totalRenderTime } at snapshot moment */
|
|
4
4
|
renderProfiles: Array<{
|
|
5
5
|
componentId: number;
|
|
@@ -115,9 +115,16 @@ export declare class SessionStore {
|
|
|
115
115
|
}>;
|
|
116
116
|
delete(id: string): boolean;
|
|
117
117
|
delta(id: string): SessionDelta;
|
|
118
|
+
/**
|
|
119
|
+
* The delta of a record in hand. `end('discard')` removes the record from
|
|
120
|
+
* the store, so end_session must not look it up again by id (it used to,
|
|
121
|
+
* and failed with "Session not found" for every discarded session).
|
|
122
|
+
*/
|
|
123
|
+
deltaOf(rec: SessionRecord): SessionDelta;
|
|
118
124
|
compare(idA: string, idB: string): SessionDiff;
|
|
119
125
|
/** The session's file, guaranteed to be a direct child of `persistDir`. */
|
|
120
126
|
private pathFor;
|
|
121
127
|
private persistToDisk;
|
|
122
128
|
private loadFromDisk;
|
|
123
129
|
}
|
|
130
|
+
export {};
|
package/dist/plugin.d.ts
CHANGED
|
@@ -5,5 +5,25 @@ export interface SvelteDevtoolsOptions {
|
|
|
5
5
|
* @default true
|
|
6
6
|
*/
|
|
7
7
|
componentTracking?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Require the one-time code before a browser can use the standalone
|
|
10
|
+
* DevTools (`/.svelte-devtools/`). Set `false` to skip it on a trusted,
|
|
11
|
+
* single-user machine.
|
|
12
|
+
*
|
|
13
|
+
* Beware: without it, any page or device that can reach the dev server
|
|
14
|
+
* can read files in your project through the DevTools (including other
|
|
15
|
+
* devices when the dev server listens on a LAN address, `--host`).
|
|
16
|
+
* Inside the Vite DevTools dock this option has no effect: use
|
|
17
|
+
* `DevTools({ clientAuth: false })` from `@vitejs/devtools` instead.
|
|
18
|
+
* The MCP endpoint keeps its own token either way.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
clientAuth?: boolean;
|
|
8
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Whether the request's `x-svelte-devtools-token` header is exactly `token`.
|
|
25
|
+
* Constant-time for equal lengths (the length itself is not secret: every
|
|
26
|
+
* token is a UUID). A repeated header (string array) is never accepted.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isValidMcpToken(header: string | string[] | undefined, token: string): boolean;
|
|
9
29
|
export declare function svelteDevtools(options?: SvelteDevtoolsOptions): Plugin[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { RESOLVED_RUNTIME_ID, RUNTIME_MODULE_ID, WRAPPER_MODULE_ID } from './ids.js';
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper code for svelte/internal/client (`./wrapper.js`).
|
|
4
|
+
*
|
|
5
|
+
* Re-exports everything from the real module, then overrides:
|
|
6
|
+
* - push/pop: component lifecycle tracking
|
|
7
|
+
* - tag/tag_proxy: named signal/proxy tracking (Svelte dev mode)
|
|
8
|
+
* - state/derived/proxy: type markers consumed by tag/tag_proxy
|
|
9
|
+
* - user_effect/user_pre_effect: effect tracking
|
|
10
|
+
* - template_effect/deferred_template_effect: render count/time profiling
|
|
11
|
+
* - each/if/key/await/component/boundary: block-callback owner attribution
|
|
12
|
+
*
|
|
13
|
+
* This single module replaces all post-compilation regex transforms
|
|
14
|
+
* for reactive tracking, making the approach Svelte-compiler-output agnostic.
|
|
15
|
+
*/
|
|
16
|
+
export declare const wrapperCode: string;
|
|
17
|
+
/** The devtools runtime (`./client.js`), installed once as `window.__SVELTE_DEVTOOLS__`. */
|
|
18
|
+
export declare const runtimeCode: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component-tracking transform for one compiled client `.svelte` module:
|
|
3
|
+
* imports the runtime and names the file for the wrapper's next `push()`.
|
|
4
|
+
* `null` when the module has no component (`$.push($$props`) to track.
|
|
5
|
+
*
|
|
6
|
+
* Nothing is inserted as a new line, so every original line keeps its
|
|
7
|
+
* number (`map: null` = mappings unchanged; stack traces and the
|
|
8
|
+
* compiler's sourcemap stay aligned).
|
|
9
|
+
*/
|
|
10
|
+
export declare function injectComponentTracking(code: string, id: string): string | null;
|
|
11
|
+
/** A Svelte module (`.svelte.js` / `.svelte.ts`, runes outside components). */
|
|
12
|
+
export declare const SVELTE_MODULE_RE: RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* Module-scope transform for one client Svelte module: signals created while
|
|
15
|
+
* its body runs (shared state, `export const cart = $state(...)`) are tracked
|
|
16
|
+
* under a scope named after the file. The body is bracketed by enter/leave
|
|
17
|
+
* calls; nothing is inserted as a new line. The bracket is plain JS, so it
|
|
18
|
+
* works before or after vite-plugin-svelte compiles the module (with
|
|
19
|
+
* `svelteDevtools()` listed before `sveltekit()`, a `.svelte.ts` module is
|
|
20
|
+
* compiled after this transform). `null` for a server-compiled module.
|
|
21
|
+
*/
|
|
22
|
+
export declare function injectModuleTracking(code: string, id: string): string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaptureInfoMap, CompilerWarning, ComponentInstance, FpsSample, LoadProfile, ReactiveGraph, ReactiveGraphRequest, ReactiveGraphResult, ReactiveSummary, ReactiveSummaryRequest, RenderProfile, RuntimeError, StateChange, StateTimelineDelta, StateTimelineEntry, DatasetVersions } from '
|
|
1
|
+
import { CaptureInfoMap, CompilerWarning, ComponentInstance, FpsSample, LoadProfile, ReactiveGraph, ReactiveGraphRequest, ReactiveGraphResult, ReactiveSummary, ReactiveSummaryRequest, RenderProfile, RuntimeError, StateChange, StateTimelineDelta, StateTimelineEntry, DatasetVersions } from '../types.js';
|
|
2
2
|
export declare const LIMITS: {
|
|
3
3
|
readonly liveComponents: 50000;
|
|
4
4
|
readonly renderProfiles: 5000;
|
|
@@ -38,14 +38,8 @@ export declare const HOT_EVENTS: {
|
|
|
38
38
|
/** server → runtime(s): `{ active: boolean }` — whether any consumer is watching. */
|
|
39
39
|
readonly subscription: "svelte-devtools:subscription";
|
|
40
40
|
};
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
readonly topK: 50;
|
|
44
|
-
readonly maxTopK: 200;
|
|
45
|
-
readonly windowMs: 10000;
|
|
46
|
-
readonly minWindowMs: 1000;
|
|
47
|
-
readonly maxWindowMs: 60000;
|
|
48
|
-
};
|
|
41
|
+
/** A hot-channel payload: an untrusted JSON object from the app's runtime. */
|
|
42
|
+
type Payload = Record<string, unknown>;
|
|
49
43
|
/** A consumer (DevTools UI tab, MCP agent) counts as watching until its lease expires. */
|
|
50
44
|
export declare const LEASE_TTL = 15000;
|
|
51
45
|
export interface HotClient {
|
|
@@ -53,8 +47,8 @@ export interface HotClient {
|
|
|
53
47
|
}
|
|
54
48
|
export interface HotChannel {
|
|
55
49
|
send(event: string, payload: unknown): void;
|
|
56
|
-
on(event: string, listener: (payload:
|
|
57
|
-
off?(event: string, listener: (payload:
|
|
50
|
+
on(event: string, listener: (payload: unknown, client: HotClient) => void): void;
|
|
51
|
+
off?(event: string, listener: (payload: unknown, client: HotClient) => void): void;
|
|
58
52
|
}
|
|
59
53
|
export interface CollectorHooks {
|
|
60
54
|
onFpsSample?: (sample: FpsSample) => void;
|
|
@@ -66,7 +60,6 @@ export interface CollectorHooks {
|
|
|
66
60
|
* feeds it, the devframe RPC layer and the MCP server read from it.
|
|
67
61
|
*/
|
|
68
62
|
export declare class Collector {
|
|
69
|
-
private readonly hooks;
|
|
70
63
|
private epochs;
|
|
71
64
|
private servedEpoch;
|
|
72
65
|
private liveCache;
|
|
@@ -108,6 +101,7 @@ export declare class Collector {
|
|
|
108
101
|
private active;
|
|
109
102
|
private sweepTimer;
|
|
110
103
|
private stateTimelineResolvers;
|
|
104
|
+
private readonly hooks;
|
|
111
105
|
constructor(hooks?: CollectorHooks);
|
|
112
106
|
/**
|
|
113
107
|
* Subscribe to the runtime's hot-channel events. Re-attaching (dev server
|
|
@@ -182,11 +176,11 @@ export declare class Collector {
|
|
|
182
176
|
added?: unknown;
|
|
183
177
|
removed?: unknown;
|
|
184
178
|
} | undefined, client?: HotClient): void;
|
|
185
|
-
ingestProfiles(data
|
|
179
|
+
ingestProfiles(data?: {
|
|
186
180
|
profiles?: unknown;
|
|
187
181
|
epoch?: unknown;
|
|
188
182
|
total?: unknown;
|
|
189
|
-
}
|
|
183
|
+
}): void;
|
|
190
184
|
/**
|
|
191
185
|
* What the server holds versus what was reported, per dataset (§6.7 B).
|
|
192
186
|
* `total: null` means unknown; nothing is estimated.
|
|
@@ -232,7 +226,7 @@ export declare class Collector {
|
|
|
232
226
|
* is a whole-app graph and answers every pending graph pull, scoped ones by
|
|
233
227
|
* filtering here.
|
|
234
228
|
*/
|
|
235
|
-
ingestReactiveGraph(data:
|
|
229
|
+
ingestReactiveGraph(data: Payload | undefined): void;
|
|
236
230
|
/**
|
|
237
231
|
* Shape a runtime reply into a {@link ReactiveGraphResult}: apply the
|
|
238
232
|
* collector caps (nodes, then only edges between kept nodes, then the edge
|
|
@@ -243,7 +237,7 @@ export declare class Collector {
|
|
|
243
237
|
private normalizeGraph;
|
|
244
238
|
private storeGraph;
|
|
245
239
|
/** A summary reply (§6.7 I): resolves only the matching request. */
|
|
246
|
-
ingestReactiveSummary(data:
|
|
240
|
+
ingestReactiveSummary(data: Payload | undefined): void;
|
|
247
241
|
private normalizeSummary;
|
|
248
242
|
ingestFps(sample: FpsSample): void;
|
|
249
243
|
ingestRuntimeError(error: RuntimeError): void;
|
|
@@ -282,3 +276,4 @@ export declare class Collector {
|
|
|
282
276
|
private pull;
|
|
283
277
|
private flushStateTimeline;
|
|
284
278
|
}
|
|
279
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DevframeDefinition } from 'devframe';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { GraphModuleLike } from '
|
|
3
|
+
import { GraphModuleLike } from '../analyzers/module-graph.js';
|
|
4
|
+
import { ApiResponse, InspectResult, OGPreview, ReactiveGraphResult, ReactiveSummary, StateTimelineDelta, LiveComponentsMeta } from '../types.js';
|
|
4
5
|
import { Collector } from './collector.js';
|
|
5
|
-
import { ApiResponse, InspectResult, OGPreview, ReactiveGraphResult, ReactiveSummary, StateTimelineDelta, LiveComponentsMeta } from './types.js';
|
|
6
6
|
export declare const DEVFRAME_ID = "svelte-devtools";
|
|
7
7
|
/** Mount base for both hosts (standalone and Vite DevTools), so the SPA URL never changes. */
|
|
8
8
|
export declare const DEVFRAME_BASE = "/.svelte-devtools/";
|
|
@@ -32,10 +32,10 @@ export interface SvelteDevtoolsHost {
|
|
|
32
32
|
/** Open `file[:line]` in the user's editor. */
|
|
33
33
|
openInEditor: (target: string) => void;
|
|
34
34
|
}
|
|
35
|
-
export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-project", "query", [], import('
|
|
35
|
+
export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-project", "query", [], import('../types.js').ProjectInfo, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-routes", "query", [], import('../types.js').RouteInfo[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-assets", "query", [], import('../types.js').AssetInfo[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-component-relations", "query", [], import('../types.js').ComponentRelation[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-svelte-files", "query", [], {
|
|
36
36
|
file: string;
|
|
37
37
|
name: string;
|
|
38
|
-
}[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-live-components", "query", [], import('
|
|
38
|
+
}[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-live-components", "query", [], import('../types.js').ComponentInstance[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-live-components-meta", "query", [], LiveComponentsMeta, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"set-active", "action", readonly [z.ZodObject<{
|
|
39
39
|
client: z.ZodString;
|
|
40
40
|
active: z.ZodBoolean;
|
|
41
41
|
}, z.core.$strip>], z.ZodVoid, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"open-in-editor", "action", readonly [z.ZodObject<{
|
|
@@ -45,7 +45,7 @@ export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [
|
|
|
45
45
|
file: z.ZodString;
|
|
46
46
|
name: z.ZodString;
|
|
47
47
|
type: z.ZodString;
|
|
48
|
-
}, z.core.$strip>], z.ZodVoid, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-render-profiles", "query", [], import('
|
|
48
|
+
}, z.core.$strip>], z.ZodVoid, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-render-profiles", "query", [], import('../types.js').RenderProfile[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"get-reactive-graph", "query", readonly [z.ZodOptional<z.ZodObject<{
|
|
49
49
|
componentId: z.ZodOptional<z.ZodNumber>;
|
|
50
50
|
epoch: z.ZodOptional<z.ZodString>;
|
|
51
51
|
maxNodes: z.ZodOptional<z.ZodNumber>;
|
|
@@ -53,7 +53,7 @@ export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [
|
|
|
53
53
|
}, z.core.$strip>>], z.ZodCustom<ReactiveGraphResult, ReactiveGraphResult>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"get-reactive-summary", "query", readonly [z.ZodOptional<z.ZodObject<{
|
|
54
54
|
topK: z.ZodOptional<z.ZodNumber>;
|
|
55
55
|
windowMs: z.ZodOptional<z.ZodNumber>;
|
|
56
|
-
}, z.core.$strip>>], z.ZodCustom<ReactiveSummary, ReactiveSummary>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-capture-info", "query", [], Partial<Record<import('
|
|
56
|
+
}, z.core.$strip>>], z.ZodCustom<ReactiveSummary, ReactiveSummary>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-capture-info", "query", [], Partial<Record<import('../types.js').CaptureKey, import('../types.js').CaptureInfo>>, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-load-profiles", "query", [], import('../types.js').LoadProfile[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-load-profiles", "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-state-timeline", "query", [], Promise<import('../types.js').StateChange[]>, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"get-state-timeline-delta", "query", readonly [z.ZodObject<{
|
|
57
57
|
since: z.ZodOptional<z.ZodNumber>;
|
|
58
58
|
}, z.core.$strip>], z.ZodCustom<StateTimelineDelta, StateTimelineDelta>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-versions", "query", [], {
|
|
59
59
|
components: number;
|
|
@@ -63,7 +63,7 @@ export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [
|
|
|
63
63
|
reactiveGraph: number;
|
|
64
64
|
errors: number;
|
|
65
65
|
fps: number;
|
|
66
|
-
}, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-state-timeline", "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-api-endpoints", "query", [], import('
|
|
66
|
+
}, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-state-timeline", "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-api-endpoints", "query", [], import('../types.js').ApiEndpoint[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"send-api-request", "action", readonly [z.ZodObject<{
|
|
67
67
|
url: z.ZodString;
|
|
68
68
|
method: z.ZodEnum<{
|
|
69
69
|
GET: "GET";
|
|
@@ -76,11 +76,11 @@ export declare function createRpcFunctions(host: SvelteDevtoolsHost): readonly [
|
|
|
76
76
|
}>;
|
|
77
77
|
headers: z.ZodString;
|
|
78
78
|
body: z.ZodString;
|
|
79
|
-
}, z.core.$strip>], z.ZodCustom<ApiResponse, ApiResponse>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-compiler-warnings", "query", [], import('
|
|
79
|
+
}, z.core.$strip>], z.ZodCustom<ApiResponse, ApiResponse>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-compiler-warnings", "query", [], import('../types.js').CompilerWarning[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-runtime-errors", "query", [], import('../types.js').RuntimeError[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-errors", "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"inspect-file", "query", readonly [z.ZodObject<{
|
|
80
80
|
file: z.ZodString;
|
|
81
|
-
}, z.core.$strip>], z.ZodCustom<InspectResult, InspectResult>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-module-graph", "query", [], import('
|
|
81
|
+
}, z.core.$strip>], z.ZodCustom<InspectResult, InspectResult>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-module-graph", "query", [], import('../types.js').ModuleGraphData, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithSchemas<"get-og-preview", "action", readonly [z.ZodObject<{
|
|
82
82
|
url: z.ZodString;
|
|
83
|
-
}, z.core.$strip>], z.ZodCustom<OGPreview, OGPreview>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-build-analysis", "query", [], import('
|
|
83
|
+
}, z.core.$strip>], z.ZodCustom<OGPreview, OGPreview>, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-build-analysis", "query", [], import('../types.js').BuildAnalysis, undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"get-fps", "query", [], import('../types.js').FpsSample[], undefined, undefined, import('devframe').DevframeNodeContext>, import('devframe/rpc').RpcFunctionDefinitionWithoutSchemas<"clear-fps", "action", [], void, undefined, undefined, import('devframe').DevframeNodeContext>];
|
|
84
84
|
/**
|
|
85
85
|
* The portable Svelte DevTools tool. Host-agnostic: the same definition is
|
|
86
86
|
* mounted standalone (`initDevframe`) or inside Vite DevTools
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import { AddressInfo } from 'node:net';
|
|
2
|
-
import { ViteDevServer } from 'vite';
|
|
3
1
|
import { DevframeDefinition } from 'devframe';
|
|
4
|
-
|
|
5
|
-
* Origins a browser may load the DevTools from when the dev server is
|
|
6
|
-
* reachable beyond loopback (`server.host`). devframe accepts loopback
|
|
7
|
-
* origins by default and rejects every other WS `Origin` unless listed.
|
|
8
|
-
*/
|
|
9
|
-
export declare function networkOrigins(address: AddressInfo, proto: string): string[];
|
|
2
|
+
import { ViteDevServer } from 'vite';
|
|
10
3
|
/**
|
|
11
4
|
* Serve the devframe standalone on this dev server: SPA, discovery,
|
|
12
5
|
* WebSocket RPC on Vite's own HTTP server at `<base>__ws`, auth gate.
|
|
@@ -15,4 +8,6 @@ export declare function networkOrigins(address: AddressInfo, proto: string): str
|
|
|
15
8
|
* event, so a restart (which builds the new server before closing the old
|
|
16
9
|
* one) can never tear down the new instance.
|
|
17
10
|
*/
|
|
18
|
-
export declare function mountStandalone(server: ViteDevServer, def: DevframeDefinition
|
|
11
|
+
export declare function mountStandalone(server: ViteDevServer, def: DevframeDefinition, { auth }?: {
|
|
12
|
+
auth?: boolean;
|
|
13
|
+
}): (() => Promise<void>) | undefined;
|
|
@@ -12,12 +12,20 @@ export interface OutboundUrlOptions {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Like {@link validateExternalUrl}, but also resolves the hostname and
|
|
15
|
-
* rejects names that point at private / loopback addresses (DNS-based SSRF)
|
|
16
|
-
* Exact dev-server origins in
|
|
15
|
+
* rejects names that point at private / loopback addresses (DNS-based SSRF),
|
|
16
|
+
* or that do not resolve at all. Exact dev-server origins in
|
|
17
|
+
* `allowedOrigins` bypass the private checks.
|
|
17
18
|
* Callers must also fetch with `redirect: 'manual'` so a public URL cannot
|
|
18
19
|
* bounce the request to a private one.
|
|
19
20
|
*/
|
|
20
21
|
export declare function assertOutboundUrl(urlStr: string, options?: OutboundUrlOptions): Promise<URL>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether `ip` (an IPv4 or IPv6 literal, IPv6 optionally in brackets) is a
|
|
24
|
+
* private, loopback or otherwise non-public address. IPv6 forms that embed
|
|
25
|
+
* an IPv4 address (mapped, compatible, NAT64, 6to4) are judged by that
|
|
26
|
+
* address. Anything that is not a valid IP literal counts as private, so a
|
|
27
|
+
* malformed value is never let through.
|
|
28
|
+
*/
|
|
21
29
|
export declare function isPrivateIP(ip: string): boolean;
|
|
22
30
|
/**
|
|
23
31
|
* Resolve a user-supplied file path strictly under `root`. Symlinks are
|
package/dist/types.d.ts
CHANGED
|
@@ -68,11 +68,24 @@ export interface RenderProfile {
|
|
|
68
68
|
}
|
|
69
69
|
export interface ReactiveNode {
|
|
70
70
|
id: string;
|
|
71
|
-
|
|
71
|
+
/**
|
|
72
|
+
* `template`: synthetic node standing for all markup effects of one
|
|
73
|
+
* component (`<componentId>:(template)`); edges into it are reads from the
|
|
74
|
+
* markup ({expr}, attributes, block conditions, <svelte:head>).
|
|
75
|
+
*/
|
|
76
|
+
type: 'state' | 'derived' | 'effect' | 'template';
|
|
72
77
|
name: string;
|
|
73
78
|
componentId: number;
|
|
74
79
|
componentFile: string;
|
|
75
80
|
value?: unknown;
|
|
81
|
+
/** A `$derived` nothing has read yet (Svelte computes deriveds lazily). */
|
|
82
|
+
unevaluated?: true;
|
|
83
|
+
/**
|
|
84
|
+
* Dependencies on signals devtools does not track (created in
|
|
85
|
+
* node_modules — e.g. SvelteKit's page state — or outside any component
|
|
86
|
+
* init / module body). Absent when there are none.
|
|
87
|
+
*/
|
|
88
|
+
untrackedDeps?: number;
|
|
76
89
|
}
|
|
77
90
|
export interface ReactiveEdge {
|
|
78
91
|
from: string;
|
|
@@ -136,8 +149,14 @@ export interface ReactiveSummaryRequest {
|
|
|
136
149
|
}
|
|
137
150
|
/** One component instance in the overview, from runtime counters over all instances. */
|
|
138
151
|
export interface ReactiveSummaryRow {
|
|
152
|
+
/** Component instance id, or the id of a module scope (`kind: 'module'`). */
|
|
139
153
|
componentId: number;
|
|
140
154
|
file: string;
|
|
155
|
+
/**
|
|
156
|
+
* `module`: shared state of a `.svelte.js` / `.svelte.ts` module (signals
|
|
157
|
+
* created while its body ran), not a component instance.
|
|
158
|
+
*/
|
|
159
|
+
kind?: 'module';
|
|
141
160
|
/** Tracked nodes registered for this instance, by type. */
|
|
142
161
|
nodes: {
|
|
143
162
|
state: number;
|
|
@@ -163,7 +182,12 @@ export interface ReactiveSummary {
|
|
|
163
182
|
sampledActiveMs: number;
|
|
164
183
|
};
|
|
165
184
|
policy: 'sampled-200ms';
|
|
166
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* Tracked: signals created during a component's init (and its later block
|
|
187
|
+
* updates / effect runs) and while a `.svelte.js`/`.ts` module body runs
|
|
188
|
+
* (module scopes count as rows/components, `kind: 'module'`). Signals
|
|
189
|
+
* created elsewhere (e.g. in an event handler) are not tracked.
|
|
190
|
+
*/
|
|
167
191
|
coverage: 'component-init';
|
|
168
192
|
components: {
|
|
169
193
|
total: number | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-devtools-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Svelte DevTools for Vite: standalone on your dev server or inside the Vite DevTools dock",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"devtools",
|
|
@@ -26,14 +26,16 @@
|
|
|
26
26
|
"skills"
|
|
27
27
|
],
|
|
28
28
|
"type": "module",
|
|
29
|
+
"sideEffects": false,
|
|
29
30
|
"main": "./dist/index.mjs",
|
|
30
31
|
"module": "./dist/index.mjs",
|
|
31
32
|
"types": "./dist/index.d.ts",
|
|
32
33
|
"exports": {
|
|
33
34
|
".": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
}
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
37
39
|
},
|
|
38
40
|
"publishConfig": {
|
|
39
41
|
"access": "public"
|
|
@@ -45,7 +47,12 @@
|
|
|
45
47
|
"zod": "^4.4.3"
|
|
46
48
|
},
|
|
47
49
|
"devDependencies": {
|
|
50
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
48
51
|
"@types/node": "^25.6.2",
|
|
52
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
53
|
+
"fast-check": "^4.10.2",
|
|
54
|
+
"happy-dom": "^20.14.5",
|
|
55
|
+
"svelte": "^5.57.1",
|
|
49
56
|
"typescript": "^6.0.3",
|
|
50
57
|
"vite": "^8.3.2",
|
|
51
58
|
"vite-plugin-dts": "^5.1.2",
|
|
@@ -61,6 +68,7 @@
|
|
|
61
68
|
"build": "vite build",
|
|
62
69
|
"dev": "vite build --watch",
|
|
63
70
|
"test": "vitest run",
|
|
71
|
+
"test:coverage": "vitest run --coverage",
|
|
64
72
|
"test:watch": "vitest"
|
|
65
73
|
}
|
|
66
74
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: vite-devtools-svelte
|
|
2
|
+
name: vite-devtools-svelte-perf-audit
|
|
3
3
|
description: Use when the user asks to audit Svelte/SvelteKit app performance, find render hotspots, or identify what to optimize. Requires the vite-devtools-svelte MCP server to be registered (the dev server prints `claude mcp add ...` on startup). Always interactive — the user picks which issues to fix; never starts editing on its own.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ If either is missing, stop and tell the user what to do; do not invent metrics.
|
|
|
21
21
|
3. Call `end_session` with `keep: "memory"`. Note the session id from the response — you will need it later.
|
|
22
22
|
4. Call `list_performance_issues` (no thresholds first; defaults are sensible). Read the `issues` array.
|
|
23
23
|
5. Present the top 3 issues to the user as a compact table: `severity | kind | summary | file`. Add any context from the `metric` field that aids interpretation.
|
|
24
|
-
6. Ask the user which issue (if any) to investigate. **Do not implement fixes in this skill.** Hand off to `/vite-devtools-svelte
|
|
24
|
+
6. Ask the user which issue (if any) to investigate. **Do not implement fixes in this skill.** Hand off to `/vite-devtools-svelte-perf-fix <issue id or summary>` once they pick one.
|
|
25
25
|
|
|
26
26
|
## Guardrails
|
|
27
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: vite-devtools-svelte
|
|
3
|
-
description: Use to apply a single, scoped performance fix to a Svelte/SvelteKit app and verify the change with before/after measurements. Pairs with /vite-devtools-svelte
|
|
2
|
+
name: vite-devtools-svelte-perf-fix
|
|
3
|
+
description: Use to apply a single, scoped performance fix to a Svelte/SvelteKit app and verify the change with before/after measurements. Pairs with /vite-devtools-svelte-perf-audit (which identifies issues). One issue per invocation. Requires the vite-devtools-svelte MCP server.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Svelte performance fix
|
|
@@ -9,7 +9,7 @@ You are about to fix exactly **one** performance issue and verify it with measur
|
|
|
9
9
|
|
|
10
10
|
## Inputs
|
|
11
11
|
|
|
12
|
-
The user will name an issue. Resolve it to a target by calling the matching detail tool — `get_component_hotspots`, `get_reactive_graph_problems`, `get_load_waterfall`, `get_fps_drops`, or `get_render_profile` — based on the issue `kind` / `suggestedTool` from `/vite-devtools-svelte
|
|
12
|
+
The user will name an issue. Resolve it to a target by calling the matching detail tool — `get_component_hotspots`, `get_reactive_graph_problems`, `get_load_waterfall`, `get_fps_drops`, or `get_render_profile` — based on the issue `kind` / `suggestedTool` from `/vite-devtools-svelte-perf-audit`.
|
|
13
13
|
|
|
14
14
|
## Workflow
|
|
15
15
|
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,Dt as n,F as r,I as i,J as a,Mt as o,N as s,Nt as c,O as l,Ot as u,P as d,Pt as ee,St as f,T as p,Tt as m,U as h,X as g,Y as te,a as _,at as v,bt as y,ct as b,dt as x,ft as S,gt as C,it as w,jt as T,kt as ne,mt as E,ot as D,pt as re,q as ie,st as O,tt as k,ut as A,wt as j,xt as M,yt as N}from"./index-BzMw8R8l.js";import{i as ae,o as oe}from"./format-CW_NXiBg.js";import{n as se,t as P}from"./Badge-CBVv8IFU.js";import{t as ce}from"./SplitView-B8lYXXEm.js";import{t as F}from"./VirtualList-BvOBTnYJ.js";import{t as I}from"./SearchField-eocQu1eB.js";var L=b(`<span class="methods svelte-1wcbixy"><!> <!></span> <span class="truncate mono path svelte-1wcbixy"><!></span>`,1),le=b(`<option> </option>`),ue=b(`<span class="err-dot svelte-1wcbixy"></span>`),de=b(`<button class="file mono svelte-1wcbixy" title="Open handler in editor"> </button>`),fe=b(`<textarea class="input editor svelte-1wcbixy" aria-label="Request body" spellcheck="false"></textarea>`),pe=b(`<p class="hint svelte-1wcbixy"> </p>`),me=b(`<p class="hint error svelte-1wcbixy"> </p>`),he=b(`<textarea class="input editor svelte-1wcbixy" aria-label="Request headers as JSON" spellcheck="false"></textarea> <!>`,1),ge=b(`<p class="mono"> </p>`),_e=b(`<dt class="mono"> </dt><dd class="mono"> </dd>`,1),ve=b(`<header class="res-head svelte-1wcbixy"><!> <span class="num muted"> </span> <span class="num muted"> </span> <details class="hdrs svelte-1wcbixy"><summary class="svelte-1wcbixy"> </summary> <dl class="kv svelte-1wcbixy"></dl></details></header> <pre class="body mono svelte-1wcbixy"> </pre>`,1),ye=b(`<p>Pick an endpoint on the left or type any URL. <kbd class="svelte-1wcbixy">⌘</kbd> <kbd class="svelte-1wcbixy">↵</kbd> sends.</p>`),be=b(`<div class="client svelte-1wcbixy"><form class="bar svelte-1wcbixy"><select class="select method svelte-1wcbixy" aria-label="HTTP method"></select> <input class="input url mono svelte-1wcbixy" placeholder="http://localhost:5173/api/…" aria-label="Request URL" spellcheck="false"/> <!></form> <div class="tabs svelte-1wcbixy" role="tablist" aria-label="Request parts"><button role="tab" class="svelte-1wcbixy">Body</button> <button role="tab" class="svelte-1wcbixy">Headers <!></button> <!></div> <div class="req svelte-1wcbixy" role="tabpanel"><!></div> <section class="res svelte-1wcbixy" aria-label="Response" aria-live="polite"><!></section></div>`);function R(b,x){t(x,!0);let R=i(_,{initial:[]}),xe=[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`,`OPTIONS`],z=e=>e===`GET`?`blue`:e===`POST`?`green`:e===`DELETE`?`red`:e===`HEAD`||e===`OPTIONS`?`neutral`:`yellow`,B=m(``),V=m(null),H=m(`GET`),U=m(``),W=m(`{
|
|
2
|
-
|
|
3
|
-
}`),G=m(``),K=m(`body`),q=m(!1),J=m(null),Y=m(null),X=n(()=>{let e=s(E(B));return e?R.data.filter(t=>e(t.path,t.route,t.methods.join(` `))):R.data}),Z=n(()=>E(V)?R.data.find(e=>e.route===E(V))??null:null),Q=n(()=>{if(!E(W).trim())return null;try{let e=JSON.parse(E(W));return e&&typeof e==`object`&&!Array.isArray(e)?null:`Headers must be a JSON object`}catch(e){return e.message}}),Se=n(()=>E(H)!==`GET`&&E(H)!==`HEAD`),Ce=n(()=>{if(!E(J)?.body)return``;if((Object.entries(E(J).headers).find(([e])=>e.toLowerCase()===`content-type`)?.[1]??``).includes(`json`)||/^\s*[[{]/.test(E(J).body))try{return JSON.stringify(JSON.parse(E(J).body),null,2)}catch{}return E(J).body});function we(e){j(V,e.route,!0),j(H,e.methods[0]??`GET`,!0),j(U,new URL(e.path,location.origin).href,!0),j(J,null),j(Y,null)}async function $(){if(!(!E(U)||E(Q)||E(q))){j(q,!0),j(Y,null);try{j(J,await l(E(U),E(H),E(W).trim()||`{}`,E(Se)?E(G):``),!0)}catch(e){j(J,null),j(Y,e instanceof Error?e.message:String(e),!0)}finally{j(q,!1)}}}function Te(e){(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),$())}function Ee(e){return e>=200&&e<300?`green`:e>=300&&e<400?`yellow`:e>=400?`red`:`neutral`}se(b,{title:`API`,get count(){return R.data.length},toolbar:e=>{I(e,{placeholder:`Filter endpoints…`,get count(){return E(X).length},get value(){return E(B)},set value(e){j(B,e,!0)}})},actions:e=>{d(e,{icon:`refresh`,variant:`ghost`,label:`Rescan endpoints`,get disabled(){return R.busy},onclick:()=>R.refresh()})},children:(t,i)=>{ce(t,{id:`api`,side:`start`,initial:300,min:200,aside:t=>{F(t,{get items(){return E(X)},getKey:e=>e.route,label:`API endpoints`,onselect:we,get selected(){return E(V)},set selected(e){j(V,e,!0)},row:(t,r=c)=>{var i=L(),a=y(i),s=N(a);k(s,16,()=>r().methods.slice(0,3),e=>e,(e,t)=>{{let r=n(()=>z(t));P(e,{get tone(){return E(r)},children:(e,n)=>{T();var r=A();C(()=>v(r,t)),D(e,r)},$$slots:{default:!0}})}});var l=f(s,2),u=e=>{P(e,{children:(e,t)=>{T();var n=A();C(()=>v(n,`+${r().methods.length-3}`)),D(e,n)},$$slots:{default:!0}})};w(l,e=>{r().methods.length>3&&e(u)}),o(a);var d=f(a,2),ee=N(d);e(ee,{get text(){return r().path},get query(){return E(B)}}),o(d),D(t,i)},empty:e=>{var t=O(),i=y(t),a=e=>{r(e,{title:`Scanning +server files…`})},o=e=>{{let t=n(()=>R.data.length?`No endpoints match`:`No +server endpoints`);r(e,{icon:`api`,get title(){return E(t)}})}};w(i,e=>{R.loading?e(a):e(o,-1)}),D(e,t)},$$slots:{row:!0,empty:!0}})},children:(e,t)=>{var i=be(),s=N(i),c=N(s);k(c,20,()=>E(Z)?.methods.length?E(Z).methods:xe,e=>e,(e,t)=>{var n=le(),r=M(n,!0),i={};C(()=>{v(r,t),i!==(i=t)&&(n.__value=i)}),D(e,n)}),o(c),g(c);var l=f(c,2);ie(l);var m=f(l,2);{let e=n(()=>!E(U)||!!E(Q)||E(q));d(m,{type:`submit`,variant:`primary`,icon:`send`,get disabled(){return E(e)},title:`Send (⌘↵)`,children:(e,t)=>{T();var n=A();C(()=>v(n,E(q)?`Sending…`:`Send`)),D(e,n)},$$slots:{default:!0}})}o(s);var _=f(s,2),b=N(_),x=f(b,2),ne=f(N(x)),se=e=>{var t=ue();C(()=>a(t,`title`,E(Q))),D(e,t)};w(ne,e=>{E(Q)&&e(se)}),o(x);var ce=f(x,2),F=e=>{var t=de(),n=M(t,!0);C(()=>v(n,E(Z).file)),S(`click`,t,()=>p(E(Z).file).catch(()=>{})),D(e,t)};w(ce,e=>{E(Z)&&e(F)}),o(_);var I=f(_,2),L=N(I),R=e=>{var t=O(),n=y(t),r=e=>{var t=fe();u(t),a(t,`placeholder`,`{ "name": "value" }`),h(t,()=>E(G),e=>j(G,e)),D(e,t)},i=e=>{var t=pe(),n=M(t);C(()=>v(n,`${E(H)??``} requests have no body.`)),D(e,t)};w(n,e=>{E(Se)?e(r):e(i,-1)}),D(e,t)},z=e=>{var t=he(),n=y(t);u(n);var r=f(n,2),i=e=>{var t=me(),n=M(t,!0);C(()=>v(n,E(Q))),D(e,t)};w(r,e=>{E(Q)&&e(i)}),C(()=>a(n,`aria-invalid`,!!E(Q))),h(n,()=>E(W),e=>j(W,e)),D(e,t)};w(L,e=>{E(K)===`body`?e(R):e(z,-1)}),o(I);var B=f(I,2),V=N(B),X=e=>{r(e,{icon:`errors`,tone:`error`,title:`Request failed`,children:(e,t)=>{var n=ge(),r=M(n,!0);C(()=>v(r,E(Y))),D(e,n)},$$slots:{default:!0}})},we=e=>{var t=ve(),r=y(t),i=N(r);{let e=n(()=>Ee(E(J).status));P(i,{get tone(){return E(e)},children:(e,t)=>{T();var n=A();C(()=>v(n,`${E(J).status??``} ${E(J).statusText??``}`)),D(e,n)},$$slots:{default:!0}})}var a=f(i,2),s=M(a,!0),c=f(a,2),l=M(c,!0),u=f(c,2),d=N(u),p=M(d),m=f(d,2);k(m,21,()=>Object.entries(E(J).headers),([e,t])=>e,(e,t)=>{var r=n(()=>ee(E(t),2));let i=()=>E(r)[0],a=()=>E(r)[1];var o=_e(),s=y(o),c=M(s,!0),l=f(s),u=M(l,!0);C(()=>{v(c,i()),v(u,a())}),D(e,o)}),o(m),o(u),o(r);var h=f(r,2),g=M(h,!0);C((e,t,n)=>{v(s,e),v(l,t),v(p,`${n??``} headers`),v(g,E(Ce)||`(empty body)`)},[()=>oe(E(J).duration),()=>ae(new Blob([E(J).body]).size),()=>Object.keys(E(J).headers).length]),D(e,t)},De=e=>{r(e,{icon:`send`,title:`Send a request`,children:(e,t)=>{var n=ye();D(e,n)},$$slots:{default:!0}})};w(V,e=>{E(Y)?e(X):E(J)?e(we,1):e(De,-1)}),o(B),o(i),C(()=>{a(b,`aria-selected`,E(K)===`body`),a(x,`aria-selected`,E(K)===`headers`)}),S(`keydown`,i,Te),re(`submit`,s,e=>{e.preventDefault(),$()}),te(c,()=>E(H),e=>j(H,e)),h(l,()=>E(U),e=>j(U,e)),S(`click`,b,()=>j(K,`body`)),S(`click`,x,()=>j(K,`headers`)),D(e,i)},$$slots:{aside:!0,default:!0}})},$$slots:{toolbar:!0,actions:!0,default:!0}}),ne()}x([`keydown`,`click`]);export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,Ct as n,Dt as r,F as i,I as a,J as o,L as s,Mt as c,N as l,Nt as u,P as d,St as f,T as p,Tt as m,Z as h,at as g,bt as _,ct as v,gt as y,it as b,jt as x,kt as S,mt as C,o as w,ot as T,st as E,ut as D,wt as O,xt as k,yt as A}from"./index-BzMw8R8l.js";import{i as j}from"./format-CW_NXiBg.js";import{n as M,t as N}from"./Badge-CBVv8IFU.js";import{t as P}from"./SplitView-B8lYXXEm.js";import{t as F}from"./SearchField-eocQu1eB.js";import{t as I}from"./DataTable-C6-tmcTQ.js";import{t as L}from"./Inspector-DGmAzhki.js";import{t as R}from"./Segmented-JGNuI5EZ.js";var z=v(`<!> <!>`,1),B=v(`<span class="total num svelte-qp140w" title="Total size of shown assets"> </span> <!>`,1),V=v(`<div class="preview svelte-qp140w"><img loading="lazy" class="svelte-qp140w"/></div>`),H=v(`<!> <h3 class="section-title">Details</h3> <dl class="kv"><dt>Public URL</dt><dd class="mono"> </dd> <dt>Size</dt><dd class="num"> <span class="faint"> </span></dd> <dt>Modified</dt><dd> </dd> <dt>Disk path</dt><dd class="mono faint"> </dd></dl>`,1),ee=v(`<span class="muted truncate mono small svelte-qp140w"> </span>`),te=v(`<span class="end faint num small svelte-qp140w"> </span>`),ne=v(`<span class="file svelte-qp140w"><!> <span class="truncate"><!></span></span> <!> <!> <span class="size end svelte-qp140w"><span class="bar svelte-qp140w"></span> <span class="num"> </span></span>`,1),re=v(`<p class="mono"> </p>`);function U(v,U){t(U,!0);let W=a(w,{initial:[]});function G(e){let t=e.split(`/`)[0];return t===`image`||t===`font`||t===`video`||t===`audio`||t===`text`?t:`other`}let ie={image:`assets`,font:`file`,video:`play`,audio:`play`,text:`file`,other:`file`},K=m(``),q=m(`all`),J=m(n({id:`size`,desc:!0})),Y=m(null),X=r(()=>{let e=new Map;for(let t of W.data)e.set(G(t.type),(e.get(G(t.type))??0)+1);return e}),ae=r(()=>[{value:`all`,label:`All`,count:W.data.length},...[`image`,`font`,`video`,`audio`,`text`,`other`].filter(e=>C(X).get(e)).map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1),count:C(X).get(e)}))]),Z=r(()=>{let e=l(C(K));return W.data.filter(t=>(C(q)===`all`||G(t.type)===C(q))&&(!e||e(t.relativePath,t.type)))}),oe=r(()=>C(Z).reduce((e,t)=>e+t.size,0)),se=r(()=>W.data.reduce((e,t)=>Math.max(e,t.size),1)),Q=r(()=>C(Y)?W.data.find(e=>e.path===C(Y))??null:null),ce=[{id:`name`,label:`File`,width:`minmax(0, 1fr)`,sort:(e,t)=>e.relativePath.localeCompare(t.relativePath)},{id:`type`,label:`Type`,width:`120px`,minWidth:640,sort:(e,t)=>e.type.localeCompare(t.type)},{id:`mtime`,label:`Modified`,width:`96px`,align:`end`,minWidth:760,descFirst:!0,sort:(e,t)=>e.mtime-t.mtime},{id:`size`,label:`Size`,width:`140px`,align:`end`,descFirst:!0,sort:(e,t)=>e.size-t.size}];function $(e){return e.url||`/`+e.relativePath}M(v,{title:`Assets`,get count(){return W.data.length},toolbar:e=>{var t=z(),n=_(t);R(n,{label:`Asset type`,get options(){return C(ae)},get value(){return C(q)},set value(e){O(q,e,!0)}});var r=f(n,2);F(r,{placeholder:`Filter assets…`,get count(){return C(Z).length},get value(){return C(K)},set value(e){O(K,e,!0)}}),T(e,t)},actions:e=>{var t=B(),n=_(t),r=k(n,!0),i=f(n,2);d(i,{icon:`refresh`,variant:`ghost`,label:`Rescan static directory`,get disabled(){return W.busy},onclick:()=>W.refresh()}),y(e=>g(r,e),[()=>j(C(oe))]),T(e,t)},children:(t,n)=>{{let n=e=>{var t=E(),n=_(t),i=e=>{L(e,{get title(){return C(Q).name},get subtitle(){return C(Q).relativePath},onclose:()=>O(Y,null),badges:e=>{var t=z(),n=_(t);N(n,{children:(e,t)=>{x();var n=D();y(()=>g(n,C(Q).type)),T(e,n)},$$slots:{default:!0}});var i=f(n,2);{let e=r(()=>C(Q).size>5e5?`yellow`:`neutral`);N(i,{get tone(){return C(e)},children:(e,t)=>{x();var n=D();y(e=>g(n,e),[()=>j(C(Q).size)]),T(e,n)},$$slots:{default:!0}})}T(e,t)},actions:e=>{var t=z(),n=_(t);d(n,{icon:`external`,onclick:()=>window.open($(C(Q)),`_blank`,`noopener`),children:(e,t)=>{x();var n=D(`Open URL`);T(e,n)},$$slots:{default:!0}});var r=f(n,2);d(r,{icon:`editor`,onclick:()=>p(C(Q).path).catch(()=>{}),children:(e,t)=>{x();var n=D(`Reveal`);T(e,n)},$$slots:{default:!0}}),T(e,t)},children:(e,t)=>{var n=H(),i=_(n),a=e=>{var t=V(),n=k(t);y(e=>{o(n,`src`,e),o(n,`alt`,C(Q).name)},[()=>$(C(Q))]),T(e,t)},s=r(()=>C(Q).type.startsWith(`image/`));b(i,e=>{C(s)&&e(a)});var l=f(i,4),u=f(A(l)),d=k(u,!0),p=f(u,3),m=A(p),h=f(m),v=k(h);c(p);var x=f(p,3),S=k(x,!0),w=f(x,3),E=k(w,!0);c(l),y((e,t,n,r)=>{g(d,e),g(m,`${t??``} `),g(v,`(${n??``} bytes)`),g(S,r),g(E,C(Q).path)},[()=>$(C(Q)),()=>j(C(Q).size),()=>C(Q).size.toLocaleString(),()=>new Date(C(Q).mtime).toLocaleString()]),T(e,n)},$$slots:{badges:!0,actions:!0,default:!0}})};b(n,e=>{C(Q)&&e(i)}),T(e,t)},a=r(()=>!!C(Q));P(t,{id:`assets`,get open(){return C(a)},aside:n,children:(t,n)=>{I(t,{get items(){return C(Z)},get columns(){return ce},getKey:e=>e.path,label:`Static assets`,onactivate:e=>p(e.path).catch(()=>{}),get sort(){return C(J)},set sort(e){O(J,e,!0)},get selected(){return C(Y)},set selected(e){O(Y,e,!0)},row:(t,n=u,i)=>{let a=()=>(i?.()).visible;var o=ne(),l=_(o),d=A(l);{let e=r(()=>ie[G(n().type)]);s(d,{get name(){return C(e)},size:14})}var p=f(d,2),m=A(p);e(m,{get text(){return n().relativePath},get query(){return C(K)}}),c(p),c(l);var v=f(l,2),x=e=>{var t=ee(),r=k(t,!0);y(()=>g(r,n().type)),T(e,t)},S=r(()=>a().has(`type`));b(v,e=>{C(S)&&e(x)});var w=f(v,2),E=e=>{var t=te(),r=k(t,!0);y(e=>g(r,e),[()=>new Date(n().mtime).toLocaleDateString()]),T(e,t)},D=r(()=>a().has(`mtime`));b(w,e=>{C(D)&&e(E)});var O=f(w,2),M=A(O);let N;var P=f(M,2),F=k(P,!0);c(O),y((e,t)=>{N=h(M,``,N,{width:e}),g(F,t)},[()=>`${Math.max(2,n().size/C(se)*56)}px`,()=>j(n().size)]),T(t,o)},empty:e=>{var t=E(),n=_(t),a=e=>{i(e,{title:`Scanning static directory…`})},o=e=>{i(e,{icon:`errors`,tone:`error`,title:`Could not read assets`,children:(e,t)=>{var n=re(),r=k(n,!0);y(()=>g(r,W.error)),T(e,n)},$$slots:{default:!0}})},s=e=>{{let t=r(()=>W.data.length?`No assets match`:`No static assets`);i(e,{icon:`assets`,get title(){return C(t)}})}};b(n,e=>{W.loading?e(a):W.error?e(o,1):e(s,-1)}),T(e,t)},$$slots:{row:!0,empty:!0}})},$$slots:{aside:!0,default:!0}})}},$$slots:{toolbar:!0,actions:!0,default:!0}}),S()}export{U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.panel.svelte-6jyhgm{flex-direction:column;min-width:0;height:100%;display:flex}.header.svelte-6jyhgm{min-height:var(--header-h);border-bottom:1px solid var(--border);flex-wrap:wrap;flex-shrink:0;align-items:center;gap:6px 10px;padding:8px 12px 8px 16px;display:flex}.title.svelte-6jyhgm{font-size:var(--fs-md);letter-spacing:-.005em;white-space:nowrap;align-items:baseline;gap:8px;margin:0 6px 0 0;font-weight:600;display:flex}.count.svelte-6jyhgm{font-size:var(--fs-xs);color:var(--fg-faint);font-weight:500}.toolbar.svelte-6jyhgm{flex-wrap:wrap;flex:260px;align-items:center;gap:6px;min-width:0;display:flex}.actions.svelte-6jyhgm{align-items:center;gap:4px;margin-left:auto;display:flex}.body.svelte-6jyhgm{flex:1;min-height:0;position:relative}.body.scroll.svelte-6jyhgm{overflow:auto}.badge.svelte-1fmrh5r{border-radius:var(--radius-sm);height:17px;font-size:var(--fs-2xs);letter-spacing:.01em;white-space:nowrap;font-variant-numeric:tabular-nums;flex-shrink:0;align-items:center;gap:3px;padding:0 6px;font-weight:600;line-height:1;display:inline-flex}.neutral.svelte-1fmrh5r{background:var(--bg-active);color:var(--fg-muted)}.accent.svelte-1fmrh5r{background:var(--bg-selected);color:var(--accent-fg)}.green.svelte-1fmrh5r{background:var(--green-bg);color:var(--green)}.yellow.svelte-1fmrh5r{background:var(--yellow-bg);color:var(--yellow)}.red.svelte-1fmrh5r{background:var(--red-bg);color:var(--red)}.blue.svelte-1fmrh5r{background:var(--blue-bg);color:var(--blue)}.purple.svelte-1fmrh5r{background:var(--purple-bg);color:var(--purple)}.cyan.svelte-1fmrh5r{background:var(--cyan-bg);color:var(--cyan)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,B as t,J as n,Mt as r,Q as i,St as a,at as o,ct as s,gt as c,it as l,ot as u,xt as d,yt as f}from"./index-BzMw8R8l.js";var p=s(`<span class="count num svelte-6jyhgm"> </span>`),m=s(`<div class="toolbar svelte-6jyhgm"><!></div>`),h=s(`<div class="actions svelte-6jyhgm"><!></div>`),g=s(`<section class="panel svelte-6jyhgm"><header class="header svelte-6jyhgm"><h1 class="title svelte-6jyhgm"> <!></h1> <!> <!></header> <div><!></div></section>`);function _(s,_){let v=t(_,`count`,3,null),y=t(_,`scroll`,3,!1);var b=g(),x=f(b),S=f(x),C=f(S),w=a(C),T=e=>{var t=p(),n=d(t,!0);c(()=>o(n,v())),u(e,t)};l(w,e=>{v()!=null&&e(T)}),r(S);var E=a(S,2),D=t=>{var n=m(),i=f(n);e(i,()=>_.toolbar),r(n),u(t,n)};l(E,e=>{_.toolbar&&e(D)});var O=a(E,2),k=t=>{var n=h(),i=f(n);e(i,()=>_.actions),r(n),u(t,n)};l(O,e=>{_.actions&&e(k)}),r(x);var A=a(x,2);let j;var M=f(A);e(M,()=>_.children),r(A),r(b),c(()=>{n(b,`aria-label`,_.title),o(C,`${_.title??``} `),j=i(A,1,`body svelte-6jyhgm`,null,j,{scroll:y()})}),u(s,b)}var v=s(`<span><!></span>`);function y(a,o){let s=t(o,`tone`,3,`neutral`);var l=v(),d=f(l);e(d,()=>o.children),r(l),c(()=>{i(l,1,`badge ${s()??``}`,`svelte-1fmrh5r`),n(l,`title`,o.title)}),u(a,l)}export{_ as n,y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,Ct as n,Dt as r,F as i,I as a,J as o,Mt as s,N as c,Nt as l,P as u,Q as d,St as f,Tt as p,Z as m,at as h,bt as g,ct as _,gt as v,it as y,jt as b,kt as x,mt as S,nt as C,ot as w,s as T,st as E,tt as D,ut as O,wt as k,xt as A,yt as j}from"./index-BzMw8R8l.js";import{i as M,t as ee}from"./format-CW_NXiBg.js";import{n as N,t as P}from"./Badge-CBVv8IFU.js";import{t as F}from"./SplitView-B8lYXXEm.js";import{t as I}from"./SearchField-eocQu1eB.js";import{t as L}from"./DataTable-C6-tmcTQ.js";import{t as R}from"./Inspector-DGmAzhki.js";import{t as z}from"./Segmented-JGNuI5EZ.js";var B=_(`<!> <!>`,1),te=_(`<span class="stamp svelte-1fwnyq9"> </span>`),ne=_(`<p>Run <code>vite build</code> (or <code>pnpm build</code>) to produce chunks, then refresh.</p> <!>`,1),re=_(`<span></span>`),ie=_(`<span class="svelte-1fwnyq9"><i></i> <span class="num muted svelte-1fwnyq9"> </span></span>`),ae=_(`<!> <!> <!>`,1),oe=_(`<li class="mono truncate svelte-1fwnyq9"><!></li>`),se=_(`<h3 class="section-title">Modules <span class="num"> </span></h3> <ul class="mods svelte-1fwnyq9"></ul>`,1),ce=_(`<span class="end num muted"> </span>`),le=_(`<span class="end num faint"> </span>`),ue=_(`<span class="chunk svelte-1fwnyq9"><!> <span class="truncate mono file svelte-1fwnyq9"><!></span> <!></span> <!> <!> <span class="size end svelte-1fwnyq9"><span></span> <span> </span></span>`,1),de=_(`<div class="layout svelte-1fwnyq9"><div class="composition svelte-1fwnyq9" aria-label="Bundle composition"><div class="total svelte-1fwnyq9"><span class="muted">Total</span> <strong class="num svelte-1fwnyq9"> </strong></div> <div class="stack svelte-1fwnyq9" role="img"></div> <div class="legend svelte-1fwnyq9"></div></div> <div class="table svelte-1fwnyq9"><!></div></div>`);function V(_,V){t(V,!0);let H=a(T,{initial:null}),U=p(``),W=p(`all`),G=p(n({id:`size`,desc:!0})),K=p(null),q=e=>e.file.split(`.`).pop()??``,J=e=>q(e)===`js`||q(e)===`mjs`?`js`:q(e)===`css`?`css`:`other`,Y={js:`yellow`,css:`purple`,other:`neutral`},X=r(()=>H.data?.chunks??[]),fe=r(()=>{let e=c(S(U));return S(X).filter(t=>(S(W)===`all`||J(t)===S(W))&&(!e||e(t.file,t.name,...t.modules)))}),Z=r(()=>H.data?.totalSize??0),pe=r(()=>S(X).reduce((e,t)=>Math.max(e,t.size),1)),Q=r(()=>S(K)?S(X).find(e=>e.file===S(K))??null:null),$=r(()=>{let e={js:0,css:0,other:0};for(let t of S(X))e[J(t)]+=t.size;return e}),me=[{id:`file`,label:`Chunk`,width:`minmax(0, 1fr)`,sort:(e,t)=>e.file.localeCompare(t.file)},{id:`modules`,label:`Modules`,width:`72px`,align:`end`,descFirst:!0,minWidth:560,sort:(e,t)=>e.modules.length-t.modules.length},{id:`share`,label:`Share`,width:`64px`,align:`end`,descFirst:!0,minWidth:640,sort:(e,t)=>e.size-t.size},{id:`size`,label:`Size`,width:`150px`,align:`end`,descFirst:!0,sort:(e,t)=>e.size-t.size}];N(_,{title:`Build`,get count(){return S(X).length},toolbar:e=>{var t=B(),n=g(t);{let e=r(()=>[{value:`all`,label:`All`},{value:`js`,label:`JS`,count:S(X).filter(e=>J(e)===`js`).length},{value:`css`,label:`CSS`,count:S(X).filter(e=>J(e)===`css`).length},{value:`other`,label:`Other`,count:S(X).filter(e=>J(e)===`other`).length}]);z(n,{label:`Chunk type`,get options(){return S(e)},get value(){return S(W)},set value(e){k(W,e,!0)}})}var i=f(n,2);I(i,{placeholder:`Filter chunks or modules…`,get count(){return S(fe).length},get value(){return S(U)},set value(e){k(U,e,!0)}}),w(e,t)},actions:e=>{var t=B(),n=g(t),r=e=>{var t=te(),n=A(t);v(e=>h(n,`built ${e??``}`),[()=>new Date(H.data.timestamp).toLocaleString()]),w(e,t)};y(n,e=>{H.data?.timestamp&&e(r)});var i=f(n,2);u(i,{icon:`refresh`,variant:`ghost`,label:`Re-read build output`,get disabled(){return H.busy},onclick:()=>H.refresh()}),w(e,t)},children:(t,n)=>{var a=E(),c=g(a),p=e=>{i(e,{icon:`build`,title:`No build output found`,children:(e,t)=>{var n=ne(),r=f(g(n),2);u(r,{icon:`refresh`,onclick:()=>H.refresh(),children:(e,t)=>{b();var n=O(`Refresh`);w(e,n)},$$slots:{default:!0}}),w(e,n)},$$slots:{default:!0}})},_=t=>{var n=de(),a=j(n),c=j(a),u=f(j(c),2),p=A(u,!0);s(c);var _=f(c,2);D(_,20,()=>[`js`,`css`,`other`],e=>e,(e,t)=>{var n=E(),r=g(n),i=e=>{var n=re();let r;v(e=>{d(n,1,`seg ${t??``}`,`svelte-1fwnyq9`),o(n,`title`,`${t??``}: ${e??``}`),r=m(n,``,r,{"flex-grow":S($)[t]})},[()=>M(S($)[t])]),w(e,n)};y(r,e=>{S($)[t]&&e(i)}),w(e,n)}),s(_);var x=f(_,2);D(x,20,()=>[`js`,`css`,`other`],e=>e,(e,t)=>{var n=ie(),r=j(n),i=f(r),a=f(i),o=A(a,!0);s(n),v((e,n)=>{d(r,1,`dot ${t??``}`,`svelte-1fwnyq9`),h(i,`${e??``} `),h(o,n)},[()=>t.toUpperCase(),()=>M(S($)[t])]),w(e,n)}),s(x),s(a);var T=f(a,2),N=j(T);{let t=t=>{var n=E(),i=g(n),a=t=>{{let n=e=>{var t=ae(),n=g(t);{let e=r(()=>Y[J(S(Q))]);P(n,{get tone(){return S(e)},children:(e,t)=>{b();var n=O();v(e=>h(n,e),[()=>q(S(Q))]),w(e,n)},$$slots:{default:!0}})}var i=f(n,2);P(i,{children:(e,t)=>{b();var n=O();v(e=>h(n,e),[()=>M(S(Q).size)]),w(e,n)},$$slots:{default:!0}});var a=f(i,2),o=e=>{P(e,{tone:`accent`,children:(e,t)=>{b();var n=O(`entry`);w(e,n)},$$slots:{default:!0}})};y(a,e=>{S(Q).isEntry&&e(o)}),w(e,t)},i=r(()=>ee(S(Q).file));R(t,{get title(){return S(i)},get subtitle(){return S(Q).file},onclose:()=>k(K,null),badges:n,children:(t,n)=>{var r=se(),i=g(r),a=f(j(i)),c=A(a,!0);s(i);var l=f(i,2);D(l,21,()=>S(Q).modules.slice(0,1e3),C,(t,n)=>{var r=oe(),i=j(r);e(i,{get text(){return S(n)},get query(){return S(U)}}),s(r),v(()=>o(r,`title`,S(n))),w(t,r)}),s(l),v(()=>h(c,S(Q).modules.length)),w(t,r)},$$slots:{badges:!0,default:!0}})}};y(i,e=>{S(Q)&&e(a)}),w(t,n)},n=r(()=>!!S(Q));F(N,{id:`build`,get open(){return S(n)},aside:t,children:(t,n)=>{L(t,{get items(){return S(fe)},get columns(){return me},getKey:e=>e.file,label:`Build chunks`,get sort(){return S(G)},set sort(e){k(G,e,!0)},get selected(){return S(K)},set selected(e){k(K,e,!0)},row:(t,n=l,i)=>{let a=()=>(i?.()).visible;var o=ue(),c=g(o),u=j(c);{let e=r(()=>Y[J(n())]);P(u,{get tone(){return S(e)},children:(e,t)=>{b();var r=O();v(e=>h(r,e),[()=>q(n())]),w(e,r)},$$slots:{default:!0}})}var p=f(u,2),_=j(p);e(_,{get text(){return n().file},get query(){return S(U)}}),s(p);var x=f(p,2),C=e=>{P(e,{tone:`accent`,children:(e,t)=>{b();var n=O(`entry`);w(e,n)},$$slots:{default:!0}})};y(x,e=>{n().isEntry&&e(C)}),s(c);var T=f(c,2),E=e=>{var t=ce(),r=A(t,!0);v(()=>h(r,n().modules.length)),w(e,t)},D=r(()=>a().has(`modules`));y(T,e=>{S(D)&&e(E)});var k=f(T,2),ee=e=>{var t=le(),r=A(t);v(e=>h(r,`${e??``}%`),[()=>S(Z)?(n().size/S(Z)*100).toFixed(1):0]),w(e,t)},N=r(()=>a().has(`share`));y(k,e=>{S(N)&&e(ee)});var F=f(k,2),I=j(F);let L;var R=f(I,2);let z;var B=A(R,!0);s(F),v((e,t,r)=>{d(I,1,`bar ${e??``}`,`svelte-1fwnyq9`),L=m(I,``,L,{width:t}),z=d(R,1,`num svelte-1fwnyq9`,null,z,{big:n().size>25e4}),h(B,r)},[()=>J(n()),()=>`${Math.max(2,n().size/S(pe)*60)}px`,()=>M(n().size)]),w(t,o)},empty:e=>{{let t=r(()=>H.loading?void 0:`search`),n=r(()=>H.loading?`Reading build output…`:`No chunks match`);i(e,{get icon(){return S(t)},get title(){return S(n)}})}},$$slots:{row:!0,empty:!0}})},$$slots:{aside:!0,default:!0}})}s(T),s(n),v((e,t,n,r)=>{h(p,e),o(_,`aria-label`,`JS ${t??``}, CSS ${n??``}, other ${r??``}`)},[()=>M(S(Z)),()=>M(S($).js),()=>M(S($).css),()=>M(S($).other)]),w(t,n)};y(c,e=>{!H.loading&&S(X).length===0?e(p):e(_,-1)}),w(t,a)},$$slots:{toolbar:!0,actions:!0,default:!0}}),x()}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{At as e,B as t,Dt as n,J as r,L as i,Mt as a,St as o,at as s,bt as c,ct as l,gt as u,it as d,jt as f,kt as p,mt as m,ot as h,st as g,ut as _,xt as v,yt as y}from"./index-BzMw8R8l.js";var b=l(`of <span class="num"> </span>`,1),x=l(`Showing <!> <strong class="num svelte-52vxjm"> </strong> <!>`,1),S=l(`<!> <span class="num"> </span> dropped`,1),C=l(`<!> <span class="num"> </span> detached`,1),w=l(`<!> stale`,1),T=l(`<span class="notice svelte-52vxjm" role="status"><!> <!> <!> <!> <!></span>`);function E(l,E){e(E,!0);let D=t(E,`noun`,3,`items`),O=t(E,`detached`,3,0),k=t(E,`stale`,3,null),A={"runtime-count":`the app buffer was full before they were sent`,"runtime-bytes":`the app buffer hit its size budget before they were sent`,"server-count":`the dev server buffer was full`,"server-bytes":`the dev server buffer hit its size budget`},j=n(()=>!!E.info?.truncated&&(E.info.total===null||E.info.total>E.info.captured)),M=n(()=>E.info?.dropped?.reduce((e,t)=>e+t.count,0)??0),N=n(()=>[m(j)?E.info.total===null?`The dev server keeps ${E.info.captured.toLocaleString()} ${D()}; more exist in the app (total not reported).`:`The dev server keeps ${E.info.captured.toLocaleString()} ${D()}; ${(E.info.total-E.info.captured).toLocaleString()} more exist in the app.`:``,E.info?.policy?`Policy: ${E.info.policy}.`:``,...(E.info?.dropped??[]).filter(e=>e.count>0).map(e=>`${e.count.toLocaleString()} dropped: ${A[e.reason]??e.reason}.`),E.info?.valueTooLarge?`${E.info.valueTooLarge.toLocaleString()} values were too large to snapshot (shown as a size).`:``,O()?`${O().toLocaleString()} ${D()} are shown as roots because their parent was not captured.`:``,k()?`Stale: ${k()}.`:``].filter(Boolean).join(` `));var P=g(),F=c(P),I=e=>{var t=T(),n=y(t);i(n,{name:`warning`,size:12});var l=o(n,2),p=e=>{var t=x(),n=o(c(t)),r=e=>{var t=_();u(()=>s(t,E.info.policy)),h(e,t)};d(n,e=>{E.info.policy&&e(r)});var i=o(n,2),a=v(i,!0),l=o(i,2),f=e=>{var t=_(`of ?`);h(e,t)},p=e=>{var t=b(),n=o(c(t)),r=v(n,!0);u(e=>s(r,e),[()=>E.info.total.toLocaleString()]),h(e,t)};d(l,e=>{E.info.total===null?e(f):e(p,-1)}),u(e=>s(a,e),[()=>E.info.captured.toLocaleString()]),h(e,t)};d(l,e=>{m(j)&&e(p)});var g=o(l,2),D=e=>{var t=S(),n=c(t),r=e=>{var t=_(`·`);h(e,t)};d(n,e=>{m(j)&&e(r)});var i=o(n,2),a=v(i,!0);f(),u(e=>s(a,e),[()=>m(M).toLocaleString()]),h(e,t)};d(g,e=>{m(M)&&e(D)});var A=o(g,2),P=e=>{var t=C(),n=c(t),r=e=>{var t=_(`·`);h(e,t)};d(n,e=>{(m(j)||m(M))&&e(r)});var i=o(n,2),a=v(i,!0);f(),u(e=>s(a,e),[()=>O().toLocaleString()]),h(e,t)};d(A,e=>{O()&&e(P)});var F=o(A,2),I=e=>{var t=w(),n=c(t),r=e=>{var t=_(`·`);h(e,t)};d(n,e=>{(m(j)||m(M)||O())&&e(r)}),f(),h(e,t)};d(F,e=>{k()&&e(I)}),a(t),u(()=>r(t,`title`,m(N))),h(e,t)};d(F,e=>{(m(j)||m(M)||O()||k())&&e(I)}),h(l,P),p()}export{E as t};
|