@vitejs/devtools-vite 0.0.0-alpha.2 → 0.0.0-alpha.20

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.
Files changed (94) hide show
  1. package/dist/{dirs-Z7VQHyIZ.js → dirs-BzX7rGLP.mjs} +1 -1
  2. package/dist/dirs.mjs +3 -0
  3. package/dist/index.d.mts +407 -0
  4. package/dist/index.mjs +9607 -0
  5. package/dist/nitro.json +3 -3
  6. package/dist/public/200.html +1 -1
  7. package/dist/public/404.html +1 -1
  8. package/dist/public/_nuxt/4_YkMRLM.js +1 -0
  9. package/dist/public/_nuxt/B6cncnam.js +1 -0
  10. package/dist/public/_nuxt/BReKREoN.js +33 -0
  11. package/dist/public/_nuxt/BaYRDImg.js +1 -0
  12. package/dist/public/_nuxt/Bij65W5n.js +1 -0
  13. package/dist/public/_nuxt/Bja_t-aS.js +1 -0
  14. package/dist/public/_nuxt/BrNGuicP.js +1 -0
  15. package/dist/public/_nuxt/BwW8gZ6K.js +1 -0
  16. package/dist/public/_nuxt/C8YTjkYM.js +1 -0
  17. package/dist/public/_nuxt/CDPpT6Cf.js +1 -0
  18. package/dist/public/_nuxt/CE23KUMI.js +1 -0
  19. package/dist/public/_nuxt/{BdGMcGSQ.js → CEj_FX93.js} +1 -1
  20. package/dist/public/_nuxt/CNlvL5ez.js +1 -0
  21. package/dist/public/_nuxt/CPYYHqxX.js +1 -0
  22. package/dist/public/_nuxt/CroQ9lcn.js +1 -0
  23. package/dist/public/_nuxt/Cu87lOT3.js +1 -0
  24. package/dist/public/_nuxt/D6yJLdbI.js +1 -0
  25. package/dist/public/_nuxt/DDRvb9yv.js +1 -0
  26. package/dist/public/_nuxt/DHdbcQDR.js +1 -0
  27. package/dist/public/_nuxt/{DSjlpmm-.js → DJFg8Mze.js} +1 -1
  28. package/dist/public/_nuxt/DkNjWA7f.js +1 -0
  29. package/dist/public/_nuxt/Ds1hqjlp.js +4 -0
  30. package/dist/public/_nuxt/DuSH8vtp.js +1 -0
  31. package/dist/public/_nuxt/{BQ-NBLhA.js → EZmie0b_.js} +1 -1
  32. package/dist/public/_nuxt/HyHtDydt.js +1 -0
  33. package/dist/public/_nuxt/L7giCKVM.js +1 -0
  34. package/dist/public/_nuxt/NkHXFX5A.js +1 -0
  35. package/dist/public/_nuxt/R6f4Y_SJ.js +1 -0
  36. package/dist/public/_nuxt/XY_il7uL.js +2 -0
  37. package/dist/public/_nuxt/{_session_.B0BbH92J.css → _session_.BXMlcDmB.css} +1 -1
  38. package/dist/public/_nuxt/builds/latest.json +1 -1
  39. package/dist/public/_nuxt/builds/meta/57a53e55-aaa8-4c2f-ab28-ef6c47fc2198.json +1 -0
  40. package/dist/public/_nuxt/diff.worker-CvsEE-qa.js +10 -0
  41. package/dist/public/_nuxt/entry.D_RYm3_j.css +1 -0
  42. package/dist/public/_nuxt/error-404.DSMcJjv-.css +1 -0
  43. package/dist/public/_nuxt/error-500.wvWNQOmL.css +1 -0
  44. package/dist/public/_nuxt/gdDtDkxO.js +1 -0
  45. package/dist/public/_nuxt/kgaOZT0B.js +1 -0
  46. package/dist/public/_nuxt/mJg3pdS2.js +1 -0
  47. package/dist/public/_nuxt/s37iQDTO.js +1 -0
  48. package/dist/public/_nuxt/x1G1EAUP.js +1 -0
  49. package/dist/public/_nuxt/xtsFKyex.js +1 -0
  50. package/dist/public/index.html +1 -1
  51. package/package.json +25 -24
  52. package/dist/dirs.js +0 -3
  53. package/dist/index.d.ts +0 -118
  54. package/dist/index.js +0 -1465
  55. package/dist/public/_nuxt/B1Vd6rqS.js +0 -1
  56. package/dist/public/_nuxt/B2YLpys2.js +0 -1
  57. package/dist/public/_nuxt/B2fBtupD.js +0 -1
  58. package/dist/public/_nuxt/BBRXmiYk.js +0 -1
  59. package/dist/public/_nuxt/BL9XEsp7.js +0 -1
  60. package/dist/public/_nuxt/BO9hKuA-.js +0 -1
  61. package/dist/public/_nuxt/BcAccMwu.js +0 -1
  62. package/dist/public/_nuxt/BdSZoQls.js +0 -1
  63. package/dist/public/_nuxt/BjbaCuBE.js +0 -1
  64. package/dist/public/_nuxt/Bjr51Ks8.js +0 -1
  65. package/dist/public/_nuxt/BvuqupwD.js +0 -1
  66. package/dist/public/_nuxt/C2X_oPur.js +0 -1
  67. package/dist/public/_nuxt/C5J04JCq.js +0 -1
  68. package/dist/public/_nuxt/CQNn9qP2.js +0 -1
  69. package/dist/public/_nuxt/CS0-317H.js +0 -1
  70. package/dist/public/_nuxt/CciM0jEL.js +0 -1
  71. package/dist/public/_nuxt/CcwEApAr.js +0 -1
  72. package/dist/public/_nuxt/Ci9NHG69.js +0 -1
  73. package/dist/public/_nuxt/D1yk44lc.js +0 -1
  74. package/dist/public/_nuxt/DJTxkAFF.js +0 -11
  75. package/dist/public/_nuxt/DS2MKblJ.js +0 -1
  76. package/dist/public/_nuxt/DZeYNBxL.js +0 -1
  77. package/dist/public/_nuxt/D_Sk_I-u.js +0 -1
  78. package/dist/public/_nuxt/Dl8iHwQo.js +0 -2
  79. package/dist/public/_nuxt/IrMnfQaU.js +0 -1
  80. package/dist/public/_nuxt/Z5tyTJaP.js +0 -1
  81. package/dist/public/_nuxt/builds/meta/c3fb67dd-1302-42f7-af58-b6ed5d47dbe9.json +0 -1
  82. package/dist/public/_nuxt/cRQbgMUp.js +0 -1
  83. package/dist/public/_nuxt/diff.worker-BXxwMoGc.js +0 -10
  84. package/dist/public/_nuxt/entry.BiqpDmeM.css +0 -1
  85. package/dist/public/_nuxt/error-404.yUUAZDjV.css +0 -1
  86. package/dist/public/_nuxt/error-500.BHZzZRS-.css +0 -1
  87. package/dist/public/_nuxt/pXptjyzi.js +0 -1
  88. package/dist/public/_nuxt/rwBDQBzn.js +0 -1
  89. package/dist/public/_nuxt/tS5wJZMm.js +0 -1
  90. package/dist/public/_nuxt/yfNgynAH.js +0 -33
  91. package/dist/public/_nuxt/z9pSC1xM.js +0 -1
  92. /package/dist/{dirs.d.ts → dirs.d.mts} +0 -0
  93. /package/dist/public/_nuxt/{DnpfwSMy.js → Cvg1SSG2.js} +0 -0
  94. /package/dist/public/_nuxt/{l47FwQA-.js → jB8TYliU.js} +0 -0
@@ -4,4 +4,4 @@ import { fileURLToPath } from "node:url";
4
4
  const clientPublicDir = fileURLToPath(new URL("../dist/public", import.meta.url));
5
5
 
6
6
  //#endregion
7
- export { clientPublicDir };
7
+ export { clientPublicDir as t };
package/dist/dirs.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { t as clientPublicDir } from "./dirs-BzX7rGLP.mjs";
2
+
3
+ export { clientPublicDir };
@@ -0,0 +1,407 @@
1
+ import { RpcFunctionsCollector, RpcFunctionsCollectorBase } from "birpc-x";
2
+ import { Plugin, ResolvedConfig, ViteDevServer } from "vite";
3
+ import { Raw } from "vue";
4
+ import { BirpcReturn } from "birpc";
5
+ import { ChildProcess } from "node:child_process";
6
+
7
+ //#region ../kit/src/types/events.d.ts
8
+ interface EventsMap {
9
+ [event: string]: any;
10
+ }
11
+ interface EventUnsubscribe {
12
+ (): void;
13
+ }
14
+ interface EventEmitter<Events extends EventsMap> {
15
+ /**
16
+ * Calls each of the listeners registered for a given event.
17
+ *
18
+ * ```js
19
+ * ee.emit('tick', tickType, tickDuration)
20
+ * ```
21
+ *
22
+ * @param event The event name.
23
+ * @param args The arguments for listeners.
24
+ */
25
+ emit: <K extends keyof Events>(event: K, ...args: Parameters<Events[K]>) => void;
26
+ /**
27
+ * Calls the listeners for a given event once and then removes the listener.
28
+ *
29
+ * @param event The event name.
30
+ * @param args The arguments for listeners.
31
+ */
32
+ emitOnce: <K extends keyof Events>(event: K, ...args: Parameters<Events[K]>) => void;
33
+ /**
34
+ * Event names in keys and arrays with listeners in values.
35
+ *
36
+ * @internal
37
+ */
38
+ _listeners: Partial<{ [E in keyof Events]: Events[E][] }>;
39
+ /**
40
+ * Add a listener for a given event.
41
+ *
42
+ * ```js
43
+ * const unbind = ee.on('tick', (tickType, tickDuration) => {
44
+ * count += 1
45
+ * })
46
+ *
47
+ * disable () {
48
+ * unbind()
49
+ * }
50
+ * ```
51
+ *
52
+ * @param event The event name.
53
+ * @param cb The listener function.
54
+ * @returns Unbind listener from event.
55
+ */
56
+ on: <K extends keyof Events>(event: K, cb: Events[K]) => EventUnsubscribe;
57
+ /**
58
+ * Add a listener for a given event once.
59
+ *
60
+ * ```js
61
+ * const unbind = ee.once('tick', (tickType, tickDuration) => {
62
+ * count += 1
63
+ * })
64
+ *
65
+ * disable () {
66
+ * unbind()
67
+ * }
68
+ * ```
69
+ *
70
+ * @param event The event name.
71
+ * @param cb The listener function.
72
+ * @returns Unbind listener from event.
73
+ */
74
+ once: <K extends keyof Events>(event: K, cb: Events[K]) => EventUnsubscribe;
75
+ }
76
+ //#endregion
77
+ //#region ../kit/src/types/docks.d.ts
78
+ interface DevToolsDockHost {
79
+ readonly views: Map<string, DevToolsDockUserEntry>;
80
+ readonly events: EventEmitter<{
81
+ 'dock:entry:updated': (entry: DevToolsDockUserEntry) => void;
82
+ }>;
83
+ register: <T extends DevToolsDockUserEntry>(entry: T, force?: boolean) => {
84
+ update: (patch: Partial<T>) => void;
85
+ };
86
+ update: (entry: DevToolsDockUserEntry) => void;
87
+ values: () => DevToolsDockUserEntry[];
88
+ }
89
+ type DevToolsDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default';
90
+ type DevToolsDockEntryIcon = string | {
91
+ light: string;
92
+ dark: string;
93
+ };
94
+ interface DevToolsDockEntryBase {
95
+ id: string;
96
+ title: string;
97
+ icon: DevToolsDockEntryIcon;
98
+ /**
99
+ * The default order of the entry in the dock.
100
+ * The higher the number the earlier it appears.
101
+ * @default 0
102
+ */
103
+ defaultOrder?: number;
104
+ /**
105
+ * The category of the entry
106
+ * @default 'default'
107
+ */
108
+ category?: DevToolsDockEntryCategory;
109
+ /**
110
+ * Whether the entry should be hidden from the user.
111
+ * @default false
112
+ */
113
+ isHidden?: boolean;
114
+ }
115
+ interface ClientScriptEntry {
116
+ /**
117
+ * The filepath or module name to import from
118
+ */
119
+ importFrom: string;
120
+ /**
121
+ * The name to import the module as
122
+ *
123
+ * @default 'default'
124
+ */
125
+ importName?: string;
126
+ }
127
+ interface DevToolsViewIframe extends DevToolsDockEntryBase {
128
+ type: 'iframe';
129
+ url: string;
130
+ /**
131
+ * The id of the iframe, if multiple tabs is assigned with the same id, the iframe will be shared.
132
+ *
133
+ * When not provided, it would be treated as a unique frame.
134
+ */
135
+ frameId?: string;
136
+ /**
137
+ * Optional client script to import into the iframe
138
+ */
139
+ clientScript?: ClientScriptEntry;
140
+ }
141
+ type DevToolsViewLauncherStatus = 'idle' | 'loading' | 'success' | 'error';
142
+ interface DevToolsViewLauncher extends DevToolsDockEntryBase {
143
+ type: 'launcher';
144
+ launcher: {
145
+ icon?: DevToolsDockEntryIcon;
146
+ title: string;
147
+ status?: DevToolsViewLauncherStatus;
148
+ error?: string;
149
+ description?: string;
150
+ buttonStart?: string;
151
+ buttonLoading?: string;
152
+ onLaunch: () => Promise<void>;
153
+ };
154
+ }
155
+ interface DevToolsViewAction extends DevToolsDockEntryBase {
156
+ type: 'action';
157
+ action: ClientScriptEntry;
158
+ }
159
+ interface DevToolsViewCustomRender extends DevToolsDockEntryBase {
160
+ type: 'custom-render';
161
+ renderer: ClientScriptEntry;
162
+ }
163
+ interface DevToolsViewBuiltin extends DevToolsDockEntryBase {
164
+ type: '~builtin';
165
+ id: '~terminals' | '~logs';
166
+ }
167
+ type DevToolsDockUserEntry = DevToolsViewIframe | DevToolsViewAction | DevToolsViewCustomRender | DevToolsViewLauncher;
168
+ type DevToolsDockEntry = DevToolsDockUserEntry | DevToolsViewBuiltin;
169
+ //#endregion
170
+ //#region ../kit/src/types/rpc-augments.d.ts
171
+ /**
172
+ * To be extended
173
+ */
174
+ interface DevToolsRpcClientFunctions {}
175
+ /**
176
+ * To be extended
177
+ */
178
+ interface DevToolsRpcServerFunctions {}
179
+ //#endregion
180
+ //#region ../kit/src/client/rpc.d.ts
181
+ interface DevToolsRpcClient {
182
+ /**
183
+ * The events of the client
184
+ */
185
+ events: EventEmitter<RpcClientEvents>;
186
+ /**
187
+ * The connection meta
188
+ */
189
+ readonly connectionMeta: ConnectionMeta;
190
+ /**
191
+ * Call a RPC function on the server
192
+ */
193
+ call: BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>['$call'];
194
+ /**
195
+ * Call a RPC event on the server, and does not expect a response
196
+ */
197
+ callEvent: BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>['$callEvent'];
198
+ /**
199
+ * Call a RPC optional function on the server
200
+ */
201
+ callOptional: BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>['$callOptional'];
202
+ /**
203
+ * The client RPC host
204
+ */
205
+ client: DevToolsClientRpcHost;
206
+ }
207
+ //#endregion
208
+ //#region ../kit/src/client/docks.d.ts
209
+ interface DockPanelStorage {
210
+ width: number;
211
+ height: number;
212
+ top: number;
213
+ left: number;
214
+ position: 'left' | 'right' | 'bottom' | 'top';
215
+ open: boolean;
216
+ inactiveTimeout: number;
217
+ }
218
+ interface DevToolsClientContext {
219
+ /**
220
+ * The RPC client to interact with the server
221
+ */
222
+ readonly rpc: DevToolsRpcClient;
223
+ }
224
+ interface DocksContext extends DevToolsClientContext {
225
+ /**
226
+ * Type of the client environment
227
+ *
228
+ * 'embedded' - running inside an embedded floating panel
229
+ * 'standalone' - running inside a standalone window (no user app)
230
+ */
231
+ readonly clientType: 'embedded' | 'standalone';
232
+ /**
233
+ * The panel context
234
+ */
235
+ readonly panel: DocksPanelContext;
236
+ /**
237
+ * The docks entries context
238
+ */
239
+ readonly docks: DocksEntriesContext;
240
+ }
241
+ type DevToolsClientRpcHost = RpcFunctionsCollector<DevToolsRpcClientFunctions, DevToolsClientContext>;
242
+ interface DocksPanelContext {
243
+ store: DockPanelStorage;
244
+ isDragging: boolean;
245
+ isResizing: boolean;
246
+ readonly isVertical: boolean;
247
+ }
248
+ interface DocksEntriesContext {
249
+ selectedId: string | null;
250
+ readonly selected: DevToolsDockEntry | null;
251
+ entries: DevToolsDockEntry[];
252
+ entryToStateMap: Map<string, DockEntryState>;
253
+ /**
254
+ * Get the state of a dock entry by its ID
255
+ */
256
+ getStateById: (id: string) => DockEntryState | undefined;
257
+ /**
258
+ * Switch to the selected dock entry, pass `null` to clear the selection
259
+ *
260
+ * @returns Whether the selection was changed successfully
261
+ */
262
+ switchEntry: (id?: string | null) => Promise<boolean>;
263
+ }
264
+ interface DockEntryState {
265
+ entryMeta: DevToolsDockEntry;
266
+ readonly isActive: boolean;
267
+ domElements: {
268
+ iframe?: HTMLIFrameElement | null;
269
+ panel?: HTMLDivElement | null;
270
+ };
271
+ events: Raw<EventEmitter<DockEntryStateEvents>>;
272
+ }
273
+ interface DockEntryStateEvents {
274
+ 'entry:activated': () => void;
275
+ 'entry:deactivated': () => void;
276
+ 'entry:updated': (newMeta: DevToolsDockUserEntry) => void;
277
+ 'dom:panel:mounted': (panel: HTMLDivElement) => void;
278
+ 'dom:iframe:mounted': (iframe: HTMLIFrameElement) => void;
279
+ }
280
+ interface RpcClientEvents {}
281
+ //#endregion
282
+ //#region ../kit/src/client/client-script.d.ts
283
+ /**
284
+ * Context for client scripts running in dock entries
285
+ */
286
+ interface DockClientScriptContext extends DocksContext {
287
+ /**
288
+ * The state of the current dock entry
289
+ */
290
+ current: DockEntryState;
291
+ }
292
+ //#endregion
293
+ //#region ../kit/src/types/terminals.d.ts
294
+ interface DevToolsTerminalSessionStreamChunkEvent {
295
+ id: string;
296
+ chunks: string[];
297
+ ts: number;
298
+ }
299
+ interface DevToolsTerminalHost {
300
+ readonly sessions: Map<string, DevToolsTerminalSession>;
301
+ readonly events: EventEmitter<{
302
+ 'terminal:session:updated': (session: DevToolsTerminalSession) => void;
303
+ 'terminal:session:stream-chunk': (data: DevToolsTerminalSessionStreamChunkEvent) => void;
304
+ }>;
305
+ register: (session: DevToolsTerminalSession) => DevToolsTerminalSession;
306
+ update: (session: DevToolsTerminalSession) => void;
307
+ startChildProcess: (executeOptions: DevToolsChildProcessExecuteOptions, terminal: Omit<DevToolsTerminalSessionBase, 'status'>) => Promise<DevToolsChildProcessTerminalSession>;
308
+ }
309
+ type DevToolsTerminalStatus = 'running' | 'stopped' | 'error';
310
+ interface DevToolsTerminalSessionBase {
311
+ id: string;
312
+ title: string;
313
+ description?: string;
314
+ status: DevToolsTerminalStatus;
315
+ icon?: DevToolsDockEntryIcon;
316
+ }
317
+ interface DevToolsTerminalSession extends DevToolsTerminalSessionBase {
318
+ buffer?: string[];
319
+ stream?: ReadableStream<string>;
320
+ }
321
+ interface DevToolsChildProcessExecuteOptions {
322
+ command: string;
323
+ args: string[];
324
+ cwd?: string;
325
+ env?: Record<string, string>;
326
+ }
327
+ interface DevToolsChildProcessTerminalSession extends DevToolsTerminalSession {
328
+ type: 'child-process';
329
+ executeOptions: DevToolsChildProcessExecuteOptions;
330
+ getChildProcess: () => ChildProcess | undefined;
331
+ terminate: () => Promise<void>;
332
+ restart: () => Promise<void>;
333
+ }
334
+ //#endregion
335
+ //#region ../kit/src/types/views.d.ts
336
+ interface DevToolsViewHost {
337
+ /**
338
+ * @internal
339
+ */
340
+ buildStaticDirs: {
341
+ baseUrl: string;
342
+ distDir: string;
343
+ }[];
344
+ /**
345
+ * Helper to host static files
346
+ * - In `dev` mode, it will register middleware to `viteServer.middlewares` to host the static files
347
+ * - In `build` mode, it will copy the static files to the dist directory
348
+ */
349
+ hostStatic: (baseUrl: string, distDir: string) => void;
350
+ }
351
+ //#endregion
352
+ //#region ../kit/src/types/vite-plugin.d.ts
353
+ interface DevToolsCapabilities {
354
+ rpc?: boolean;
355
+ views?: boolean;
356
+ }
357
+ interface DevToolsPluginOptions {
358
+ capabilities?: {
359
+ dev?: DevToolsCapabilities | boolean;
360
+ build?: DevToolsCapabilities | boolean;
361
+ };
362
+ setup: (context: DevToolsNodeContext) => void | Promise<void>;
363
+ }
364
+ interface DevToolsNodeContext {
365
+ readonly cwd: string;
366
+ readonly mode: 'dev' | 'build';
367
+ readonly viteConfig: ResolvedConfig;
368
+ readonly viteServer?: ViteDevServer;
369
+ rpc: RpcFunctionsHost;
370
+ docks: DevToolsDockHost;
371
+ views: DevToolsViewHost;
372
+ utils: DevToolsNodeUtils;
373
+ terminals: DevToolsTerminalHost;
374
+ }
375
+ interface DevToolsNodeUtils {
376
+ /**
377
+ * Create a simple client script from a function or stringified code
378
+ *
379
+ * @deprecated DO NOT USE. This is mostly for testing only. Please use a proper importable module instead.
380
+ * @experimental
381
+ */
382
+ createSimpleClientScript: (fn: string | ((ctx: DockClientScriptContext) => void)) => ClientScriptEntry;
383
+ }
384
+ interface ConnectionMeta {
385
+ backend: 'websocket' | 'static';
386
+ websocket?: number | string;
387
+ }
388
+ //#endregion
389
+ //#region ../kit/src/types/rpc.d.ts
390
+ type RpcFunctionsHost = RpcFunctionsCollectorBase<DevToolsRpcServerFunctions, DevToolsNodeContext> & {
391
+ boardcast: <T extends keyof DevToolsRpcClientFunctions, Args extends Parameters<DevToolsRpcClientFunctions[T]>>(name: T, ...args: Args) => Promise<(Awaited<ReturnType<DevToolsRpcClientFunctions[T]>> | undefined)[]>;
392
+ };
393
+ //#endregion
394
+ //#region ../kit/src/types/vite-augment.d.ts
395
+ declare module 'vite' {
396
+ interface Plugin {
397
+ devtools?: DevToolsPluginOptions;
398
+ }
399
+ }
400
+ interface PluginWithDevTools extends Plugin {
401
+ devtools?: DevToolsPluginOptions;
402
+ }
403
+ //#endregion
404
+ //#region src/node/plugin.d.ts
405
+ declare function DevToolsViteUI(): PluginWithDevTools;
406
+ //#endregion
407
+ export { DevToolsViteUI };