@nuxt/devtools-nightly 4.0.0-beta.7-29884487.e727f2d β 4.1.0-29893292.8fc4720
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 +9 -13
- package/dist/chunks/analyze-build.mjs +6 -2
- package/dist/chunks/assets.mjs +1 -1
- package/dist/chunks/module-main.mjs +90 -21
- package/dist/chunks/timeline.mjs +4 -2
- package/dist/chunks/vite-inspect.mjs +5 -2
- package/dist/chunks/vue-devtools.mjs +2 -1
- package/dist/chunks/vue-tracer.mjs +3 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/view/client.js +86 -22
- package/dist/shared/{devtools-nightly.C3s9ubDZ.mjs β devtools-nightly.DnJkSJYB.mjs} +8 -1
- package/dist/webcomponents/index.mjs +43 -0
- package/package.json +31 -31
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<a href="https://
|
|
1
|
+
<a href="https://nuxt.com/modules/devtools"><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
|
|
|
4
4
|
<h1>
|
|
@@ -20,7 +20,7 @@ Unleash Nuxt Developer Experience.
|
|
|
20
20
|
<a href="https://nuxt.com/blog/nuxt-devtools-v1-0">π Introduction</a> |
|
|
21
21
|
<a href="https://github.com/nuxt/devtools/discussions/29">π‘ Ideas & Suggestions</a> |
|
|
22
22
|
<a href="https://github.com/nuxt/devtools/discussions/31">πΊοΈ Project Roadmap</a> |
|
|
23
|
-
<a href="https://
|
|
23
|
+
<a href="https://nuxt.com/modules/devtools">π Documentation</a>
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
26
|
> [!NOTE]
|
|
@@ -46,7 +46,7 @@ export default defineNuxtConfig({
|
|
|
46
46
|
|
|
47
47
|
### Nuxt 4
|
|
48
48
|
|
|
49
|
-
Nuxt 5 ships
|
|
49
|
+
Nuxt 5 ships `@nuxt/devtools-onboard`, which offers to install Nuxt DevTools v4 the first time you run `nuxt dev`; you can also install `@nuxt/devtools` with your package manager. Nuxt 4.5+ still bundles v3; override `@nuxt/devtools` to `^4.0.0` with your package manager (`overrides` in `package.json` for npm, in `pnpm-workspace.yaml` for pnpm, `resolutions` for yarn), remove your lockfile and reinstall. See the [upgrade guide](https://nuxt.com/modules/devtools/upgrading-to-v4) for details and for what changed.
|
|
50
50
|
|
|
51
51
|
### Nightly Release Channel
|
|
52
52
|
|
|
@@ -83,14 +83,10 @@ You can opt-in to the nightly release channel by using package manager resolutio
|
|
|
83
83
|
<details>
|
|
84
84
|
<summary>pnpm</summary>
|
|
85
85
|
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
86
|
+
```yaml
|
|
87
|
+
# pnpm-workspace.yaml
|
|
88
|
+
overrides:
|
|
89
|
+
'@nuxt/devtools': 'npm:@nuxt/devtools-nightly@latest'
|
|
94
90
|
```
|
|
95
91
|
|
|
96
92
|
</details>
|
|
@@ -122,11 +118,11 @@ Read the [**Announcement Blog Post π**](https://nuxt.com/blog/nuxt-devtools-v
|
|
|
122
118
|
|
|
123
119
|
## Module Authors
|
|
124
120
|
|
|
125
|
-
Please refer to the [Module Authors Guide](https://
|
|
121
|
+
Please refer to the [Module Authors Guide](https://nuxt.com/modules/devtools/module-authors).
|
|
126
122
|
|
|
127
123
|
## Contribution Guide
|
|
128
124
|
|
|
129
|
-
Please refer to the [Contribution Guide](https://
|
|
125
|
+
Please refer to the [Contribution Guide](https://nuxt.com/modules/devtools/contributing).
|
|
130
126
|
|
|
131
127
|
## Anonymous Usage Analytics
|
|
132
128
|
|
|
@@ -11,7 +11,7 @@ import 'consola/utils';
|
|
|
11
11
|
import 'devframe/utils/serve-static';
|
|
12
12
|
import 'verkit';
|
|
13
13
|
import 'vite';
|
|
14
|
-
import '../shared/devtools-nightly.
|
|
14
|
+
import '../shared/devtools-nightly.DnJkSJYB.mjs';
|
|
15
15
|
import '../dirs.mjs';
|
|
16
16
|
import 'node:path';
|
|
17
17
|
import 'node:url';
|
|
@@ -28,6 +28,7 @@ import 'node:process';
|
|
|
28
28
|
import 'node:module';
|
|
29
29
|
import '@vitejs/devtools-kit/constants';
|
|
30
30
|
import 'perfect-debounce';
|
|
31
|
+
import 'node:tls';
|
|
31
32
|
|
|
32
33
|
async function getFolderSize(dir) {
|
|
33
34
|
const dirents = await readdir(dir, {
|
|
@@ -73,7 +74,10 @@ async function setup(nuxt, options) {
|
|
|
73
74
|
nuxt.hook("build:analyze:done", async (meta) => {
|
|
74
75
|
const _meta = meta;
|
|
75
76
|
_meta.size = _meta.size || {};
|
|
76
|
-
const dirs = [
|
|
77
|
+
const dirs = [
|
|
78
|
+
join(meta.buildDir, "dist/client"),
|
|
79
|
+
meta.outDir
|
|
80
|
+
];
|
|
77
81
|
const [clientBundleSize, nitroBundleSize] = await Promise.all(dirs.map(getFolderSize));
|
|
78
82
|
_meta.size.clientBundle = clientBundleSize;
|
|
79
83
|
_meta.size.nitroBundle = nitroBundleSize;
|
package/dist/chunks/assets.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAssetsDevframe } from '@devframes/plugin-assets';
|
|
2
2
|
import { onDevtoolsReady, NUXT_DEVTOOLS_GROUP_ID } from '@nuxt/devtools-kit';
|
|
3
3
|
import { resolve } from 'pathe';
|
|
4
|
-
import { d as defaultAllowedExtensions } from '../shared/devtools-nightly.
|
|
4
|
+
import { d as defaultAllowedExtensions } from '../shared/devtools-nightly.DnJkSJYB.mjs';
|
|
5
5
|
import '@nuxt/kit';
|
|
6
6
|
|
|
7
7
|
function setup({ nuxt, options }) {
|
|
@@ -6,7 +6,7 @@ import { serveStaticNodeMiddleware } from 'devframe/utils/serve-static';
|
|
|
6
6
|
import { join, dirname, resolve } from 'pathe';
|
|
7
7
|
import { isLessThan, isGreaterThanOrEqual } from 'verkit';
|
|
8
8
|
import { version as version$1, searchForWorkspaceRoot } from 'vite';
|
|
9
|
-
import { c as createDefaultTabOptions, s as setServerTasksEnabledByDefault } from '../shared/devtools-nightly.
|
|
9
|
+
import { c as createDefaultTabOptions, s as setServerTasksEnabledByDefault } from '../shared/devtools-nightly.DnJkSJYB.mjs';
|
|
10
10
|
import { runtimeDir, packageDir } from '../dirs.mjs';
|
|
11
11
|
import { execFile } from 'node:child_process';
|
|
12
12
|
import fs$1, { existsSync } from 'node:fs';
|
|
@@ -22,10 +22,11 @@ import { getDefaultExportOptions, addNuxtModule } from 'magicast/helpers';
|
|
|
22
22
|
import process$1 from 'node:process';
|
|
23
23
|
import { createRequire } from 'node:module';
|
|
24
24
|
import { getPackageInfo } from 'local-pkg';
|
|
25
|
-
import { DEVTOOLS_TERMINALS_DOCK_ID } from '@vitejs/devtools-kit/constants';
|
|
25
|
+
import { DEVTOOLS_TERMINALS_DOCK_ID, DEVTOOLS_MOUNT_PATH } from '@vitejs/devtools-kit/constants';
|
|
26
26
|
import { debounce } from 'perfect-debounce';
|
|
27
|
+
import { Server } from 'node:tls';
|
|
27
28
|
|
|
28
|
-
const version = "4.
|
|
29
|
+
const version = "4.1.0-29893292.8fc4720";
|
|
29
30
|
const peerDependencies = {
|
|
30
31
|
"@nuxt/kit": "^4.0.0-0 || ^5.0.0-0",
|
|
31
32
|
nitro: "*",
|
|
@@ -80,7 +81,13 @@ function setupAnalyzeBuildRPC(ctx) {
|
|
|
80
81
|
activeSessionId = sessionId;
|
|
81
82
|
const session = await kit.terminals.startChildProcess({
|
|
82
83
|
command: "npx",
|
|
83
|
-
args: [
|
|
84
|
+
args: [
|
|
85
|
+
"nuxi",
|
|
86
|
+
"analyze",
|
|
87
|
+
"--no-serve",
|
|
88
|
+
"--name",
|
|
89
|
+
name
|
|
90
|
+
],
|
|
84
91
|
cwd: nuxt.options.rootDir
|
|
85
92
|
}, {
|
|
86
93
|
id: sessionId,
|
|
@@ -574,8 +581,12 @@ function setupGeneralRPC({
|
|
|
574
581
|
const subKey = parentKey ? `${parentKey}_${key}` : key;
|
|
575
582
|
const envValue = _getEnv(subKey);
|
|
576
583
|
if (_isObject(obj[key])) {
|
|
577
|
-
if (_isObject(envValue))
|
|
578
|
-
obj[key] = {
|
|
584
|
+
if (_isObject(envValue)) {
|
|
585
|
+
obj[key] = {
|
|
586
|
+
...obj[key],
|
|
587
|
+
...envValue
|
|
588
|
+
};
|
|
589
|
+
}
|
|
579
590
|
_applyEnv(obj[key], subKey);
|
|
580
591
|
} else {
|
|
581
592
|
obj[key] = envValue ?? obj[key];
|
|
@@ -624,7 +635,13 @@ function setupGeneralRPC({
|
|
|
624
635
|
input = match[1];
|
|
625
636
|
suffix = match[2];
|
|
626
637
|
}
|
|
627
|
-
const candidates = isRelative ? [
|
|
638
|
+
const candidates = isRelative ? [
|
|
639
|
+
...new Set([
|
|
640
|
+
process.cwd(),
|
|
641
|
+
nuxt.options.rootDir,
|
|
642
|
+
nuxt.options.workspaceDir
|
|
643
|
+
].filter(Boolean))
|
|
644
|
+
].map((dir) => resolve(dir, input)) : [input];
|
|
628
645
|
const path = candidates.flatMap((i) => [i, `${i}.js`, `${i}.mjs`, `${i}.ts`]).find((i) => existsSync(i));
|
|
629
646
|
if (!path) {
|
|
630
647
|
console.error("File not found:", candidates[0]);
|
|
@@ -639,6 +656,8 @@ function setupGeneralRPC({
|
|
|
639
656
|
let editor = getOptions()?.behavior.openInEditor ?? void 0;
|
|
640
657
|
if (editor === "auto")
|
|
641
658
|
editor = void 0;
|
|
659
|
+
else if (editor === "sublime")
|
|
660
|
+
editor = "subl";
|
|
642
661
|
await import('devframe/utils/launch-editor').then((r) => r.launchEditor(path + suffix, editor));
|
|
643
662
|
return true;
|
|
644
663
|
} catch (e) {
|
|
@@ -961,7 +980,13 @@ function removeNuxtModuleFromCode(source, name, filepath) {
|
|
|
961
980
|
}
|
|
962
981
|
|
|
963
982
|
function broadcastTerminalExit(ctx, id, code) {
|
|
964
|
-
ctx.devtoolsKit?.rpc.broadcast({
|
|
983
|
+
ctx.devtoolsKit?.rpc.broadcast({
|
|
984
|
+
method: "onTerminalExit",
|
|
985
|
+
args: [
|
|
986
|
+
{ id, code }
|
|
987
|
+
],
|
|
988
|
+
event: true
|
|
989
|
+
});
|
|
965
990
|
}
|
|
966
991
|
function statusForExit(code) {
|
|
967
992
|
return code == null || code === 0 ? "stopped" : "error";
|
|
@@ -1462,7 +1487,11 @@ function setupStorageRPC(ctx) {
|
|
|
1462
1487
|
return;
|
|
1463
1488
|
await Promise.all(unwatchStorageMounts.map((unwatch) => unwatch()));
|
|
1464
1489
|
unwatchStorageMounts = await Promise.all(Object.keys(storageMounts).map((mountName) => watchStorageMount(activeStorage, mountName, (event, key) => {
|
|
1465
|
-
ctx.devtoolsKit?.rpc.broadcast({
|
|
1490
|
+
ctx.devtoolsKit?.rpc.broadcast({
|
|
1491
|
+
method: "callHook",
|
|
1492
|
+
args: ["storage:key:update", key, event],
|
|
1493
|
+
event: true
|
|
1494
|
+
});
|
|
1466
1495
|
})));
|
|
1467
1496
|
});
|
|
1468
1497
|
nuxt.hook("close", async () => {
|
|
@@ -1732,6 +1761,37 @@ function setupRPC(nuxt, options) {
|
|
|
1732
1761
|
};
|
|
1733
1762
|
}
|
|
1734
1763
|
|
|
1764
|
+
const SKIPS_DEVTOOLS_UPGRADES = /* @__PURE__ */ Symbol.for("nuxt-devtools:skips-devtools-upgrades");
|
|
1765
|
+
function createDevListenerPlugin(nuxt) {
|
|
1766
|
+
return {
|
|
1767
|
+
name: "nuxt:devtools:dev-listener",
|
|
1768
|
+
apply: "serve",
|
|
1769
|
+
configureServer: {
|
|
1770
|
+
order: "pre",
|
|
1771
|
+
handler(server) {
|
|
1772
|
+
if (server.config.build?.ssr || server.httpServer)
|
|
1773
|
+
return;
|
|
1774
|
+
const listener = nuxt._devServerListener;
|
|
1775
|
+
if (!(listener instanceof Server))
|
|
1776
|
+
return;
|
|
1777
|
+
server.httpServer = listener;
|
|
1778
|
+
skipDevToolsUpgrades(nuxt.server);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
function skipDevToolsUpgrades(nuxtServer) {
|
|
1784
|
+
const upgrade = nuxtServer?.upgrade;
|
|
1785
|
+
if (!nuxtServer || typeof upgrade !== "function" || nuxtServer[SKIPS_DEVTOOLS_UPGRADES])
|
|
1786
|
+
return;
|
|
1787
|
+
nuxtServer[SKIPS_DEVTOOLS_UPGRADES] = true;
|
|
1788
|
+
nuxtServer.upgrade = (req, socket, head) => {
|
|
1789
|
+
if (req.url?.startsWith(DEVTOOLS_MOUNT_PATH))
|
|
1790
|
+
return;
|
|
1791
|
+
return upgrade.call(nuxtServer, req, socket, head);
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1735
1795
|
const MULTIPLE_SLASHES_RE = /\/+/g;
|
|
1736
1796
|
const ASSETS_PACKAGE = "@nuxt/devtools-assets";
|
|
1737
1797
|
function resolveClientAssetsSource() {
|
|
@@ -1756,18 +1816,16 @@ async function enableModule(options, nuxt) {
|
|
|
1756
1816
|
return;
|
|
1757
1817
|
}
|
|
1758
1818
|
await nuxt.callHook("devtools:before");
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1819
|
+
const viteDevToolsDefaults = {};
|
|
1820
|
+
if (options.disableAuthorization)
|
|
1821
|
+
viteDevToolsDefaults.clientAuth = false;
|
|
1822
|
+
if (options.mcp !== void 0)
|
|
1823
|
+
viteDevToolsDefaults.mcp = options.mcp;
|
|
1764
1824
|
const kit = await import('@nuxt/kit');
|
|
1765
1825
|
if ("useTerminal" in kit) {
|
|
1766
1826
|
const { banner, onTrusted } = createTerminalAuthBanner(kit.useTerminal);
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
devtools.onTrusted ??= onTrusted;
|
|
1770
|
-
});
|
|
1827
|
+
viteDevToolsDefaults.banner = banner;
|
|
1828
|
+
viteDevToolsDefaults.onTrusted = onTrusted;
|
|
1771
1829
|
}
|
|
1772
1830
|
nuxt.options.imports.collectMeta = true;
|
|
1773
1831
|
addPlugin({
|
|
@@ -1799,9 +1857,12 @@ async function enableModule(options, nuxt) {
|
|
|
1799
1857
|
const clientAssetsSource = isSelfClient ? void 0 : resolveClientAssetsSource();
|
|
1800
1858
|
const clientUrl = clientAssetsSource ? `${ROUTE_CLIENT}/` : `${nuxt.options.app.baseURL || "/"}/`.replace(MULTIPLE_SLASHES_RE, "/");
|
|
1801
1859
|
let publicDevServerOrigin;
|
|
1802
|
-
|
|
1860
|
+
const allowedOrigins = [];
|
|
1861
|
+
nuxt.hook("listen", async (_server, listener) => {
|
|
1803
1862
|
if (listener?.url)
|
|
1804
1863
|
publicDevServerOrigin = new URL(listener.url).origin;
|
|
1864
|
+
const urls = await listener?.getURLs?.() ?? [];
|
|
1865
|
+
allowedOrigins.push(...urls.map(({ url }) => new URL(url).origin));
|
|
1805
1866
|
});
|
|
1806
1867
|
const branding = {
|
|
1807
1868
|
productName: "Nuxt DevTools",
|
|
@@ -1814,14 +1875,22 @@ async function enableModule(options, nuxt) {
|
|
|
1814
1875
|
},
|
|
1815
1876
|
windowTitle: "Nuxt DevTools"
|
|
1816
1877
|
};
|
|
1878
|
+
viteDevToolsDefaults.branding = branding;
|
|
1879
|
+
viteDevToolsDefaults.allowedOrigins = allowedOrigins;
|
|
1817
1880
|
if (isGreaterThanOrEqual(version$1, "8.3.0")) {
|
|
1818
1881
|
extendViteDevToolsConfig((devtools) => {
|
|
1819
|
-
devtools.
|
|
1882
|
+
devtools.allowedOrigins = [
|
|
1883
|
+
...devtools.allowedOrigins ?? [],
|
|
1884
|
+
...allowedOrigins
|
|
1885
|
+
];
|
|
1886
|
+
for (const [key, value] of Object.entries(viteDevToolsDefaults))
|
|
1887
|
+
devtools[key] ??= value;
|
|
1820
1888
|
});
|
|
1821
1889
|
} else {
|
|
1822
|
-
const DevTools = await import('@vitejs/devtools').then((r) => r.DevTools(
|
|
1890
|
+
const DevTools = await import('@vitejs/devtools').then((r) => r.DevTools(viteDevToolsDefaults));
|
|
1823
1891
|
addVitePlugin(DevTools);
|
|
1824
1892
|
}
|
|
1893
|
+
addVitePlugin(createDevListenerPlugin(nuxt), { server: false });
|
|
1825
1894
|
let connectDevToolsKit;
|
|
1826
1895
|
addVitePlugin(defineViteDevToolsPlugin({
|
|
1827
1896
|
name: "nuxt:devtools",
|
package/dist/chunks/timeline.mjs
CHANGED
|
@@ -103,10 +103,12 @@ function setup({ nuxt, options }) {
|
|
|
103
103
|
if (item.type)
|
|
104
104
|
return false;
|
|
105
105
|
const name = item.as || item.name;
|
|
106
|
-
if (!include.some((f) => typeof f === "function" ? f(item) : typeof f === "string" ? name === f : f.test(name)))
|
|
106
|
+
if (!include.some((f) => typeof f === "function" ? f(item) : typeof f === "string" ? name === f : f.test(name))) {
|
|
107
107
|
return false;
|
|
108
|
-
|
|
108
|
+
}
|
|
109
|
+
if (exclude.some((f) => typeof f === "function" ? f(item) : typeof f === "string" ? name === f : f.test(name))) {
|
|
109
110
|
return false;
|
|
111
|
+
}
|
|
110
112
|
return true;
|
|
111
113
|
}
|
|
112
114
|
let unimport;
|
|
@@ -9,7 +9,7 @@ import 'devframe/utils/serve-static';
|
|
|
9
9
|
import 'pathe';
|
|
10
10
|
import 'verkit';
|
|
11
11
|
import 'vite';
|
|
12
|
-
import '../shared/devtools-nightly.
|
|
12
|
+
import '../shared/devtools-nightly.DnJkSJYB.mjs';
|
|
13
13
|
import '../dirs.mjs';
|
|
14
14
|
import 'node:path';
|
|
15
15
|
import 'node:url';
|
|
@@ -27,6 +27,7 @@ import 'node:process';
|
|
|
27
27
|
import 'node:module';
|
|
28
28
|
import '@vitejs/devtools-kit/constants';
|
|
29
29
|
import 'perfect-debounce';
|
|
30
|
+
import 'node:tls';
|
|
30
31
|
|
|
31
32
|
const VERSION_QUERY_RE = /\?v=\w+$/;
|
|
32
33
|
const VUE_EXT_RE = /\.vue($|\?v=)/;
|
|
@@ -34,7 +35,9 @@ const INSPECT_DOCK_ID = "vite-plugin-inspect";
|
|
|
34
35
|
const INSPECT_DOCK_TITLE = "Inspect";
|
|
35
36
|
const INSPECT_DOCK_ICON = "ph:magnifying-glass-duotone";
|
|
36
37
|
function isVitePluginInspectAvailable(rootDir) {
|
|
37
|
-
return isPackageExists("vite-plugin-inspect", {
|
|
38
|
+
return isPackageExists("vite-plugin-inspect", {
|
|
39
|
+
paths: [rootDir]
|
|
40
|
+
});
|
|
38
41
|
}
|
|
39
42
|
async function createVitePluginInspect(options) {
|
|
40
43
|
return await import('vite-plugin-inspect').then((r) => r.default(options));
|
|
@@ -8,7 +8,7 @@ import 'devframe/utils/serve-static';
|
|
|
8
8
|
import 'pathe';
|
|
9
9
|
import 'verkit';
|
|
10
10
|
import 'vite';
|
|
11
|
-
import '../shared/devtools-nightly.
|
|
11
|
+
import '../shared/devtools-nightly.DnJkSJYB.mjs';
|
|
12
12
|
import '../dirs.mjs';
|
|
13
13
|
import 'node:path';
|
|
14
14
|
import 'node:url';
|
|
@@ -27,6 +27,7 @@ import 'node:module';
|
|
|
27
27
|
import 'local-pkg';
|
|
28
28
|
import '@vitejs/devtools-kit/constants';
|
|
29
29
|
import 'perfect-debounce';
|
|
30
|
+
import 'node:tls';
|
|
30
31
|
|
|
31
32
|
function setup({ nuxt }) {
|
|
32
33
|
if (!nuxt.options.dev || nuxt.options.test)
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '@nuxt/kit';
|
|
2
|
-
export { m as default } from './shared/devtools-nightly.
|
|
2
|
+
export { m as default } from './shared/devtools-nightly.DnJkSJYB.mjs';
|
|
@@ -3,10 +3,11 @@ import { NuxtDevtoolsInspectPanel } from "@nuxt/devtools/webcomponents";
|
|
|
3
3
|
import { createHooks } from "hookable";
|
|
4
4
|
import { debounce } from "perfect-debounce";
|
|
5
5
|
import { events as inspectorEvents, hasData as inspectorHasData, state as inspectorState } from "vite-plugin-vue-tracer/client/overlay";
|
|
6
|
-
import { computed, markRaw, nextTick, reactive, ref, shallowReactive, shallowRef, toRef
|
|
6
|
+
import { computed, effect, isRef, markRaw, nextTick, reactive, ref, shallowReactive, shallowRef, toRef } from "vue";
|
|
7
7
|
import { useAppConfig } from "#imports";
|
|
8
8
|
import { initTimelineMetrics } from "../../function-metrics-helpers.js";
|
|
9
9
|
const NUXT_DOCK_ANCHOR_ID = "nuxt:devtools";
|
|
10
|
+
const VUE_TRACER_DOCK_ID = "vue-tracer";
|
|
10
11
|
function getDevframeContext() {
|
|
11
12
|
return getDevframeClientContext();
|
|
12
13
|
}
|
|
@@ -34,7 +35,7 @@ export async function setupDevToolsClient({
|
|
|
34
35
|
close() {
|
|
35
36
|
const ctx = getDevframeContext();
|
|
36
37
|
if (ctx)
|
|
37
|
-
ctx
|
|
38
|
+
closePanel(ctx);
|
|
38
39
|
},
|
|
39
40
|
open() {
|
|
40
41
|
const ctx = getDevframeContext();
|
|
@@ -94,10 +95,46 @@ export async function setupDevToolsClient({
|
|
|
94
95
|
left: "0",
|
|
95
96
|
top: "0"
|
|
96
97
|
});
|
|
98
|
+
const supportsTopLayer = typeof component.showPopover === "function";
|
|
99
|
+
function raiseToTopLayer() {
|
|
100
|
+
if (!supportsTopLayer)
|
|
101
|
+
return;
|
|
102
|
+
if (component.matches(":popover-open"))
|
|
103
|
+
component.hidePopover();
|
|
104
|
+
component.showPopover();
|
|
105
|
+
}
|
|
106
|
+
if (supportsTopLayer) {
|
|
107
|
+
component.popover = "manual";
|
|
108
|
+
Object.assign(component.style, {
|
|
109
|
+
inset: "auto",
|
|
110
|
+
margin: "0",
|
|
111
|
+
padding: "0",
|
|
112
|
+
border: "none",
|
|
113
|
+
background: "transparent",
|
|
114
|
+
overflow: "visible"
|
|
115
|
+
});
|
|
116
|
+
raiseToTopLayer();
|
|
117
|
+
}
|
|
118
|
+
let reopenPanelOnClose = false;
|
|
119
|
+
function holdPanelWhileInspecting() {
|
|
120
|
+
queueMicrotask(() => {
|
|
121
|
+
const ctx = getDevframeContext();
|
|
122
|
+
if (!props.matched || !ctx?.panel.session.open)
|
|
123
|
+
return;
|
|
124
|
+
ctx.panel.session.open = false;
|
|
125
|
+
reopenPanelOnClose = true;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
97
128
|
component.addEventListener("close", () => {
|
|
98
129
|
props.matched = void 0;
|
|
99
130
|
inspectorState.isEnabled = false;
|
|
100
131
|
inspectorState.isVisible = false;
|
|
132
|
+
if (reopenPanelOnClose) {
|
|
133
|
+
reopenPanelOnClose = false;
|
|
134
|
+
const ctx = getDevframeContext();
|
|
135
|
+
if (ctx)
|
|
136
|
+
ctx.panel.session.open = true;
|
|
137
|
+
}
|
|
101
138
|
});
|
|
102
139
|
component.addEventListener("selectParent", () => {
|
|
103
140
|
const parent = inspectorState.main?.getParent();
|
|
@@ -132,6 +169,8 @@ export async function setupDevToolsClient({
|
|
|
132
169
|
inspectorState.isVisible = true;
|
|
133
170
|
props.matched = info;
|
|
134
171
|
props.mouse = { x: e.clientX, y: e.clientY };
|
|
172
|
+
raiseToTopLayer();
|
|
173
|
+
holdPanelWhileInspecting();
|
|
135
174
|
});
|
|
136
175
|
const isAvailable = ref(inspectorHasData());
|
|
137
176
|
if (!isAvailable.value) {
|
|
@@ -139,21 +178,21 @@ export async function setupDevToolsClient({
|
|
|
139
178
|
isAvailable.value = inspectorHasData();
|
|
140
179
|
});
|
|
141
180
|
}
|
|
181
|
+
function setActive(active) {
|
|
182
|
+
const ctx = getDevframeContext();
|
|
183
|
+
if (ctx?.docks.getStateById(VUE_TRACER_DOCK_ID)) {
|
|
184
|
+
ctx.docks.setActionActive(VUE_TRACER_DOCK_ID, active);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
inspectorState.isVisible = active;
|
|
188
|
+
inspectorState.isEnabled = active;
|
|
189
|
+
}
|
|
142
190
|
return inspector = markRaw({
|
|
143
191
|
isAvailable,
|
|
144
192
|
isEnabled: toRef(inspectorState, "isVisible"),
|
|
145
|
-
enable: () =>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
disable: () => {
|
|
150
|
-
inspectorState.isVisible = false;
|
|
151
|
-
inspectorState.isEnabled = false;
|
|
152
|
-
},
|
|
153
|
-
toggle: () => {
|
|
154
|
-
inspectorState.isEnabled = !inspectorState.isEnabled;
|
|
155
|
-
inspectorState.isVisible = inspectorState.isEnabled;
|
|
156
|
-
}
|
|
193
|
+
enable: () => setActive(true),
|
|
194
|
+
disable: () => setActive(false),
|
|
195
|
+
toggle: () => setActive(!inspectorState.isEnabled)
|
|
157
196
|
});
|
|
158
197
|
}
|
|
159
198
|
setupRouteTracking(timeline, router);
|
|
@@ -164,6 +203,10 @@ export async function setupDevToolsClient({
|
|
|
164
203
|
client.devtools.toggle();
|
|
165
204
|
});
|
|
166
205
|
}
|
|
206
|
+
function closePanel(ctx) {
|
|
207
|
+
ctx.docks.switchEntry(null);
|
|
208
|
+
ctx.panel.session.open = false;
|
|
209
|
+
}
|
|
167
210
|
export function useClientColorMode() {
|
|
168
211
|
const explicitColor = ref();
|
|
169
212
|
const systemColor = ref();
|
|
@@ -240,14 +283,19 @@ function setupReactivity(client, router, timeMetric) {
|
|
|
240
283
|
const refreshReactivity = debounce(() => {
|
|
241
284
|
client.hooks.callHook("host:update:reactivity");
|
|
242
285
|
}, 100, { trailing: true });
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}, {
|
|
286
|
+
const runner = effect(() => {
|
|
287
|
+
traverse([
|
|
288
|
+
client.nuxt.payload,
|
|
289
|
+
client.app.colorMode.value,
|
|
290
|
+
client.metrics.loading(),
|
|
291
|
+
timeMetric
|
|
292
|
+
]);
|
|
293
|
+
}, {
|
|
294
|
+
scheduler: debounce(() => {
|
|
295
|
+
runner();
|
|
296
|
+
client.hooks.callHook("host:update:reactivity");
|
|
297
|
+
}, 100, { trailing: true })
|
|
298
|
+
});
|
|
251
299
|
router?.afterEach(() => {
|
|
252
300
|
refreshReactivity();
|
|
253
301
|
});
|
|
@@ -255,3 +303,19 @@ function setupReactivity(client, router, timeMetric) {
|
|
|
255
303
|
refreshReactivity();
|
|
256
304
|
});
|
|
257
305
|
}
|
|
306
|
+
function traverse(value, seen = /* @__PURE__ */ new Set()) {
|
|
307
|
+
if (!value || typeof value !== "object" || seen.has(value) || value.__v_skip)
|
|
308
|
+
return;
|
|
309
|
+
seen.add(value);
|
|
310
|
+
if (isRef(value)) {
|
|
311
|
+
traverse(value.value, seen);
|
|
312
|
+
} else if (Array.isArray(value)) {
|
|
313
|
+
for (const item of value)
|
|
314
|
+
traverse(item, seen);
|
|
315
|
+
} else if (value instanceof Map || value instanceof Set) {
|
|
316
|
+
value.forEach((item) => traverse(item, seen));
|
|
317
|
+
} else if (Object.prototype.toString.call(value) === "[object Object]") {
|
|
318
|
+
for (const key in value)
|
|
319
|
+
traverse(value[key], seen);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
@@ -56,7 +56,14 @@ function createDefaultTabOptions() {
|
|
|
56
56
|
inputDefaults: {
|
|
57
57
|
query: [],
|
|
58
58
|
body: [],
|
|
59
|
-
headers: [
|
|
59
|
+
headers: [
|
|
60
|
+
{
|
|
61
|
+
active: true,
|
|
62
|
+
key: "Content-Type",
|
|
63
|
+
value: "application/json",
|
|
64
|
+
type: "string"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
60
67
|
}
|
|
61
68
|
},
|
|
62
69
|
assets: {
|
|
@@ -190,6 +190,43 @@ function onClickOutside(target, handler, options = {}) {
|
|
|
190
190
|
return stop;
|
|
191
191
|
}
|
|
192
192
|
//#endregion
|
|
193
|
+
//#region onKeyStroke/index.ts
|
|
194
|
+
function createKeyPredicate(keyFilter) {
|
|
195
|
+
if (typeof keyFilter === "function") return keyFilter;
|
|
196
|
+
else if (typeof keyFilter === "string") return (event) => event.key === keyFilter;
|
|
197
|
+
else if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);
|
|
198
|
+
return () => true;
|
|
199
|
+
}
|
|
200
|
+
function onKeyStroke(...args) {
|
|
201
|
+
let key;
|
|
202
|
+
let handler;
|
|
203
|
+
let options = {};
|
|
204
|
+
if (args.length === 3) {
|
|
205
|
+
key = args[0];
|
|
206
|
+
handler = args[1];
|
|
207
|
+
options = args[2];
|
|
208
|
+
} else if (args.length === 2) {
|
|
209
|
+
if (typeof args[1] === "object") {
|
|
210
|
+
key = true;
|
|
211
|
+
handler = args[0];
|
|
212
|
+
options = args[1];
|
|
213
|
+
} else {
|
|
214
|
+
key = args[0];
|
|
215
|
+
handler = args[1];
|
|
216
|
+
}
|
|
217
|
+
} else {
|
|
218
|
+
key = true;
|
|
219
|
+
handler = args[0];
|
|
220
|
+
}
|
|
221
|
+
const { target = defaultWindow, eventName = "keydown", passive = false, dedupe = false } = options;
|
|
222
|
+
const predicate = createKeyPredicate(key);
|
|
223
|
+
const listener = (e) => {
|
|
224
|
+
if (e.repeat && toValue(dedupe)) return;
|
|
225
|
+
if (predicate(e)) handler(e);
|
|
226
|
+
};
|
|
227
|
+
return useEventListener(target, eventName, listener, passive);
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
193
230
|
//#region useDraggable/index.ts
|
|
194
231
|
const defaultScrollConfig = {
|
|
195
232
|
speed: 2,
|
|
@@ -441,6 +478,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
441
478
|
close();
|
|
442
479
|
});
|
|
443
480
|
});
|
|
481
|
+
onKeyStroke("Escape", () => {
|
|
482
|
+
if (__props.props.matched)
|
|
483
|
+
close();
|
|
484
|
+
});
|
|
444
485
|
function close() {
|
|
445
486
|
emit("close");
|
|
446
487
|
}
|
|
@@ -452,6 +493,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
452
493
|
return;
|
|
453
494
|
const file = `${__props.props.matched.pos[0]}:${__props.props.matched.pos[1]}:${__props.props.matched.pos[2]}`;
|
|
454
495
|
emit("openInEditor", file);
|
|
496
|
+
close();
|
|
455
497
|
}
|
|
456
498
|
function generateUniqueSelector(element) {
|
|
457
499
|
if (!element)
|
|
@@ -545,6 +587,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
545
587
|
toastTimer = setTimeout(() => {
|
|
546
588
|
showToast.value = false;
|
|
547
589
|
}, 6e3);
|
|
590
|
+
close();
|
|
548
591
|
} catch (error) {
|
|
549
592
|
console.error("Failed to copy agent info:", error);
|
|
550
593
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/devtools-nightly",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.1.0-29893292.8fc4720",
|
|
5
5
|
"description": "The Nuxt DevTools gives you insights and transparency about your Nuxt App.",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://nuxt.com/modules/devtools",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/nuxt/devtools.git",
|
|
@@ -43,64 +43,64 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@devframes/hub": "^1.2
|
|
47
|
-
"@devframes/plugin-assets": "^1.2
|
|
48
|
-
"@devframes/plugin-code-server": "^1.2
|
|
49
|
-
"@devframes/plugin-data-inspector": "^1.2
|
|
50
|
-
"@devframes/plugin-og": "^1.2
|
|
51
|
-
"@nuxt/devtools-assets": "npm:@nuxt/devtools-assets-nightly@4.
|
|
52
|
-
"@nuxt/devtools-kit": "npm:@nuxt/devtools-kit-nightly@4.
|
|
46
|
+
"@devframes/hub": "^1.3.2",
|
|
47
|
+
"@devframes/plugin-assets": "^1.3.2",
|
|
48
|
+
"@devframes/plugin-code-server": "^1.3.2",
|
|
49
|
+
"@devframes/plugin-data-inspector": "^1.3.2",
|
|
50
|
+
"@devframes/plugin-og": "^1.3.2",
|
|
51
|
+
"@nuxt/devtools-assets": "npm:@nuxt/devtools-assets-nightly@4.1.0-29893292.8fc4720",
|
|
52
|
+
"@nuxt/devtools-kit": "npm:@nuxt/devtools-kit-nightly@4.1.0-29893292.8fc4720",
|
|
53
53
|
"@vitejs/devtools": "^0.8.0",
|
|
54
54
|
"@vitejs/devtools-kit": "^0.8.0",
|
|
55
55
|
"consola": "^3.4.2",
|
|
56
56
|
"destr": "^2.0.5",
|
|
57
|
-
"devframe": "^1.2
|
|
57
|
+
"devframe": "^1.3.2",
|
|
58
58
|
"error-stack-parser-es": "^2.0.1",
|
|
59
59
|
"escape-string-regexp": "^5.0.0",
|
|
60
60
|
"fast-npm-meta": "^2.2.0",
|
|
61
61
|
"hookable": "^6.1.2",
|
|
62
|
-
"local-pkg": "^
|
|
63
|
-
"magic-string": "^1.4.
|
|
62
|
+
"local-pkg": "^2.0.0",
|
|
63
|
+
"magic-string": "^1.4.5",
|
|
64
64
|
"magicast": "^0.5.5",
|
|
65
65
|
"mlly": "^1.8.2",
|
|
66
66
|
"pathe": "^2.0.3",
|
|
67
67
|
"perfect-debounce": "^2.1.0",
|
|
68
68
|
"tinyglobby": "^0.2.17",
|
|
69
|
-
"unplugin": "^3.
|
|
69
|
+
"unplugin": "^3.7.0",
|
|
70
70
|
"verkit": "^0.5.0",
|
|
71
71
|
"vite-plugin-vue-devtools": "^9.0.0-beta.1",
|
|
72
|
-
"vite-plugin-vue-tracer": "^1.
|
|
72
|
+
"vite-plugin-vue-tracer": "^1.7.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@antfu/utils": "^9.3.0",
|
|
76
76
|
"@iconify-json/bxl": "^1.2.4",
|
|
77
|
-
"@iconify-json/carbon": "^1.2.
|
|
78
|
-
"@iconify-json/logos": "^1.2.
|
|
77
|
+
"@iconify-json/carbon": "^1.2.29",
|
|
78
|
+
"@iconify-json/logos": "^1.2.18",
|
|
79
79
|
"@iconify-json/ph": "^1.2.2",
|
|
80
80
|
"@iconify-json/ri": "^1.2.10",
|
|
81
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
82
|
-
"@iconify-json/tabler": "^1.2.
|
|
83
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-
|
|
84
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-
|
|
81
|
+
"@iconify-json/simple-icons": "^1.2.101",
|
|
82
|
+
"@iconify-json/tabler": "^1.2.43",
|
|
83
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-2611010234-c709ec8",
|
|
84
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-2611010234-c709ec8",
|
|
85
85
|
"@parcel/watcher": "^2.6.0",
|
|
86
86
|
"@types/markdown-it-link-attributes": "^3.0.5",
|
|
87
|
-
"@unocss/nuxt": "^66.
|
|
88
|
-
"@unocss/preset-icons": "^66.
|
|
89
|
-
"@unocss/preset-uno": "^66.
|
|
87
|
+
"@unocss/nuxt": "^66.12.0",
|
|
88
|
+
"@unocss/preset-icons": "^66.12.0",
|
|
89
|
+
"@unocss/preset-uno": "^66.12.0",
|
|
90
90
|
"@vueuse/nuxt": "^15.0.0",
|
|
91
91
|
"cronstrue": "^3.38.0",
|
|
92
92
|
"diff": "^9.0.0",
|
|
93
93
|
"dompurify": "^3.4.17",
|
|
94
|
-
"exsolve": "^1.
|
|
94
|
+
"exsolve": "^1.2.0",
|
|
95
95
|
"floating-vue": "^5.4.0",
|
|
96
96
|
"fuse.js": "^7.5.0",
|
|
97
97
|
"json-editor-vue": "^0.19.2",
|
|
98
98
|
"lightningcss": "^1.33.0",
|
|
99
99
|
"markdown-exit": "^1.3.0",
|
|
100
100
|
"markdown-it-link-attributes": "^4.0.1",
|
|
101
|
-
"nitro": "^3.0.
|
|
101
|
+
"nitro": "^3.0.261029-rc",
|
|
102
102
|
"nitropack": "^2.13.5",
|
|
103
|
-
"nuxt": "npm:nuxt-nightly@5.0.0-
|
|
103
|
+
"nuxt": "npm:nuxt-nightly@5.0.0-2611010234-c709ec8",
|
|
104
104
|
"ofetch": "^1.5.1",
|
|
105
105
|
"package-manager-detector": "^1.9.0",
|
|
106
106
|
"quicktype-core": "22.0.0",
|
|
@@ -113,15 +113,15 @@
|
|
|
113
113
|
"ua-parser-modern": "^0.1.1",
|
|
114
114
|
"unbuild": "^3.6.1",
|
|
115
115
|
"unimport": "^7.0.2",
|
|
116
|
-
"unocss": "^66.
|
|
117
|
-
"unplugin-vue": "^8.0.
|
|
116
|
+
"unocss": "^66.12.0",
|
|
117
|
+
"unplugin-vue": "^8.0.1",
|
|
118
118
|
"unplugin-vue-markdown": "^32.1.1",
|
|
119
119
|
"unstorage": "^1.17.6",
|
|
120
120
|
"vanilla-jsoneditor": "^3.13.0",
|
|
121
|
-
"vis-data": "^8.0.
|
|
122
|
-
"vis-network": "^10.1.
|
|
121
|
+
"vis-data": "^8.0.6",
|
|
122
|
+
"vis-network": "^10.1.4",
|
|
123
123
|
"vite-plugin-inspect": "^12.1.0",
|
|
124
|
-
"vue-tsc": "
|
|
124
|
+
"vue-tsc": "3.3.13",
|
|
125
125
|
"vue-virtual-scroller": "^3.0.5"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|