@visulima/dev-toolbar 1.0.0-alpha.12 → 1.0.0-alpha.14
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 +14 -0
- package/LICENSE.md +21 -0
- package/dist/apps/a11y/index.d.ts +3 -2
- package/dist/apps/a11y/index.js +1 -1
- package/dist/apps/annotations/index.d.ts +3 -2
- package/dist/apps/annotations/index.js +1 -1
- package/dist/apps/assets/index.d.ts +3 -2
- package/dist/apps/assets/index.js +1 -1
- package/dist/apps/inspector/index.d.ts +3 -2
- package/dist/apps/inspector/index.js +1 -1
- package/dist/apps/module-graph/index.d.ts +3 -2
- package/dist/apps/module-graph/index.js +1 -1
- package/dist/apps/performance/index.d.ts +3 -2
- package/dist/apps/performance/index.js +1 -1
- package/dist/apps/seo/index.d.ts +3 -2
- package/dist/apps/seo/index.js +1 -1
- package/dist/apps/settings/index.d.ts +3 -2
- package/dist/apps/settings/index.js +1 -1
- package/dist/apps/tailwind/index.d.ts +3 -2
- package/dist/apps/timeline/index.d.ts +3 -2
- package/dist/apps/timeline/index.js +1 -1
- package/dist/apps/vite-config/index.d.ts +3 -2
- package/dist/apps/vite-config/index.js +1 -1
- package/dist/client/overlay.d.ts +1 -1
- package/dist/index.d.ts +143 -8
- package/dist/mcp/server.d.ts +2 -12
- package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
- package/dist/packem_shared/global-api.d-BLfn-OUA.d.ts +547 -0
- package/dist/packem_shared/{sharedToolbarStylesheet-CaTdYhVe.js → sharedToolbarStylesheet-Bx1muJAh.js} +1 -1
- package/dist/toolbar/index.d.ts +152 -48
- package/dist/toolbar/index.js +1 -1
- package/dist/ui/index.d.ts +382 -18
- package/dist/vite-plugin.d.ts +155 -146
- package/package.json +4 -4
- package/dist/apps/a11y/a11y-app.d.ts +0 -4
- package/dist/apps/a11y/a11y-store.d.ts +0 -42
- package/dist/apps/a11y/a11y-tooltip.d.ts +0 -10
- package/dist/apps/annotations/annotations-app.d.ts +0 -4
- package/dist/apps/assets/assets-app.d.ts +0 -4
- package/dist/apps/inspector/a11y-capture.d.ts +0 -12
- package/dist/apps/inspector/annotation-overlay.d.ts +0 -55
- package/dist/apps/inspector/annotation-settings.d.ts +0 -33
- package/dist/apps/inspector/element-utils.d.ts +0 -115
- package/dist/apps/inspector/freeze-animations.d.ts +0 -22
- package/dist/apps/inspector/inspector-app.d.ts +0 -14
- package/dist/apps/inspector/rulers.d.ts +0 -14
- package/dist/apps/inspector/theme-palette.d.ts +0 -34
- package/dist/apps/module-graph/module-graph-app.d.ts +0 -4
- package/dist/apps/performance/performance-app.d.ts +0 -4
- package/dist/apps/performance/performance-tooltip.d.ts +0 -4
- package/dist/apps/seo/seo-app.d.ts +0 -4
- package/dist/apps/settings/settings-app.d.ts +0 -4
- package/dist/apps/tailwind/tailwind-app.d.ts +0 -4
- package/dist/apps/timeline/timeline-app.d.ts +0 -4
- package/dist/apps/vite-config/vite-config-app.d.ts +0 -4
- package/dist/hooks/create-hook.d.ts +0 -12
- package/dist/hooks/events.d.ts +0 -7
- package/dist/hooks/global-hook.d.ts +0 -15
- package/dist/hooks/index.d.ts +0 -6
- package/dist/performance/monitor.d.ts +0 -116
- package/dist/rpc/client.d.ts +0 -9
- package/dist/rpc/functions/annotations.d.ts +0 -28
- package/dist/rpc/functions/assets.d.ts +0 -16
- package/dist/rpc/functions/module-graph.d.ts +0 -17
- package/dist/rpc/functions/open-in-editor.d.ts +0 -16
- package/dist/rpc/functions/tailwind-config.d.ts +0 -15
- package/dist/rpc/functions/vite-config.d.ts +0 -83
- package/dist/rpc/server.d.ts +0 -15
- package/dist/store/annotation-store.d.ts +0 -41
- package/dist/timeline/capture.d.ts +0 -8
- package/dist/timeline/index.d.ts +0 -8
- package/dist/timeline/store.d.ts +0 -42
- package/dist/toolbar/app-manager.d.ts +0 -104
- package/dist/toolbar/components/app-button.d.ts +0 -18
- package/dist/toolbar/components/app-canvas.d.ts +0 -12
- package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -12
- package/dist/toolbar/components/first-visit-hint.d.ts +0 -15
- package/dist/toolbar/components/index.d.ts +0 -4
- package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -22
- package/dist/toolbar/components/toolbar-bar.d.ts +0 -9
- package/dist/toolbar/components/toolbar-container.d.ts +0 -49
- package/dist/toolbar/components/vite-overlay-button.d.ts +0 -14
- package/dist/toolbar/context/index.d.ts +0 -2
- package/dist/toolbar/context/toolbar-context.d.ts +0 -107
- package/dist/toolbar/global-api.d.ts +0 -24
- package/dist/toolbar/helpers.d.ts +0 -8
- package/dist/toolbar/hooks/index.d.ts +0 -10
- package/dist/toolbar/hooks/use-apps.d.ts +0 -15
- package/dist/toolbar/hooks/use-frame-state.d.ts +0 -110
- package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -23
- package/dist/toolbar/hooks/use-position.d.ts +0 -24
- package/dist/toolbar/hooks/use-theme.d.ts +0 -15
- package/dist/toolbar/hooks/use-toolbar.d.ts +0 -16
- package/dist/toolbar/settings.d.ts +0 -17
- package/dist/toolbar/stylesheet.d.ts +0 -3
- package/dist/toolbar/utils/index.d.ts +0 -12
- package/dist/types/annotations.d.ts +0 -156
- package/dist/types/app.d.ts +0 -175
- package/dist/types/global-api.d.ts +0 -91
- package/dist/types/hooks.d.ts +0 -86
- package/dist/types/index.d.ts +0 -13
- package/dist/types/messaging.d.ts +0 -43
- package/dist/types/rpc.d.ts +0 -137
- package/dist/types/timeline.d.ts +0 -62
- package/dist/types/toolbar.d.ts +0 -56
- package/dist/ui/components/alert.d.ts +0 -19
- package/dist/ui/components/badge.d.ts +0 -9
- package/dist/ui/components/button.d.ts +0 -11
- package/dist/ui/components/card.d.ts +0 -16
- package/dist/ui/components/icon.d.ts +0 -19
- package/dist/ui/components/input.d.ts +0 -7
- package/dist/ui/components/label.d.ts +0 -7
- package/dist/ui/components/popover.d.ts +0 -27
- package/dist/ui/components/progress.d.ts +0 -7
- package/dist/ui/components/select.d.ts +0 -54
- package/dist/ui/components/separator.d.ts +0 -8
- package/dist/ui/components/skeleton.d.ts +0 -6
- package/dist/ui/components/switch.d.ts +0 -11
- package/dist/ui/components/tabs.d.ts +0 -28
- package/dist/ui/components/textarea.d.ts +0 -7
- package/dist/ui/components/tooltip.d.ts +0 -19
- package/dist/vite/inject-source.d.ts +0 -24
- package/dist/vite/matcher.d.ts +0 -6
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Viewport rulers & draggable guidelines for the inspector.
|
|
3
|
-
*
|
|
4
|
-
* Rulers are rendered with Canvas 2D (DPR-aware) along the top and left
|
|
5
|
-
* viewport edges. Users can drag from a ruler to spawn a guideline — a
|
|
6
|
-
* reference line that snaps to nearby element edges. Dragging a guideline
|
|
7
|
-
* back onto the ruler removes it.
|
|
8
|
-
*/
|
|
9
|
-
import type { InspectorPalette } from "./theme-palette.d.ts";
|
|
10
|
-
export declare const createRulers: (palette: InspectorPalette) => void;
|
|
11
|
-
export declare const removeRulers: () => void;
|
|
12
|
-
export declare const areRulersVisible: () => boolean;
|
|
13
|
-
/** Check if an element is part of the ruler/guideline system. */
|
|
14
|
-
export declare const isRulerElement: (element: Element) => boolean;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared theme palette for inspector and annotation overlay.
|
|
3
|
-
* Both run in document.body (outside Shadow DOM) so CSS variables
|
|
4
|
-
* from the toolbar's :host are not available. We resolve the theme
|
|
5
|
-
* from the same localStorage key used by use-theme.ts.
|
|
6
|
-
*/
|
|
7
|
-
export interface BasePalette {
|
|
8
|
-
bg: string;
|
|
9
|
-
btnBg: string;
|
|
10
|
-
btnBgHover: string;
|
|
11
|
-
btnBorder: string;
|
|
12
|
-
btnBorderHover: string;
|
|
13
|
-
fg: string;
|
|
14
|
-
muted: string;
|
|
15
|
-
primary: string;
|
|
16
|
-
shadow: string;
|
|
17
|
-
}
|
|
18
|
-
export interface InspectorPalette extends BasePalette {
|
|
19
|
-
overlayBg: string;
|
|
20
|
-
overlayBorder: string;
|
|
21
|
-
}
|
|
22
|
-
export interface AnnotationPalette extends BasePalette {
|
|
23
|
-
danger: string;
|
|
24
|
-
success: string;
|
|
25
|
-
}
|
|
26
|
-
export declare const INSPECTOR_DARK: InspectorPalette;
|
|
27
|
-
export declare const INSPECTOR_LIGHT: InspectorPalette;
|
|
28
|
-
export declare const ANNOTATION_DARK: AnnotationPalette;
|
|
29
|
-
export declare const ANNOTATION_LIGHT: AnnotationPalette;
|
|
30
|
-
export declare const isDarkTheme: () => boolean;
|
|
31
|
-
export declare const getInspectorPalette: () => InspectorPalette;
|
|
32
|
-
export declare const getAnnotationPalette: () => AnnotationPalette;
|
|
33
|
-
/** Reset cache (e.g. when theme changes). */
|
|
34
|
-
export declare const resetPaletteCache: () => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { DevToolbarApp } from "../types/app.d.ts";
|
|
2
|
-
import type { DevToolbarHook } from "../types/hooks.d.ts";
|
|
3
|
-
import type { TimelineEvent } from "../types/timeline.d.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Creates a dev toolbar hook instance.
|
|
6
|
-
* @param onRegisterApp Callback when app is registered.
|
|
7
|
-
* @param onTimelineEvent Callback when timeline event is added.
|
|
8
|
-
* @returns Hook instance.
|
|
9
|
-
*/
|
|
10
|
-
declare const createDevToolbarHook: (onRegisterApp?: (app: DevToolbarApp) => void, onTimelineEvent?: (groupId: string, event: TimelineEvent) => void) => DevToolbarHook;
|
|
11
|
-
export { createDevToolbarHook };
|
|
12
|
-
export default createDevToolbarHook;
|
package/dist/hooks/events.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { DevToolbarApp } from "../types/app.d.ts";
|
|
2
|
-
import type { DevToolbarHook } from "../types/hooks.d.ts";
|
|
3
|
-
import type { TimelineEvent } from "../types/timeline.d.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Setup global hook on window object.
|
|
6
|
-
* @param onRegisterApp Callback when app is registered.
|
|
7
|
-
* @param onTimelineEvent Callback when timeline event is added.
|
|
8
|
-
* @returns Hook instance.
|
|
9
|
-
*/
|
|
10
|
-
export declare const setupGlobalHook: (onRegisterApp?: (app: DevToolbarApp) => void, onTimelineEvent?: (groupId: string, event: TimelineEvent) => void) => DevToolbarHook;
|
|
11
|
-
/**
|
|
12
|
-
* Get the global hook instance.
|
|
13
|
-
* @returns Hook instance or undefined.
|
|
14
|
-
*/
|
|
15
|
-
export declare const getGlobalHook: () => DevToolbarHook | undefined;
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Performance Monitor — singleton that collects browser performance metrics.
|
|
3
|
-
*
|
|
4
|
-
* Metrics collected:
|
|
5
|
-
* - FPS via requestAnimationFrame circular buffer (last 60 samples)
|
|
6
|
-
* - Memory via performance.memory (Chrome only, 1-second polling)
|
|
7
|
-
* - Core Web Vitals: LCP, CLS, FID, FCP, TTFB (PerformanceObserver, buffered)
|
|
8
|
-
* - Long tasks (>50 ms blocking) via PerformanceObserver
|
|
9
|
-
*/
|
|
10
|
-
interface MemoryInfo {
|
|
11
|
-
/** JS heap size limit in bytes */
|
|
12
|
-
jsHeapSizeLimit: number;
|
|
13
|
-
/** Total allocated JS heap in bytes */
|
|
14
|
-
totalJSHeapSize: number;
|
|
15
|
-
/** Currently used JS heap in bytes */
|
|
16
|
-
usedJSHeapSize: number;
|
|
17
|
-
}
|
|
18
|
-
interface LongTask {
|
|
19
|
-
/** Duration in milliseconds */
|
|
20
|
-
duration: number;
|
|
21
|
-
/** Unique id */
|
|
22
|
-
id: string;
|
|
23
|
-
/** Start time (DOMHighResTimeStamp) */
|
|
24
|
-
startTime: number;
|
|
25
|
-
}
|
|
26
|
-
interface CoreWebVitals {
|
|
27
|
-
/** Cumulative Layout Shift score */
|
|
28
|
-
cls: number | undefined;
|
|
29
|
-
/** First Contentful Paint in ms */
|
|
30
|
-
fcp: number | undefined;
|
|
31
|
-
/** First Input Delay in ms */
|
|
32
|
-
fid: number | undefined;
|
|
33
|
-
/** Largest Contentful Paint in ms */
|
|
34
|
-
lcp: number | undefined;
|
|
35
|
-
/** Time to First Byte in ms */
|
|
36
|
-
ttfb: number | undefined;
|
|
37
|
-
}
|
|
38
|
-
interface PerformanceSnapshot {
|
|
39
|
-
/** Current FPS (0–60) */
|
|
40
|
-
fps: number;
|
|
41
|
-
/** Long tasks captured since start */
|
|
42
|
-
longTasks: LongTask[];
|
|
43
|
-
/** Memory info (Chrome only, otherwise undefined) */
|
|
44
|
-
memory: MemoryInfo | undefined;
|
|
45
|
-
/** Core Web Vitals */
|
|
46
|
-
vitals: CoreWebVitals;
|
|
47
|
-
}
|
|
48
|
-
type Listener = (snapshot: PerformanceSnapshot) => void;
|
|
49
|
-
declare const CWV_THRESHOLDS: {
|
|
50
|
-
readonly cls: {
|
|
51
|
-
readonly good: 0.1;
|
|
52
|
-
readonly poor: 0.25;
|
|
53
|
-
};
|
|
54
|
-
readonly fcp: {
|
|
55
|
-
readonly good: 1800;
|
|
56
|
-
readonly poor: 3000;
|
|
57
|
-
};
|
|
58
|
-
readonly fid: {
|
|
59
|
-
readonly good: 100;
|
|
60
|
-
readonly poor: 300;
|
|
61
|
-
};
|
|
62
|
-
readonly lcp: {
|
|
63
|
-
readonly good: 2500;
|
|
64
|
-
readonly poor: 4000;
|
|
65
|
-
};
|
|
66
|
-
readonly ttfb: {
|
|
67
|
-
readonly good: 800;
|
|
68
|
-
readonly poor: 1800;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
type CwvRating = "good" | "needs-improvement" | "poor";
|
|
72
|
-
declare const getCwvRating: (metric: keyof typeof CWV_THRESHOLDS, value: number) => CwvRating;
|
|
73
|
-
declare class PerformanceMonitor {
|
|
74
|
-
private clsValue;
|
|
75
|
-
private fpsSamples;
|
|
76
|
-
private listeners;
|
|
77
|
-
private longTaskIdCounter;
|
|
78
|
-
private longTasks;
|
|
79
|
-
private memory;
|
|
80
|
-
private memoryInterval;
|
|
81
|
-
private observers;
|
|
82
|
-
private rafId;
|
|
83
|
-
private running;
|
|
84
|
-
private vitals;
|
|
85
|
-
/**
|
|
86
|
-
* Removes all collected long tasks (useful for the "Clear" button in the UI).
|
|
87
|
-
*/
|
|
88
|
-
clearLongTasks(): void;
|
|
89
|
-
/**
|
|
90
|
-
* Returns a snapshot of the current metrics (no subscription).
|
|
91
|
-
*/
|
|
92
|
-
getSnapshot(): PerformanceSnapshot;
|
|
93
|
-
/**
|
|
94
|
-
* Starts collecting metrics. Safe to call multiple times — starts once.
|
|
95
|
-
*/
|
|
96
|
-
start(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Stops all observers and timers.
|
|
99
|
-
*/
|
|
100
|
-
stop(): void;
|
|
101
|
-
/**
|
|
102
|
-
* Subscribes to metric updates. Returns an unsubscribe function.
|
|
103
|
-
*/
|
|
104
|
-
subscribe(listener: Listener): () => void;
|
|
105
|
-
private currentFps;
|
|
106
|
-
private emit;
|
|
107
|
-
private loadTtfb;
|
|
108
|
-
private startCwv;
|
|
109
|
-
private startFps;
|
|
110
|
-
private startLongTasks;
|
|
111
|
-
private startMemory;
|
|
112
|
-
private tryObserve;
|
|
113
|
-
}
|
|
114
|
-
declare const performanceMonitor: PerformanceMonitor;
|
|
115
|
-
export type { CoreWebVitals, CwvRating, LongTask, MemoryInfo, PerformanceSnapshot };
|
|
116
|
-
export { CWV_THRESHOLDS, getCwvRating, PerformanceMonitor, performanceMonitor };
|
package/dist/rpc/client.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ClientFunctions, ClientRPCContext } from "../types/rpc.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Creates client-side RPC context.
|
|
4
|
-
* @param customFunctions Custom client functions to register.
|
|
5
|
-
* @returns Client RPC context.
|
|
6
|
-
*/
|
|
7
|
-
declare const createClientRPCContext: (customFunctions?: Partial<ClientFunctions>) => ClientRPCContext;
|
|
8
|
-
export { createClientRPCContext };
|
|
9
|
-
export default createClientRPCContext;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from "vite";
|
|
2
|
-
import type { Annotation, CreateAnnotationData, UpdateAnnotationData } from "../../types/annotations.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Get all annotations.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getAnnotations: (server: ViteDevServer) => Promise<Annotation[]>;
|
|
7
|
-
/**
|
|
8
|
-
* Create a new annotation.
|
|
9
|
-
* Only picks known fields from data to prevent injection of server-managed fields.
|
|
10
|
-
*/
|
|
11
|
-
export declare const createAnnotation: (server: ViteDevServer, data: CreateAnnotationData) => Promise<Annotation>;
|
|
12
|
-
/**
|
|
13
|
-
* Update an existing annotation.
|
|
14
|
-
*/
|
|
15
|
-
export declare const updateAnnotation: (server: ViteDevServer, id: string, data: UpdateAnnotationData) => Promise<Annotation | null>;
|
|
16
|
-
/**
|
|
17
|
-
* Delete an annotation.
|
|
18
|
-
*/
|
|
19
|
-
export declare const deleteAnnotation: (server: ViteDevServer, id: string) => Promise<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Save a screenshot from a base64 data URL.
|
|
22
|
-
* Returns the relative path within .devtoolbar/ (e.g. "screenshots/<id>.png").
|
|
23
|
-
*/
|
|
24
|
-
export declare const saveScreenshot: (server: ViteDevServer, annotationId: string, dataUrl: string) => Promise<string>;
|
|
25
|
-
/**
|
|
26
|
-
* Get a screenshot as a base64 data URL.
|
|
27
|
-
*/
|
|
28
|
-
export declare const getScreenshot: (server: ViteDevServer, annotationId: string) => Promise<string | null>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from "vite";
|
|
2
|
-
export interface StaticAsset {
|
|
3
|
-
/** Last-modified timestamp (ms since epoch) */
|
|
4
|
-
mtime: number;
|
|
5
|
-
/** Public URL path (e.g. "/images/logo.png") */
|
|
6
|
-
publicPath: string;
|
|
7
|
-
/** File size in bytes */
|
|
8
|
-
size: number;
|
|
9
|
-
/** Asset type category */
|
|
10
|
-
type: "audio" | "font" | "image" | "other" | "text" | "video";
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Walk the Vite publicDir and return serializable asset descriptors.
|
|
14
|
-
* Results are capped at MAX_ASSETS (5000) to prevent memory exhaustion.
|
|
15
|
-
*/
|
|
16
|
-
export declare const getStaticAssets: (server: ViteDevServer) => Promise<StaticAsset[]>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from "vite";
|
|
2
|
-
export interface SerializableModuleNode {
|
|
3
|
-
id: string;
|
|
4
|
-
importerCount: number;
|
|
5
|
-
importerUrls: string[];
|
|
6
|
-
url: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Get module dependency graph as serializable objects.
|
|
10
|
-
* Raw ModuleNode objects contain circular references (importers/importedModules)
|
|
11
|
-
* which cannot be JSON-serialized; this function returns a flat, safe representation.
|
|
12
|
-
* Importer URLs are extracted from each ModuleNode's importers Set before serialization
|
|
13
|
-
* so the client can display the full "imported by" list without a second RPC call.
|
|
14
|
-
* @param server Vite dev server instance
|
|
15
|
-
* @returns Array of serializable module entries
|
|
16
|
-
*/
|
|
17
|
-
export declare const getModuleGraph: (server: ViteDevServer) => Promise<SerializableModuleNode[]>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from "vite";
|
|
2
|
-
/**
|
|
3
|
-
* Open a file in the editor at a specific line/column.
|
|
4
|
-
* Uses `launch-editor` which knows the right CLI flags for each editor
|
|
5
|
-
* (e.g. `--goto` for VS Code, `-l` for vim, `--line` for Emacs, etc.).
|
|
6
|
-
* @param server Vite dev server instance.
|
|
7
|
-
* @param file File path (absolute or relative to server.config.root).
|
|
8
|
-
* @param line Line number (1-based).
|
|
9
|
-
* @param column Column number (1-based).
|
|
10
|
-
* @param editor Optional editor override — any value accepted by launch-editor
|
|
11
|
-
* (e.g. "code", "webstorm", "vim", "/usr/local/bin/hx"). When omitted,
|
|
12
|
-
* launch-editor auto-detects from EDITOR / VISUAL env vars or the running IDE.
|
|
13
|
-
*/
|
|
14
|
-
declare const openInEditor: (server: ViteDevServer, file: string, line?: number, column?: number, editor?: string) => Promise<void>;
|
|
15
|
-
export { openInEditor };
|
|
16
|
-
export default openInEditor;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from "vite";
|
|
2
|
-
interface TailwindConfigResult {
|
|
3
|
-
/** CSS files that \@import tailwindcss */
|
|
4
|
-
cssFiles: string[];
|
|
5
|
-
/** User-defined \@theme overrides/extensions */
|
|
6
|
-
customTheme: Record<string, string>;
|
|
7
|
-
/** Full default Tailwind theme tokens */
|
|
8
|
-
defaultTheme: Record<string, string>;
|
|
9
|
-
/** Detected Tailwind version */
|
|
10
|
-
version: "v3" | "v4" | "unknown";
|
|
11
|
-
}
|
|
12
|
-
declare const getTailwindConfig: (server: ViteDevServer) => Promise<TailwindConfigResult>;
|
|
13
|
-
export type { TailwindConfigResult };
|
|
14
|
-
export { getTailwindConfig };
|
|
15
|
-
export default getTailwindConfig;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from "vite";
|
|
2
|
-
type PluginInfo = {
|
|
3
|
-
enforce?: "post" | "pre";
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
6
|
-
/** Alias entry with find always normalized to string (RegExp serialized as "/pattern/flags") */
|
|
7
|
-
type AliasEntry = {
|
|
8
|
-
find: string;
|
|
9
|
-
replacement: string;
|
|
10
|
-
};
|
|
11
|
-
type ViteConfigSnapshot = {
|
|
12
|
-
base: string;
|
|
13
|
-
build: {
|
|
14
|
-
assetsDir?: string;
|
|
15
|
-
assetsInlineLimit?: number;
|
|
16
|
-
chunkSizeWarningLimit?: number;
|
|
17
|
-
cssCodeSplit?: boolean;
|
|
18
|
-
emptyOutDir?: boolean | null;
|
|
19
|
-
minify?: "esbuild" | "oxc" | "terser" | boolean;
|
|
20
|
-
outDir?: string;
|
|
21
|
-
reportCompressedSize?: boolean;
|
|
22
|
-
sourcemap?: "hidden" | "inline" | boolean;
|
|
23
|
-
target?: false | string | string[];
|
|
24
|
-
};
|
|
25
|
-
cacheDir: string;
|
|
26
|
-
css: {
|
|
27
|
-
devSourcemap?: boolean;
|
|
28
|
-
preprocessors: string[];
|
|
29
|
-
};
|
|
30
|
-
define?: Record<string, unknown>;
|
|
31
|
-
env?: Record<string, string>;
|
|
32
|
-
envDir?: string;
|
|
33
|
-
envPrefix?: string | string[];
|
|
34
|
-
esbuild?: {
|
|
35
|
-
jsx?: string;
|
|
36
|
-
jsxFactory?: string;
|
|
37
|
-
jsxFragment?: string;
|
|
38
|
-
jsxImportSource?: string;
|
|
39
|
-
target?: string | string[];
|
|
40
|
-
};
|
|
41
|
-
mode: string;
|
|
42
|
-
optimizeDeps: {
|
|
43
|
-
exclude?: string[];
|
|
44
|
-
include?: string[];
|
|
45
|
-
};
|
|
46
|
-
plugins: PluginInfo[];
|
|
47
|
-
publicDir: string;
|
|
48
|
-
resolve: {
|
|
49
|
-
alias?: AliasEntry[] | Record<string, string>;
|
|
50
|
-
conditions?: string[];
|
|
51
|
-
dedupe?: string[];
|
|
52
|
-
extensions?: string[];
|
|
53
|
-
mainFields?: string[];
|
|
54
|
-
preserveSymlinks?: boolean;
|
|
55
|
-
};
|
|
56
|
-
root: string;
|
|
57
|
-
server: {
|
|
58
|
-
cors?: boolean;
|
|
59
|
-
hmrEnabled?: boolean;
|
|
60
|
-
hmrPort?: number;
|
|
61
|
-
host?: boolean | string;
|
|
62
|
-
https?: boolean;
|
|
63
|
-
middlewareMode?: boolean | string;
|
|
64
|
-
open?: boolean | string;
|
|
65
|
-
origin?: string;
|
|
66
|
-
port?: number;
|
|
67
|
-
proxy?: string[];
|
|
68
|
-
strictPort?: boolean;
|
|
69
|
-
};
|
|
70
|
-
ssr?: {
|
|
71
|
-
external?: string[];
|
|
72
|
-
noExternal?: boolean | string[];
|
|
73
|
-
target?: string;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Gets Vite configuration from the dev server.
|
|
78
|
-
* @param server Vite dev server instance.
|
|
79
|
-
* @returns Vite config snapshot with the most useful fields.
|
|
80
|
-
*/
|
|
81
|
-
declare const getViteConfig: (server: ViteDevServer) => Promise<ViteConfigSnapshot>;
|
|
82
|
-
export { getViteConfig };
|
|
83
|
-
export default getViteConfig;
|
package/dist/rpc/server.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from "vite";
|
|
2
|
-
import type { ServerFunctions, ServerRPCContext } from "../types/rpc.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Creates server-side RPC context.
|
|
5
|
-
* @param server Vite dev server instance.
|
|
6
|
-
* @param customFunctions Custom server functions to register.
|
|
7
|
-
* @param options Additional options (e.g. which editor to launch).
|
|
8
|
-
* @param options.editor Editor to use for "open in editor" functionality.
|
|
9
|
-
* @returns Server RPC context.
|
|
10
|
-
*/
|
|
11
|
-
declare const createServerRPCContext: (server: ViteDevServer, customFunctions?: Partial<ServerFunctions>, options?: {
|
|
12
|
-
editor?: string;
|
|
13
|
-
}) => ServerRPCContext;
|
|
14
|
-
export { createServerRPCContext };
|
|
15
|
-
export default createServerRPCContext;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { Annotation } from "../types/annotations.d.ts";
|
|
2
|
-
/** Base directory for annotation storage (relative to project root) */
|
|
3
|
-
export declare const STORE_DIR = ".devtoolbar";
|
|
4
|
-
export declare const ANNOTATIONS_FILE = "annotations.json";
|
|
5
|
-
export declare const SCREENSHOTS_DIR = "screenshots";
|
|
6
|
-
/**
|
|
7
|
-
* Resolves absolute paths for the annotation store.
|
|
8
|
-
*/
|
|
9
|
-
export declare const resolvePaths: (root: string) => {
|
|
10
|
-
annotationsFile: string;
|
|
11
|
-
base: string;
|
|
12
|
-
screenshotsDir: string;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Validates that a resolved file path stays inside the store base directory.
|
|
16
|
-
* Prevents directory traversal attacks.
|
|
17
|
-
*/
|
|
18
|
-
export declare const isPathInsideBase: (filepath: string, baseDir: string) => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Sanitizes an ID for use as a filename — strips path separators and
|
|
21
|
-
* non-alphanumeric characters (except hyphens) to prevent traversal.
|
|
22
|
-
*/
|
|
23
|
-
export declare const sanitizeId: (id: string) => string;
|
|
24
|
-
/**
|
|
25
|
-
* Ensures the store directories exist.
|
|
26
|
-
*/
|
|
27
|
-
export declare const ensureStoreDir: (root: string) => Promise<void>;
|
|
28
|
-
export declare const withLock: <T>(function_: () => Promise<T>) => Promise<T>;
|
|
29
|
-
/**
|
|
30
|
-
* Reads all annotations from disk.
|
|
31
|
-
*/
|
|
32
|
-
export declare const readAnnotations: (root: string) => Promise<Annotation[]>;
|
|
33
|
-
/**
|
|
34
|
-
* Writes annotations to disk.
|
|
35
|
-
*/
|
|
36
|
-
export declare const writeAnnotations: (root: string, annotations: Annotation[]) => Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Deletes a screenshot file from disk.
|
|
39
|
-
* Validates the path stays inside the store directory to prevent traversal.
|
|
40
|
-
*/
|
|
41
|
-
export declare const deleteScreenshotFile: (root: string, screenshotPath: string) => Promise<void>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeline event capture
|
|
3
|
-
* Intercepts HMR events, fetch requests, and JS errors and feeds them
|
|
4
|
-
* into the timeline store so the Timeline app can display them.
|
|
5
|
-
*/
|
|
6
|
-
declare const startTimelineCapture: () => void;
|
|
7
|
-
export { startTimelineCapture };
|
|
8
|
-
export default startTimelineCapture;
|
package/dist/timeline/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeline system exports
|
|
3
|
-
*/
|
|
4
|
-
export type { TimelineEvent, TimelineEventLevel, TimelineGroup } from "../types/timeline.d.ts";
|
|
5
|
-
export { DEFAULT_TIMELINE_GROUPS } from "../types/timeline.d.ts";
|
|
6
|
-
export { startTimelineCapture } from "./capture.d.ts";
|
|
7
|
-
export type { TimelineStore } from "./store.d.ts";
|
|
8
|
-
export { getTimelineStore } from "./store.d.ts";
|
package/dist/timeline/store.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { TimelineEvent, TimelineGroup } from "../types/timeline.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Timeline store for managing timeline events.
|
|
4
|
-
*/
|
|
5
|
-
declare class TimelineStore {
|
|
6
|
-
private groups;
|
|
7
|
-
private maxEvents;
|
|
8
|
-
constructor(maxEvents?: number);
|
|
9
|
-
/**
|
|
10
|
-
* Adds an event to a group.
|
|
11
|
-
*/
|
|
12
|
-
addEvent(groupId: string, event: TimelineEvent): void;
|
|
13
|
-
/**
|
|
14
|
-
* Gets all timeline groups.
|
|
15
|
-
*/
|
|
16
|
-
getGroups(): TimelineGroup[];
|
|
17
|
-
/**
|
|
18
|
-
* Gets events for a specific group.
|
|
19
|
-
*/
|
|
20
|
-
getGroupEvents(groupId: string): TimelineEvent[];
|
|
21
|
-
/**
|
|
22
|
-
* Gets all events across all groups.
|
|
23
|
-
*/
|
|
24
|
-
getAllEvents(): TimelineEvent[];
|
|
25
|
-
/**
|
|
26
|
-
* Clears events for a specific group.
|
|
27
|
-
*/
|
|
28
|
-
clearGroup(groupId: string): void;
|
|
29
|
-
/**
|
|
30
|
-
* Clears all events from all groups.
|
|
31
|
-
*/
|
|
32
|
-
clearAll(): void;
|
|
33
|
-
/**
|
|
34
|
-
* Gets events within a time range.
|
|
35
|
-
*/
|
|
36
|
-
getEventsInRange(startTime: number, endTime: number): TimelineEvent[];
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Gets or creates the timeline store singleton instance.
|
|
40
|
-
*/
|
|
41
|
-
declare const getTimelineStore: () => TimelineStore;
|
|
42
|
-
export { getTimelineStore, TimelineStore };
|