@nuxt/devtools 0.8.4 → 1.0.0-beta.0
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/README.md +1 -5
- package/dist/chunks/module-main.mjs +115 -43
- package/dist/chunks/vscode.mjs +12 -13
- package/dist/client/200.html +17 -17
- package/dist/client/404.html +17 -17
- package/dist/client/_nuxt/{CodeDiff.vue.a8c9e639.js → CodeDiff.vue.3beaa134.js} +2 -2
- package/dist/client/_nuxt/ComposableItem.vue.136c5104.js +1 -0
- package/dist/client/_nuxt/DataSchemaButton.vue.125423b7.js +1 -0
- package/dist/client/_nuxt/{DataSchemaDrawer.f84a2081.js → DataSchemaDrawer.8ac6b677.js} +2 -2
- package/dist/client/_nuxt/{DurationDisplay.vue.1f34b658.js → DurationDisplay.vue.c49b4e64.js} +1 -1
- package/dist/client/_nuxt/{FilepathItem.vue.a4d269b8.js → FilepathItem.vue.5af0b5df.js} +1 -1
- package/dist/client/_nuxt/HelpFab.vue.98c902f4.js +1 -0
- package/dist/client/_nuxt/{LaunchPage.vue.012ddba7.js → LaunchPage.vue.805f9595.js} +1 -1
- package/dist/client/_nuxt/NBadge.98d5d309.js +1 -0
- package/dist/client/_nuxt/{NCheckbox.vue.0e359f85.js → NCheckbox.vue.6fb2ece1.js} +1 -1
- package/dist/client/_nuxt/{NCodeBlock.vue.01eb6d1c.js → NCodeBlock.vue.adf1e9b4.js} +1 -1
- package/dist/client/_nuxt/NDrawer.vue.8e620517.js +1 -0
- package/dist/client/_nuxt/{NDropdown.vue.b3117df4.js → NDropdown.vue.b2f7aaef.js} +1 -1
- package/dist/client/_nuxt/{NIconTitle.vue.79485c3a.js → NIconTitle.vue.bf8093eb.js} +1 -1
- package/dist/client/_nuxt/NLink.vue.0e98999b.js +1 -0
- package/dist/client/_nuxt/{NMarkdown.vue.7a10e6e6.js → NMarkdown.vue.b0e8b2fc.js} +1 -1
- package/dist/client/_nuxt/NSectionBlock.0d0061ef.css +1 -0
- package/dist/client/_nuxt/NSectionBlock.4347cc14.js +1 -0
- package/dist/client/_nuxt/NSelect.vue.4c22d30e.js +1 -0
- package/dist/client/_nuxt/{NSelectTabs.vue.72adf277.js → NSelectTabs.vue.c9be0aa2.js} +1 -1
- package/dist/client/_nuxt/{NSwitch.vue.67a4fdb0.js → NSwitch.vue.de333089.js} +1 -1
- package/dist/client/_nuxt/{NTip.vue.d505e897.js → NTip.vue.770a171a.js} +1 -1
- package/dist/client/_nuxt/{Navbar.vue.8dc15d25.js → Navbar.vue.371e4d0a.js} +1 -1
- package/dist/client/_nuxt/StateEditor.vue.332bb451.js +1 -0
- package/dist/client/_nuxt/analyze-build.281c50c1.js +1 -0
- package/dist/client/_nuxt/assets.ca8faf7a.js +16 -0
- package/dist/client/_nuxt/{client.c59e50d6.js → client.3f2665f1.js} +1 -1
- package/dist/client/_nuxt/{components.31c6fd6f.js → components.a8900a78.js} +26 -26
- package/dist/client/_nuxt/custom-_name_.c49c72a2.js +1 -0
- package/dist/client/_nuxt/{default.30ac8af4.js → default.3ba7d10b.js} +1 -1
- package/dist/client/_nuxt/entry.1c0836ed.css +1 -0
- package/dist/client/_nuxt/entry.e01776ec.js +27 -0
- package/dist/client/_nuxt/{error-404.5c6d1cc1.js → error-404.9d2aaad9.js} +1 -1
- package/dist/client/_nuxt/{error-500.b5b10475.js → error-500.20d1b3ce.js} +1 -1
- package/dist/client/_nuxt/{full.03097bfb.js → full.6d0fd7cf.js} +1 -1
- package/dist/client/_nuxt/hooks.908144b2.js +1 -0
- package/dist/client/_nuxt/{imports.b827859f.js → imports.d7bd415a.js} +1 -1
- package/dist/client/_nuxt/{index.b5454355.js → index.a0a2f0b3.js} +1 -1
- package/dist/client/_nuxt/index.eb95211d.js +1 -0
- package/dist/client/_nuxt/{json-editor-vue.1bc58c26.js → json-editor-vue.b22bf91c.js} +1 -1
- package/dist/client/_nuxt/{middleware.434dc02a.js → middleware.9e4b2529.js} +1 -1
- package/dist/client/_nuxt/modules.fd214f26.js +2 -0
- package/dist/client/_nuxt/{none.2b3e8ddc.js → none.27bf71df.js} +1 -1
- package/dist/client/_nuxt/open-graph.b95ebacd.js +3 -0
- package/dist/client/_nuxt/overview.4991be1e.js +1 -0
- package/dist/client/_nuxt/pages.708b9e25.js +1 -0
- package/dist/client/_nuxt/payload.eaf10e21.js +1 -0
- package/dist/client/_nuxt/plugins.f02b2c56.js +1 -0
- package/dist/client/_nuxt/{runtime-configs.1f844468.js → runtime-configs.63235af8.js} +1 -1
- package/dist/client/_nuxt/server-routes.88eebd4c.js +9 -0
- package/dist/client/_nuxt/settings.7dbb31cf.js +1 -0
- package/dist/client/_nuxt/{state-components.a223a28c.js → state-components.ca4a58b1.js} +1 -1
- package/dist/client/_nuxt/state-modules.6d6b039c.js +1 -0
- package/dist/client/_nuxt/storage-options.ab028b2a.js +1 -0
- package/dist/client/_nuxt/storage.27117a31.js +1 -0
- package/dist/client/_nuxt/{terminals.cb4eb909.js → terminals.cdead889.js} +3 -3
- package/dist/client/_nuxt/timeline.ddc61557.js +29 -0
- package/dist/client/_nuxt/{unocss-runtime.68d64d4a.js → unocss-runtime.ddd835d7.js} +2 -2
- package/dist/client/_nuxt/virtual-files.9da3562d.js +1 -0
- package/dist/client/index.html +17 -17
- package/dist/client/modules/analyze-build/index.html +17 -17
- package/dist/client/modules/assets/index.html +17 -17
- package/dist/client/modules/components/index.html +17 -17
- package/dist/client/modules/hooks/index.html +17 -17
- package/dist/client/modules/imports/index.html +17 -17
- package/dist/client/modules/middleware/index.html +17 -17
- package/dist/client/modules/modules/index.html +17 -17
- package/dist/client/modules/open-graph/index.html +17 -17
- package/dist/client/modules/overview/index.html +17 -17
- package/dist/client/modules/pages/index.html +17 -17
- package/dist/client/modules/payload/index.html +17 -17
- package/dist/client/modules/plugins/index.html +17 -17
- package/dist/client/modules/runtime-configs/index.html +17 -17
- package/dist/client/modules/server-routes/index.html +17 -17
- package/dist/client/modules/storage/index.html +17 -17
- package/dist/client/modules/terminals/index.html +17 -17
- package/dist/client/modules/timeline/index.html +17 -17
- package/dist/client/modules/virtual-files/index.html +17 -17
- package/dist/client/settings/index.html +17 -17
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/devtools.client.mjs +7 -0
- package/dist/runtime/plugins/view/Main.vue +39 -10
- package/dist/runtime/plugins/view/client.mjs +2 -1
- package/dist/runtime/settings.d.ts +4 -0
- package/dist/runtime/settings.mjs +2 -0
- package/dist/shared/{devtools.4169e037.mjs → devtools.c28fc9a7.mjs} +6 -1
- package/package.json +19 -23
- package/dist/client/__blank/index.html +0 -42
- package/dist/client/_nuxt/Badge.a4bd58d4.js +0 -1
- package/dist/client/_nuxt/ComposableItem.vue.bd112256.js +0 -1
- package/dist/client/_nuxt/DataSchemaButton.vue.fbb61806.js +0 -1
- package/dist/client/_nuxt/DrawerRight.vue.b9dc765f.js +0 -1
- package/dist/client/_nuxt/HelpFab.vue.c0c3f8e6.js +0 -1
- package/dist/client/_nuxt/NLink.vue.6dc3b4af.js +0 -1
- package/dist/client/_nuxt/NSectionBlock.012f83f1.css +0 -1
- package/dist/client/_nuxt/NSectionBlock.2d8e1431.js +0 -1
- package/dist/client/_nuxt/NSelect.vue.9cac29ef.js +0 -1
- package/dist/client/_nuxt/StateEditor.vue.2463efc9.js +0 -1
- package/dist/client/_nuxt/__blank.20eb2cab.js +0 -1
- package/dist/client/_nuxt/analyze-build.423f57eb.js +0 -1
- package/dist/client/_nuxt/assets.dc245910.js +0 -16
- package/dist/client/_nuxt/custom-_name_.9b02fa14.js +0 -1
- package/dist/client/_nuxt/entry.05b33d7f.js +0 -27
- package/dist/client/_nuxt/entry.79095383.css +0 -1
- package/dist/client/_nuxt/hooks.d674696d.js +0 -1
- package/dist/client/_nuxt/index.b2055c8f.js +0 -1
- package/dist/client/_nuxt/modules.7dc02a95.js +0 -2
- package/dist/client/_nuxt/open-graph.693bd031.js +0 -3
- package/dist/client/_nuxt/overview.f2e48477.js +0 -1
- package/dist/client/_nuxt/pages.745a0630.js +0 -1
- package/dist/client/_nuxt/payload.897ca8fa.js +0 -1
- package/dist/client/_nuxt/plugins.cd2e64ba.js +0 -1
- package/dist/client/_nuxt/server-routes.91c861d0.js +0 -9
- package/dist/client/_nuxt/settings.367ae337.js +0 -1
- package/dist/client/_nuxt/state-modules.c0927595.js +0 -1
- package/dist/client/_nuxt/storage-options.8fdc9b2a.js +0 -1
- package/dist/client/_nuxt/storage.76034502.js +0 -1
- package/dist/client/_nuxt/timeline.60d410a7.js +0 -29
- package/dist/client/_nuxt/virtual-files.829bd209.js +0 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<a href="https://devtools.nuxt.com"><img width="1200" alt="Nuxt DevTools" src="https://github-production-user-asset-6210df.s3.amazonaws.com/904724/261577617-a10567bd-ad33-48cc-9bda-9e37dbe1929f.png"></a>
|
|
2
2
|
<br>
|
|
3
3
|
<h1>
|
|
4
|
-
Nuxt DevTools
|
|
4
|
+
Nuxt DevTools
|
|
5
5
|
</h1>
|
|
6
6
|
|
|
7
7
|
[![npm version][npm-version-src]][npm-version-href]
|
|
@@ -23,10 +23,6 @@ Unleash Nuxt Developer Experience.
|
|
|
23
23
|
|
|
24
24
|
<br>
|
|
25
25
|
|
|
26
|
-
> **Warning**: Experimental and under heavy development. APIs are subject to change.
|
|
27
|
-
|
|
28
|
-
<br>
|
|
29
|
-
|
|
30
26
|
## Installation
|
|
31
27
|
|
|
32
28
|
> Nuxt DevTools requires **Nuxt v3.1.0 or higher**.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import fs, { existsSync } from 'node:fs';
|
|
2
|
+
import os, { homedir } from 'node:os';
|
|
2
3
|
import { resolve, join as join$1, dirname } from 'pathe';
|
|
3
|
-
import { logger, useNuxt, addPlugin, addVitePlugin } from '@nuxt/kit';
|
|
4
|
+
import { logger, useNuxt, addPlugin, addTemplate, addVitePlugin } from '@nuxt/kit';
|
|
4
5
|
import { searchForWorkspaceRoot } from 'vite';
|
|
5
6
|
import sirv from 'sirv';
|
|
6
|
-
import
|
|
7
|
+
import { colors } from 'consola/utils';
|
|
7
8
|
import { createBirpcGroup } from 'birpc';
|
|
8
9
|
import { stringify, parse } from 'flatted';
|
|
9
|
-
import { R as ROUTE_AUTH, d as defaultTabOptions, W as WS_EVENT_NAME, a as ROUTE_ANALYZE, b as ROUTE_CLIENT, c as ROUTE_AUTH_VERIFY } from '../shared/devtools.
|
|
10
|
-
import {
|
|
11
|
-
import { join } from 'node:path';
|
|
10
|
+
import { R as ROUTE_AUTH, d as defaultTabOptions, W as WS_EVENT_NAME, a as ROUTE_ANALYZE, b as ROUTE_CLIENT, c as ROUTE_AUTH_VERIFY } from '../shared/devtools.c28fc9a7.mjs';
|
|
11
|
+
import { join, dirname as dirname$1 } from 'node:path';
|
|
12
12
|
import fsp from 'node:fs/promises';
|
|
13
13
|
import { randomStr } from '@antfu/utils';
|
|
14
14
|
import { imageMeta } from 'image-meta';
|
|
@@ -24,12 +24,11 @@ import 'pkg-types';
|
|
|
24
24
|
import semver from 'semver';
|
|
25
25
|
import { getPackageInfo } from 'local-pkg';
|
|
26
26
|
import { resolveBuiltinPresets } from 'unimport';
|
|
27
|
-
import boxen from 'boxen';
|
|
28
27
|
import Git from 'simple-git';
|
|
29
28
|
import { hash } from 'ohash';
|
|
30
29
|
import { runtimeDir, clientDir, packageDir, isGlobalInstall } from '../dirs.mjs';
|
|
31
30
|
|
|
32
|
-
const version = "0.
|
|
31
|
+
const version = "1.0.0-beta.0";
|
|
33
32
|
|
|
34
33
|
let token;
|
|
35
34
|
async function getDevAuthToken() {
|
|
@@ -597,26 +596,27 @@ function setupGeneralRPC({ nuxt, options, refresh, openInEditorHooks }) {
|
|
|
597
596
|
logger.info("Restarting Nuxt...");
|
|
598
597
|
return nuxt.callHook("restart", { hard });
|
|
599
598
|
},
|
|
600
|
-
async requestForAuth(info) {
|
|
599
|
+
async requestForAuth(info, origin) {
|
|
601
600
|
const token = await getDevAuthToken();
|
|
601
|
+
origin || (origin = `${nuxt.options.devServer.https ? "https" : "http"}://${nuxt.options.devServer.host === "::" ? "localhost" : nuxt.options.devServer.host || "localhost"}:${nuxt.options.devServer.port}`);
|
|
602
602
|
const message = [
|
|
603
|
-
`A browser is requesting permissions of ${
|
|
604
|
-
|
|
603
|
+
`A browser is requesting permissions of ${colors.bold(colors.yellow("writing files and running commands"))} from the DevTools UI.`,
|
|
604
|
+
colors.bold(info),
|
|
605
605
|
"",
|
|
606
606
|
"Please open the following URL in the browser:",
|
|
607
|
-
|
|
607
|
+
colors.bold(colors.green(`${origin}${ROUTE_AUTH}?token=${token}`)),
|
|
608
608
|
"",
|
|
609
609
|
"Or manually copy and paste the following token:",
|
|
610
|
-
|
|
610
|
+
colors.bold(colors.cyan(token))
|
|
611
611
|
];
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
612
|
+
logger.box({
|
|
613
|
+
message: message.join("\n"),
|
|
614
|
+
title: colors.bold(colors.yellow(" Permission Request ")),
|
|
615
|
+
style: {
|
|
616
|
+
borderColor: "yellow",
|
|
617
|
+
borderStyle: "rounded"
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
620
|
},
|
|
621
621
|
async verifyAuthToken(token) {
|
|
622
622
|
return token === await getDevAuthToken();
|
|
@@ -657,19 +657,19 @@ const wizard = {
|
|
|
657
657
|
enablePages
|
|
658
658
|
};
|
|
659
659
|
|
|
660
|
-
const LOG_PREFIX =
|
|
660
|
+
const LOG_PREFIX = colors.cyan("Nuxt DevTools:");
|
|
661
661
|
|
|
662
662
|
function setupWizardRPC({ nuxt, ensureDevAuthToken }) {
|
|
663
663
|
return {
|
|
664
664
|
async runWizard(token, name, ...args) {
|
|
665
665
|
await ensureDevAuthToken(token);
|
|
666
|
-
logger.info(LOG_PREFIX, `Running wizard ${
|
|
666
|
+
logger.info(LOG_PREFIX, `Running wizard ${colors.green(name)}...`);
|
|
667
667
|
return wizard[name](nuxt, ...args);
|
|
668
668
|
}
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
671
|
|
|
672
|
-
function setupTerminalRPC({ nuxt, rpc, refresh }) {
|
|
672
|
+
function setupTerminalRPC({ nuxt, rpc, refresh, ensureDevAuthToken }) {
|
|
673
673
|
const terminals = /* @__PURE__ */ new Map();
|
|
674
674
|
nuxt.hook("devtools:terminal:register", (terminal) => {
|
|
675
675
|
terminals.set(terminal.id, terminal);
|
|
@@ -719,10 +719,12 @@ function setupTerminalRPC({ nuxt, rpc, refresh }) {
|
|
|
719
719
|
getTerminals() {
|
|
720
720
|
return Array.from(terminals.values()).map((i) => serializeTerminal(i));
|
|
721
721
|
},
|
|
722
|
-
getTerminalDetail(id) {
|
|
722
|
+
async getTerminalDetail(token, id) {
|
|
723
|
+
await ensureDevAuthToken(token);
|
|
723
724
|
return serializeTerminal(terminals.get(id), true);
|
|
724
725
|
},
|
|
725
|
-
async runTerminalAction(id, action) {
|
|
726
|
+
async runTerminalAction(token, id, action) {
|
|
727
|
+
await ensureDevAuthToken(token);
|
|
726
728
|
const terminal = terminals.get(id);
|
|
727
729
|
if (!terminal)
|
|
728
730
|
return false;
|
|
@@ -888,13 +890,8 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
888
890
|
};
|
|
889
891
|
}
|
|
890
892
|
|
|
891
|
-
async function
|
|
892
|
-
|
|
893
|
-
if (options.key)
|
|
894
|
-
hashedKey = hash(`${options.root}:${options.key}`);
|
|
895
|
-
else
|
|
896
|
-
hashedKey = hash(options.root);
|
|
897
|
-
const filePath = join$1(homedir(), ".nuxt/devtools", `${hashedKey}.json`);
|
|
893
|
+
async function readLocalOptions(defaults, options) {
|
|
894
|
+
const { filePath } = getOptionsFilepath(options);
|
|
898
895
|
if (existsSync(filePath)) {
|
|
899
896
|
const options2 = {
|
|
900
897
|
...defaults,
|
|
@@ -905,16 +902,21 @@ async function readOptions(defaults, options) {
|
|
|
905
902
|
return { ...defaults };
|
|
906
903
|
}
|
|
907
904
|
}
|
|
908
|
-
|
|
909
|
-
const dir = join$1(homedir(), ".nuxt/devtools");
|
|
910
|
-
if (!existsSync(dir))
|
|
911
|
-
await fsp.mkdir(dir, { recursive: true });
|
|
905
|
+
function getOptionsFilepath(options) {
|
|
912
906
|
let hashedKey;
|
|
913
907
|
if (options.key)
|
|
914
908
|
hashedKey = hash(`${options.root}:${options.key}`);
|
|
915
909
|
else
|
|
916
910
|
hashedKey = hash(options.root);
|
|
917
|
-
const filePath = join$1(
|
|
911
|
+
const filePath = join$1(homedir(), ".nuxt/devtools", `${hashedKey}.json`);
|
|
912
|
+
return {
|
|
913
|
+
filePath,
|
|
914
|
+
hashedKey
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
async function writeLocalOptions(settings, options) {
|
|
918
|
+
const { filePath, hashedKey } = getOptionsFilepath(options);
|
|
919
|
+
await fsp.mkdir(dirname$1(filePath), { recursive: true });
|
|
918
920
|
await fsp.writeFile(
|
|
919
921
|
filePath,
|
|
920
922
|
JSON.stringify(
|
|
@@ -940,7 +942,7 @@ function setupOptionsRPC({ nuxt }) {
|
|
|
940
942
|
return options[tab];
|
|
941
943
|
}
|
|
942
944
|
async function read(tab) {
|
|
943
|
-
options[tab] = await
|
|
945
|
+
options[tab] = await readLocalOptions(defaultTabOptions[tab], {
|
|
944
946
|
root: nuxt.options.rootDir,
|
|
945
947
|
key: tab !== "ui" && tab
|
|
946
948
|
});
|
|
@@ -950,9 +952,17 @@ function setupOptionsRPC({ nuxt }) {
|
|
|
950
952
|
async updateOptions(tab, _settings) {
|
|
951
953
|
const settings = await getOptions(tab);
|
|
952
954
|
Object.assign(settings, _settings);
|
|
953
|
-
await
|
|
954
|
-
|
|
955
|
-
|
|
955
|
+
await writeLocalOptions(
|
|
956
|
+
{ ...settings },
|
|
957
|
+
{
|
|
958
|
+
root: nuxt.options.rootDir,
|
|
959
|
+
key: tab !== "ui" && tab
|
|
960
|
+
}
|
|
961
|
+
);
|
|
962
|
+
nuxt.callHook("builder:generateApp", {
|
|
963
|
+
filter(template) {
|
|
964
|
+
return template.filename.includes("devtools/settings.mjs");
|
|
965
|
+
}
|
|
956
966
|
});
|
|
957
967
|
},
|
|
958
968
|
getOptions
|
|
@@ -979,6 +989,49 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
979
989
|
};
|
|
980
990
|
}
|
|
981
991
|
|
|
992
|
+
const SEND_DELAY = 5e3;
|
|
993
|
+
function throttle(fn, delay) {
|
|
994
|
+
let timer;
|
|
995
|
+
return () => {
|
|
996
|
+
if (!timer) {
|
|
997
|
+
timer = setTimeout(() => {
|
|
998
|
+
timer = void 0;
|
|
999
|
+
fn();
|
|
1000
|
+
}, delay);
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
function setupTelemetryRPC({ nuxt, options }) {
|
|
1005
|
+
let telemetry;
|
|
1006
|
+
if (options.telemetry !== false) {
|
|
1007
|
+
nuxt.hook("telemetry:setup", (t) => {
|
|
1008
|
+
telemetry = t;
|
|
1009
|
+
t.eventFactories.devtools = (_, payload) => {
|
|
1010
|
+
return {
|
|
1011
|
+
name: "devtools",
|
|
1012
|
+
version,
|
|
1013
|
+
...payload
|
|
1014
|
+
};
|
|
1015
|
+
};
|
|
1016
|
+
t.createEvent("devtools", { event: "enabled" });
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
const throttledSend = throttle(() => {
|
|
1020
|
+
telemetry?.sendEvents();
|
|
1021
|
+
}, SEND_DELAY);
|
|
1022
|
+
return {
|
|
1023
|
+
telemetryEvent(payload, immediate = false) {
|
|
1024
|
+
if (!telemetry)
|
|
1025
|
+
return;
|
|
1026
|
+
telemetry.createEvent("devtools", payload);
|
|
1027
|
+
if (immediate)
|
|
1028
|
+
telemetry.sendEvents();
|
|
1029
|
+
else
|
|
1030
|
+
throttledSend();
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
|
|
982
1035
|
function setupRPC(nuxt, options) {
|
|
983
1036
|
const serverFunctions = {};
|
|
984
1037
|
const extendedRpcMap = /* @__PURE__ */ new Map();
|
|
@@ -1041,7 +1094,8 @@ function setupRPC(nuxt, options) {
|
|
|
1041
1094
|
...setupServerRoutesRPC(ctx),
|
|
1042
1095
|
...setupAnalyzeBuildRPC(ctx),
|
|
1043
1096
|
...setupOptionsRPC(ctx),
|
|
1044
|
-
...setupTimelineRPC(ctx)
|
|
1097
|
+
...setupTimelineRPC(ctx),
|
|
1098
|
+
...setupTelemetryRPC(ctx)
|
|
1045
1099
|
});
|
|
1046
1100
|
const wsClients = /* @__PURE__ */ new Set();
|
|
1047
1101
|
const vitePlugin = {
|
|
@@ -1101,6 +1155,7 @@ async function enableModule(options, nuxt) {
|
|
|
1101
1155
|
await import('./analyze-build.mjs').then(({ setup }) => setup(nuxt, options));
|
|
1102
1156
|
return;
|
|
1103
1157
|
}
|
|
1158
|
+
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");
|
|
1104
1159
|
await nuxt.callHook("devtools:before");
|
|
1105
1160
|
nuxt.options.imports.collectMeta = true;
|
|
1106
1161
|
addPlugin({
|
|
@@ -1111,6 +1166,22 @@ async function enableModule(options, nuxt) {
|
|
|
1111
1166
|
src: join$1(runtimeDir, "plugins/devtools.server"),
|
|
1112
1167
|
mode: "server"
|
|
1113
1168
|
});
|
|
1169
|
+
addTemplate({
|
|
1170
|
+
filename: "devtools/settings.mjs",
|
|
1171
|
+
async getContents() {
|
|
1172
|
+
const uiOptions = await readLocalOptions(
|
|
1173
|
+
{
|
|
1174
|
+
...defaultTabOptions.ui,
|
|
1175
|
+
// When not enabled explicitly, we hide the panel by default
|
|
1176
|
+
showPanel: enabledExplicitly ? true : null
|
|
1177
|
+
},
|
|
1178
|
+
{ root: nuxt.options.rootDir }
|
|
1179
|
+
);
|
|
1180
|
+
return `export default ${JSON.stringify({
|
|
1181
|
+
ui: uiOptions
|
|
1182
|
+
})}`;
|
|
1183
|
+
}
|
|
1184
|
+
});
|
|
1114
1185
|
nuxt.hook("nitro:config", (config) => {
|
|
1115
1186
|
config.externals = config.externals || {};
|
|
1116
1187
|
config.externals.inline = config.externals.inline || [];
|
|
@@ -1195,7 +1266,8 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
1195
1266
|
packagePath: packageDir,
|
|
1196
1267
|
isGlobalInstall: isGlobalInstall()
|
|
1197
1268
|
});
|
|
1198
|
-
|
|
1269
|
+
const isMac = os.platform() === "darwin";
|
|
1270
|
+
logger.success(`Nuxt DevTools ${colors.dim(`v${version}`)}${isGlobalInstall() ? colors.dim(" [global]") : ""} enabled, press \`Shift\` + \`${isMac ? "Option" : "Alt"}\` + \`D\` in app to open.`);
|
|
1199
1271
|
}
|
|
1200
1272
|
|
|
1201
1273
|
const moduleMain = {
|
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -6,16 +6,15 @@ import { logger } from '@nuxt/kit';
|
|
|
6
6
|
import { execa } from 'execa';
|
|
7
7
|
import { checkPort, getPort } from 'get-port-please';
|
|
8
8
|
import which from 'which';
|
|
9
|
-
import waitOn from 'wait-on';
|
|
10
9
|
import { startSubprocess } from '@nuxt/devtools-kit';
|
|
11
10
|
import { L as LOG_PREFIX } from './module-main.mjs';
|
|
12
11
|
import 'pathe';
|
|
13
12
|
import 'vite';
|
|
14
13
|
import 'sirv';
|
|
15
|
-
import '
|
|
14
|
+
import 'consola/utils';
|
|
16
15
|
import 'birpc';
|
|
17
16
|
import 'flatted';
|
|
18
|
-
import '../shared/devtools.
|
|
17
|
+
import '../shared/devtools.c28fc9a7.mjs';
|
|
19
18
|
import '../dirs.mjs';
|
|
20
19
|
import 'node:url';
|
|
21
20
|
import 'is-installed-globally';
|
|
@@ -31,7 +30,6 @@ import 'pkg-types';
|
|
|
31
30
|
import 'semver';
|
|
32
31
|
import 'local-pkg';
|
|
33
32
|
import 'unimport';
|
|
34
|
-
import 'boxen';
|
|
35
33
|
import 'simple-git';
|
|
36
34
|
import 'ohash';
|
|
37
35
|
|
|
@@ -96,11 +94,11 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
96
94
|
},
|
|
97
95
|
nuxt
|
|
98
96
|
);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
97
|
+
for (let i = 0; i < 100; i++) {
|
|
98
|
+
if (await fetch(url).then((r) => r.ok).catch(() => false))
|
|
99
|
+
break;
|
|
100
|
+
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
101
|
+
}
|
|
104
102
|
await new Promise((resolve2) => setTimeout(resolve2, 2e3));
|
|
105
103
|
loaded = true;
|
|
106
104
|
}
|
|
@@ -119,10 +117,11 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
119
117
|
nuxt.hook("close", () => {
|
|
120
118
|
command.kill();
|
|
121
119
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
for (let i = 0; i < 100; i++) {
|
|
121
|
+
if (await fetch(url).then((r) => r.ok).catch(() => false))
|
|
122
|
+
break;
|
|
123
|
+
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
124
|
+
}
|
|
126
125
|
await new Promise((resolve2) => setTimeout(resolve2, 2e3));
|
|
127
126
|
loaded = true;
|
|
128
127
|
}
|
package/dist/client/200.html
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<html >
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
-
<link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.
|
|
5
|
+
<link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.1c0836ed.css">
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.e01776ec.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.a0a2f0b3.js">
|
|
8
8
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/onig.0c57a370.js">
|
|
9
9
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/vitesse-dark.ab479e3d.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/vitesse-light.696edcfd.js">
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/vue-html.0806679f.js">
|
|
19
19
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/diff.22e0b108.js">
|
|
20
20
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/shellscript.9d056341.js">
|
|
21
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.
|
|
22
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.
|
|
23
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.3ba7d10b.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.6d0fd7cf.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.27bf71df.js">
|
|
24
24
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/nuxt-docs.100caa70.js">
|
|
25
25
|
<link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/NCodeBlock.6994516c.css">
|
|
26
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/DataSchemaDrawer.
|
|
27
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NSelect.vue.
|
|
28
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NSwitch.vue.
|
|
29
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NDropdown.vue.
|
|
30
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NCodeBlock.vue.
|
|
31
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/client.
|
|
32
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/
|
|
33
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/unocss-runtime.
|
|
26
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/DataSchemaDrawer.8ac6b677.js">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NSelect.vue.4c22d30e.js">
|
|
28
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NSwitch.vue.de333089.js">
|
|
29
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NDropdown.vue.b2f7aaef.js">
|
|
30
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NCodeBlock.vue.adf1e9b4.js">
|
|
31
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/client.3f2665f1.js">
|
|
32
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NDrawer.vue.8e620517.js">
|
|
33
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/unocss-runtime.ddd835d7.js">
|
|
34
34
|
<link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-404.82ac0ec5.css">
|
|
35
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-404.
|
|
35
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-404.9d2aaad9.js">
|
|
36
36
|
<link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-500.ff959f66.css">
|
|
37
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-500.
|
|
38
|
-
<script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.
|
|
37
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-500.20d1b3ce.js">
|
|
38
|
+
<script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.e01776ec.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?f():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function d(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
|
|
39
39
|
</script></head>
|
|
40
40
|
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script>
|
|
41
41
|
<script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__nuxt_devtools__/client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
|
package/dist/client/404.html
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<html >
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
-
<link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.
|
|
5
|
+
<link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.1c0836ed.css">
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.e01776ec.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.a0a2f0b3.js">
|
|
8
8
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/onig.0c57a370.js">
|
|
9
9
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/vitesse-dark.ab479e3d.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/vitesse-light.696edcfd.js">
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/vue-html.0806679f.js">
|
|
19
19
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/diff.22e0b108.js">
|
|
20
20
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/shellscript.9d056341.js">
|
|
21
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.
|
|
22
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.
|
|
23
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.3ba7d10b.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.6d0fd7cf.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.27bf71df.js">
|
|
24
24
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/nuxt-docs.100caa70.js">
|
|
25
25
|
<link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/NCodeBlock.6994516c.css">
|
|
26
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/DataSchemaDrawer.
|
|
27
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NSelect.vue.
|
|
28
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NSwitch.vue.
|
|
29
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NDropdown.vue.
|
|
30
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NCodeBlock.vue.
|
|
31
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/client.
|
|
32
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/
|
|
33
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/unocss-runtime.
|
|
26
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/DataSchemaDrawer.8ac6b677.js">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NSelect.vue.4c22d30e.js">
|
|
28
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NSwitch.vue.de333089.js">
|
|
29
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NDropdown.vue.b2f7aaef.js">
|
|
30
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NCodeBlock.vue.adf1e9b4.js">
|
|
31
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/client.3f2665f1.js">
|
|
32
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/NDrawer.vue.8e620517.js">
|
|
33
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/unocss-runtime.ddd835d7.js">
|
|
34
34
|
<link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-404.82ac0ec5.css">
|
|
35
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-404.
|
|
35
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-404.9d2aaad9.js">
|
|
36
36
|
<link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-500.ff959f66.css">
|
|
37
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-500.
|
|
38
|
-
<script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.
|
|
37
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-500.20d1b3ce.js">
|
|
38
|
+
<script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.e01776ec.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?f():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function d(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
|
|
39
39
|
</script></head>
|
|
40
40
|
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script>
|
|
41
41
|
<script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__nuxt_devtools__/client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as R}from"./NCodeBlock.vue.
|
|
1
|
+
import{_ as R}from"./NCodeBlock.vue.adf1e9b4.js";import{d as _,a as N,r as F,aj as W,bv as A,o as B,h as J,f as V}from"./entry.e01776ec.js";function m(){}m.prototype={diff:function(e,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},f=o.callback;typeof o=="function"&&(f=o,o={}),this.options=o;var r=this;function l(c){return f?(setTimeout(function(){f(void 0,c)},0),!0):c}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var i=t.length,s=e.length,u=1,d=i+s;o.maxEditLength&&(d=Math.min(d,o.maxEditLength));var a=[{newPos:-1,components:[]}],p=this.extractCommon(a[0],t,e,0);if(a[0].newPos+1>=i&&p+1>=s)return l([{value:this.join(t),count:t.length}]);function v(){for(var c=-1*u;c<=u;c+=2){var h=void 0,w=a[c-1],C=a[c+1],g=(C?C.newPos:0)-c;w&&(a[c-1]=void 0);var q=w&&w.newPos+1<i,$=C&&0<=g&&g<s;if(!q&&!$){a[c]=void 0;continue}if(!q||$&&w.newPos<C.newPos?(h=Z(C),r.pushComponent(h.components,void 0,!0)):(h=w,h.newPos++,r.pushComponent(h.components,!0,void 0)),g=r.extractCommon(h,t,e,c),h.newPos+1>=i&&g+1>=s)return l(M(r,h.components,t,e,r.useLongestToken));a[c]=h}u++}if(f)(function c(){setTimeout(function(){if(u>d)return f();v()||c()},0)})();else for(;u<=d;){var y=v();if(y)return y}},pushComponent:function(e,t,o){var f=e[e.length-1];f&&f.added===t&&f.removed===o?e[e.length-1]={count:f.count+1,added:t,removed:o}:e.push({count:1,added:t,removed:o})},extractCommon:function(e,t,o,f){for(var r=t.length,l=o.length,i=e.newPos,s=i-f,u=0;i+1<r&&s+1<l&&this.equals(t[i+1],o[s+1]);)i++,s++,u++;return u&&e.components.push({count:u}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],o=0;o<e.length;o++)e[o]&&t.push(e[o]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function M(n,e,t,o,f){for(var r=0,l=e.length,i=0,s=0;r<l;r++){var u=e[r];if(u.removed){if(u.value=n.join(o.slice(s,s+u.count)),s+=u.count,r&&e[r-1].added){var a=e[r-1];e[r-1]=e[r],e[r]=a}}else{if(!u.added&&f){var d=t.slice(i,i+u.count);d=d.map(function(v,y){var c=o[s+y];return c.length>v.length?c:v}),u.value=n.join(d)}else u.value=n.join(t.slice(i,i+u.count));i+=u.count,u.added||(s+=u.count)}}var p=e[l-1];return l>1&&typeof p.value=="string"&&(p.added||p.removed)&&n.equals("",p.value)&&(e[l-2].value+=p.value,e.pop()),e}function Z(n){return{newPos:n.newPos,components:n.components.slice(0)}}var I=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,T=/\S/,O=new m;O.equals=function(n,e){return this.options.ignoreCase&&(n=n.toLowerCase(),e=e.toLowerCase()),n===e||this.options.ignoreWhitespace&&!T.test(n)&&!T.test(e)};O.tokenize=function(n){for(var e=n.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),t=0;t<e.length-1;t++)!e[t+1]&&e[t+2]&&I.test(e[t])&&I.test(e[t+2])&&(e[t]+=e[t+2],e.splice(t+1,2),t--);return e};var D=new m;D.tokenize=function(n){var e=[],t=n.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var o=0;o<t.length;o++){var f=t[o];o%2&&!this.options.newlineIsToken?e[e.length-1]+=f:(this.options.ignoreWhitespace&&(f=f.trim()),e.push(f))}return e};function k(n,e,t){return D.diff(n,e,t)}var G=new m;G.tokenize=function(n){return n.split(/(\S.+?[.!?])(?=\s+|$)/)};var H=new m;H.tokenize=function(n){return n.split(/([{}:;,]|\s+)/)};function z(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?z=function(e){return typeof e}:z=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(n)}var Q=Object.prototype.toString,L=new m;L.useLongestToken=!0;L.tokenize=D.tokenize;L.castInput=function(n){var e=this.options,t=e.undefinedReplacement,o=e.stringifyReplacer,f=o===void 0?function(r,l){return typeof l>"u"?t:l}:o;return typeof n=="string"?n:JSON.stringify(E(n,null,null,f),f," ")};L.equals=function(n,e){return m.prototype.equals.call(L,n.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function E(n,e,t,o,f){e=e||[],t=t||[],o&&(n=o(f,n));var r;for(r=0;r<e.length;r+=1)if(e[r]===n)return t[r];var l;if(Q.call(n)==="[object Array]"){for(e.push(n),l=new Array(n.length),t.push(l),r=0;r<n.length;r+=1)l[r]=E(n[r],e,t,o,f);return e.pop(),t.pop(),l}if(n&&n.toJSON&&(n=n.toJSON()),z(n)==="object"&&n!==null){e.push(n),l={},t.push(l);var i=[],s;for(s in n)n.hasOwnProperty(s)&&i.push(s);for(i.sort(),r=0;r<i.length;r+=1)s=i[r],l[s]=E(n[s],e,t,o,s);e.pop(),t.pop()}else l=n;return l}var x=new m;x.tokenize=function(n){return n.slice()};x.join=x.removeEmpty=function(n){return n};const Y=_({__name:"CodeDiff",props:{from:{},to:{},lang:{}},setup(n){const e=n;function t(i,s){const u=k(i.trim(),s.trim()),d=[],a=[],p=[];for(const v of u){const y=v.value.trimEnd().split(`
|
|
2
2
|
`);for(const c of y)v.added?(d.push(p.length),p.push(c)):(v.removed&&a.push(p.length),p.push(c))}return{added:d,removed:a,result:p.join(`
|
|
3
|
-
`)}}const o=N(()=>t(e.from,e.to));function f(i){let
|
|
3
|
+
`)}}const o=N(()=>t(e.from,e.to));function f(i){let s=0;return i.replace(/class="shiki/,'class="shiki diff').replace(/class="line"/g,u=>(s++,o.value.added.includes(s-1)?'class="line line-added"':o.value.removed.includes(s-1)?'class="line line-removed"':u))}const r=F();W(l);function l(){const i=A(r);i&&i.querySelector(".line-added,.line-removed")?.scrollIntoView()}return(i,s)=>{const u=R;return B(),J(u,{ref_key:"elRef",ref:r,code:V(o).result,lang:i.lang,"transform-rendered":f,onLoaded:l},null,8,["code","lang"])}}});export{Y as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as I}from"./NMarkdown.vue.b0e8b2fc.js";import{d as V,e as D,a7 as U,a as c,al as $,o as s,h as r,j as i,k as o,p as l,i as j,f as e,v as u,m as _,F as v,t as h,n as E,G as F,_ as S}from"./entry.e01776ec.js";import{_ as z}from"./FilepathItem.vue.5af0b5df.js";import{C as k}from"./constants.4e5eba24.js";const G={"hover:text-primary":""},L={key:0,"text-primary":""},M={"max-w-100":""},O={px4:"",py3:"","text-sm":""},T={flex:"~ gap2",n:"primary xs"},W={border:"t base","max-h-60":"","of-auto":"",px4:"",py3:""},q={"text-sm":""},A=o("span",{op50:""},"It has been referenced ",-1),H={"text-primary":""},J=o("span",{op50:""}," times by:",-1),K={flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},P={key:1,"text-sm":"",op50:""},Z=V({__name:"ComposableItem",props:{item:{},metadata:{},filepath:{},counter:{type:Boolean,default:!0},classes:{default:"px2 py1 text-sm bg-gray:5 "}},setup(x){const t=x,b=D(),g=U(),m=c(()=>t.item.as||t.item.name),n=c(()=>t.metadata?.injectionUsage?.[m.value]?.count||0),C=c(()=>(t.metadata?.injectionUsage?.[m.value]?.moduleIds||[]).filter(a=>!a.endsWith("?macro=true"))),y=c(()=>{if(t.item.meta?.docsUrl)return t.item.meta.docsUrl;if(["nuxt","#app","nuxt3"].includes(t.item.from))return k.nuxt[t.item.name];if(t.item.from==="vue")return k.vue[t.item.name]});return(a,p)=>{const w=I,f=S,N=z,B=$("VDropdown");return s(),r(B,{disabled:!t.metadata},{popper:i(()=>[o("div",M,[o("div",O,[a.item.meta?.description?(s(),r(w,{key:0,tag:"div",pb3:"","text-sm":"",markdown:a.item.meta.description},null,8,["markdown"])):l("",!0),o("div",T,[j(f,{icon:"carbon-copy",onClick:p[0]||(p[0]=d=>e(b)(e(m)))},{default:i(()=>[u(" Copy ")]),_:1}),a.filepath?(s(),r(f,{key:0,icon:"carbon-code",onClick:p[1]||(p[1]=d=>a.filepath&&e(g)(a.filepath))},{default:i(()=>[u(" Source ")]),_:1})):l("",!0),e(y)?(s(),r(f,{key:1,icon:"carbon-catalog",to:e(y),target:"_blank"},{default:i(()=>[u(" Docs ")]),_:1},8,["to"])):l("",!0)])]),o("div",W,[e(n)?(s(),_(v,{key:0},[o("div",q,[A,o("strong",H,h(e(n)),1),J]),o("div",K,[(s(!0),_(v,null,E(e(C),d=>(s(),r(N,{key:d,filepath:d},null,8,["filepath"]))),128))])],64)):(s(),_("div",P," Not in use via auto import. "))])])]),default:i(()=>[o("button",G,[o("code",{rounded:"","font-mono":"",class:F([a.metadata&&!e(n)?"op30 hover:op100":"",a.classes])},[u(h(e(m))+" ",1),e(n)&&a.counter?(s(),_("sup",L,"x"+h(e(n)),1)):l("",!0)],2)])]),_:1},8,["disabled"])}}});export{Z as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as r,u as s,aa as c,I as i,o as p,h as _,_ as u}from"./entry.e01776ec.js";const f=r({__name:"DataSchemaButton",props:{getter:{type:Function}},setup(l){const t=s();return(n,e)=>{const o=u,a=c("tooltip");return i((p(),_(o,{title:"Generate Data Schema",icon:"carbon:container-services",border:!1,onClick:e[0]||(e[0]=m=>t.value=n.getter())},null,512)),[[a,"Generate Data Schema"]])}}});export{f as _};
|