@nuxt/devtools-nightly 4.0.0-alpha.7-29733712.fb3fac0 → 4.0.0-alpha.7-29733834.f9dda69
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/chunks/analyze-build.mjs +29 -0
- package/dist/chunks/module-main.mjs +94 -69
- package/dist/chunks/vite-inspect.mjs +72 -39
- package/dist/chunks/vscode.mjs +6 -7
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/{analyze-build-ec2nwdu8.js → analyze-build-o2xubcvl.js} +1 -1
- package/dist/client/_nuxt/{assets-hfvm3oaz.js → assets-h3hl7z1o.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/05e26437-f2cc-492f-acc4-a147631ddc71.json +1 -0
- package/dist/client/_nuxt/{code-diff-hsqacdn9.js → code-diff-o0p6ygu9.js} +1 -1
- package/dist/client/_nuxt/{components-ovc8cu01.js → components-orauksb9.js} +1 -1
- package/dist/client/_nuxt/{composable-item-gj7ponbx.js → composable-item-njspzx3v.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_-e3jkaiwa.js → custom-_name_-nyvbtaai.js} +1 -1
- package/dist/client/_nuxt/{data-schema-drawer-nxfa9a8f.js → data-schema-drawer-livtfy7s.js} +1 -1
- package/dist/client/_nuxt/{debug-c49c2qtd.js → debug-e26rbr91.js} +1 -1
- package/dist/client/_nuxt/{izfxyqz6.js → ern5ggeg.js} +3 -3
- package/dist/client/_nuxt/{error-404-bm0vthpy.js → error-404-lfvml9w4.js} +1 -1
- package/dist/client/_nuxt/error-404.css-gtuoqvk8.css +1 -0
- package/dist/client/_nuxt/{error-500-ovo5vsn4.js → error-500-kimn5am8.js} +1 -1
- package/dist/client/_nuxt/error-500.css-bh9l40d0.css +1 -0
- package/dist/client/_nuxt/{error-jf4rsxnj.js → error-emg2s2qd.js} +1 -1
- package/dist/client/_nuxt/{filepath-item-olhhpw5a.js → filepath-item-d0vg8skv.js} +1 -1
- package/dist/client/_nuxt/{help-fab-nkw5uknq.js → help-fab-dt2igbly.js} +1 -1
- package/dist/client/_nuxt/{hooks-drvjmc5j.js → hooks-gdogk72d.js} +1 -1
- package/dist/client/_nuxt/{imports-kjqsyte3.js → imports-fldu9cqi.js} +1 -1
- package/dist/client/_nuxt/{modules-k1d4y3th.js → modules-ilaxi4gj.js} +1 -1
- package/dist/client/_nuxt/{ncheckbox-oavfoam6.js → ncheckbox-mtdsbp1a.js} +1 -1
- package/dist/client/_nuxt/{ndrawer-fhrme7vv.js → ndrawer-cb7r4xcw.js} +1 -1
- package/dist/client/_nuxt/{ndropdown-hn12e18a.js → ndropdown-dadvl968.js} +1 -1
- package/dist/client/_nuxt/{nsection-block-bce91rsn.js → nsection-block-g08189om.js} +1 -1
- package/dist/client/_nuxt/{nselect-y9nxdwas.js → nselect-bt63blmq.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs-m41ni7sn.js → nselect-tabs-ljky0azv.js} +1 -1
- package/dist/client/_nuxt/{open-graph-h2ufwxwo.js → open-graph-lo291j57.js} +1 -1
- package/dist/client/_nuxt/{overview-gskuaz49.js → overview-hxs47pod.js} +1 -1
- package/dist/client/_nuxt/{pages-ifsix6yb.js → pages-c4e3c11g.js} +1 -1
- package/dist/client/_nuxt/{pages-e62a1kls.js → pages-jw76o0vz.js} +1 -1
- package/dist/client/_nuxt/{payload-ntb7y2o3.js → payload-gr6b75xd.js} +1 -1
- package/dist/client/_nuxt/{pinia-dwd6rejd.js → pinia-hqdlwcob.js} +1 -1
- package/dist/client/_nuxt/{plugins-jn9umb5b.js → plugins-emmlunmb.js} +1 -1
- package/dist/client/_nuxt/{render-tree-g7glmv0m.js → render-tree-fiwgnbqw.js} +1 -1
- package/dist/client/_nuxt/{rpc-cz5v706s.js → rpc-orxw6a9i.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-c8lrgjgy.js → runtime-configs-bk2lo09r.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-ip4g2koq.js → server-discovery-byisobzt.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs-g8iesj3t.js → server-route-inputs-m23f51vv.js} +1 -1
- package/dist/client/_nuxt/{server-routes-hg28i596.js → server-routes-h4f0btji.js} +1 -1
- package/dist/client/_nuxt/{server-tasks-mykedpj8.js → server-tasks-gq7ooojj.js} +1 -1
- package/dist/client/_nuxt/{settings-l1j5cjkr.js → settings-d6c5t5q2.js} +1 -1
- package/dist/client/_nuxt/{stacktrace-list-iooxnujk.js → stacktrace-list-ddsrw7yb.js} +1 -1
- package/dist/client/_nuxt/{state-components-e3c5731z.js → state-components-odzrklnn.js} +1 -1
- package/dist/client/_nuxt/{state-editor-dstnul15.js → state-editor-jiljx628.js} +1 -1
- package/dist/client/_nuxt/{state-modules-lqu8srfq.js → state-modules-b752hl25.js} +1 -1
- package/dist/client/_nuxt/{storage-o9dm2hcu.js → storage-ofrou6iy.js} +1 -1
- package/dist/client/_nuxt/{storage-options-b5a9d4af.js → storage-options-cjhumdfc.js} +1 -1
- package/dist/client/_nuxt/{terminals-mmgtldnb.js → terminals-esnwnao3.js} +1 -1
- package/dist/client/_nuxt/{timeline-mwdpqngc.js → timeline-moc098en.js} +1 -1
- package/dist/client/_nuxt/{unocss-runtime-bs4ifaab.js → unocss-runtime-hmm1sbzc.js} +1 -1
- package/dist/client/_nuxt/{utils-e4pljy9r.js → utils-kx1pynf6.js} +1 -1
- package/dist/client/_nuxt/vendor/{unocss-oy2uhvhx.js → unocss-ij8bbku6.js} +2 -2
- package/dist/client/_nuxt/{virtual-files-jrjnxjnt.js → virtual-files-m17k0sdx.js} +1 -1
- package/dist/client/_nuxt/{vue-devtools-ca2y77js.js → vue-devtools-d1p9dl4c.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/shared/{devtools-nightly.FxTEQguS.mjs → devtools-nightly.B9TxdMuu.mjs} +1 -1
- package/package.json +2 -2
- package/dist/client/_nuxt/builds/meta/6c8e5c00-c45b-4883-96ca-6d2dc3406554.json +0 -1
- package/dist/client/_nuxt/error-404.css-l7mtyvou.css +0 -1
- package/dist/client/_nuxt/error-500.css-dg4lmj6f.css +0 -1
|
@@ -2,6 +2,35 @@ import { addVitePlugin } from '@nuxt/kit';
|
|
|
2
2
|
import { resolve, join } from 'pathe';
|
|
3
3
|
import { readdir, lstat } from 'node:fs/promises';
|
|
4
4
|
import { createVitePluginInspect } from './vite-inspect.mjs';
|
|
5
|
+
import '@nuxt/devtools-kit';
|
|
6
|
+
import './module-main.mjs';
|
|
7
|
+
import 'node:fs';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'consola/utils';
|
|
10
|
+
import 'sirv';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '../shared/devtools-nightly.B9TxdMuu.mjs';
|
|
13
|
+
import '../dirs.mjs';
|
|
14
|
+
import 'node:path';
|
|
15
|
+
import 'node:url';
|
|
16
|
+
import 'tinyexec';
|
|
17
|
+
import 'tinyglobby';
|
|
18
|
+
import 'image-meta';
|
|
19
|
+
import 'perfect-debounce';
|
|
20
|
+
import 'destr';
|
|
21
|
+
import '../../dist/runtime/shared/hooks.js';
|
|
22
|
+
import 'ohash';
|
|
23
|
+
import 'node:process';
|
|
24
|
+
import 'node:module';
|
|
25
|
+
import 'pkg-types';
|
|
26
|
+
import 'node:assert';
|
|
27
|
+
import 'node:v8';
|
|
28
|
+
import 'node:util';
|
|
29
|
+
import 'local-pkg';
|
|
30
|
+
import 'magicast';
|
|
31
|
+
import 'magicast/helpers';
|
|
32
|
+
import 'semver';
|
|
33
|
+
import 'unstorage';
|
|
5
34
|
|
|
6
35
|
async function getFolderSize(dir) {
|
|
7
36
|
const dirents = await readdir(dir, {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import fs$1, { promises, statSync, realpathSync, readFileSync, existsSync, accessSync, constants } from 'node:fs';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import os, { homedir } from 'node:os';
|
|
4
|
-
import { logger, useNuxt, addVitePlugin, addPlugin, addTemplate,
|
|
4
|
+
import { logger, useNuxt, addVitePlugin, extendViteConfig, addPlugin, addTemplate, addImports } from '@nuxt/kit';
|
|
5
5
|
import { colors } from 'consola/utils';
|
|
6
6
|
import { join, dirname, resolve, isAbsolute } from 'pathe';
|
|
7
7
|
import sirv from 'sirv';
|
|
8
8
|
import { searchForWorkspaceRoot } from 'vite';
|
|
9
|
-
import { d as defaultAllowedExtensions, c as createDefaultTabOptions, s as setServerTasksEnabledByDefault } from '../shared/devtools-nightly.
|
|
9
|
+
import { d as defaultAllowedExtensions, c as createDefaultTabOptions, s as setServerTasksEnabledByDefault } from '../shared/devtools-nightly.B9TxdMuu.mjs';
|
|
10
10
|
import { runtimeDir, clientDir, packageDir } from '../dirs.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import { deprecate, registerHostDiagnostics } from '@nuxt/devtools-kit';
|
|
12
12
|
import { x } from 'tinyexec';
|
|
13
13
|
import { glob } from 'tinyglobby';
|
|
14
14
|
import path, { relative, parse, dirname as dirname$1 } from 'node:path';
|
|
@@ -30,10 +30,13 @@ import { getDefaultExportOptions, addNuxtModule } from 'magicast/helpers';
|
|
|
30
30
|
import semver from 'semver';
|
|
31
31
|
import { normalizeBaseKey, normalizeKey } from 'unstorage';
|
|
32
32
|
|
|
33
|
-
const version$1 = "4.0.0-alpha.7-
|
|
33
|
+
const version$1 = "4.0.0-alpha.7-29733834.f9dda69";
|
|
34
|
+
|
|
35
|
+
const RPC_NAMESPACE = "nuxt:devtools";
|
|
34
36
|
|
|
35
37
|
const COLON_RE = /:/g;
|
|
36
|
-
function setupAnalyzeBuildRPC(
|
|
38
|
+
function setupAnalyzeBuildRPC(ctx) {
|
|
39
|
+
const { nuxt, refresh } = ctx;
|
|
37
40
|
let builds = [];
|
|
38
41
|
let promise;
|
|
39
42
|
let initalized;
|
|
@@ -42,18 +45,21 @@ function setupAnalyzeBuildRPC({ nuxt, refresh }) {
|
|
|
42
45
|
async function startAnalyzeBuild(name) {
|
|
43
46
|
if (promise)
|
|
44
47
|
throw new Error("[Nuxt DevTools] A building process is already running");
|
|
45
|
-
const
|
|
48
|
+
const kit = ctx.devtoolsKit;
|
|
49
|
+
if (!kit)
|
|
50
|
+
throw new Error("[Nuxt DevTools] Vite DevTools kit is not connected yet.");
|
|
51
|
+
const session = await kit.terminals.startChildProcess({
|
|
46
52
|
command: "npx",
|
|
47
53
|
args: ["nuxi", "analyze", "--no-serve", "--name", name],
|
|
48
54
|
cwd: nuxt.options.rootDir
|
|
49
55
|
}, {
|
|
50
56
|
id: processId,
|
|
51
|
-
|
|
57
|
+
title: "Analyze Build",
|
|
52
58
|
icon: "logos-nuxt-icon"
|
|
53
|
-
}
|
|
59
|
+
});
|
|
54
60
|
refresh("getAnalyzeBuildInfo");
|
|
55
61
|
initalized = void 0;
|
|
56
|
-
promise = Promise.resolve(
|
|
62
|
+
promise = Promise.resolve(session.getResult()).then(() => {
|
|
57
63
|
refresh("getAnalyzeBuildInfo");
|
|
58
64
|
return readBuildInfo();
|
|
59
65
|
}).finally(() => {
|
|
@@ -11138,7 +11144,14 @@ function removeNuxtModuleFromCode(source, name, filepath) {
|
|
|
11138
11144
|
return mod.generate().code;
|
|
11139
11145
|
}
|
|
11140
11146
|
|
|
11141
|
-
function setupNpmRPC(
|
|
11147
|
+
function setupNpmRPC(ctx) {
|
|
11148
|
+
const { nuxt } = ctx;
|
|
11149
|
+
function getTerminals() {
|
|
11150
|
+
const kit = ctx.devtoolsKit;
|
|
11151
|
+
if (!kit)
|
|
11152
|
+
throw new Error("[Nuxt DevTools] Vite DevTools kit is not connected yet.");
|
|
11153
|
+
return kit.terminals;
|
|
11154
|
+
}
|
|
11142
11155
|
let detectPromise;
|
|
11143
11156
|
const updatesPromise = /* @__PURE__ */ new Map();
|
|
11144
11157
|
function getPackageManager() {
|
|
@@ -11174,14 +11187,13 @@ function setupNpmRPC({ nuxt }) {
|
|
|
11174
11187
|
if (!args)
|
|
11175
11188
|
return;
|
|
11176
11189
|
const processId = `npm:${command}:${packageName}`;
|
|
11177
|
-
|
|
11190
|
+
await getTerminals().startChildProcess({
|
|
11178
11191
|
command: args[0],
|
|
11179
11192
|
args: args.slice(1)
|
|
11180
11193
|
}, {
|
|
11181
11194
|
id: processId,
|
|
11182
|
-
|
|
11183
|
-
icon: "i-logos-npm-icon"
|
|
11184
|
-
restartable: false
|
|
11195
|
+
title: `${command} ${packageName}`,
|
|
11196
|
+
icon: "i-logos-npm-icon"
|
|
11185
11197
|
});
|
|
11186
11198
|
return {
|
|
11187
11199
|
processId
|
|
@@ -11213,16 +11225,15 @@ function setupNpmRPC({ nuxt }) {
|
|
|
11213
11225
|
if (!dry) {
|
|
11214
11226
|
latestGenerated = generated;
|
|
11215
11227
|
installSet.add(name);
|
|
11216
|
-
const
|
|
11228
|
+
const session = await getTerminals().startChildProcess({
|
|
11217
11229
|
command: commands[0],
|
|
11218
11230
|
args: commands.slice(1)
|
|
11219
11231
|
}, {
|
|
11220
11232
|
id: processId,
|
|
11221
|
-
|
|
11222
|
-
icon: "carbon:intent-request-create"
|
|
11223
|
-
restartable: false
|
|
11233
|
+
title: `Install ${name}`,
|
|
11234
|
+
icon: "carbon:intent-request-create"
|
|
11224
11235
|
});
|
|
11225
|
-
const result = await
|
|
11236
|
+
const result = await session.getResult();
|
|
11226
11237
|
await Promise.resolve();
|
|
11227
11238
|
installSet.delete(name);
|
|
11228
11239
|
const code = result.exitCode;
|
|
@@ -11251,16 +11262,15 @@ function setupNpmRPC({ nuxt }) {
|
|
|
11251
11262
|
});
|
|
11252
11263
|
const processId = `nuxt:remove-module:${name}`;
|
|
11253
11264
|
if (!dry) {
|
|
11254
|
-
const
|
|
11265
|
+
const session = await getTerminals().startChildProcess({
|
|
11255
11266
|
command: commands[0],
|
|
11256
11267
|
args: commands.slice(1)
|
|
11257
11268
|
}, {
|
|
11258
11269
|
id: processId,
|
|
11259
|
-
|
|
11260
|
-
icon: "carbon:intent-request-uninstall"
|
|
11261
|
-
restartable: false
|
|
11270
|
+
title: `Uninstall ${name}`,
|
|
11271
|
+
icon: "carbon:intent-request-uninstall"
|
|
11262
11272
|
});
|
|
11263
|
-
const result = await
|
|
11273
|
+
const result = await session.getResult();
|
|
11264
11274
|
await Promise.resolve();
|
|
11265
11275
|
const code = result.exitCode;
|
|
11266
11276
|
if (code !== 0) {
|
|
@@ -11471,10 +11481,8 @@ const IGNORE_STORAGE_MOUNTS = ["root", "build", "src", "cache"];
|
|
|
11471
11481
|
function shouldIgnoreStorageKey(key) {
|
|
11472
11482
|
return IGNORE_STORAGE_MOUNTS.includes(key.split(":")[0]);
|
|
11473
11483
|
}
|
|
11474
|
-
function setupStorageRPC({
|
|
11475
|
-
nuxt
|
|
11476
|
-
rpc
|
|
11477
|
-
}) {
|
|
11484
|
+
function setupStorageRPC(ctx) {
|
|
11485
|
+
const { nuxt } = ctx;
|
|
11478
11486
|
const storageMounts = {};
|
|
11479
11487
|
let storage;
|
|
11480
11488
|
let unwatchStorageMounts = [];
|
|
@@ -11498,7 +11506,7 @@ function setupStorageRPC({
|
|
|
11498
11506
|
return;
|
|
11499
11507
|
await Promise.all(unwatchStorageMounts.map((unwatch) => unwatch()));
|
|
11500
11508
|
unwatchStorageMounts = await Promise.all(Object.keys(storageMounts).map((mountName) => watchStorageMount(activeStorage, mountName, (event, key) => {
|
|
11501
|
-
rpc.broadcast
|
|
11509
|
+
ctx.devtoolsKit?.rpc.broadcast({ method: "callHook", args: ["storage:key:update", key, event], event: true });
|
|
11502
11510
|
})));
|
|
11503
11511
|
});
|
|
11504
11512
|
nuxt.hook("close", async () => {
|
|
@@ -11586,7 +11594,8 @@ function telemetryEvent(payload, immediate = false) {
|
|
|
11586
11594
|
throttledSend();
|
|
11587
11595
|
}
|
|
11588
11596
|
|
|
11589
|
-
function setupTerminalRPC(
|
|
11597
|
+
function setupTerminalRPC(ctx) {
|
|
11598
|
+
const { nuxt, refresh } = ctx;
|
|
11590
11599
|
const terminals = /* @__PURE__ */ new Map();
|
|
11591
11600
|
nuxt.hook("devtools:terminal:register", (terminal) => {
|
|
11592
11601
|
terminals.set(terminal.id, terminal);
|
|
@@ -11606,7 +11615,7 @@ function setupTerminalRPC({ nuxt, rpc, refresh }) {
|
|
|
11606
11615
|
return false;
|
|
11607
11616
|
terminal.buffer ||= "";
|
|
11608
11617
|
terminal.buffer += data;
|
|
11609
|
-
rpc.broadcast
|
|
11618
|
+
ctx.devtoolsKit?.rpc.broadcast({ method: "onTerminalData", args: [{ id, data }], event: true });
|
|
11610
11619
|
return true;
|
|
11611
11620
|
});
|
|
11612
11621
|
nuxt.hook("devtools:terminal:exit", ({ id, code }) => {
|
|
@@ -11614,7 +11623,7 @@ function setupTerminalRPC({ nuxt, rpc, refresh }) {
|
|
|
11614
11623
|
if (!terminal)
|
|
11615
11624
|
return false;
|
|
11616
11625
|
terminal.isTerminated = true;
|
|
11617
|
-
rpc.broadcast
|
|
11626
|
+
ctx.devtoolsKit?.rpc.broadcast({ method: "onTerminalExit", args: [{ id, code }], event: true });
|
|
11618
11627
|
refresh("getTerminals");
|
|
11619
11628
|
return true;
|
|
11620
11629
|
});
|
|
@@ -11732,14 +11741,28 @@ function setupRPC(nuxt, options) {
|
|
|
11732
11741
|
return true;
|
|
11733
11742
|
}
|
|
11734
11743
|
});
|
|
11735
|
-
const rpc = {
|
|
11744
|
+
const rpc = new Proxy({
|
|
11736
11745
|
broadcast: createBroadcastProxy(),
|
|
11737
11746
|
functions: functionsProxy
|
|
11738
|
-
}
|
|
11747
|
+
}, {
|
|
11748
|
+
get(target, prop, receiver) {
|
|
11749
|
+
if (prop === "broadcast" || prop === "functions") {
|
|
11750
|
+
deprecate(nuxt, "NDT_DEP_0007", {
|
|
11751
|
+
api: `nuxt.devtools.rpc.${prop}`,
|
|
11752
|
+
replacement: "the connected ctx.rpc from onDevtoolsReady((ctx) => ...)"
|
|
11753
|
+
}, { key: prop });
|
|
11754
|
+
}
|
|
11755
|
+
return Reflect.get(target, prop, receiver);
|
|
11756
|
+
}
|
|
11757
|
+
});
|
|
11739
11758
|
function refresh(event) {
|
|
11740
11759
|
broadcast("refresh", event);
|
|
11741
11760
|
}
|
|
11742
11761
|
function extendServerRpc(namespace, functions) {
|
|
11762
|
+
deprecate(nuxt, "NDT_DEP_0003", {
|
|
11763
|
+
api: "extendServerRpc",
|
|
11764
|
+
replacement: "onDevtoolsReady((ctx) => ctx.rpc.register(defineRpcFunction(...)))"
|
|
11765
|
+
}, { key: namespace });
|
|
11743
11766
|
extendedRpcMap.set(namespace, functions);
|
|
11744
11767
|
if (devtoolsKitCtx) {
|
|
11745
11768
|
for (const [fnName, handler] of Object.entries(functions)) {
|
|
@@ -11782,47 +11805,39 @@ function setupRPC(nuxt, options) {
|
|
|
11782
11805
|
...setupTelemetryRPC(ctx),
|
|
11783
11806
|
...setupServerDataRPC(ctx)
|
|
11784
11807
|
});
|
|
11785
|
-
function connectDevToolsKit(
|
|
11808
|
+
async function connectDevToolsKit(kitCtx) {
|
|
11786
11809
|
if (devtoolsKitCtx)
|
|
11787
11810
|
return;
|
|
11788
|
-
devtoolsKitCtx =
|
|
11789
|
-
const host =
|
|
11811
|
+
devtoolsKitCtx = kitCtx;
|
|
11812
|
+
const host = kitCtx.rpc;
|
|
11790
11813
|
for (const { method, args } of pendingBroadcasts) {
|
|
11791
11814
|
broadcast(method, ...args);
|
|
11792
11815
|
}
|
|
11793
11816
|
pendingBroadcasts.length = 0;
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
}
|
|
11801
|
-
} catch (e) {
|
|
11802
|
-
logger.warn(
|
|
11803
|
-
colors.yellow(`[nuxt-devtools] Failed to register RPC function "${name}":
|
|
11817
|
+
registerHostDiagnostics(ctx);
|
|
11818
|
+
function registerFn(name, handler) {
|
|
11819
|
+
try {
|
|
11820
|
+
host.register({ name, handler });
|
|
11821
|
+
} catch (e) {
|
|
11822
|
+
logger.warn(
|
|
11823
|
+
colors.yellow(`[nuxt-devtools] Failed to register RPC function "${name}":
|
|
11804
11824
|
`) + colors.red(e?.message || "")
|
|
11805
|
-
|
|
11806
|
-
}
|
|
11825
|
+
);
|
|
11807
11826
|
}
|
|
11808
11827
|
}
|
|
11828
|
+
for (const [name, handler] of Object.entries(serverFunctions)) {
|
|
11829
|
+
if (typeof handler !== "function")
|
|
11830
|
+
continue;
|
|
11831
|
+
registerFn(`${RPC_NAMESPACE}:${name}`, handler);
|
|
11832
|
+
registerFn(name, handler);
|
|
11833
|
+
}
|
|
11809
11834
|
for (const [namespace, fns] of extendedRpcMap) {
|
|
11810
11835
|
for (const [fnName, handler] of Object.entries(fns)) {
|
|
11811
|
-
if (typeof handler === "function")
|
|
11812
|
-
|
|
11813
|
-
host.register({
|
|
11814
|
-
name: `${namespace}:${fnName}`,
|
|
11815
|
-
handler
|
|
11816
|
-
});
|
|
11817
|
-
} catch (e) {
|
|
11818
|
-
logger.warn(
|
|
11819
|
-
colors.yellow(`[nuxt-devtools] Failed to register RPC function "${namespace}:${fnName}":
|
|
11820
|
-
`) + colors.red(e?.message || "")
|
|
11821
|
-
);
|
|
11822
|
-
}
|
|
11823
|
-
}
|
|
11836
|
+
if (typeof handler === "function")
|
|
11837
|
+
registerFn(`${namespace}:${fnName}`, handler);
|
|
11824
11838
|
}
|
|
11825
11839
|
}
|
|
11840
|
+
await nuxt.callHook("devtools:ready", kitCtx);
|
|
11826
11841
|
}
|
|
11827
11842
|
return {
|
|
11828
11843
|
connectDevToolsKit,
|
|
@@ -11845,8 +11860,12 @@ async function enableModule(options, nuxt) {
|
|
|
11845
11860
|
return;
|
|
11846
11861
|
}
|
|
11847
11862
|
await nuxt.callHook("devtools:before");
|
|
11848
|
-
if (
|
|
11849
|
-
|
|
11863
|
+
if (options.disableAuthorization) {
|
|
11864
|
+
extendViteConfig((config) => {
|
|
11865
|
+
const devtoolsConfig = config.devtools ||= {};
|
|
11866
|
+
if (devtoolsConfig.clientAuth === void 0)
|
|
11867
|
+
devtoolsConfig.clientAuth = false;
|
|
11868
|
+
});
|
|
11850
11869
|
}
|
|
11851
11870
|
if (options.iframeProps) {
|
|
11852
11871
|
nuxt.options.runtimeConfig.app.devtools ||= {};
|
|
@@ -11879,15 +11898,16 @@ async function enableModule(options, nuxt) {
|
|
|
11879
11898
|
addVitePlugin(defineViteDevToolsPlugin({
|
|
11880
11899
|
name: "nuxt:devtools",
|
|
11881
11900
|
devtools: {
|
|
11882
|
-
setup(ctx2) {
|
|
11901
|
+
async setup(ctx2) {
|
|
11883
11902
|
ctx2.docks.register({
|
|
11884
11903
|
id: "nuxt:devtools",
|
|
11885
11904
|
type: "iframe",
|
|
11886
|
-
icon: "
|
|
11905
|
+
icon: "/__nuxt_devtools__/client/nuxt.svg",
|
|
11887
11906
|
title: "Nuxt DevTools",
|
|
11888
|
-
url: "/__nuxt_devtools__/client/"
|
|
11907
|
+
url: "/__nuxt_devtools__/client/",
|
|
11908
|
+
defaultOrder: -2e3
|
|
11889
11909
|
});
|
|
11890
|
-
connectDevToolsKit?.(ctx2);
|
|
11910
|
+
await connectDevToolsKit?.(ctx2);
|
|
11891
11911
|
}
|
|
11892
11912
|
}
|
|
11893
11913
|
}));
|
|
@@ -12010,4 +12030,9 @@ function defineViteDevToolsPlugin(plugin) {
|
|
|
12010
12030
|
return plugin;
|
|
12011
12031
|
}
|
|
12012
12032
|
|
|
12013
|
-
|
|
12033
|
+
const moduleMain = {
|
|
12034
|
+
__proto__: null,
|
|
12035
|
+
enableModule: enableModule
|
|
12036
|
+
};
|
|
12037
|
+
|
|
12038
|
+
export { RPC_NAMESPACE as R, moduleMain as m };
|
|
@@ -1,52 +1,85 @@
|
|
|
1
|
+
import { onDevtoolsReady } from '@nuxt/devtools-kit';
|
|
1
2
|
import { addVitePlugin, logger } from '@nuxt/kit';
|
|
3
|
+
import { R as RPC_NAMESPACE } from './module-main.mjs';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import 'node:fs/promises';
|
|
6
|
+
import 'node:os';
|
|
7
|
+
import 'consola/utils';
|
|
8
|
+
import 'pathe';
|
|
9
|
+
import 'sirv';
|
|
10
|
+
import 'vite';
|
|
11
|
+
import '../shared/devtools-nightly.B9TxdMuu.mjs';
|
|
12
|
+
import '../dirs.mjs';
|
|
13
|
+
import 'node:path';
|
|
14
|
+
import 'node:url';
|
|
15
|
+
import 'tinyexec';
|
|
16
|
+
import 'tinyglobby';
|
|
17
|
+
import 'image-meta';
|
|
18
|
+
import 'perfect-debounce';
|
|
19
|
+
import 'destr';
|
|
20
|
+
import '../../dist/runtime/shared/hooks.js';
|
|
21
|
+
import 'ohash';
|
|
22
|
+
import 'node:process';
|
|
23
|
+
import 'node:module';
|
|
24
|
+
import 'pkg-types';
|
|
25
|
+
import 'node:assert';
|
|
26
|
+
import 'node:v8';
|
|
27
|
+
import 'node:util';
|
|
28
|
+
import 'local-pkg';
|
|
29
|
+
import 'magicast';
|
|
30
|
+
import 'magicast/helpers';
|
|
31
|
+
import 'semver';
|
|
32
|
+
import 'unstorage';
|
|
2
33
|
|
|
3
34
|
const VERSION_QUERY_RE = /\?v=\w+$/;
|
|
4
35
|
const VUE_EXT_RE = /\.vue($|\?v=)/;
|
|
5
36
|
async function createVitePluginInspect(options) {
|
|
6
37
|
return await import('vite-plugin-inspect').then((r) => r.default(options));
|
|
7
38
|
}
|
|
8
|
-
async function setup(
|
|
39
|
+
async function setup(ctx) {
|
|
9
40
|
const plugin = await createVitePluginInspect();
|
|
10
41
|
addVitePlugin(plugin);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const meta = await devtoolsKit.rpc.invokeLocal("vite-plugin-inspect:get-metadata");
|
|
17
|
-
const modules = (meta && meta.instances[0] ? await devtoolsKit.rpc.invokeLocal("vite-plugin-inspect:get-modules-list", {
|
|
18
|
-
vite: meta.instances[0].vite,
|
|
19
|
-
env: meta.instances[0].environments[0]
|
|
20
|
-
}) : null) || [];
|
|
21
|
-
const components = await rpc.functions.getComponents() || [];
|
|
22
|
-
const vueModules = modules.filter((m) => {
|
|
23
|
-
const plainId = m.id.replace(VERSION_QUERY_RE, "");
|
|
24
|
-
if (components.some((c) => c.filePath === plainId))
|
|
25
|
-
return true;
|
|
26
|
-
return m.id.match(VUE_EXT_RE);
|
|
27
|
-
});
|
|
28
|
-
const graph = vueModules.map((i) => {
|
|
29
|
-
function searchForVueDeps(id, seen = /* @__PURE__ */ new Set()) {
|
|
30
|
-
if (seen.has(id))
|
|
31
|
-
return [];
|
|
32
|
-
seen.add(id);
|
|
33
|
-
const module = modules.find((m) => m.id === id);
|
|
34
|
-
if (!module)
|
|
35
|
-
return [];
|
|
36
|
-
return module.deps.flatMap((i2) => {
|
|
37
|
-
if (vueModules.some((m) => m.id === i2))
|
|
38
|
-
return [i2];
|
|
39
|
-
return searchForVueDeps(i2, seen);
|
|
40
|
-
});
|
|
42
|
+
onDevtoolsReady((kit) => {
|
|
43
|
+
async function getComponentsRelationships() {
|
|
44
|
+
if (!kit.rpc.has("vite-plugin-inspect:get-metadata")) {
|
|
45
|
+
logger.warn("[nuxt-devtools] vite-plugin-inspect RPC functions not registered, component relationships unavailable");
|
|
46
|
+
return [];
|
|
41
47
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const meta = await kit.rpc.invokeLocal("vite-plugin-inspect:get-metadata");
|
|
49
|
+
const modules = (meta && meta.instances[0] ? await kit.rpc.invokeLocal("vite-plugin-inspect:get-modules-list", {
|
|
50
|
+
vite: meta.instances[0].vite,
|
|
51
|
+
env: meta.instances[0].environments[0]
|
|
52
|
+
}) : null) || [];
|
|
53
|
+
const components = await kit.rpc.invokeLocal(`${RPC_NAMESPACE}:getComponents`) || [];
|
|
54
|
+
const vueModules = modules.filter((m) => {
|
|
55
|
+
const plainId = m.id.replace(VERSION_QUERY_RE, "");
|
|
56
|
+
if (components.some((c) => c.filePath === plainId))
|
|
57
|
+
return true;
|
|
58
|
+
return m.id.match(VUE_EXT_RE);
|
|
59
|
+
});
|
|
60
|
+
const graph = vueModules.map((i) => {
|
|
61
|
+
function searchForVueDeps(id, seen = /* @__PURE__ */ new Set()) {
|
|
62
|
+
if (seen.has(id))
|
|
63
|
+
return [];
|
|
64
|
+
seen.add(id);
|
|
65
|
+
const module = modules.find((m) => m.id === id);
|
|
66
|
+
if (!module)
|
|
67
|
+
return [];
|
|
68
|
+
return module.deps.flatMap((i2) => {
|
|
69
|
+
if (vueModules.some((m) => m.id === i2))
|
|
70
|
+
return [i2];
|
|
71
|
+
return searchForVueDeps(i2, seen);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
id: i.id,
|
|
76
|
+
deps: searchForVueDeps(i.id)
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
return graph;
|
|
80
|
+
}
|
|
81
|
+
kit.rpc.register({ name: `${RPC_NAMESPACE}:getComponentsRelationships`, handler: getComponentsRelationships }, true);
|
|
82
|
+
}, ctx.nuxt);
|
|
50
83
|
}
|
|
51
84
|
|
|
52
85
|
export { createVitePluginInspect, setup };
|
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -2,7 +2,6 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import { hostname } from 'node:os';
|
|
4
4
|
import { resolve } from 'node:path';
|
|
5
|
-
import { startSubprocess } from '@nuxt/devtools-kit';
|
|
6
5
|
import { logger } from '@nuxt/kit';
|
|
7
6
|
import { checkPort, getPort } from 'get-port-please';
|
|
8
7
|
import { x } from 'tinyexec';
|
|
@@ -31,7 +30,8 @@ const codeBinaryOptions = {
|
|
|
31
30
|
connectionTokenArg: ""
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
|
-
async function setup(
|
|
33
|
+
async function setup(ctx) {
|
|
34
|
+
const { nuxt, options, openInEditorHooks } = ctx;
|
|
35
35
|
const vsOptions = options?.vscode || {};
|
|
36
36
|
const codeServer = vsOptions?.codeServer || "ms-code-server";
|
|
37
37
|
const { codeBinary, launchArg, licenseTermsArg, connectionTokenArg } = codeBinaryOptions[codeServer];
|
|
@@ -52,7 +52,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
52
52
|
const { port: port2 } = JSON.parse(await fs.readFile(vscodeServerControllerFile, "utf-8"));
|
|
53
53
|
const url2 = `http://localhost:${port2}/open?path=${encodeURIComponent(`${root}/${file}`)}`;
|
|
54
54
|
await fetch(url2);
|
|
55
|
-
rpc.broadcast
|
|
55
|
+
ctx.devtoolsKit?.rpc.broadcast({ method: "navigateTo", args: ["/modules/custom-builtin-vscode"], event: true });
|
|
56
56
|
return true;
|
|
57
57
|
} catch (e) {
|
|
58
58
|
console.debug(`Failed to open file "${file}" in VS Code Server`);
|
|
@@ -76,7 +76,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
76
76
|
"--install-extension",
|
|
77
77
|
"antfu.vscode-server-controller"
|
|
78
78
|
], { nodeOptions: { stdio: ["pipe", "ignore", "inherit"] } });
|
|
79
|
-
|
|
79
|
+
await ctx.devtoolsKit?.terminals.startChildProcess(
|
|
80
80
|
{
|
|
81
81
|
command: codeBinary,
|
|
82
82
|
args: [
|
|
@@ -89,10 +89,9 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
id: "devtools:vscode",
|
|
92
|
-
|
|
92
|
+
title: "VS Code Server",
|
|
93
93
|
icon: "logos-visual-studio-code"
|
|
94
|
-
}
|
|
95
|
-
nuxt
|
|
94
|
+
}
|
|
96
95
|
);
|
|
97
96
|
for (let i = 0; i < 100; i++) {
|
|
98
97
|
if (await fetch(url).then((r) => r.ok).catch(() => false))
|
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/ern5ggeg.js"}}</script><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-ogksm1gk.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-lb1ewor6.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-flyrgbwp.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ern5ggeg.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/_plugin-vue_export-helper-d9irwgla.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/rolldown-runtime-imbltlrc.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-dqdvn8dy.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/utils-kx1pynf6.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-mgsi4s2l.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ready-nen2jn0n.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dist-l07sxtw0.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-krm6uln9.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue-router-kdlawv8o.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/rpc-orxw6a9i.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-ij8bbku6.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/storage-options-cjhumdfc.js"><script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/ern5ggeg.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-cx0uvu2o.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-cpmtsy11.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-o5traho8.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-or9h2zq3.js"><link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.css-ivoxtfjk.css"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-livtfy7s.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-otmjigaj.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block-ckqwlxff.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-otdlvsyg.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer-cb7r4xcw.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown-dadvl968.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect-bt63blmq.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch-bw81lfyl.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-hmm1sbzc.js"><link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-bh9l40d0.css"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-kimn5am8.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"05e26437-f2cc-492f-acc4-a147631ddc71",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1784030089298,false]</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/ern5ggeg.js"}}</script><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-ogksm1gk.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-lb1ewor6.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-flyrgbwp.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ern5ggeg.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/_plugin-vue_export-helper-d9irwgla.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/rolldown-runtime-imbltlrc.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-dqdvn8dy.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/utils-kx1pynf6.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-mgsi4s2l.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ready-nen2jn0n.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dist-l07sxtw0.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-krm6uln9.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue-router-kdlawv8o.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/rpc-orxw6a9i.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-ij8bbku6.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/storage-options-cjhumdfc.js"><script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/ern5ggeg.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-cx0uvu2o.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-cpmtsy11.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-o5traho8.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-or9h2zq3.js"><link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.css-ivoxtfjk.css"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-livtfy7s.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-otmjigaj.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block-ckqwlxff.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-otdlvsyg.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer-cb7r4xcw.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown-dadvl968.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect-bt63blmq.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch-bw81lfyl.js"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-hmm1sbzc.js"><link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-bh9l40d0.css"><link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-kimn5am8.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"05e26437-f2cc-492f-acc4-a147631ddc71",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1784030089303,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,J as t,S as n,St as r,T as i,U as a,Zt as o,_ as s,dt as c,en as l,g as u,h as d,jt as f,m as p,p as m,s as h,ut as g}from"./vendor/json-editor-vue-dqdvn8dy.js";import{A as _,_ as v}from"./ready-nen2jn0n.js";import{a as y}from"./nuxt-krm6uln9.js";import{_ as b,g as x}from"./utils-
|
|
1
|
+
import{C as e,J as t,S as n,St as r,T as i,U as a,Zt as o,_ as s,dt as c,en as l,g as u,h as d,jt as f,m as p,p as m,s as h,ut as g}from"./vendor/json-editor-vue-dqdvn8dy.js";import{A as _,_ as v}from"./ready-nen2jn0n.js";import{a as y}from"./nuxt-krm6uln9.js";import{_ as b,g as x}from"./utils-kx1pynf6.js";import{a as S,h as C,m as w}from"./rpc-orxw6a9i.js";import{t as T}from"./_plugin-vue_export-helper-d9irwgla.js";import{T as E,_ as D,b as O,c as k,g as A,h as j,j as M,p as N,t as P}from"#entry";import{t as F}from"./ncode-block-ckqwlxff.js";import"./composables-ioamscf4.js";import{t as I}from"./ncheckbox-mtdsbp1a.js";import{t as L}from"./filepath-item-d0vg8skv.js";import{t as R}from"./ntip-kfuisnga.js";import{t as z}from"./help-fab-dt2igbly.js";var B={"h-full":``,grid:`~ rows-[max-content_1fr]`},V={flex:`~ wrap`,"w-full":``},H=[`onClick`],U={key:0,flex:`~ col gap-4 items-center justify-center`,p4:``},W={grid:`~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center`,"w-100":``},G=`/__nuxt_devtools__/client`,K=Object.assign(i({__name:`BuildAnalyzeDetails`,props:{current:{},prev:{}},setup(i){let d=i,v=`${y().app.baseURL.replace(G,`/`)}/__nuxt_devtools__/analyze/`.replace(/\/+/g,`/`),b=m(()=>{let e=[{name:`Overview`,id:`overview`}];return d.current.features.bundleClient&&e.push({name:`Client Bundle`,id:`bundle-client`}),d.current.features.bundleNitro&&e.push({name:`Nitro Bundle`,id:`bundle-nitro`}),d.current.features.viteInspect&&e.push({name:`Vite Inspect`,id:`vite-inspect`}),e}),x=r(b.value[0]);function w(e){return`${((e.endTime-e.startTime)/1e3).toFixed(1)}s`}function T(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)}MB`:`${(e/1024/1024/1024).toFixed(1)}GB`}async function E(e){return S.clearAnalyzeBuilds([e])}return(r,d)=>{let m=L,y=M;return a(),s(`div`,B,[p(`div`,V,[(a(!0),s(h,null,t(b.value,(e,t)=>(a(),s(`button`,{key:t,px4:``,py2:``,border:`r base`,hover:`bg-active`,class:o(e.id===x.value?.id?``:`border-b`),onClick:t=>x.value=e},[p(`div`,{class:o(e.id===x.value?.id?``:`op30`)},l(e.name),3)],10,H))),128)),d[1]||=p(`div`,{border:`b base`,"flex-auto":``},null,-1)]),x.value?.id===`overview`?(a(),s(`div`,U,[d[15]||=p(`div`,{"flex-auto":``},null,-1),p(`div`,W,[d[10]||=p(`div`,{"i-carbon-commit":``,"text-xl":``},null,-1),p(`div`,null,[d[2]||=p(`div`,{"text-sm":``,op50:``},` Name `,-1),p(`div`,null,l(i.current.name),1)]),d[11]||=p(`div`,{"i-carbon-time":``,"text-xl":``},null,-1),p(`div`,null,[d[3]||=p(`div`,{"text-sm":``,op50:``},` Build duration `,-1),p(`div`,null,l(w(i.current)),1)]),i.current.size?.clientBundle?(a(),s(h,{key:0},[d[5]||=p(`div`,{"i-carbon-cics-program":``,"text-xl":``},null,-1),p(`div`,null,[d[4]||=p(`div`,{"text-sm":``,op50:``},` Client bundle size `,-1),p(`div`,null,l(T(i.current.size.clientBundle)),1)])],64)):u(``,!0),i.current.size?.nitroBundle?(a(),s(h,{key:1},[d[7]||=p(`div`,{"i-carbon-bare-metal-server":``,"text-xl":``},null,-1),p(`div`,null,[d[6]||=p(`div`,{"text-sm":``,op50:``},` Nitro bundle size `,-1),p(`div`,null,l(T(i.current.size.nitroBundle)),1)])],64)):u(``,!0),d[12]||=p(`div`,{"i-carbon-edge-node":``,"text-xl":``},null,-1),p(`div`,null,[d[8]||=p(`div`,{"text-sm":``,op50:``},` Built `,-1),p(`div`,null,l(f(C)(new Date(i.current.endTime))),1)]),d[13]||=p(`div`,{"i-carbon:folder-parent":``,"text-xl":``},null,-1),p(`div`,null,[d[9]||=p(`div`,{"text-sm":``,op50:``},` Report Path `,-1),e(m,{filepath:i.current.analyzeDir},null,8,[`filepath`])])]),d[16]||=p(`div`,{"flex-auto":``},null,-1),e(y,{n:`rose`,icon:`carbon-delete`,onClick:d[0]||=e=>E(i.current.name)},{default:g(()=>[...d[14]||=[n(` Delete this report `,-1)]]),_:1})])):u(``,!0),d._lazyshow1||x.value?.id===`bundle-client`?(d._lazyshow1=!0,a(),s(h,null,[c(p(`iframe`,{src:`${f(v)}${i.current.slug}/client.html`,"h-full":``,"w-full":``},null,8,[`src`]),[[_,x.value?.id===`bundle-client`]])],64)):u(`v-show-if`,!0),d._lazyshow2||x.value?.id===`bundle-nitro`?(d._lazyshow2=!0,a(),s(h,null,[c(p(`iframe`,{src:`${f(v)}${i.current.slug}/nitro.html`,"h-full":``,"w-full":``},null,8,[`src`]),[[_,x.value?.id===`bundle-nitro`]])],64)):u(`v-show-if`,!0),d._lazyshow3||x.value?.id===`vite-inspect`?(d._lazyshow3=!0,a(),s(h,null,[c(p(`iframe`,{src:`${f(v)}${i.current.slug}/.vite-inspect/`,"h-full":``,"w-full":``},null,8,[`src`]),[[_,x.value?.id===`vite-inspect`]])],64)):u(`v-show-if`,!0)])}}}),{__name:`BuildAnalyzeDetails`}),q={},J={class:`markdown-body`};function Y(e,t){return a(),s(`div`,J,[...t[0]||=[p(`template`,null,[p(`div`,{class:`markdown-body`},[p(`h1`,null,`Build Analyze`),p(`p`,null,[n(`DevTools provides a build analyze tool to help you understand the size of your app in production. Whenever you start a new build, it runs the command `),p(`code`,{"v-pre":``},`nuxt build --analyze`),n(` and present the output data directly in DevTools for easy browsing and comparing.`)])])],-1)]])}var X=T(q,[[`render`,Y]]),Z={flex:`~ col`},Q=[`onClick`],$={flex:`~ gap-1 items-center wrap`,"w-full":``,"text-sm":``,op60:``},ee={flex:`~ items-center justify-center wrap`,p4:``},te={flex:`~ col gap-1`,"w-250":``,p4:``},ne={flex:`~ gap-3`,mt2:``,"justify-end":``},re=i({__name:`analyze-build`,setup(i){let c=w(),_=b(),y=v(),T=x(`analyze-build:slug`,``),L=m(()=>_.value?.builds.find(e=>e.slug===T.value)??_.value?.builds[0]),B=r(!1),V=r(``),H=m(()=>_.value?.builds.some(e=>e.name===V.value.trim()));async function U(){V.value=await S.generateAnalyzeBuildName(),await c.start()&&(E(`analyze-build:start`),P.value={name:V.value,processId:await S.startAnalyzeBuild(V.value)},B.value&&q())}let W=k();function G(e){return`${((e.endTime-e.startTime)/1e3).toFixed(1)}s`}function q(){P.value?.processId&&(W.value=P.value.processId,y.push(`/modules/terminals`))}return N(()=>[{id:`action:analyze-build: start`,title:`Start a new analyze build`,icon:`i-carbon-edge-node`,action:U}]),(r,i)=>{let m=M,v=K,y=O,b=D,x=A,S=R,w=F,E=I,k=j,N=X,W=z;return a(),s(h,null,[e(b,{"left-size":30},{left:g(()=>[p(`div`,Z,[(a(!0),s(h,null,t(f(_)?.builds,e=>(a(),s(h,{key:e.slug},[p(`button`,{flex:`~ col gap1`,p3:``,"hover:bg-active":``,class:o(e.slug===L.value?.slug?`text-primary bg-active`:``),onClick:t=>T.value=e.slug},[p(`code`,null,l(e.name),1),p(`div`,$,[i[4]||=p(`div`,{"i-carbon-time":``},null,-1),p(`span`,null,l(G(e)),1),i[5]||=p(`div`,{"flex-auto":``},null,-1),p(`span`,null,l(f(C)(new Date(e.endTime))),1)])],10,Q),i[6]||=p(`div`,{"x-divider":``},null,-1)],64))),128)),p(`div`,ee,[f(P)?(a(),d(m,{key:1,n:`primary`,icon:`carbon-circle-dash animate-spin`,onClick:i[1]||=e=>q()},{default:g(()=>[...i[8]||=[n(` Building... `,-1)]]),_:1})):(a(),d(m,{key:0,n:`primary`,icon:`carbon-edge-node`,onClick:i[0]||=e=>U()},{default:g(()=>[...i[7]||=[n(` Start a new build `,-1)]]),_:1}))])])]),right:g(()=>[L.value?(a(),d(v,{key:0,current:L.value},null,8,[`current`])):(a(),d(y,{key:1}))]),_:1}),e(f(c),null,{default:g(({resolve:t})=>[e(k,{"model-value":!0,onClose:e=>t(!1)},{default:g(()=>[p(`div`,te,[i[13]||=p(`h3`,{class:`text-lg font-medium leading-6`,mb2:``},` Start analyze build? `,-1),i[14]||=p(`p`,{op50:``},` Enter the name of the build: `,-1),e(x,{modelValue:V.value,"onUpdate:modelValue":i[2]||=e=>V.value=e,placeholder:`Build name`},null,8,[`modelValue`]),H.value?(a(),d(S,{key:0,"n-orange":``},{default:g(()=>[...i[9]||=[n(` A build with the same name already exists, continue would overrides the previous build result. `,-1)]]),_:1})):u(``,!0),i[15]||=p(`div`,{my3:``,"x-divider":``},null,-1),i[16]||=p(`p`,{op50:``},` The following command will be executed in your terminal: `,-1),e(w,{code:`npx nuxi analyze --no-serve --name=${V.value}`,lang:`bash`,px4:``,py2:``,border:`~ base rounded`,lines:!1},null,8,[`code`]),e(E,{modelValue:B.value,"onUpdate:modelValue":i[3]||=e=>B.value=e,mt2:``,n:`primary`},{default:g(()=>[...i[10]||=[n(` Navigate to terminal `,-1)]]),_:1},8,[`modelValue`]),p(`div`,ne,[e(m,{onClick:e=>t(!1)},{default:g(()=>[...i[11]||=[n(` Cancel `,-1)]]),_:1},8,[`onClick`]),e(m,{n:`solid primary`,onClick:e=>t(!0)},{default:g(()=>[...i[12]||=[n(` Start `,-1)]]),_:1},8,[`onClick`])])])]),_:2},1032,[`onClose`])]),_:1}),e(W,null,{default:g(()=>[e(N)]),_:1})],64)}}});export{re as default};
|