@nuxt/devtools 1.6.4 → 2.0.0-beta.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.
- package/.discoveryrc.cjs +13 -0
- package/README.md +8 -5
- package/dist/chunks/module-main.mjs +105 -51
- package/dist/chunks/vite-inspect.mjs +5 -1
- package/dist/chunks/vscode.mjs +34 -12
- package/dist/client/200.html +15 -15
- package/dist/client/404.html +15 -15
- package/dist/client/_nuxt/__blank-mzki7hds.js +1 -0
- package/dist/client/_nuxt/{analyze-build-m6hjy8b6.js → analyze-build-cm7nbw0a.js} +1 -1
- package/dist/client/_nuxt/{assets-jkla6b4k.js → assets-4eyg0st2.js} +3 -3
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/7235b424-6975-4a9d-93d7-43e41c8bf0d0.json +1 -0
- package/dist/client/_nuxt/{client-iy54pzt5.js → client-bnemmvey.js} +1 -1
- package/dist/client/_nuxt/{code-diff.vue-lhj9gxzz.js → code-diff.vue-b35z64iy.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-jbtneucz.js → code-snippets.vue-kod959e4.js} +1 -1
- package/dist/client/_nuxt/components-owz73qfn.js +1 -0
- package/dist/client/_nuxt/{composable-item.vue-glp5bo7t.js → composable-item.vue-k3upmevr.js} +1 -1
- package/dist/client/_nuxt/custom-_name_-1x91219n.js +1 -0
- package/dist/client/_nuxt/{default-g9cho5c5.js → default-knqf5o69.js} +1 -1
- package/dist/client/_nuxt/duration-display.vue-jvaccd8v.js +1 -0
- package/dist/client/_nuxt/entry.css-egk2z7qr.css +1 -0
- package/dist/client/_nuxt/{error-404-kpv9svhd.js → error-404-njmanbq9.js} +1 -1
- package/dist/client/_nuxt/error-404.css-lmmxplpx.css +1 -0
- package/dist/client/_nuxt/{error-500-hs8gcksv.js → error-500-efmvdg7h.js} +1 -1
- package/dist/client/_nuxt/error-500.css-u0boq89r.css +1 -0
- package/dist/client/_nuxt/error-g6edq0yb.js +9 -0
- package/dist/client/_nuxt/filepath-item.vue-jlqwj704.js +1 -0
- package/dist/client/_nuxt/full-b288af13.js +1 -0
- package/dist/client/_nuxt/{help-fab.vue-dsbe70oc.js → help-fab.vue-j6249tgf.js} +1 -1
- package/dist/client/_nuxt/{hooks-ntg8apv0.js → hooks-j5sf1l7v.js} +1 -1
- package/dist/client/_nuxt/imports-bnmsrgkh.js +1 -0
- package/dist/client/_nuxt/index-fzja6ux8.js +2 -0
- package/dist/client/_nuxt/index-nx28hfsi.js +1 -0
- package/dist/client/_nuxt/launch-page.vue-h6bzyiyl.js +1 -0
- package/dist/client/_nuxt/modules-dg7kfyjr.js +1 -0
- package/dist/client/_nuxt/mxzg8bne.js +17 -0
- package/dist/client/_nuxt/nbadge-065dqs5v.js +1 -0
- package/dist/client/_nuxt/{ncheckbox.vue-cse1wr02.js → ncheckbox.vue-d0yw5qc1.js} +1 -1
- package/dist/client/_nuxt/ncode-block.css-lvdc77tw.css +1 -0
- package/dist/client/_nuxt/ncode-block.vue-c2t0anp9.js +2 -0
- package/dist/client/_nuxt/ndrawer.vue-g7wzeynf.js +1 -0
- package/dist/client/_nuxt/ndropdown.vue-jksxbs6t.js +1 -0
- package/dist/client/_nuxt/{nicon-title.vue-jza46fsn.js → nicon-title.vue-hch1agon.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-n7487xrt.js → nlink.vue-i0hrioln.js} +1 -1
- package/dist/client/_nuxt/{nmarkdown.vue-ly8z22rg.js → nmarkdown.vue-lym2fx3e.js} +1 -1
- package/dist/client/_nuxt/nnavbar.vue-y4opgitt.js +1 -0
- package/dist/client/_nuxt/none-nup47uz7.js +1 -0
- package/dist/client/_nuxt/nsection-block-mb0wrwu4.js +1 -0
- package/dist/client/_nuxt/nselect-tabs.vue-mvcu0rv4.js +1 -0
- package/dist/client/_nuxt/nselect.vue-eyd0vhij.js +1 -0
- package/dist/client/_nuxt/{open-graph-oo7uwhvx.js → open-graph-k0hqg0gj.js} +2 -2
- package/dist/client/_nuxt/overview-o54gzos9.js +1 -0
- package/dist/client/_nuxt/pages-eou4r3my.js +1 -0
- package/dist/client/_nuxt/{payload-i4d3og4m.js → payload-nhrpw6bb.js} +1 -1
- package/dist/client/_nuxt/pinia-fydnwhe3.js +1 -0
- package/dist/client/_nuxt/plugins-c7p6t581.js +1 -0
- package/dist/client/_nuxt/render-tree-j2aypyg1.js +1 -0
- package/dist/client/_nuxt/{runtime-configs-elwu7luj.js → runtime-configs-d0jvii1m.js} +1 -1
- package/dist/client/_nuxt/server-discovery-gexdv3di.js +1 -0
- package/dist/client/_nuxt/{server-route-inputs.vue-ot4rib01.js → server-route-inputs.vue-o8209idy.js} +1 -1
- package/dist/client/_nuxt/server-routes-dqhxkhv4.js +9 -0
- package/dist/client/_nuxt/server-tasks-k2bo3ecg.js +1 -0
- package/dist/client/_nuxt/settings-kg4bwnbo.js +1 -0
- package/dist/client/_nuxt/{stacktrace-list.vue-ojf2cyfb.js → stacktrace-list.vue-cb98on8v.js} +1 -1
- package/dist/client/_nuxt/{state-components-i6bpejw5.js → state-components-of7uu2vz.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-j30ssdvq.js +1 -0
- package/dist/client/_nuxt/state-modules-dvf4dhgf.js +1 -0
- package/dist/client/_nuxt/storage-h5g7r393.js +1 -0
- package/dist/client/_nuxt/{terminals-dmw85v8a.js → terminals-h4bqkpmq.js} +1 -1
- package/dist/client/_nuxt/{timeline-ilgburvu.js → timeline-km82a89k.js} +2 -2
- package/dist/client/_nuxt/{unocss-runtime-dmm6yugz.js → unocss-runtime-eltx4hvu.js} +1 -1
- package/dist/client/_nuxt/vendor/{json-editor-vue-ivrsfd8a.js → json-editor-vue-fw81xiot.js} +100 -100
- package/dist/client/_nuxt/vendor/shiki-j4jbxo4i.js +148 -0
- package/dist/client/_nuxt/vendor/unocss-dypm4cev.js +2 -0
- package/dist/client/_nuxt/vendor/{vis-cum19y28.js → vis-fzckz0r6.js} +12 -12
- package/dist/client/_nuxt/vendor/{xterm-dbpzgj7s.js → xterm-b1jefe3j.js} +7 -7
- package/dist/client/_nuxt/virtual-files-lhs4uf37.js +1 -0
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-lq6f9fzq.js → vue-virtual-scroller.esm-luvj44av.js} +1 -1
- package/dist/client/discovery/index.html +611 -0
- package/dist/client/index.html +15 -15
- package/dist/module.json +2 -2
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/view/Main.vue +2 -9
- package/dist/shared/{devtools.5ac54dae.mjs → devtools.60b2ba4d.mjs} +3 -2
- package/package.json +49 -43
- package/dist/client/_nuxt/__blank-lypl178u.js +0 -1
- package/dist/client/_nuxt/builds/meta/3a026b0b-3c88-4a7c-8ad7-043b5176a32e.json +0 -1
- package/dist/client/_nuxt/components-h2g43vc5.js +0 -1
- package/dist/client/_nuxt/components-tree-iq3immmn.js +0 -1
- package/dist/client/_nuxt/custom-_name_-m2razr0k.js +0 -1
- package/dist/client/_nuxt/duration-display.vue-oy3zq0wt.js +0 -1
- package/dist/client/_nuxt/entry.css-f054t818.css +0 -1
- package/dist/client/_nuxt/error-404.css-he1uoaye.css +0 -1
- package/dist/client/_nuxt/error-500.css-ojhe2u1c.css +0 -1
- package/dist/client/_nuxt/error-kq6fdjd8.js +0 -9
- package/dist/client/_nuxt/filepath-item.vue-khcefxw1.js +0 -1
- package/dist/client/_nuxt/full-h4bblsc2.js +0 -1
- package/dist/client/_nuxt/imports-oas5k4l1.js +0 -1
- package/dist/client/_nuxt/index-cr2km0lm.js +0 -1
- package/dist/client/_nuxt/index-kk6zx8yh.js +0 -2
- package/dist/client/_nuxt/jkwjqiby.js +0 -17
- package/dist/client/_nuxt/launch-page.vue-qpalyfg3.js +0 -1
- package/dist/client/_nuxt/modules-djo3gmhk.js +0 -1
- package/dist/client/_nuxt/nbadge-gvjrabwx.js +0 -1
- package/dist/client/_nuxt/ncode-block.css-c9cb29at.css +0 -1
- package/dist/client/_nuxt/ncode-block.vue-d0rio4gb.js +0 -2
- package/dist/client/_nuxt/ndrawer.vue-lv2j51sl.js +0 -1
- package/dist/client/_nuxt/ndropdown.vue-nrkf5gj7.js +0 -1
- package/dist/client/_nuxt/nnavbar.vue-h0vrbdpc.js +0 -1
- package/dist/client/_nuxt/none-o20iaxfc.js +0 -1
- package/dist/client/_nuxt/nsection-block-c30h9a7p.js +0 -1
- package/dist/client/_nuxt/nselect-tabs.vue-kva09wsa.js +0 -1
- package/dist/client/_nuxt/nselect.vue-97v3ez5s.js +0 -1
- package/dist/client/_nuxt/overview-myl8hwsb.js +0 -1
- package/dist/client/_nuxt/pages-b55hg92j.js +0 -1
- package/dist/client/_nuxt/pinia-d820aun4.js +0 -1
- package/dist/client/_nuxt/plugins-fyuck7jc.js +0 -1
- package/dist/client/_nuxt/server-routes-egyll002.js +0 -9
- package/dist/client/_nuxt/server-tasks-lubqj3k2.js +0 -1
- package/dist/client/_nuxt/settings-k355sbsm.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-iy8ydlol.js +0 -1
- package/dist/client/_nuxt/state-modules-g393ybfq.js +0 -1
- package/dist/client/_nuxt/storage-pbps5f8y.js +0 -1
- package/dist/client/_nuxt/vendor/shiki-enrzjv18.js +0 -57
- package/dist/client/_nuxt/vendor/unocss-hwbthrao.js +0 -2
- package/dist/client/_nuxt/virtual-files-b7capdoa.js +0 -1
package/.discoveryrc.cjs
ADDED
package/README.md
CHANGED
|
@@ -25,9 +25,12 @@ Unleash Nuxt Developer Experience.
|
|
|
25
25
|
|
|
26
26
|
<br>
|
|
27
27
|
|
|
28
|
+
> [!NOTE]
|
|
29
|
+
> You are viewing the v2.x branch which are in active development. For the latest stable version, please refer to the [v1.x branch](https://github.com/nuxt/devtools/tree/v1)
|
|
30
|
+
|
|
28
31
|
## Installation
|
|
29
32
|
|
|
30
|
-
> Nuxt DevTools requires **Nuxt v3.
|
|
33
|
+
> Nuxt DevTools v2 requires **Nuxt v3.15.0 or higher**.
|
|
31
34
|
|
|
32
35
|
Nuxt DevTools is **enabled by default** in Nuxt v3.8.0. You can press <kbd>Shift</kbd> + <kbd>Alt</kbd> / <kbd>⇧ Shift</kbd> + <kbd>⌥ Option</kbd> + <kbd>D</kbd> in your app to open it up.
|
|
33
36
|
|
|
@@ -41,17 +44,17 @@ export default defineNuxtConfig({
|
|
|
41
44
|
})
|
|
42
45
|
```
|
|
43
46
|
|
|
44
|
-
###
|
|
47
|
+
### Nightly Release Channel
|
|
45
48
|
|
|
46
|
-
Similar to [Nuxt's Nightly Channel](https://nuxt.com/docs/guide/going-further/nightly-release-channel
|
|
49
|
+
Similar to [Nuxt's Nightly Channel](https://nuxt.com/docs/guide/going-further/nightly-release-channel), DevTools also offers a nightly release channel, that automatically releases for every commit to `main` branch.
|
|
47
50
|
|
|
48
|
-
You can opt-in to the
|
|
51
|
+
You can opt-in to the nightly release channel by running:
|
|
49
52
|
|
|
50
53
|
```diff
|
|
51
54
|
{
|
|
52
55
|
"devDependencies": {
|
|
53
56
|
-- "@nuxt/devtools": "^0.1.0"
|
|
54
|
-
++ "@nuxt/devtools": "npm:@nuxt/devtools-
|
|
57
|
+
++ "@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
```
|
|
@@ -6,7 +6,7 @@ import { colors } from 'consola/utils';
|
|
|
6
6
|
import { join, dirname as dirname$1, resolve } from 'pathe';
|
|
7
7
|
import sirv from 'sirv';
|
|
8
8
|
import { searchForWorkspaceRoot } from 'vite';
|
|
9
|
-
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools.
|
|
9
|
+
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools.60b2ba4d.mjs';
|
|
10
10
|
import { dirname, join as join$1, relative, parse } from 'node:path';
|
|
11
11
|
import { randomStr } from '@antfu/utils';
|
|
12
12
|
import { hash } from 'ohash';
|
|
@@ -31,7 +31,7 @@ import { getPackageInfo } from 'local-pkg';
|
|
|
31
31
|
import 'pkg-types';
|
|
32
32
|
import semver from 'semver';
|
|
33
33
|
|
|
34
|
-
const version = "
|
|
34
|
+
const version = "2.0.0-beta.2";
|
|
35
35
|
|
|
36
36
|
function getHomeDir() {
|
|
37
37
|
return process.env.XDG_CONFIG_HOME || homedir();
|
|
@@ -384,6 +384,54 @@ function setupCustomTabRPC({ nuxt, options, refresh }) {
|
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
let options;
|
|
388
|
+
function getOptions() {
|
|
389
|
+
return options;
|
|
390
|
+
}
|
|
391
|
+
function setupOptionsRPC({ nuxt }) {
|
|
392
|
+
async function getOptions2(tab) {
|
|
393
|
+
if (!options || options[tab]) {
|
|
394
|
+
options = defaultTabOptions;
|
|
395
|
+
await read(tab);
|
|
396
|
+
}
|
|
397
|
+
return options[tab];
|
|
398
|
+
}
|
|
399
|
+
async function read(tab) {
|
|
400
|
+
options[tab] = await readLocalOptions(defaultTabOptions[tab], {
|
|
401
|
+
root: nuxt.options.rootDir,
|
|
402
|
+
key: tab !== "ui" && tab
|
|
403
|
+
});
|
|
404
|
+
return options;
|
|
405
|
+
}
|
|
406
|
+
getOptions2("ui");
|
|
407
|
+
async function clearOptions() {
|
|
408
|
+
options = void 0;
|
|
409
|
+
await clearLocalOptions({
|
|
410
|
+
root: nuxt.options.rootDir
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
async updateOptions(tab, _settings) {
|
|
415
|
+
const settings = await getOptions2(tab);
|
|
416
|
+
Object.assign(settings, _settings);
|
|
417
|
+
await writeLocalOptions(
|
|
418
|
+
{ ...settings },
|
|
419
|
+
{
|
|
420
|
+
root: nuxt.options.rootDir,
|
|
421
|
+
key: tab !== "ui" && tab
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
nuxt.callHook("builder:generateApp", {
|
|
425
|
+
filter(template) {
|
|
426
|
+
return template.filename.includes("devtools/settings.js");
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
},
|
|
430
|
+
getOptions: getOptions2,
|
|
431
|
+
clearOptions
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
|
|
387
435
|
function setupGeneralRPC({
|
|
388
436
|
nuxt,
|
|
389
437
|
options,
|
|
@@ -443,9 +491,6 @@ function setupGeneralRPC({
|
|
|
443
491
|
app = v;
|
|
444
492
|
});
|
|
445
493
|
return {
|
|
446
|
-
getServerConfig() {
|
|
447
|
-
return nuxt.options;
|
|
448
|
-
},
|
|
449
494
|
getServerRuntimeConfig() {
|
|
450
495
|
const ENV_PREFIX = "NITRO_";
|
|
451
496
|
const ENV_PREFIX_ALT = "NUXT_";
|
|
@@ -526,11 +571,14 @@ function setupGeneralRPC({
|
|
|
526
571
|
}
|
|
527
572
|
try {
|
|
528
573
|
for (const hook of openInEditorHooks) {
|
|
529
|
-
const result = await hook(path);
|
|
574
|
+
const result = await hook(path + suffix);
|
|
530
575
|
if (result)
|
|
531
576
|
return true;
|
|
532
577
|
}
|
|
533
|
-
|
|
578
|
+
let editor = getOptions()?.behavior.openInEditor ?? void 0;
|
|
579
|
+
if (editor === "auto")
|
|
580
|
+
editor = void 0;
|
|
581
|
+
await import('launch-editor').then((r) => (r.default || r)(path + suffix, editor));
|
|
534
582
|
return true;
|
|
535
583
|
} catch (e) {
|
|
536
584
|
console.error(e);
|
|
@@ -1148,7 +1196,11 @@ async function checkForUpdateOf(name, current, nuxt = useNuxt()) {
|
|
|
1148
1196
|
try {
|
|
1149
1197
|
if (!current) {
|
|
1150
1198
|
const require = createRequire(nuxt.options.rootDir);
|
|
1151
|
-
const
|
|
1199
|
+
const modulePaths = [
|
|
1200
|
+
...nuxt.options.modulesDir,
|
|
1201
|
+
...require.resolve.paths(name) || []
|
|
1202
|
+
];
|
|
1203
|
+
const info = await getPackageInfo(name, { paths: modulePaths });
|
|
1152
1204
|
if (!info)
|
|
1153
1205
|
return;
|
|
1154
1206
|
current = info.packageJson.version;
|
|
@@ -1342,51 +1394,52 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
1342
1394
|
};
|
|
1343
1395
|
}
|
|
1344
1396
|
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
}
|
|
1364
|
-
getOptions2("ui");
|
|
1365
|
-
async function clearOptions() {
|
|
1366
|
-
options = void 0;
|
|
1367
|
-
await clearLocalOptions({
|
|
1368
|
-
root: nuxt.options.rootDir
|
|
1369
|
-
});
|
|
1370
|
-
}
|
|
1371
|
-
return {
|
|
1372
|
-
async updateOptions(tab, _settings) {
|
|
1373
|
-
const settings = await getOptions2(tab);
|
|
1374
|
-
Object.assign(settings, _settings);
|
|
1375
|
-
await writeLocalOptions(
|
|
1376
|
-
{ ...settings },
|
|
1377
|
-
{
|
|
1378
|
-
root: nuxt.options.rootDir,
|
|
1379
|
-
key: tab !== "ui" && tab
|
|
1397
|
+
function setupServerDataRPC({
|
|
1398
|
+
nuxt,
|
|
1399
|
+
ensureDevAuthToken
|
|
1400
|
+
}) {
|
|
1401
|
+
let nitro;
|
|
1402
|
+
let viteServer;
|
|
1403
|
+
let viteClient;
|
|
1404
|
+
nuxt.hook("nitro:build:before", (_nitro) => {
|
|
1405
|
+
nitro = _nitro;
|
|
1406
|
+
});
|
|
1407
|
+
nuxt.hook("vite:extendConfig", (vite, options) => {
|
|
1408
|
+
if (options.isServer) {
|
|
1409
|
+
vite.plugins ||= [];
|
|
1410
|
+
vite.plugins.push({
|
|
1411
|
+
name: "nuxt:devtools:config-retriever",
|
|
1412
|
+
enforce: "post",
|
|
1413
|
+
configResolved(config) {
|
|
1414
|
+
viteServer = config;
|
|
1380
1415
|
}
|
|
1381
|
-
);
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1416
|
+
});
|
|
1417
|
+
} else if (options.isClient) {
|
|
1418
|
+
vite.plugins ||= [];
|
|
1419
|
+
vite.plugins.push({
|
|
1420
|
+
name: "nuxt:devtools:config-retriever",
|
|
1421
|
+
enforce: "post",
|
|
1422
|
+
configResolved(config) {
|
|
1423
|
+
viteClient = config;
|
|
1385
1424
|
}
|
|
1386
1425
|
});
|
|
1426
|
+
}
|
|
1427
|
+
});
|
|
1428
|
+
return {
|
|
1429
|
+
getServerConfig() {
|
|
1430
|
+
return nuxt.options;
|
|
1387
1431
|
},
|
|
1388
|
-
|
|
1389
|
-
|
|
1432
|
+
async getServerData(token) {
|
|
1433
|
+
await ensureDevAuthToken(token);
|
|
1434
|
+
return {
|
|
1435
|
+
nuxt: nuxt.options,
|
|
1436
|
+
nitro: nitro?.options,
|
|
1437
|
+
vite: {
|
|
1438
|
+
server: viteServer,
|
|
1439
|
+
client: viteClient
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
}
|
|
1390
1443
|
};
|
|
1391
1444
|
}
|
|
1392
1445
|
|
|
@@ -1817,7 +1870,8 @@ function setupRPC(nuxt, options) {
|
|
|
1817
1870
|
...setupAnalyzeBuildRPC(ctx),
|
|
1818
1871
|
...setupOptionsRPC(ctx),
|
|
1819
1872
|
...setupTimelineRPC(ctx),
|
|
1820
|
-
...setupTelemetryRPC(ctx)
|
|
1873
|
+
...setupTelemetryRPC(ctx),
|
|
1874
|
+
...setupServerDataRPC(ctx)
|
|
1821
1875
|
});
|
|
1822
1876
|
const wsClients = /* @__PURE__ */ new Set();
|
|
1823
1877
|
const vitePlugin = {
|
|
@@ -1877,7 +1931,7 @@ async function enableModule(options, nuxt) {
|
|
|
1877
1931
|
await import('./analyze-build.mjs').then(({ setup }) => setup(nuxt, options));
|
|
1878
1932
|
return;
|
|
1879
1933
|
}
|
|
1880
|
-
const enabledExplicitly = nuxt.options.devtools === true || nuxt.options.devtools && nuxt.options.devtools.enabled || !!nuxt.options.modules.find((m) => m === "@nuxt/devtools" || m === "@nuxt/devtools-edge");
|
|
1934
|
+
const enabledExplicitly = nuxt.options.devtools === true || nuxt.options.devtools && nuxt.options.devtools.enabled || !!nuxt.options.modules.find((m) => m === "@nuxt/devtools" || m === "@nuxt/devtools-edge" || m === "@nuxt/devtools-nightly");
|
|
1881
1935
|
await nuxt.callHook("devtools:before");
|
|
1882
1936
|
if (options.iframeProps) {
|
|
1883
1937
|
nuxt.options.runtimeConfig.app.devtools ||= {};
|
|
@@ -22,7 +22,11 @@ async function setup({ nuxt, rpc }) {
|
|
|
22
22
|
}
|
|
23
23
|
}), nuxt);
|
|
24
24
|
async function getComponentsRelationships() {
|
|
25
|
-
const
|
|
25
|
+
const meta = await api?.rpc.getMetadata();
|
|
26
|
+
const modules = (meta ? await api?.rpc.getModulesList({
|
|
27
|
+
vite: meta?.instances[0].vite,
|
|
28
|
+
env: meta?.instances[0].environments[0]
|
|
29
|
+
}) : null) || [];
|
|
26
30
|
const components = await rpc.functions.getComponents() || [];
|
|
27
31
|
const vueModules = modules.filter((m) => {
|
|
28
32
|
const plainId = m.id.replace(/\?v=\w+$/, "");
|
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import 'consola/utils';
|
|
|
12
12
|
import 'pathe';
|
|
13
13
|
import 'sirv';
|
|
14
14
|
import 'vite';
|
|
15
|
-
import '../shared/devtools.
|
|
15
|
+
import '../shared/devtools.60b2ba4d.mjs';
|
|
16
16
|
import '../dirs.mjs';
|
|
17
17
|
import 'node:url';
|
|
18
18
|
import 'is-installed-globally';
|
|
@@ -36,11 +36,34 @@ import 'local-pkg';
|
|
|
36
36
|
import 'pkg-types';
|
|
37
37
|
import 'semver';
|
|
38
38
|
|
|
39
|
+
const codeBinaryOptions = {
|
|
40
|
+
"ms-code-cli": {
|
|
41
|
+
codeBinary: "code",
|
|
42
|
+
launchArg: "serve-web",
|
|
43
|
+
licenseTermsArg: "--accept-server-license-terms",
|
|
44
|
+
connectionTokenArg: "--without-connection-token"
|
|
45
|
+
},
|
|
46
|
+
"ms-code-server": {
|
|
47
|
+
codeBinary: "code-server",
|
|
48
|
+
launchArg: "serve-local",
|
|
49
|
+
licenseTermsArg: "--accept-server-license-terms",
|
|
50
|
+
connectionTokenArg: "--without-connection-token"
|
|
51
|
+
},
|
|
52
|
+
"coder-code-server": {
|
|
53
|
+
codeBinary: "code-server",
|
|
54
|
+
launchArg: "serve-local",
|
|
55
|
+
licenseTermsArg: "",
|
|
56
|
+
connectionTokenArg: ""
|
|
57
|
+
}
|
|
58
|
+
};
|
|
39
59
|
async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
40
|
-
const installed = !!await which("code-server").catch(() => null);
|
|
41
60
|
const vsOptions = options?.vscode || {};
|
|
61
|
+
const codeServer = vsOptions?.codeServer || "ms-code-server";
|
|
62
|
+
const { codeBinary, launchArg, licenseTermsArg, connectionTokenArg } = codeBinaryOptions[codeServer];
|
|
63
|
+
const installed = !!await which(codeBinary).catch(() => null);
|
|
42
64
|
let port = vsOptions?.port || 3080;
|
|
43
65
|
let url = `http://localhost:${port}`;
|
|
66
|
+
const host = vsOptions?.host ? `--host=${vsOptions.host}` : "--host=127.0.0.1";
|
|
44
67
|
let loaded = false;
|
|
45
68
|
let promise = null;
|
|
46
69
|
const mode = vsOptions?.mode || "local-serve";
|
|
@@ -52,7 +75,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
52
75
|
return false;
|
|
53
76
|
try {
|
|
54
77
|
const { port: port2 } = JSON.parse(await fs.readFile(vscodeServerControllerFile, "utf-8"));
|
|
55
|
-
const url2 = `http://localhost:${port2}/open?path=${encodeURIComponent(file)}`;
|
|
78
|
+
const url2 = `http://localhost:${port2}/open?path=${encodeURIComponent(`${root}/${file}`)}`;
|
|
56
79
|
await fetch(url2);
|
|
57
80
|
rpc.broadcast.navigateTo("/modules/custom-builtin-vscode");
|
|
58
81
|
return true;
|
|
@@ -74,20 +97,19 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
74
97
|
port = await getPort({ port });
|
|
75
98
|
url = `http://localhost:${port}/?folder=${encodeURIComponent(root)}`;
|
|
76
99
|
logger.info(LOG_PREFIX, `Starting VS Code Server at ${url} ...`);
|
|
77
|
-
execa(
|
|
78
|
-
"serve-local",
|
|
79
|
-
"--accept-server-license-terms",
|
|
100
|
+
execa(codeBinary, [
|
|
80
101
|
"--install-extension",
|
|
81
102
|
"antfu.vscode-server-controller"
|
|
82
103
|
], { stderr: "inherit", stdout: "ignore", reject: false });
|
|
83
104
|
startSubprocess(
|
|
84
105
|
{
|
|
85
|
-
command:
|
|
106
|
+
command: codeBinary,
|
|
86
107
|
args: [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
`--port=${port}
|
|
108
|
+
launchArg,
|
|
109
|
+
licenseTermsArg,
|
|
110
|
+
connectionTokenArg,
|
|
111
|
+
`--port=${port}`,
|
|
112
|
+
host
|
|
91
113
|
]
|
|
92
114
|
},
|
|
93
115
|
{
|
|
@@ -141,7 +163,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
141
163
|
icon: "bxl-visual-studio",
|
|
142
164
|
category: "modules",
|
|
143
165
|
requireAuth: true,
|
|
144
|
-
view: !installed ? {
|
|
166
|
+
view: !installed && !(vsOptions?.mode === "tunnel") ? {
|
|
145
167
|
type: "launch",
|
|
146
168
|
title: "Install VS Code Server",
|
|
147
169
|
description: `It seems you don't have code-server installed.
|
package/dist/client/200.html
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-egk2z7qr.css" crossorigin>
|
|
4
4
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
5
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/mxzg8bne.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-fw81xiot.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-dypm4cev.js">
|
|
9
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-j4jbxo4i.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
14
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-
|
|
15
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-
|
|
17
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-
|
|
19
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
20
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-knqf5o69.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-b288af13.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-nup47uz7.js">
|
|
14
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-eltx4hvu.js">
|
|
15
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-lmmxplpx.css">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-njmanbq9.js">
|
|
17
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-u0boq89r.css">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-efmvdg7h.js">
|
|
19
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/mxzg8bne.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1737018576773,false]</script>
|
|
20
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"7235b424-6975-4a9d-93d7-43e41c8bf0d0",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-egk2z7qr.css" crossorigin>
|
|
4
4
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
5
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/mxzg8bne.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-fw81xiot.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-dypm4cev.js">
|
|
9
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-j4jbxo4i.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
14
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-
|
|
15
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-
|
|
17
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-
|
|
19
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
20
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-knqf5o69.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-b288af13.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-nup47uz7.js">
|
|
14
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-eltx4hvu.js">
|
|
15
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-lmmxplpx.css">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-njmanbq9.js">
|
|
17
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-u0boq89r.css">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-efmvdg7h.js">
|
|
19
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/mxzg8bne.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1737018576773,false]</script>
|
|
20
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"7235b424-6975-4a9d-93d7-43e41c8bf0d0",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e,S as n,Q as t}from"./vendor/json-editor-vue-fw81xiot.js";const c={"h-screen":"","w-screen":"","bg-black":""},r=e({__name:"__blank",setup(o){return(s,_)=>(t(),n("div",c))}});export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g as P,h as J,r as S,j as R,f as U,k as X,l as h,m as ee,n as ne,o as te,p as le,q as ie,s as oe,v as C,w as re,x as ue,y as se,d as ae}from"./mxzg8bne.js";import{_ as de}from"./filepath-item.vue-jlqwj704.js";import{k as E,l as V,b as F,Q as i,S as u,U as e,F as p,ab as G,Y as j,a5 as v,W as x,u as c,a0 as d,$ as a,a6 as f,a8 as A,a9 as I,M as k}from"./vendor/json-editor-vue-fw81xiot.js";import{_ as me}from"./ncode-block.vue-c2t0anp9.js";import{_ as pe}from"./ncheckbox.vue-d0yw5qc1.js";import{_ as ve}from"./help-fab.vue-j6249tgf.js";import"./vendor/unocss-dypm4cev.js";import"./vendor/shiki-j4jbxo4i.js";import"./client-bnemmvey.js";const fe={"h-full":"",grid:"~ rows-[max-content_1fr]"},ye={flex:"~ wrap","w-full":""},be=["onClick"],ce={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},ge={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},xe=E({__name:"BuildAnalyzeDetails",props:{current:{},prev:{}},setup(N){const y=N,$=`${J().app.baseURL}/__nuxt_devtools__/analyze/`.replace(/\/+/g,"/"),b=V(()=>{const l=[{name:"Overview",id:"overview"}];return y.current.features.bundleClient&&l.push({name:"Client Bundle",id:"bundle-client"}),y.current.features.bundleNitro&&l.push({name:"Nitro Bundle",id:"bundle-nitro"}),y.current.features.viteInspect&&l.push({name:"Vite Inspect",id:"vite-inspect"}),l}),o=F(b.value[0]);function z(l){return`${((l.endTime-l.startTime)/1e3).toFixed(1)}s`}function m(l){return l<1024?`${l}B`:l<1024*1024?`${(l/1024).toFixed(1)}KB`:l<1024*1024*1024?`${(l/1024/1024).toFixed(1)}MB`:`${(l/1024/1024/1024).toFixed(1)}GB`}async function T(l){return S.clearAnalyzeBuilds(await R(),[l])}return(l,n)=>{const D=de,B=U;return i(),u("div",fe,[e("div",ye,[(i(!0),u(p,null,G(b.value,(r,t)=>(i(),u("button",{key:t,px4:"",py2:"",border:"r base",hover:"bg-active",class:j(r.id===o.value.id?"":"border-b"),onClick:_=>o.value=r},[e("div",{class:j(r.id===o.value.id?"":"op30")},v(r.name),3)],10,be))),128)),n[1]||(n[1]=e("div",{border:"b base","flex-auto":""},null,-1))]),o.value.id==="overview"?(i(),u("div",ce,[n[15]||(n[15]=e("div",{"flex-auto":""},null,-1)),e("div",ge,[n[10]||(n[10]=e("div",{"i-carbon-commit":"","text-xl":""},null,-1)),e("div",null,[n[2]||(n[2]=e("div",{"text-sm":"",op50:""}," Name ",-1)),e("div",null,v(l.current.name),1)]),n[11]||(n[11]=e("div",{"i-carbon-time":"","text-xl":""},null,-1)),e("div",null,[n[3]||(n[3]=e("div",{"text-sm":"",op50:""}," Build duration ",-1)),e("div",null,v(z(l.current)),1)]),l.current.size?.clientBundle?(i(),u(p,{key:0},[n[5]||(n[5]=e("div",{"i-carbon-cics-program":"","text-xl":""},null,-1)),e("div",null,[n[4]||(n[4]=e("div",{"text-sm":"",op50:""}," Client bundle size ",-1)),e("div",null,v(m(l.current.size.clientBundle)),1)])],64)):x("",!0),l.current.size.nitroBundle?(i(),u(p,{key:1},[n[7]||(n[7]=e("div",{"i-carbon-bare-metal-server":"","text-xl":""},null,-1)),e("div",null,[n[6]||(n[6]=e("div",{"text-sm":"",op50:""}," Nitro bundle size ",-1)),e("div",null,v(m(l.current.size.nitroBundle)),1)])],64)):x("",!0),n[12]||(n[12]=e("div",{"i-carbon-edge-node":"","text-xl":""},null,-1)),e("div",null,[n[8]||(n[8]=e("div",{"text-sm":"",op50:""}," Built ",-1)),e("div",null,v(c(P)(new Date(l.current.endTime))),1)]),n[13]||(n[13]=e("div",{"i-carbon:folder-parent":"","text-xl":""},null,-1)),e("div",null,[n[9]||(n[9]=e("div",{"text-sm":"",op50:""}," Report Path ",-1)),d(D,{filepath:l.current.analyzeDir},null,8,["filepath"])])]),n[16]||(n[16]=e("div",{"flex-auto":""},null,-1)),d(B,{n:"rose",icon:"carbon-delete",onClick:n[0]||(n[0]=r=>T(l.current.name))},{default:a(()=>n[14]||(n[14]=[f(" Delete this report ")])),_:1})])):x("",!0),n._lazyshow1||o.value.id==="bundle-client"?(n._lazyshow1=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-client"]])],64)):x("v-show-if",!0),n._lazyshow2||o.value.id==="bundle-nitro"?(n._lazyshow2=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-nitro"]])],64)):x("v-show-if",!0),n._lazyshow3||o.value.id==="vite-inspect"?(n._lazyshow3=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="vite-inspect"]])],64)):x("v-show-if",!0)])}}}),we={class:"markdown-body"},$e={__name:"analyze-build",setup(N,{expose:y}){return y({frontmatter:{}}),($,b)=>(i(),u("div",we,b[0]||(b[0]=[e("h1",null,"Build Analyze",-1),e("p",null,[f("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 "),e("code",null,"nuxt build --analyze"),f(" and present the output data directly in DevTools for easy browsing and comparing.")],-1)])))}},ze={flex:"~ col"},_e=["onClick"],ke={flex:"~ gap-1 items-center wrap","w-full":"","text-sm":"",op60:""},Be={flex:"~ items-center justify-center wrap",p4:""},Ce={flex:"~ col gap-1","w-250":"",p4:""},Ne={flex:"~ gap-3",mt2:"","justify-end":""},Re=E({__name:"analyze-build",setup(N){const y=X(),w=h(),$=ee(),b=ne("analyze-build:slug",""),o=V(()=>w.value?.builds.find(r=>r.slug===b.value)??w.value?.builds[0]),z=F(!1),m=F(""),T=V(()=>w.value?.builds.some(r=>r.name===m.value.trim()));async function l(){m.value=await S.generateAnalyzeBuildName(),await y.start()&&(oe("analyze-build:start"),C.value={name:m.value,processId:await S.startAnalyzeBuild(await R(),m.value)},z.value&&B())}const n=te();function D(r){return`${((r.endTime-r.startTime)/1e3).toFixed(1)}s`}function B(){C.value?.processId&&(n.value=C.value.processId,$.push("/modules/terminals"))}return le(()=>[{id:"action:analyze-build: start",title:"Start a new analyze build",icon:"i-carbon-edge-node",action:l}]),(r,t)=>{const _=U,L=xe,M=ae,O=ie,W=re,Y=ue,q=me,H=pe,K=se,Q=$e,Z=ve;return i(),u(p,null,[d(O,{"left-size":30},{left:a(()=>[e("div",ze,[(i(!0),u(p,null,G(c(w)?.builds,s=>(i(),u(p,{key:s.slug},[e("button",{flex:"~ col gap1","hover:bg-active":"",p3:"",class:j(s.slug===o.value?.slug?"text-primary bg-active":""),onClick:g=>b.value=s.slug},[e("code",null,v(s.name),1),e("div",ke,[t[4]||(t[4]=e("div",{"i-carbon-time":""},null,-1)),e("span",null,v(D(s)),1),t[5]||(t[5]=e("div",{"flex-auto":""},null,-1)),e("span",null,v(c(P)(new Date(s.endTime))),1)])],10,_e),t[6]||(t[6]=e("div",{"x-divider":""},null,-1))],64))),128)),e("div",Be,[c(C)?(i(),k(_,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:t[1]||(t[1]=s=>B())},{default:a(()=>t[8]||(t[8]=[f(" Building... ")])),_:1})):(i(),k(_,{key:0,n:"primary",icon:"carbon-edge-node",onClick:t[0]||(t[0]=s=>l())},{default:a(()=>t[7]||(t[7]=[f(" Start a new build ")])),_:1}))])])]),right:a(()=>[o.value?(i(),k(L,{key:0,current:o.value},null,8,["current"])):(i(),k(M,{key:1}))]),_:1}),d(c(y),null,{default:a(({resolve:s})=>[d(K,{"model-value":!0,onClose:g=>s(!1)},{default:a(()=>[e("div",Ce,[t[13]||(t[13]=e("h3",{class:"text-lg font-medium leading-6",mb2:""}," Start analyze build? ",-1)),t[14]||(t[14]=e("p",{op50:""}," Enter the name of the build: ",-1)),d(W,{modelValue:m.value,"onUpdate:modelValue":t[2]||(t[2]=g=>m.value=g),placeholder:"Build name"},null,8,["modelValue"]),T.value?(i(),k(Y,{key:0,"n-orange":""},{default:a(()=>t[9]||(t[9]=[f(" A build with the same name already exists, continue would overrides the previous build result. ")])),_:1})):x("",!0),t[15]||(t[15]=e("div",{my3:"","x-divider":""},null,-1)),t[16]||(t[16]=e("p",{op50:""}," The following command will be executed in your terminal: ",-1)),d(q,{code:`npx nuxi analyze --no-serve --name=${m.value}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),d(H,{modelValue:z.value,"onUpdate:modelValue":t[3]||(t[3]=g=>z.value=g),mt2:"",n:"primary"},{default:a(()=>t[10]||(t[10]=[f(" Navigate to terminal ")])),_:1},8,["modelValue"]),e("div",Ne,[d(_,{onClick:g=>s(!1)},{default:a(()=>t[11]||(t[11]=[f(" Cancel ")])),_:2},1032,["onClick"]),d(_,{n:"solid primary",onClick:g=>s(!0)},{default:a(()=>t[12]||(t[12]=[f(" Start ")])),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),d(Z,null,{default:a(()=>[d(Q)]),_:1})],64)}}});export{Re as default};
|