@nuxt/devtools-kit 4.0.0-alpha.7 → 4.0.0-alpha.9
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/dist/index.cjs +134 -1
- package/dist/index.d.cts +241 -9
- package/dist/index.d.mts +241 -9
- package/dist/index.d.ts +241 -9
- package/dist/index.mjs +125 -2
- package/dist/runtime/iframe-client.d.ts +18 -0
- package/dist/runtime/iframe-client.mjs +7 -0
- package/dist/shared/{devtools-kit.BwQLAI1z.d.cts → devtools-kit.Do7_fnKq.d.cts} +229 -86
- package/dist/shared/{devtools-kit.BwQLAI1z.d.mts → devtools-kit.Do7_fnKq.d.mts} +229 -86
- package/dist/shared/{devtools-kit.BwQLAI1z.d.ts → devtools-kit.Do7_fnKq.d.ts} +229 -86
- package/dist/types.d.cts +27 -3
- package/dist/types.d.mts +27 -3
- package/dist/types.d.ts +27 -3
- package/package.json +8 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { DevToolsMessageLevel, DevToolsMessageFilePosition, ViteDevToolsNodeContext } from '@vitejs/devtools-kit';
|
|
1
2
|
import { VNode, MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import { DevToolsNodeContext } from '@vitejs/devtools-kit';
|
|
3
3
|
import { BirpcGroup } from 'birpc';
|
|
4
|
-
import { Component, NuxtOptions, NuxtPage, NuxtLayout, NuxtApp,
|
|
4
|
+
import { Component, NuxtOptions, NuxtPage, NuxtLayout, NuxtApp, Nuxt, NuxtDebugModuleMutationRecord } from 'nuxt/schema';
|
|
5
5
|
import { Import, UnimportMeta } from 'unimport';
|
|
6
6
|
import { RouteRecordNormalized } from 'vue-router';
|
|
7
7
|
import { Nitro, StorageMounts } from 'nitropack';
|
|
@@ -130,6 +130,7 @@ interface ModuleBuiltinTab {
|
|
|
130
130
|
title?: string;
|
|
131
131
|
path?: string;
|
|
132
132
|
category?: TabCategory;
|
|
133
|
+
defaultOrder?: number;
|
|
133
134
|
show?: () => MaybeRefOrGetter<any>;
|
|
134
135
|
badge?: () => MaybeRefOrGetter<number | string | undefined>;
|
|
135
136
|
onClick?: () => void;
|
|
@@ -137,6 +138,51 @@ interface ModuleBuiltinTab {
|
|
|
137
138
|
type ModuleTabInfo = ModuleCustomTab | ModuleBuiltinTab;
|
|
138
139
|
type CategorizedTabs = [TabCategory, (ModuleCustomTab | ModuleBuiltinTab)[]][];
|
|
139
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Severity level of a notification, mirroring devframe's message levels.
|
|
143
|
+
*
|
|
144
|
+
* Determines the color/icon of the entry in the Vite DevTools **Messages** dock
|
|
145
|
+
* and its toast.
|
|
146
|
+
*/
|
|
147
|
+
type NuxtDevtoolsNotifyLevel = DevToolsMessageLevel;
|
|
148
|
+
/**
|
|
149
|
+
* A Nuxt-friendly subset of devframe's `DevframeMessageEntryInput`.
|
|
150
|
+
*
|
|
151
|
+
* This is the input accepted by the `devtools:notify` Nuxt hook, the `notify`
|
|
152
|
+
* RPC function and the injected client's `notify()` — all of which forward to
|
|
153
|
+
* the connected `ctx.messages` host so notifications flow through the single
|
|
154
|
+
* devframe Messages system (persistent dock list + toast overlay).
|
|
155
|
+
*
|
|
156
|
+
* Tiers are expressed through the flags below:
|
|
157
|
+
* - **Ephemeral** (toast-only feedback like "Copied!"): `notify: true` with an
|
|
158
|
+
* `autoDismiss` (toast lifetime) and `autoDelete` (entry lifetime) so it never
|
|
159
|
+
* builds up history in the Messages dock.
|
|
160
|
+
* - **Persistent** (server-originated, leveled): omit `autoDelete` so the entry
|
|
161
|
+
* is kept in the Messages dock list.
|
|
162
|
+
*/
|
|
163
|
+
interface NuxtDevtoolsNotifyInput {
|
|
164
|
+
/** Short title / summary of the message. */
|
|
165
|
+
message: string;
|
|
166
|
+
/** Severity level. Defaults to `'info'`. */
|
|
167
|
+
level?: NuxtDevtoolsNotifyLevel;
|
|
168
|
+
/** Optional detailed description or explanation. */
|
|
169
|
+
description?: string;
|
|
170
|
+
/** Optional tags/labels for filtering in the Messages dock. */
|
|
171
|
+
labels?: string[];
|
|
172
|
+
/** Optional grouping category (e.g. `'build'`, `'lint'`, `'runtime'`). */
|
|
173
|
+
category?: string;
|
|
174
|
+
/** Optional source file position (e.g. for a build/lint error). */
|
|
175
|
+
filePosition?: DevToolsMessageFilePosition;
|
|
176
|
+
/** Optional stack trace string. */
|
|
177
|
+
stacktrace?: string;
|
|
178
|
+
/** Whether this message should also appear as a transient toast. */
|
|
179
|
+
notify?: boolean;
|
|
180
|
+
/** Time in ms to auto-dismiss the toast (client-side). */
|
|
181
|
+
autoDismiss?: number;
|
|
182
|
+
/** Time in ms to auto-delete the entry from the persistent list (server-side). */
|
|
183
|
+
autoDelete?: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
140
186
|
interface HookInfo {
|
|
141
187
|
name: string;
|
|
142
188
|
start: number;
|
|
@@ -338,13 +384,8 @@ interface ComponentWithRelationships {
|
|
|
338
384
|
dependencies?: string[];
|
|
339
385
|
dependents?: string[];
|
|
340
386
|
}
|
|
341
|
-
interface CodeServerOptions {
|
|
342
|
-
codeBinary: string;
|
|
343
|
-
launchArg: string;
|
|
344
|
-
licenseTermsArg: string;
|
|
345
|
-
connectionTokenArg: string;
|
|
346
|
-
}
|
|
347
387
|
|
|
388
|
+
/** @deprecated Part of the removed `vscode` integration. */
|
|
348
389
|
type CodeServerType = 'ms-code-cli' | 'ms-code-server' | 'coder-code-server';
|
|
349
390
|
interface ModuleOptions {
|
|
350
391
|
/**
|
|
@@ -359,8 +400,12 @@ interface ModuleOptions {
|
|
|
359
400
|
* This is in static format, for dynamic injection, call `nuxt.hook('devtools:customTabs')` instead
|
|
360
401
|
*/
|
|
361
402
|
customTabs?: ModuleCustomTab[];
|
|
403
|
+
/** Code Server integration options. */
|
|
404
|
+
codeServer?: CodeServerIntegrationOptions;
|
|
362
405
|
/**
|
|
363
|
-
* VS Code Server integration options.
|
|
406
|
+
* Legacy VS Code Server integration options.
|
|
407
|
+
*
|
|
408
|
+
* @deprecated Use `codeServer`. Legacy modes are no longer supported.
|
|
364
409
|
*/
|
|
365
410
|
vscode?: VSCodeIntegrationOptions;
|
|
366
411
|
/**
|
|
@@ -380,7 +425,14 @@ interface ModuleOptions {
|
|
|
380
425
|
*/
|
|
381
426
|
viteInspect?: boolean;
|
|
382
427
|
/**
|
|
383
|
-
*
|
|
428
|
+
* Disable the DevTools client authorization prompt, allowing any browser to
|
|
429
|
+
* connect without approving it first.
|
|
430
|
+
*
|
|
431
|
+
* Defaults to `true` in sandboxed environments (StackBlitz, CodeSandbox).
|
|
432
|
+
*
|
|
433
|
+
* Note: disabling authorization lets any browser (including other devices, if
|
|
434
|
+
* you expose the dev server to your LAN/WAN) connect to DevTools and access
|
|
435
|
+
* your server and filesystem. Only disable it in trusted environments.
|
|
384
436
|
*/
|
|
385
437
|
disableAuthorization?: boolean;
|
|
386
438
|
/**
|
|
@@ -442,6 +494,31 @@ interface ModuleOptions {
|
|
|
442
494
|
*/
|
|
443
495
|
telemetry?: boolean;
|
|
444
496
|
}
|
|
497
|
+
interface CodeServerIntegrationOptions {
|
|
498
|
+
/**
|
|
499
|
+
* Enable the Code Server integration.
|
|
500
|
+
*
|
|
501
|
+
* @default true
|
|
502
|
+
*/
|
|
503
|
+
enabled?: boolean;
|
|
504
|
+
/** Path or command name for Coder's `code-server` binary. */
|
|
505
|
+
bin?: string;
|
|
506
|
+
/** Workspace opened by Code Server. Defaults to the Nuxt root directory. */
|
|
507
|
+
cwd?: string;
|
|
508
|
+
/** Port for the Code Server process. Defaults to the plugin's free-port behavior. */
|
|
509
|
+
serverPort?: number;
|
|
510
|
+
/** Host for the Code Server process. Defaults to the plugin's loopback host. */
|
|
511
|
+
host?: string;
|
|
512
|
+
/** Additional safe arguments passed to `code-server`. */
|
|
513
|
+
args?: string[];
|
|
514
|
+
/** Additional safe environment variables passed to `code-server`. */
|
|
515
|
+
env?: Record<string, string>;
|
|
516
|
+
/** Suffix used to isolate the authenticated Code Server session cookie. */
|
|
517
|
+
cookieSuffix?: string;
|
|
518
|
+
/** Milliseconds to wait for Code Server to become ready. */
|
|
519
|
+
startTimeout?: number;
|
|
520
|
+
}
|
|
521
|
+
/** @deprecated Use {@link CodeServerIntegrationOptions}. */
|
|
445
522
|
interface VSCodeIntegrationOptions {
|
|
446
523
|
/**
|
|
447
524
|
* Enable VS Code Server integration
|
|
@@ -487,6 +564,7 @@ interface VSCodeIntegrationOptions {
|
|
|
487
564
|
*/
|
|
488
565
|
host?: string;
|
|
489
566
|
}
|
|
567
|
+
/** @deprecated Tunnels are not supported by the Code Server integration. */
|
|
490
568
|
interface VSCodeTunnelOptions {
|
|
491
569
|
/**
|
|
492
570
|
* the machine name for port forwarding service
|
|
@@ -509,13 +587,10 @@ interface NuxtDevToolsOptions {
|
|
|
509
587
|
componentsView: 'list' | 'graph';
|
|
510
588
|
hiddenTabCategories: string[];
|
|
511
589
|
hiddenTabs: string[];
|
|
512
|
-
interactionCloseOnOutsideClick: boolean;
|
|
513
590
|
pinnedTabs: string[];
|
|
514
591
|
scale: number;
|
|
515
592
|
showExperimentalFeatures: boolean;
|
|
516
593
|
showHelpButtons: boolean;
|
|
517
|
-
sidebarExpanded: boolean;
|
|
518
|
-
sidebarScrollable: boolean;
|
|
519
594
|
};
|
|
520
595
|
serverRoutes: {
|
|
521
596
|
selectedRoute: ServerRouteInfo | null;
|
|
@@ -547,55 +622,23 @@ interface AnalyzeBuildMeta extends NuxtAnalyzeMeta {
|
|
|
547
622
|
}
|
|
548
623
|
interface AnalyzeBuildsInfo {
|
|
549
624
|
isBuilding: boolean;
|
|
550
|
-
builds: AnalyzeBuildMeta[];
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
interface TerminalBase {
|
|
554
|
-
id: string;
|
|
555
|
-
name: string;
|
|
556
|
-
description?: string;
|
|
557
|
-
icon?: string;
|
|
558
|
-
}
|
|
559
|
-
type TerminalAction = 'restart' | 'terminate' | 'clear' | 'remove';
|
|
560
|
-
interface SubprocessOptions {
|
|
561
|
-
command: string;
|
|
562
|
-
args?: string[];
|
|
563
|
-
cwd?: string;
|
|
564
|
-
env?: Record<string, string | undefined>;
|
|
565
|
-
nodeOptions?: SpawnOptions;
|
|
566
|
-
}
|
|
567
|
-
interface TerminalInfo extends TerminalBase {
|
|
568
625
|
/**
|
|
569
|
-
*
|
|
626
|
+
* Unique id of the terminal session for the build currently in flight, or
|
|
627
|
+
* `undefined` when idle. The client reveals this session and derives its
|
|
628
|
+
* "Building…" state from it instead of an `onTerminalExit` broadcast.
|
|
570
629
|
*/
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
* Whether the terminal can be terminated
|
|
574
|
-
*/
|
|
575
|
-
terminatable?: boolean;
|
|
576
|
-
/**
|
|
577
|
-
* Whether the terminal is terminated
|
|
578
|
-
*/
|
|
579
|
-
isTerminated?: boolean;
|
|
580
|
-
/**
|
|
581
|
-
* Content buffer
|
|
582
|
-
*/
|
|
583
|
-
buffer?: string;
|
|
584
|
-
}
|
|
585
|
-
interface TerminalState extends TerminalInfo {
|
|
586
|
-
/**
|
|
587
|
-
* User action to restart the terminal, when not provided, this action will be disabled
|
|
588
|
-
*/
|
|
589
|
-
onActionRestart?: () => Promise<void> | void;
|
|
590
|
-
/**
|
|
591
|
-
* User action to terminate the terminal, when not provided, this action will be disabled
|
|
592
|
-
*/
|
|
593
|
-
onActionTerminate?: () => Promise<void> | void;
|
|
630
|
+
activeSessionId?: string;
|
|
631
|
+
builds: AnalyzeBuildMeta[];
|
|
594
632
|
}
|
|
595
633
|
|
|
596
634
|
interface ServerFunctions {
|
|
597
635
|
getServerConfig: () => NuxtOptions;
|
|
598
636
|
getServerDebugContext: () => Promise<ServerDebugContext | undefined>;
|
|
637
|
+
/**
|
|
638
|
+
* @deprecated Replaced by the Data Inspector panel's live `Nuxt Application`
|
|
639
|
+
* source. Kept as a compatibility shim (emits `NDT_DEP_0009`) for one
|
|
640
|
+
* migration window and will be removed in a future major.
|
|
641
|
+
*/
|
|
599
642
|
getServerData: () => Promise<NuxtServerData>;
|
|
600
643
|
getServerRuntimeConfig: () => Record<string, any>;
|
|
601
644
|
getModuleOptions: () => ModuleOptions;
|
|
@@ -618,9 +661,7 @@ interface ServerFunctions {
|
|
|
618
661
|
runNpmCommand: (command: NpmCommandType, packageName: string, options?: NpmCommandOptions) => Promise<{
|
|
619
662
|
processId: string;
|
|
620
663
|
} | undefined>;
|
|
621
|
-
|
|
622
|
-
getTerminalDetail: (id: string) => Promise<TerminalInfo | undefined>;
|
|
623
|
-
runTerminalAction: (id: string, action: TerminalAction) => Promise<boolean>;
|
|
664
|
+
revealTerminal: (id: string) => Promise<boolean>;
|
|
624
665
|
getStorageMounts: () => Promise<StorageMounts>;
|
|
625
666
|
getStorageKeys: (base?: string) => Promise<string[]>;
|
|
626
667
|
getStorageItem: (key: string) => Promise<StorageValue>;
|
|
@@ -635,13 +676,14 @@ interface ServerFunctions {
|
|
|
635
676
|
writeStaticAssets: (file: AssetEntry[], folder: string) => Promise<string[]>;
|
|
636
677
|
deleteStaticAsset: (filepath: string) => Promise<void>;
|
|
637
678
|
renameStaticAsset: (oldPath: string, newPath: string) => Promise<void>;
|
|
679
|
+
notify: (input: NuxtDevtoolsNotifyInput) => Promise<void>;
|
|
638
680
|
telemetryEvent: (payload: object, immediate?: boolean) => void;
|
|
639
681
|
customTabAction: (name: string, action: number) => Promise<boolean>;
|
|
640
682
|
enablePages: () => Promise<void>;
|
|
641
683
|
openInEditor: (filepath: string) => Promise<boolean>;
|
|
642
684
|
restartNuxt: (hard?: boolean) => Promise<void>;
|
|
643
|
-
installNuxtModule: (name: string, dry?: boolean) => Promise<InstallModuleReturn>;
|
|
644
|
-
uninstallNuxtModule: (name: string, dry?: boolean) => Promise<InstallModuleReturn>;
|
|
685
|
+
installNuxtModule: (name: string, dry?: boolean, sessionId?: string) => Promise<InstallModuleReturn>;
|
|
686
|
+
uninstallNuxtModule: (name: string, dry?: boolean, sessionId?: string) => Promise<InstallModuleReturn>;
|
|
645
687
|
enableTimeline: (dry: boolean) => Promise<[string, string]>;
|
|
646
688
|
requestForAuth: (info?: string, origin?: string) => Promise<void>;
|
|
647
689
|
verifyAuthToken: () => Promise<boolean>;
|
|
@@ -650,15 +692,23 @@ interface ClientFunctions {
|
|
|
650
692
|
refresh: (event: ClientUpdateEvent) => void;
|
|
651
693
|
callHook: (hook: string, ...args: any[]) => Promise<void>;
|
|
652
694
|
navigateTo: (path: string) => void;
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
695
|
+
/**
|
|
696
|
+
* Minimal server→client completion signal for generic package updates only
|
|
697
|
+
* (`runNpmCommand`): the run RPC returns before the process exits, so this
|
|
698
|
+
* lets `usePackageUpdate` and the restart prompt settle once it finishes. It
|
|
699
|
+
* carries only `{ id, code }` and is not a terminal-data transport. Module
|
|
700
|
+
* install/uninstall and analyze-build no longer rely on it — they clear their
|
|
701
|
+
* UI from the awaited RPC / refreshed info instead.
|
|
702
|
+
*/
|
|
657
703
|
onTerminalExit: (_: {
|
|
658
704
|
id: string;
|
|
659
705
|
code?: number;
|
|
660
706
|
}) => void;
|
|
661
707
|
}
|
|
708
|
+
/**
|
|
709
|
+
* @deprecated The payload of the deprecated {@link ServerFunctions.getServerData}
|
|
710
|
+
* shim. Use the Data Inspector panel's live `Nuxt Application` source instead.
|
|
711
|
+
*/
|
|
662
712
|
interface NuxtServerData {
|
|
663
713
|
nuxt: NuxtOptions;
|
|
664
714
|
nitro?: Nitro['options'];
|
|
@@ -670,13 +720,16 @@ interface NuxtServerData {
|
|
|
670
720
|
type ClientUpdateEvent = keyof ServerFunctions;
|
|
671
721
|
|
|
672
722
|
/**
|
|
673
|
-
*
|
|
674
|
-
*
|
|
723
|
+
* Legacy Nuxt DevTools RPC compatibility surface exposed on `nuxt.devtools.rpc`.
|
|
724
|
+
*
|
|
725
|
+
* For new integrations prefer {@link onDevtoolsReady}, where the connected
|
|
726
|
+
* `ViteDevToolsNodeContext` gives you the full devframe `ctx.rpc`
|
|
727
|
+
* (`register`/`invokeLocal`/`broadcast`/`sharedState`/…).
|
|
675
728
|
*/
|
|
676
729
|
interface NuxtDevtoolsRpc {
|
|
677
730
|
/**
|
|
678
731
|
* Broadcast proxy for calling client functions.
|
|
679
|
-
* Supports `rpc.broadcast.refresh.asEvent(event)`
|
|
732
|
+
* Supports `rpc.broadcast.refresh.asEvent(event)` for backward compatibility.
|
|
680
733
|
*/
|
|
681
734
|
broadcast: {
|
|
682
735
|
[K in keyof ClientFunctions]: ClientFunctions[K] & {
|
|
@@ -684,7 +737,7 @@ interface NuxtDevtoolsRpc {
|
|
|
684
737
|
};
|
|
685
738
|
};
|
|
686
739
|
/**
|
|
687
|
-
* Proxy for
|
|
740
|
+
* Proxy for reading/writing server functions locally.
|
|
688
741
|
*/
|
|
689
742
|
functions: ServerFunctions;
|
|
690
743
|
}
|
|
@@ -696,9 +749,14 @@ interface NuxtDevtoolsServerContext {
|
|
|
696
749
|
options: ModuleOptions;
|
|
697
750
|
rpc: NuxtDevtoolsRpc;
|
|
698
751
|
/**
|
|
699
|
-
* The Vite DevTools
|
|
752
|
+
* The connected Vite DevTools kit context (`docks`/`terminals`/`messages`/
|
|
753
|
+
* `commands`/`rpc`/`diagnostics`/…).
|
|
754
|
+
*
|
|
755
|
+
* This is the raw escape hatch and is `undefined` until the Vite DevTools
|
|
756
|
+
* plugin connects. Prefer {@link onDevtoolsReady}, which hands you the
|
|
757
|
+
* connected context.
|
|
700
758
|
*/
|
|
701
|
-
devtoolsKit:
|
|
759
|
+
devtoolsKit: ViteDevToolsNodeContext | undefined;
|
|
702
760
|
/**
|
|
703
761
|
* Hook to open file in editor
|
|
704
762
|
*/
|
|
@@ -707,6 +765,19 @@ interface NuxtDevtoolsServerContext {
|
|
|
707
765
|
* Invalidate client cache for a function and ask for re-fetching
|
|
708
766
|
*/
|
|
709
767
|
refresh: (event: keyof ServerFunctions) => void;
|
|
768
|
+
/**
|
|
769
|
+
* Push a notification through the devframe Messages system (`ctx.messages`).
|
|
770
|
+
*
|
|
771
|
+
* The connected messages host surfaces it in the Vite DevTools **Messages**
|
|
772
|
+
* dock and/or as a toast. Calls made before the kit connects are buffered and
|
|
773
|
+
* replayed on connect. Used by the `devtools:notify` hook, the `notify` RPC
|
|
774
|
+
* function and the curated built-in notification sources.
|
|
775
|
+
*/
|
|
776
|
+
notify: (input: NuxtDevtoolsNotifyInput) => void;
|
|
777
|
+
/**
|
|
778
|
+
* @deprecated Use the Vite DevTools RPC registration instead:
|
|
779
|
+
* `nuxt.devtools.rpc.register(defineRpcFunction(...))`. Kept working as a shim.
|
|
780
|
+
*/
|
|
710
781
|
extendServerRpc: <ClientFunctions extends object = Record<string, unknown>, ServerFunctions extends object = Record<string, unknown>>(name: string, functions: ServerFunctions) => BirpcGroup<ClientFunctions, ServerFunctions>;
|
|
711
782
|
}
|
|
712
783
|
interface NuxtDevtoolsInfo {
|
|
@@ -726,6 +797,64 @@ interface ServerDebugContext {
|
|
|
726
797
|
moduleMutationRecords: ServerDebugModuleMutationRecord[];
|
|
727
798
|
}
|
|
728
799
|
|
|
800
|
+
interface TerminalBase {
|
|
801
|
+
id: string;
|
|
802
|
+
name: string;
|
|
803
|
+
description?: string;
|
|
804
|
+
icon?: string;
|
|
805
|
+
}
|
|
806
|
+
type TerminalAction = 'restart' | 'terminate' | 'clear' | 'remove';
|
|
807
|
+
interface SubprocessOptions {
|
|
808
|
+
command: string;
|
|
809
|
+
args?: string[];
|
|
810
|
+
cwd?: string;
|
|
811
|
+
env?: Record<string, string | undefined>;
|
|
812
|
+
nodeOptions?: SpawnOptions;
|
|
813
|
+
}
|
|
814
|
+
interface TerminalInfo extends TerminalBase {
|
|
815
|
+
/**
|
|
816
|
+
* Whether the terminal can be restarted.
|
|
817
|
+
*
|
|
818
|
+
* @deprecated Ignored since v4: legacy terminals are bridged onto the built-in
|
|
819
|
+
* Terminals dock as read-only, output-only sessions, so Devframe shows no
|
|
820
|
+
* restart control. Restart a `startSubprocess()`-owned process through its
|
|
821
|
+
* returned handle instead. Will be removed in v5.
|
|
822
|
+
*/
|
|
823
|
+
restartable?: boolean;
|
|
824
|
+
/**
|
|
825
|
+
* Whether the terminal can be terminated.
|
|
826
|
+
*
|
|
827
|
+
* @deprecated Ignored since v4 (see {@link TerminalInfo.restartable}). Will be
|
|
828
|
+
* removed in v5.
|
|
829
|
+
*/
|
|
830
|
+
terminatable?: boolean;
|
|
831
|
+
/**
|
|
832
|
+
* Whether the terminal is terminated
|
|
833
|
+
*/
|
|
834
|
+
isTerminated?: boolean;
|
|
835
|
+
/**
|
|
836
|
+
* Content buffer
|
|
837
|
+
*/
|
|
838
|
+
buffer?: string;
|
|
839
|
+
}
|
|
840
|
+
interface TerminalState extends TerminalInfo {
|
|
841
|
+
/**
|
|
842
|
+
* User action to restart the terminal, when not provided, this action will be disabled.
|
|
843
|
+
*
|
|
844
|
+
* @deprecated Ignored since v4: the bridge to the built-in Terminals dock
|
|
845
|
+
* cannot attach action callbacks to an externally registered session. Will be
|
|
846
|
+
* removed in v5.
|
|
847
|
+
*/
|
|
848
|
+
onActionRestart?: () => Promise<void> | void;
|
|
849
|
+
/**
|
|
850
|
+
* User action to terminate the terminal, when not provided, this action will be disabled.
|
|
851
|
+
*
|
|
852
|
+
* @deprecated Ignored since v4 (see {@link TerminalState.onActionRestart}).
|
|
853
|
+
* Will be removed in v5.
|
|
854
|
+
*/
|
|
855
|
+
onActionTerminate?: () => Promise<void> | void;
|
|
856
|
+
}
|
|
857
|
+
|
|
729
858
|
declare module '@nuxt/schema' {
|
|
730
859
|
interface NuxtHooks {
|
|
731
860
|
/**
|
|
@@ -736,6 +865,30 @@ declare module '@nuxt/schema' {
|
|
|
736
865
|
* Called after devtools is initialized.
|
|
737
866
|
*/
|
|
738
867
|
'devtools:initialized': (info: NuxtDevtoolsInfo) => void;
|
|
868
|
+
/**
|
|
869
|
+
* Called once the Vite DevTools kit has connected, with the connected
|
|
870
|
+
* `ViteDevToolsNodeContext`.
|
|
871
|
+
*
|
|
872
|
+
* This is the recommended place to do all DevTools integration
|
|
873
|
+
* (registering docks, terminals, messages, commands, RPC functions,
|
|
874
|
+
* diagnostics, …): the kit is guaranteed to be available here, so you don't
|
|
875
|
+
* need the connect-safe accessors on `nuxt.devtools`.
|
|
876
|
+
*/
|
|
877
|
+
'devtools:ready': (ctx: ViteDevToolsNodeContext) => void | Promise<void>;
|
|
878
|
+
/**
|
|
879
|
+
* Push a notification through the devframe Messages system.
|
|
880
|
+
*
|
|
881
|
+
* Forwarded to the connected `ctx.messages` host, so it surfaces in the
|
|
882
|
+
* Vite DevTools **Messages** dock (persistent, when leveled) and/or as a
|
|
883
|
+
* transient toast (when `notify` is set). Calls made before the kit connects
|
|
884
|
+
* are buffered and replayed once it does.
|
|
885
|
+
*
|
|
886
|
+
* @example
|
|
887
|
+
* ```ts
|
|
888
|
+
* nuxt.callHook('devtools:notify', { message: 'Build failed', level: 'error' })
|
|
889
|
+
* ```
|
|
890
|
+
*/
|
|
891
|
+
'devtools:notify': (input: NuxtDevtoolsNotifyInput) => void;
|
|
739
892
|
/**
|
|
740
893
|
* Hooks to extend devtools tabs.
|
|
741
894
|
*/
|
|
@@ -745,7 +898,11 @@ declare module '@nuxt/schema' {
|
|
|
745
898
|
*/
|
|
746
899
|
'devtools:customTabs:refresh': () => void;
|
|
747
900
|
/**
|
|
748
|
-
* Register a terminal.
|
|
901
|
+
* Register a terminal whose process is owned by the caller (module).
|
|
902
|
+
*
|
|
903
|
+
* The registered session is surfaced **read-only** in the built-in Vite
|
|
904
|
+
* DevTools **Terminals** dock; stream output into it via
|
|
905
|
+
* `devtools:terminal:write`.
|
|
749
906
|
*/
|
|
750
907
|
'devtools:terminal:register': (terminal: TerminalState) => void;
|
|
751
908
|
/**
|
|
@@ -774,19 +931,5 @@ declare module '@nuxt/schema' {
|
|
|
774
931
|
}) => void;
|
|
775
932
|
}
|
|
776
933
|
}
|
|
777
|
-
declare module '@nuxt/schema' {
|
|
778
|
-
/**
|
|
779
|
-
* Runtime Hooks
|
|
780
|
-
*/
|
|
781
|
-
interface RuntimeNuxtHooks {
|
|
782
|
-
/**
|
|
783
|
-
* On terminal data.
|
|
784
|
-
*/
|
|
785
|
-
'devtools:terminal:data': (payload: {
|
|
786
|
-
id: string;
|
|
787
|
-
data: string;
|
|
788
|
-
}) => void;
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
934
|
|
|
792
|
-
export type {
|
|
935
|
+
export type { PluginInfoWithMetic as $, AnalyzeBuildMeta as A, BasicModuleInfo as B, CategorizedTabs as C, ModuleStaticInfo as D, ModuleStats as E, ModuleTabInfo as F, GitHubContributor as G, HookInfo as H, ImageMeta as I, ModuleType as J, ModuleVNodeView as K, LoadingTimeMetric as L, ModuleCustomTab as M, NuxtDevtoolsServerContext as N, ModuleView as O, PluginMetric as P, NpmCommandOptions as Q, NpmCommandType as R, SubprocessOptions as S, TerminalState as T, NuxtDevToolsOptions as U, NuxtDevtoolsNotifyLevel as V, NuxtDevtoolsRpc as W, NuxtServerData as X, PackageManagerName as Y, PackageUpdateInfo as Z, Payload as _, NuxtDevtoolsInfo as a, RouteInfo as a0, ScannedNitroTasks as a1, ServerDebugContext as a2, ServerDebugModuleMutationRecord as a3, ServerRouteInfo as a4, ServerRouteInput as a5, ServerRouteInputType as a6, ServerTaskInfo as a7, TabCategory as a8, TerminalAction as a9, TerminalBase as aa, TerminalInfo as ab, VSCodeIntegrationOptions as ac, VSCodeTunnelOptions as ad, VueInspectorClient as ae, VueInspectorData as af, ServerFunctions as b, NuxtDevtoolsNotifyInput as c, AnalyzeBuildsInfo as d, AssetEntry as e, AssetInfo as f, AssetType as g, AutoImportsWithMetadata as h, ClientFunctions as i, ClientUpdateEvent as j, CodeServerIntegrationOptions as k, CodeServerType as l, CodeSnippet as m, CompatibilityStatus as n, ComponentRelationship as o, ComponentWithRelationships as p, InstallModuleReturn as q, InstalledModuleInfo as r, MaintainerInfo as s, ModuleBuiltinTab as t, ModuleCompatibility as u, ModuleIframeTabLazyOptions as v, ModuleIframeView as w, ModuleLaunchAction as x, ModuleLaunchView as y, ModuleOptions as z };
|