@nuxt/devtools-kit 0.4.0 → 0.4.2

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.
@@ -2,7 +2,7 @@ import { AppConfig } from 'nuxt/schema';
2
2
  import { NuxtApp } from 'nuxt/dist/app/nuxt';
3
3
  import { Hookable } from 'hookable';
4
4
  import { BirpcReturn } from 'birpc';
5
- import { v as VueInspectorData, V as VueInspectorClient, H as HookInfo, q as PluginMetric, F as ServerFunctions } from './rpc-7b22fbcc.js';
5
+ import { v as VueInspectorData, V as VueInspectorClient, H as HookInfo, q as PluginMetric, F as ServerFunctions } from './rpc-ca77a6c9.js';
6
6
 
7
7
  interface NuxtDevtoolsClientHooks {
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { M as ModuleCustomTab, J as ClientFunctions, F as ServerFunctions, T as TerminalState } from './rpc-7b22fbcc.js';
1
+ import { M as ModuleCustomTab, J as ClientFunctions, F as ServerFunctions, T as TerminalState } from './rpc-ca77a6c9.js';
2
2
  import { BirpcGroup } from 'birpc';
3
3
  import { Nuxt } from 'nuxt/schema';
4
4
 
@@ -6,6 +6,8 @@ let clientRef;
6
6
  const fns = [];
7
7
  function onDevtoolsClientConnected(fn) {
8
8
  fns.push(fn);
9
+ if (typeof window === "undefined")
10
+ return;
9
11
  if (window.__NUXT_DEVTOOLS__) {
10
12
  fns.forEach((fn2) => fn2(window.__NUXT_DEVTOOLS__));
11
13
  }
@@ -1,10 +1,10 @@
1
1
  import { Ref } from 'vue';
2
- import { c as NuxtDevtoolsIframeClient } from './client-api-a2b0aa8f.js';
2
+ import { c as NuxtDevtoolsIframeClient } from './client-api-690096c8.js';
3
3
  import 'nuxt/schema';
4
4
  import 'nuxt/dist/app/nuxt';
5
5
  import 'hookable';
6
6
  import 'birpc';
7
- import './rpc-7b22fbcc.js';
7
+ import './rpc-ca77a6c9.js';
8
8
  import 'nitropack';
9
9
  import 'unstorage';
10
10
  import 'vue-router';
@@ -4,6 +4,8 @@ let clientRef;
4
4
  const fns = [];
5
5
  function onDevtoolsClientConnected(fn) {
6
6
  fns.push(fn);
7
+ if (typeof window === "undefined")
8
+ return;
7
9
  if (window.__NUXT_DEVTOOLS__) {
8
10
  fns.forEach((fn2) => fn2(window.__NUXT_DEVTOOLS__));
9
11
  }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as execa from 'execa';
2
2
  import * as _nuxt_schema from '@nuxt/schema';
3
3
  import { BirpcGroup } from 'birpc';
4
- import { N as NuxtDevtoolsInfo } from './hooks-bf2fa0f7.js';
5
- import { M as ModuleCustomTab, S as SubprocessOptions, T as TerminalState } from './rpc-7b22fbcc.js';
4
+ import { N as NuxtDevtoolsInfo } from './hooks-1302b71e.js';
5
+ import { M as ModuleCustomTab, S as SubprocessOptions, T as TerminalState } from './rpc-ca77a6c9.js';
6
6
  import 'nuxt/schema';
7
7
  import 'nitropack';
8
8
  import 'unstorage';
@@ -6,6 +6,8 @@ import { RouteRecordNormalized } from 'vue-router';
6
6
  import { Import, UnimportMeta } from 'unimport';
7
7
  import { Options } from 'execa';
8
8
 
9
+ type TabCategory = 'app' | 'analyze' | 'server' | 'modules' | 'documentation' | 'advanced';
10
+
9
11
  interface ModuleCustomTab {
10
12
  /**
11
13
  * The name of the tab, must be unique
@@ -23,6 +25,11 @@ interface ModuleCustomTab {
23
25
  * Main view of the tab
24
26
  */
25
27
  view: ModuleView;
28
+ /**
29
+ * Category of the tab
30
+ * @default 'app'
31
+ */
32
+ category?: TabCategory;
26
33
  /**
27
34
  * Insert static vnode to the tab entry
28
35
  *
@@ -104,8 +111,9 @@ interface ModuleBuiltinTab {
104
111
  icon?: string;
105
112
  title?: string;
106
113
  path?: string;
107
- requireClient?: boolean;
108
- shouldShow?: () => boolean;
114
+ category?: TabCategory;
115
+ show?: () => any;
116
+ badge?: () => number | string | undefined;
109
117
  }
110
118
  type ModuleTabInfo = ModuleCustomTab | ModuleBuiltinTab;
111
119
 
@@ -139,6 +147,7 @@ interface NpmCommandOptions {
139
147
  interface AutoImportsWithMetadata {
140
148
  imports: Import[];
141
149
  metadata?: UnimportMeta;
150
+ dirs: string[];
142
151
  }
143
152
  interface RouteInfo extends Pick<RouteRecordNormalized, 'name' | 'path' | 'meta' | 'props' | 'children'> {
144
153
  file?: string;
@@ -165,6 +174,8 @@ interface PluginInfoWithMetic {
165
174
  }
166
175
  interface PluginMetric {
167
176
  src: string;
177
+ start: number;
178
+ end: number;
168
179
  duration: number;
169
180
  }
170
181
  interface BasicModuleInfo {
@@ -224,7 +235,7 @@ interface VueInspectorClient {
224
235
  onUpdated: () => void;
225
236
  }
226
237
  type VueInspectorData = VueInspectorClient['linkParams'] & VueInspectorClient['position'];
227
- type AssetType = 'image' | 'font' | 'video' | 'audio' | 'text' | 'other';
238
+ type AssetType = 'image' | 'font' | 'video' | 'audio' | 'text' | 'json' | 'other';
228
239
  interface AssetInfo {
229
240
  path: string;
230
241
  type: AssetType;
@@ -341,4 +352,4 @@ interface ClientFunctions {
341
352
  }
342
353
  type ClientUpdateEvent = keyof ServerFunctions;
343
354
 
344
- export { AutoImportsWithMetadata as A, BasicModuleInfo as B, CompatibilityStatus as C, WizardActions as D, GetWizardArgs as E, ServerFunctions as F, GitHubContributor as G, HookInfo as H, ImageMeta as I, ClientFunctions as J, ClientUpdateEvent as K, ModuleCustomTab as M, NpmCommandType as N, PackageUpdateInfo as P, RouteInfo as R, SubprocessOptions as S, TerminalState as T, VueInspectorClient as V, WizardFunctions as W, ModuleLaunchView as a, ModuleIframeView as b, ModuleVNodeView as c, ModuleLaunchAction as d, ModuleView as e, ModuleIframeTabLazyOptions as f, ModuleBuiltinTab as g, ModuleTabInfo as h, TerminalBase as i, TerminalAction as j, TerminalInfo as k, PackageManagerName as l, NpmCommandOptions as m, ServerRouteInfo as n, Payload as o, PluginInfoWithMetic as p, PluginMetric as q, ModuleMetric as r, ModuleCompatibility as s, ModuleType as t, MaintainerInfo as u, VueInspectorData as v, AssetType as w, AssetInfo as x, CodeSnippet as y, ComponentRelationship as z };
355
+ export { AutoImportsWithMetadata as A, BasicModuleInfo as B, CompatibilityStatus as C, WizardActions as D, GetWizardArgs as E, ServerFunctions as F, GitHubContributor as G, HookInfo as H, ImageMeta as I, ClientFunctions as J, ClientUpdateEvent as K, TabCategory as L, ModuleCustomTab as M, NpmCommandType as N, PackageUpdateInfo as P, RouteInfo as R, SubprocessOptions as S, TerminalState as T, VueInspectorClient as V, WizardFunctions as W, ModuleLaunchView as a, ModuleIframeView as b, ModuleVNodeView as c, ModuleLaunchAction as d, ModuleView as e, ModuleIframeTabLazyOptions as f, ModuleBuiltinTab as g, ModuleTabInfo as h, TerminalBase as i, TerminalAction as j, TerminalInfo as k, PackageManagerName as l, NpmCommandOptions as m, ServerRouteInfo as n, Payload as o, PluginInfoWithMetic as p, PluginMetric as q, ModuleMetric as r, ModuleCompatibility as s, ModuleType as t, MaintainerInfo as u, VueInspectorData as v, AssetType as w, AssetInfo as x, CodeSnippet as y, ComponentRelationship as z };
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { b as ModuleGlobalOptions, M as ModuleOptions, N as NuxtDevtoolsInfo, a as NuxtDevtoolsServerContext, V as VSCodeIntegrationOptions, c as VSCodeTunnelOptions } from './hooks-bf2fa0f7.js';
2
- export { x as AssetInfo, w as AssetType, A as AutoImportsWithMetadata, B as BasicModuleInfo, J as ClientFunctions, K as ClientUpdateEvent, y as CodeSnippet, C as CompatibilityStatus, z as ComponentRelationship, E as GetWizardArgs, G as GitHubContributor, H as HookInfo, I as ImageMeta, u as MaintainerInfo, g as ModuleBuiltinTab, s as ModuleCompatibility, M as ModuleCustomTab, f as ModuleIframeTabLazyOptions, b as ModuleIframeView, d as ModuleLaunchAction, a as ModuleLaunchView, r as ModuleMetric, h as ModuleTabInfo, t as ModuleType, c as ModuleVNodeView, e as ModuleView, m as NpmCommandOptions, N as NpmCommandType, l as PackageManagerName, P as PackageUpdateInfo, o as Payload, p as PluginInfoWithMetic, q as PluginMetric, R as RouteInfo, F as ServerFunctions, n as ServerRouteInfo, S as SubprocessOptions, j as TerminalAction, i as TerminalBase, k as TerminalInfo, T as TerminalState, V as VueInspectorClient, v as VueInspectorData, D as WizardActions, W as WizardFunctions } from './rpc-7b22fbcc.js';
3
- export { b as NuxtDevtoolsClient, N as NuxtDevtoolsClientHooks, d as NuxtDevtoolsGlobal, a as NuxtDevtoolsHostClient, c as NuxtDevtoolsIframeClient } from './client-api-a2b0aa8f.js';
1
+ export { b as ModuleGlobalOptions, M as ModuleOptions, N as NuxtDevtoolsInfo, a as NuxtDevtoolsServerContext, V as VSCodeIntegrationOptions, c as VSCodeTunnelOptions } from './hooks-1302b71e.js';
2
+ export { x as AssetInfo, w as AssetType, A as AutoImportsWithMetadata, B as BasicModuleInfo, J as ClientFunctions, K as ClientUpdateEvent, y as CodeSnippet, C as CompatibilityStatus, z as ComponentRelationship, E as GetWizardArgs, G as GitHubContributor, H as HookInfo, I as ImageMeta, u as MaintainerInfo, g as ModuleBuiltinTab, s as ModuleCompatibility, M as ModuleCustomTab, f as ModuleIframeTabLazyOptions, b as ModuleIframeView, d as ModuleLaunchAction, a as ModuleLaunchView, r as ModuleMetric, h as ModuleTabInfo, t as ModuleType, c as ModuleVNodeView, e as ModuleView, m as NpmCommandOptions, N as NpmCommandType, l as PackageManagerName, P as PackageUpdateInfo, o as Payload, p as PluginInfoWithMetic, q as PluginMetric, R as RouteInfo, F as ServerFunctions, n as ServerRouteInfo, S as SubprocessOptions, L as TabCategory, j as TerminalAction, i as TerminalBase, k as TerminalInfo, T as TerminalState, V as VueInspectorClient, v as VueInspectorData, D as WizardActions, W as WizardFunctions } from './rpc-ca77a6c9.js';
3
+ export { b as NuxtDevtoolsClient, N as NuxtDevtoolsClientHooks, d as NuxtDevtoolsGlobal, a as NuxtDevtoolsHostClient, c as NuxtDevtoolsIframeClient } from './client-api-690096c8.js';
4
4
  import 'birpc';
5
5
  import 'nuxt/schema';
6
6
  import 'nitropack';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/devtools-kit",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "license": "MIT",
6
6
  "repository": "nuxt/devtools",
7
7
  "exports": {
@@ -30,18 +30,18 @@
30
30
  "*.mjs"
31
31
  ],
32
32
  "peerDependencies": {
33
- "nuxt": "^3.3.1",
33
+ "nuxt": "^3.4.2",
34
34
  "vite": "*"
35
35
  },
36
36
  "dependencies": {
37
- "@nuxt/kit": "^3.3.3",
38
- "@nuxt/schema": "^3.3.3",
37
+ "@nuxt/kit": "^3.4.2",
38
+ "@nuxt/schema": "^3.4.2",
39
39
  "execa": "^7.1.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "birpc": "^0.2.11",
43
43
  "hookable": "^5.5.3",
44
- "unbuild": "^1.2.0",
44
+ "unbuild": "^1.2.1",
45
45
  "unimport": "^3.0.6",
46
46
  "vue-router": "^4.1.6"
47
47
  },