@nuxt/devtools 4.0.0-alpha.1 → 4.0.0-alpha.3
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 +84 -5
- package/dist/chunks/module-main.mjs +174 -220
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/__blank-hkoz1rvj.js +1 -0
- package/dist/client/_nuxt/analyze-build-kqtn42f3.js +1 -0
- package/dist/client/_nuxt/assets-pdpavuv7.js +6 -0
- package/dist/client/_nuxt/auth-required-panel-eykuzska.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/424f9fd7-bd33-4b1e-8498-929c14b6ad71.json +1 -0
- package/dist/client/_nuxt/{client-im47u3kz.js → client-coqmopwz.js} +1 -1
- package/dist/client/_nuxt/{code-diff-idsu3m0z.js → code-diff-o5b2z2ie.js} +3 -3
- package/dist/client/_nuxt/code-snippets-lje00rjy.js +1 -0
- package/dist/client/_nuxt/components-mkmd03mc.js +1 -0
- package/dist/client/_nuxt/composable-item-lw4aqry9.js +1 -0
- package/dist/client/_nuxt/custom-_name_-h2d0kmts.js +1 -0
- package/dist/client/_nuxt/data-schema-button-g6gxhvpu.js +1 -0
- package/dist/client/_nuxt/data-schema-drawer-h229qgae.js +2 -0
- package/dist/client/_nuxt/debug-ezvak7q9.js +1 -0
- package/dist/client/_nuxt/{default-jvhm51ri.js → default-f17ja76u.js} +1 -1
- package/dist/client/_nuxt/dev-auth-h6radlhi.js +1 -0
- package/dist/client/_nuxt/duration-display-lgba3ul7.js +1 -0
- package/dist/client/_nuxt/entry.css-d9crsfkn.css +1 -0
- package/dist/client/_nuxt/error-404-j6bw0i0a.js +1 -0
- package/dist/client/_nuxt/error-404.css-op0yx84h.css +1 -0
- package/dist/client/_nuxt/error-500-oozftcqy.js +1 -0
- package/dist/client/_nuxt/error-500.css-f169vd1x.css +1 -0
- package/dist/client/_nuxt/error-knm3fbzu.js +9 -0
- package/dist/client/_nuxt/filepath-item-o7vxzdbh.js +1 -0
- package/dist/client/_nuxt/full-h1zczfpi.js +1 -0
- package/dist/client/_nuxt/h9sdxxta.js +4 -0
- package/dist/client/_nuxt/help-fab-ekagn9f2.js +1 -0
- package/dist/client/_nuxt/hooks-k3agmywq.js +1 -0
- package/dist/client/_nuxt/imports-gw4s306d.js +1 -0
- package/dist/client/_nuxt/launch-page-jvtn5jef.js +1 -0
- package/dist/client/_nuxt/modules-b3ta2mlp.js +1 -0
- package/dist/client/_nuxt/nbadge-ia2sg78l.js +1 -0
- package/dist/client/_nuxt/ncard-bpchuz30.js +1 -0
- package/dist/client/_nuxt/ncheckbox-dqqmiqln.js +1 -0
- package/dist/client/_nuxt/ncode-block-lbvhz228.js +2 -0
- package/dist/client/_nuxt/ndrawer-pdhwqkg2.js +1 -0
- package/dist/client/_nuxt/ndropdown-o0hg8oi1.js +1 -0
- package/dist/client/_nuxt/nicon-o8vtl3nv.js +1 -0
- package/dist/client/_nuxt/nicon-title-f04kekaa.js +1 -0
- package/dist/client/_nuxt/nlink-flm1s7uj.js +1 -0
- package/dist/client/_nuxt/nmarkdown-cu68ujlp.js +1 -0
- package/dist/client/_nuxt/nnavbar-iwf1qrzf.js +1 -0
- package/dist/client/_nuxt/none-b8do2yyn.js +1 -0
- package/dist/client/_nuxt/nsection-block-oc6icst0.js +1 -0
- package/dist/client/_nuxt/nselect-k14i70o0.js +1 -0
- package/dist/client/_nuxt/nselect-tabs-gmel1seg.js +1 -0
- package/dist/client/_nuxt/nswitch-kprd7bwp.js +1 -0
- package/dist/client/_nuxt/ntip-erjk5wo4.js +1 -0
- package/dist/client/_nuxt/{nuxt-otp6bp04.js → nuxt-bl8ryhiw.js} +1 -1
- package/dist/client/_nuxt/{nuxt-link-bumooa9d.js → nuxt-link-h8a2u03t.js} +1 -1
- package/dist/client/_nuxt/open-graph-ipvg6gyk.js +3 -0
- package/dist/client/_nuxt/overview-fbg2mjz1.js +1 -0
- package/dist/client/_nuxt/pages-jx3r1z1o.js +1 -0
- package/dist/client/_nuxt/pages-nqnq5f5t.js +1 -0
- package/dist/client/_nuxt/payload-f7ar9blu.js +1 -0
- package/dist/client/_nuxt/pinia-in67b2ff.js +1 -0
- package/dist/client/_nuxt/plugins-foc4m9cu.js +1 -0
- package/dist/client/_nuxt/{ready-dadbdj5i.js → ready-nmtplnq5.js} +1 -1
- package/dist/client/_nuxt/render-tree-mzpnvjww.js +1 -0
- package/dist/client/_nuxt/rpc-ga26o8l5.js +1 -0
- package/dist/client/_nuxt/runtime-configs-f691dtpr.js +1 -0
- package/dist/client/_nuxt/server-discovery-fa3lq0oe.js +1 -0
- package/dist/client/_nuxt/server-route-inputs-kx5eivj6.js +1 -0
- package/dist/client/_nuxt/server-routes-ozsawrbd.js +7 -0
- package/dist/client/_nuxt/server-tasks-sykxh8ji.js +1 -0
- package/dist/client/_nuxt/settings-eufw79s0.js +1 -0
- package/dist/client/_nuxt/{splitpanes.es-bxyirks2.js → splitpanes.es-krbzt5ww.js} +1 -1
- package/dist/client/_nuxt/stacktrace-list-ilvbql3y.js +1 -0
- package/dist/client/_nuxt/state-components-pfh0w3gz.js +1 -0
- package/dist/client/_nuxt/state-editor-c9yn0k8x.js +1 -0
- package/dist/client/_nuxt/state-modules-c35cpfly.js +1 -0
- package/dist/client/_nuxt/{state-tabs-etl5jr30.js → state-tabs-0wkipn6s.js} +1 -1
- package/dist/client/_nuxt/storage-dqgie6yp.js +1 -0
- package/dist/client/_nuxt/storage-options-fmhmng6m.js +1 -0
- package/dist/client/_nuxt/terminals-o5xyk44w.js +1 -0
- package/dist/client/_nuxt/timeline-hwj8vazt.js +31 -0
- package/dist/client/_nuxt/unocss-runtime-fghua2d1.js +1 -0
- package/dist/client/_nuxt/utils-c43quyky.js +2 -0
- package/dist/client/_nuxt/vendor/{json-editor-vue-eojr4v24.js → json-editor-vue-mpqfj7dd.js} +5 -5
- package/dist/client/_nuxt/vendor/{quicktype-core-k4qx3809.js → quicktype-core-bxh3g3c2.js} +2 -2
- package/dist/client/_nuxt/vendor/{shiki-lqo1hg2n.js → shiki-ildq90cv.js} +3 -3
- package/dist/client/_nuxt/vendor/{unocss-k727ub0h.js → unocss-hiscr44j.js} +1 -1
- package/dist/client/_nuxt/vendor/{vis-id8udisj.js → vis-obscvyyi.js} +2 -2
- package/dist/client/_nuxt/vendor/{xterm-ed0pys2e.js → xterm-g6v3jqah.js} +1 -1
- package/dist/client/_nuxt/virtual-files-ld5g0ep3.js +1 -0
- package/dist/client/_nuxt/vue-devtools-mcimudqm.js +4 -0
- package/dist/client/_nuxt/{vue-router-jbnxw7nb.js → vue-router-imuzx5c1.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/shared/{devtools.COlX0Gls.mjs → devtools.DClER4Dv.mjs} +1 -2
- package/package.json +15 -15
- package/dist/client/_nuxt/__blank-cpzbm3dn.js +0 -1
- package/dist/client/_nuxt/analyze-build-e7v5vkef.js +0 -1
- package/dist/client/_nuxt/assets-b5c187l4.js +0 -6
- package/dist/client/_nuxt/builds/meta/25fc8778-785e-4df1-8047-b131fc1cd4b2.json +0 -1
- package/dist/client/_nuxt/code-snippets-k81hoi4s.js +0 -1
- package/dist/client/_nuxt/components-bmictfph.js +0 -1
- package/dist/client/_nuxt/composable-item-cza22cup.js +0 -1
- package/dist/client/_nuxt/copkoh3j.js +0 -4
- package/dist/client/_nuxt/custom-_name_-gqm5kr56.js +0 -1
- package/dist/client/_nuxt/data-schema-button-b308wyi0.js +0 -1
- package/dist/client/_nuxt/data-schema-drawer-lr34uwsh.js +0 -2
- package/dist/client/_nuxt/debug-kgc8fptp.js +0 -1
- package/dist/client/_nuxt/dev-auth-ojiqold5.js +0 -1
- package/dist/client/_nuxt/duration-display-f7ucshmo.js +0 -1
- package/dist/client/_nuxt/entry.css-me26coxn.css +0 -1
- package/dist/client/_nuxt/error-404-nggtc73s.js +0 -1
- package/dist/client/_nuxt/error-404.css-j1aav08u.css +0 -1
- package/dist/client/_nuxt/error-500-dym2gzqx.js +0 -1
- package/dist/client/_nuxt/error-500.css-eu9fz4va.css +0 -1
- package/dist/client/_nuxt/error-fqinfa1x.js +0 -9
- package/dist/client/_nuxt/filepath-item-e1s52fbh.js +0 -1
- package/dist/client/_nuxt/full-et0weok9.js +0 -1
- package/dist/client/_nuxt/help-fab-hz6r2oxa.js +0 -1
- package/dist/client/_nuxt/hooks-i7nsduqp.js +0 -1
- package/dist/client/_nuxt/imports-9o2qs53q.js +0 -1
- package/dist/client/_nuxt/launch-page-hpkkqhit.js +0 -1
- package/dist/client/_nuxt/modules-jok0opuq.js +0 -1
- package/dist/client/_nuxt/nbadge-m66xoquo.js +0 -1
- package/dist/client/_nuxt/nbutton-gygn07c2.js +0 -1
- package/dist/client/_nuxt/ncard-mqcl8pso.js +0 -1
- package/dist/client/_nuxt/ncheckbox-c0r45qtu.js +0 -1
- package/dist/client/_nuxt/ncode-block-figzf35k.js +0 -2
- package/dist/client/_nuxt/ndrawer-bgqyrlmt.js +0 -1
- package/dist/client/_nuxt/ndropdown-cip8lboe.js +0 -1
- package/dist/client/_nuxt/nicon-m1crov2l.js +0 -1
- package/dist/client/_nuxt/nicon-title-tqdvw0w0.js +0 -1
- package/dist/client/_nuxt/nlink-od4lllbl.js +0 -1
- package/dist/client/_nuxt/nmarkdown-hw0hmqw7.js +0 -1
- package/dist/client/_nuxt/nnavbar-lpozm5fj.js +0 -1
- package/dist/client/_nuxt/none-bdxkqeml.js +0 -1
- package/dist/client/_nuxt/npanel-grids-dd23ifsw.js +0 -1
- package/dist/client/_nuxt/nsection-block-lqrohs9v.js +0 -1
- package/dist/client/_nuxt/nselect-gczoit0g.js +0 -1
- package/dist/client/_nuxt/nselect-tabs-bsw5fg3d.js +0 -1
- package/dist/client/_nuxt/nswitch-ke379yjx.js +0 -1
- package/dist/client/_nuxt/ntext-input-cygthohl.js +0 -1
- package/dist/client/_nuxt/ntip-ke63ovgc.js +0 -1
- package/dist/client/_nuxt/open-graph-lumhcitx.js +0 -3
- package/dist/client/_nuxt/overview-c1ufrox9.js +0 -1
- package/dist/client/_nuxt/pages-cf1hvns3.js +0 -1
- package/dist/client/_nuxt/pages-lgihsvbt.js +0 -1
- package/dist/client/_nuxt/payload-fvgw4hh9.js +0 -1
- package/dist/client/_nuxt/pinia-lmrgyjxw.js +0 -1
- package/dist/client/_nuxt/plugins-ccaip8nh.js +0 -1
- package/dist/client/_nuxt/render-tree-corj3giw.js +0 -1
- package/dist/client/_nuxt/rpc-ez4fzlum.js +0 -1
- package/dist/client/_nuxt/runtime-configs-im0uu24n.js +0 -1
- package/dist/client/_nuxt/server-discovery-ffkkczqi.js +0 -1
- package/dist/client/_nuxt/server-route-inputs-lspeoiem.js +0 -1
- package/dist/client/_nuxt/server-routes-dhvqrowz.js +0 -7
- package/dist/client/_nuxt/server-tasks-mr9ezn8q.js +0 -1
- package/dist/client/_nuxt/settings-issronwn.js +0 -1
- package/dist/client/_nuxt/stacktrace-list-hiui24c3.js +0 -1
- package/dist/client/_nuxt/state-components-fbls8ka7.js +0 -1
- package/dist/client/_nuxt/state-editor-c7e04uj2.js +0 -1
- package/dist/client/_nuxt/state-modules-inqbwd7z.js +0 -1
- package/dist/client/_nuxt/state-routes-jln33b1m.js +0 -1
- package/dist/client/_nuxt/storage-husj5pg6.js +0 -1
- package/dist/client/_nuxt/storage-options-cth3coln.js +0 -1
- package/dist/client/_nuxt/telemetry-eqv6a0hn.js +0 -1
- package/dist/client/_nuxt/terminals-kitd8oja.js +0 -1
- package/dist/client/_nuxt/timeline-gr4tcvcz.js +0 -31
- package/dist/client/_nuxt/unocss-runtime-cpug61u1.js +0 -1
- package/dist/client/_nuxt/utils-nbkl6byi.js +0 -2
- package/dist/client/_nuxt/virtual-files-ky9cc4av.js +0 -1
- package/dist/client/_nuxt/vue-devtools-dunhx2nz.js +0 -4
- /package/dist/client/_nuxt/{color-b9xoe9j2.js → color-bh8526bd.js} +0 -0
- /package/dist/client/_nuxt/{composables-b2ccklz4.js → composables-f0oa0ya0.js} +0 -0
- /package/dist/client/_nuxt/{constants-ih922r91.js → constants-g7ujya00.js} +0 -0
- /package/dist/client/_nuxt/{dist-m49wlq01.js → dist-f16b9vaq.js} +0 -0
- /package/dist/client/_nuxt/{mitt.es-fjx0h8xe.js → mitt.es-pc7qwi6p.js} +0 -0
- /package/dist/client/_nuxt/vendor/{markdown-it-ckeo8pwp.js → markdown-it-liuu8zo7.js} +0 -0
package/README.md
CHANGED
|
@@ -44,21 +44,100 @@ export default defineNuxtConfig({
|
|
|
44
44
|
})
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
### Opting in to v4.0
|
|
48
|
+
|
|
49
|
+
Nuxt DevTools v4.0 is currently in alpha. Since Nuxt ships with a built-in version of DevTools, you can opt-in to v4.0 by using package manager resolutions to override the bundled version:
|
|
50
|
+
|
|
51
|
+
<details>
|
|
52
|
+
<summary>npm</summary>
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"overrides": {
|
|
57
|
+
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
</details>
|
|
63
|
+
|
|
64
|
+
<details>
|
|
65
|
+
<summary>yarn</summary>
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"resolutions": {
|
|
70
|
+
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
</details>
|
|
76
|
+
|
|
77
|
+
<details>
|
|
78
|
+
<summary>pnpm</summary>
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"pnpm": {
|
|
83
|
+
"overrides": {
|
|
84
|
+
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
</details>
|
|
91
|
+
|
|
92
|
+
Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies.
|
|
93
|
+
|
|
47
94
|
### Nightly Release Channel
|
|
48
95
|
|
|
49
96
|
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.
|
|
50
97
|
|
|
51
|
-
You can opt-in to the nightly release channel by
|
|
98
|
+
You can opt-in to the nightly release channel by using package manager resolutions:
|
|
99
|
+
|
|
100
|
+
<details>
|
|
101
|
+
<summary>npm</summary>
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"overrides": {
|
|
106
|
+
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
</details>
|
|
112
|
+
|
|
113
|
+
<details>
|
|
114
|
+
<summary>yarn</summary>
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"resolutions": {
|
|
119
|
+
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
</details>
|
|
52
125
|
|
|
53
|
-
|
|
126
|
+
<details>
|
|
127
|
+
<summary>pnpm</summary>
|
|
128
|
+
|
|
129
|
+
```json
|
|
54
130
|
{
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
131
|
+
"pnpm": {
|
|
132
|
+
"overrides": {
|
|
133
|
+
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
|
|
134
|
+
}
|
|
58
135
|
}
|
|
59
136
|
}
|
|
60
137
|
```
|
|
61
138
|
|
|
139
|
+
</details>
|
|
140
|
+
|
|
62
141
|
Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies.
|
|
63
142
|
|
|
64
143
|
### Module Options
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import fs$1, {
|
|
1
|
+
import fs$1, { promises, statSync, realpathSync, readFileSync, existsSync, accessSync, constants } from 'node:fs';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import os, { homedir } from 'node:os';
|
|
4
4
|
import { logger, useNuxt, addVitePlugin, addPlugin, addTemplate, extendViteConfig, addImports } from '@nuxt/kit';
|
|
5
5
|
import { colors } from 'consola/utils';
|
|
6
|
-
import { join, dirname
|
|
6
|
+
import { join, dirname, resolve, isAbsolute } from 'pathe';
|
|
7
7
|
import sirv from 'sirv';
|
|
8
8
|
import { searchForWorkspaceRoot } from 'vite';
|
|
9
|
-
import { d as defaultAllowedExtensions, a as defaultTabOptions
|
|
10
|
-
import path, { dirname, join as join$1, relative, parse } from 'node:path';
|
|
11
|
-
import { hash } from 'ohash';
|
|
9
|
+
import { d as defaultAllowedExtensions, a as defaultTabOptions } from '../shared/devtools.DClER4Dv.mjs';
|
|
12
10
|
import { runtimeDir, clientDir, packageDir } from '../dirs.mjs';
|
|
13
|
-
import { createBirpcGroup } from 'birpc';
|
|
14
|
-
import { parse as parse$1, stringify } from 'structured-clone-es';
|
|
15
11
|
import { startSubprocess } from '@nuxt/devtools-kit';
|
|
16
12
|
import { x } from 'tinyexec';
|
|
17
13
|
import { glob } from 'tinyglobby';
|
|
14
|
+
import path, { relative, parse, dirname as dirname$1 } from 'node:path';
|
|
18
15
|
import { imageMeta } from 'image-meta';
|
|
19
16
|
import { debounce } from 'perfect-debounce';
|
|
20
17
|
import destr from 'destr';
|
|
21
18
|
import { setupHooksDebug } from '../../dist/runtime/shared/hooks.js';
|
|
19
|
+
import { hash } from 'ohash';
|
|
22
20
|
import process$1 from 'node:process';
|
|
23
21
|
import { builtinModules, createRequire } from 'node:module';
|
|
24
22
|
import { resolvePackageJSON, readPackageJSON } from 'pkg-types';
|
|
@@ -32,90 +30,7 @@ import { getDefaultExportOptions, addNuxtModule } from 'magicast/helpers';
|
|
|
32
30
|
import semver from 'semver';
|
|
33
31
|
import { normalizeBaseKey, normalizeKey } from 'unstorage';
|
|
34
32
|
|
|
35
|
-
const version$1 = "4.0.0-alpha.
|
|
36
|
-
|
|
37
|
-
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
38
|
-
function randomStr(size = 16, dict = urlAlphabet) {
|
|
39
|
-
let id = "";
|
|
40
|
-
let i = size;
|
|
41
|
-
const len = dict.length;
|
|
42
|
-
while (i--)
|
|
43
|
-
id += dict[Math.random() * len | 0];
|
|
44
|
-
return id;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function getHomeDir() {
|
|
48
|
-
return process.env.XDG_CONFIG_HOME || homedir();
|
|
49
|
-
}
|
|
50
|
-
async function readLocalOptions(defaults, options) {
|
|
51
|
-
const { filePath } = getOptionsFilepath(options);
|
|
52
|
-
if (existsSync(filePath)) {
|
|
53
|
-
try {
|
|
54
|
-
const options2 = {
|
|
55
|
-
...defaults,
|
|
56
|
-
...JSON.parse(await fs.readFile(filePath, "utf-8")).settings || {}
|
|
57
|
-
};
|
|
58
|
-
return options2;
|
|
59
|
-
} catch (e) {
|
|
60
|
-
console.error(`[DevTools] failed to parse local options file: ${filePath}, fallback to defaults`);
|
|
61
|
-
console.error(e);
|
|
62
|
-
return { ...defaults };
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
return { ...defaults };
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function getOptionsFilepath(options) {
|
|
69
|
-
let hashedKey;
|
|
70
|
-
if (options.key)
|
|
71
|
-
hashedKey = hash(`${options.root}:${options.key}`);
|
|
72
|
-
else
|
|
73
|
-
hashedKey = hash(options.root);
|
|
74
|
-
const home = getHomeDir();
|
|
75
|
-
const filePath = join(home, ".nuxt/devtools", `${hashedKey}.json`);
|
|
76
|
-
return {
|
|
77
|
-
filePath,
|
|
78
|
-
hashedKey
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
async function clearLocalOptions(options) {
|
|
82
|
-
const { filePath } = getOptionsFilepath(options);
|
|
83
|
-
if (existsSync(filePath))
|
|
84
|
-
await fs.unlink(filePath);
|
|
85
|
-
}
|
|
86
|
-
async function writeLocalOptions(settings, options) {
|
|
87
|
-
const { filePath, hashedKey } = getOptionsFilepath(options);
|
|
88
|
-
await fs.mkdir(dirname(filePath), { recursive: true });
|
|
89
|
-
await fs.writeFile(
|
|
90
|
-
filePath,
|
|
91
|
-
JSON.stringify(
|
|
92
|
-
{
|
|
93
|
-
root: options.root,
|
|
94
|
-
hash: hashedKey,
|
|
95
|
-
settings
|
|
96
|
-
},
|
|
97
|
-
null,
|
|
98
|
-
2
|
|
99
|
-
),
|
|
100
|
-
"utf-8"
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
let token;
|
|
105
|
-
async function getDevAuthToken() {
|
|
106
|
-
if (token)
|
|
107
|
-
return token;
|
|
108
|
-
const home = getHomeDir();
|
|
109
|
-
const dir = join$1(home, ".nuxt/devtools");
|
|
110
|
-
const filepath = join$1(dir, "dev-auth-token.txt");
|
|
111
|
-
if (existsSync(filepath))
|
|
112
|
-
token = (await fs.readFile(filepath, "utf-8")).trim();
|
|
113
|
-
if (!token)
|
|
114
|
-
token = randomStr(16);
|
|
115
|
-
await fs.mkdir(dir, { recursive: true });
|
|
116
|
-
await fs.writeFile(filepath, token, "utf-8");
|
|
117
|
-
return token;
|
|
118
|
-
}
|
|
33
|
+
const version$1 = "4.0.0-alpha.3";
|
|
119
34
|
|
|
120
35
|
const COLON_RE = /:/g;
|
|
121
36
|
function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
@@ -161,7 +76,7 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
161
76
|
});
|
|
162
77
|
for (const file of files2) {
|
|
163
78
|
const slug = JSON.parse(await fs.readFile(file, "utf-8")).slug;
|
|
164
|
-
const dir2 = dirname
|
|
79
|
+
const dir2 = dirname(file);
|
|
165
80
|
await fs.mkdir(devtoolsAnalyzeDir, { recursive: true });
|
|
166
81
|
await fs.rename(dir2, join(devtoolsAnalyzeDir, slug));
|
|
167
82
|
}
|
|
@@ -172,7 +87,7 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
172
87
|
absolute: true
|
|
173
88
|
});
|
|
174
89
|
builds = await Promise.all(files.map(async (file) => {
|
|
175
|
-
const dir = dirname
|
|
90
|
+
const dir = dirname(file);
|
|
176
91
|
const json = JSON.parse(await fs.readFile(file, "utf-8"));
|
|
177
92
|
return {
|
|
178
93
|
...json,
|
|
@@ -9275,7 +9190,7 @@ async function extractExports(name, url, cache = true) {
|
|
|
9275
9190
|
return JSON.parse(await promises.readFile(cachePath, "utf-8"));
|
|
9276
9191
|
const scanned = await resolveModuleExportNames(name, { url });
|
|
9277
9192
|
if (useCache) {
|
|
9278
|
-
await promises.mkdir(dirname
|
|
9193
|
+
await promises.mkdir(dirname(cachePath), { recursive: true });
|
|
9279
9194
|
await promises.writeFile(cachePath, JSON.stringify(scanned), "utf-8");
|
|
9280
9195
|
}
|
|
9281
9196
|
return scanned;
|
|
@@ -10256,6 +10171,63 @@ function safeKey(key) {
|
|
|
10256
10171
|
return JSON.stringify(key);
|
|
10257
10172
|
}
|
|
10258
10173
|
|
|
10174
|
+
function getHomeDir() {
|
|
10175
|
+
return process.env.XDG_CONFIG_HOME || homedir();
|
|
10176
|
+
}
|
|
10177
|
+
async function readLocalOptions(defaults, options) {
|
|
10178
|
+
const { filePath } = getOptionsFilepath(options);
|
|
10179
|
+
if (existsSync(filePath)) {
|
|
10180
|
+
try {
|
|
10181
|
+
const options2 = {
|
|
10182
|
+
...defaults,
|
|
10183
|
+
...JSON.parse(await fs.readFile(filePath, "utf-8")).settings || {}
|
|
10184
|
+
};
|
|
10185
|
+
return options2;
|
|
10186
|
+
} catch (e) {
|
|
10187
|
+
console.error(`[DevTools] failed to parse local options file: ${filePath}, fallback to defaults`);
|
|
10188
|
+
console.error(e);
|
|
10189
|
+
return { ...defaults };
|
|
10190
|
+
}
|
|
10191
|
+
} else {
|
|
10192
|
+
return { ...defaults };
|
|
10193
|
+
}
|
|
10194
|
+
}
|
|
10195
|
+
function getOptionsFilepath(options) {
|
|
10196
|
+
let hashedKey;
|
|
10197
|
+
if (options.key)
|
|
10198
|
+
hashedKey = hash(`${options.root}:${options.key}`);
|
|
10199
|
+
else
|
|
10200
|
+
hashedKey = hash(options.root);
|
|
10201
|
+
const home = getHomeDir();
|
|
10202
|
+
const filePath = join(home, ".nuxt/devtools", `${hashedKey}.json`);
|
|
10203
|
+
return {
|
|
10204
|
+
filePath,
|
|
10205
|
+
hashedKey
|
|
10206
|
+
};
|
|
10207
|
+
}
|
|
10208
|
+
async function clearLocalOptions(options) {
|
|
10209
|
+
const { filePath } = getOptionsFilepath(options);
|
|
10210
|
+
if (existsSync(filePath))
|
|
10211
|
+
await fs.unlink(filePath);
|
|
10212
|
+
}
|
|
10213
|
+
async function writeLocalOptions(settings, options) {
|
|
10214
|
+
const { filePath, hashedKey } = getOptionsFilepath(options);
|
|
10215
|
+
await fs.mkdir(dirname$1(filePath), { recursive: true });
|
|
10216
|
+
await fs.writeFile(
|
|
10217
|
+
filePath,
|
|
10218
|
+
JSON.stringify(
|
|
10219
|
+
{
|
|
10220
|
+
root: options.root,
|
|
10221
|
+
hash: hashedKey,
|
|
10222
|
+
settings
|
|
10223
|
+
},
|
|
10224
|
+
null,
|
|
10225
|
+
2
|
|
10226
|
+
),
|
|
10227
|
+
"utf-8"
|
|
10228
|
+
);
|
|
10229
|
+
}
|
|
10230
|
+
|
|
10259
10231
|
let options;
|
|
10260
10232
|
function getOptions() {
|
|
10261
10233
|
return options;
|
|
@@ -10306,7 +10278,6 @@ function setupOptionsRPC({ nuxt }) {
|
|
|
10306
10278
|
|
|
10307
10279
|
const ABSOLUTE_PATH_RE = /^[a-z]:|^\//i;
|
|
10308
10280
|
const FILE_LINE_COL_RE = /^(.*?)(:[:\d]*)$/;
|
|
10309
|
-
const MULTIPLE_SLASHES_RE$1 = /\/+/g;
|
|
10310
10281
|
const NUXT_WELCOME_RE = /<NuxtWelcome\s*\/>/;
|
|
10311
10282
|
function setupGeneralRPC({
|
|
10312
10283
|
nuxt,
|
|
@@ -10517,7 +10488,7 @@ const route = useRoute()
|
|
|
10517
10488
|
</div>
|
|
10518
10489
|
</template>
|
|
10519
10490
|
`;
|
|
10520
|
-
await fs.mkdir(dirname
|
|
10491
|
+
await fs.mkdir(dirname(pathPageIndex), { recursive: true });
|
|
10521
10492
|
await fs.writeFile(pathPageIndex, pagesIndexTemplate, "utf-8");
|
|
10522
10493
|
let appContent = existsSync(pathApp) ? await fs.readFile(pathApp, "utf-8") : void 0;
|
|
10523
10494
|
if (appContent && !appContent.includes("<NuxtPage")) {
|
|
@@ -10531,35 +10502,14 @@ const route = useRoute()
|
|
|
10531
10502
|
logger.info("Restarting Nuxt...");
|
|
10532
10503
|
return nuxt.callHook("restart", { hard });
|
|
10533
10504
|
},
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
const token = await getDevAuthToken();
|
|
10538
|
-
origin ||= `${nuxt.options.devServer.https ? "https" : "http"}://${nuxt.options.devServer.host === "::" ? "localhost" : nuxt.options.devServer.host || "localhost"}:${nuxt.options.devServer.port}`;
|
|
10539
|
-
const ROUTE_AUTH = `${nuxt.options.app.baseURL || "/"}/__nuxt_devtools__/auth`.replace(MULTIPLE_SLASHES_RE$1, "/");
|
|
10540
|
-
const message = [
|
|
10541
|
-
`A browser is requesting permissions of ${colors.bold(colors.yellow("writing files and running commands"))} from the DevTools UI.`,
|
|
10542
|
-
colors.bold(info || "Unknown"),
|
|
10543
|
-
"",
|
|
10544
|
-
"Please open the following URL in the browser:",
|
|
10545
|
-
colors.bold(colors.green(`${origin}${ROUTE_AUTH}?token=${token}`)),
|
|
10546
|
-
"",
|
|
10547
|
-
"Or manually copy and paste the following token:",
|
|
10548
|
-
colors.bold(colors.cyan(token))
|
|
10549
|
-
];
|
|
10550
|
-
logger.box({
|
|
10551
|
-
message: message.join("\n"),
|
|
10552
|
-
title: colors.bold(colors.yellow(" Permission Request ")),
|
|
10553
|
-
style: {
|
|
10554
|
-
borderColor: "yellow",
|
|
10555
|
-
borderStyle: "rounded"
|
|
10556
|
-
}
|
|
10557
|
-
});
|
|
10505
|
+
/** @deprecated Auth is now handled by Vite DevTools */
|
|
10506
|
+
async requestForAuth() {
|
|
10507
|
+
logger.warn("[nuxt-devtools] `requestForAuth` is deprecated. Auth is now handled by Vite DevTools.");
|
|
10558
10508
|
},
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
return
|
|
10509
|
+
/** @deprecated Auth is now handled by Vite DevTools */
|
|
10510
|
+
async verifyAuthToken() {
|
|
10511
|
+
logger.warn("[nuxt-devtools] `verifyAuthToken` is deprecated. Auth is now handled by Vite DevTools.");
|
|
10512
|
+
return true;
|
|
10563
10513
|
}
|
|
10564
10514
|
};
|
|
10565
10515
|
}
|
|
@@ -11703,40 +11653,65 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
11703
11653
|
function setupRPC(nuxt, options) {
|
|
11704
11654
|
const serverFunctions = {};
|
|
11705
11655
|
const extendedRpcMap = /* @__PURE__ */ new Map();
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
{
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11656
|
+
let rpcHost;
|
|
11657
|
+
const pendingBroadcasts = [];
|
|
11658
|
+
function broadcast(method, ...args) {
|
|
11659
|
+
if (!rpcHost) {
|
|
11660
|
+
pendingBroadcasts.push({ method, args });
|
|
11661
|
+
return;
|
|
11662
|
+
}
|
|
11663
|
+
rpcHost.broadcast({
|
|
11664
|
+
method,
|
|
11665
|
+
args,
|
|
11666
|
+
event: true
|
|
11667
|
+
});
|
|
11668
|
+
}
|
|
11669
|
+
function createBroadcastProxy(prefix = "") {
|
|
11670
|
+
return new Proxy({}, {
|
|
11671
|
+
get: (_, method) => {
|
|
11672
|
+
if (typeof method !== "string")
|
|
11714
11673
|
return;
|
|
11715
|
-
const
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11674
|
+
const fullMethod = prefix ? `${prefix}:${method}` : method;
|
|
11675
|
+
const fn = (...args) => broadcast(fullMethod, ...args);
|
|
11676
|
+
fn.asEvent = (...args) => broadcast(fullMethod, ...args);
|
|
11677
|
+
return fn;
|
|
11678
|
+
}
|
|
11679
|
+
});
|
|
11680
|
+
}
|
|
11681
|
+
const functionsProxy = new Proxy(serverFunctions, {
|
|
11682
|
+
set(target, prop, value) {
|
|
11683
|
+
target[prop] = value;
|
|
11684
|
+
if (rpcHost && typeof prop === "string") {
|
|
11685
|
+
if (rpcHost.has(prop)) {
|
|
11686
|
+
rpcHost.update({ name: prop, handler: value });
|
|
11687
|
+
} else {
|
|
11688
|
+
rpcHost.register({ name: prop, handler: value });
|
|
11689
|
+
}
|
|
11690
|
+
}
|
|
11691
|
+
return true;
|
|
11725
11692
|
}
|
|
11726
|
-
);
|
|
11693
|
+
});
|
|
11694
|
+
const rpc = {
|
|
11695
|
+
broadcast: createBroadcastProxy(),
|
|
11696
|
+
functions: functionsProxy
|
|
11697
|
+
};
|
|
11727
11698
|
function refresh(event) {
|
|
11728
|
-
|
|
11699
|
+
broadcast("refresh", event);
|
|
11729
11700
|
}
|
|
11730
11701
|
function extendServerRpc(namespace, functions) {
|
|
11731
11702
|
extendedRpcMap.set(namespace, functions);
|
|
11732
|
-
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
return;
|
|
11737
|
-
return rpc.broadcast[`${namespace}:${key}`];
|
|
11703
|
+
if (rpcHost) {
|
|
11704
|
+
for (const [fnName, handler] of Object.entries(functions)) {
|
|
11705
|
+
if (typeof handler === "function") {
|
|
11706
|
+
rpcHost.register({ name: `${namespace}:${fnName}`, handler });
|
|
11738
11707
|
}
|
|
11739
|
-
}
|
|
11708
|
+
}
|
|
11709
|
+
}
|
|
11710
|
+
return {
|
|
11711
|
+
broadcast: createBroadcastProxy(namespace),
|
|
11712
|
+
functions,
|
|
11713
|
+
clients: [],
|
|
11714
|
+
updateChannels: () => []
|
|
11740
11715
|
};
|
|
11741
11716
|
}
|
|
11742
11717
|
const ctx = {
|
|
@@ -11746,11 +11721,9 @@ function setupRPC(nuxt, options) {
|
|
|
11746
11721
|
refresh,
|
|
11747
11722
|
extendServerRpc,
|
|
11748
11723
|
openInEditorHooks: [],
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
if (token !== await getDevAuthToken())
|
|
11753
|
-
throw new Error("[Nuxt DevTools] Invalid dev auth token.");
|
|
11724
|
+
/** @deprecated Auth is now handled by Vite DevTools */
|
|
11725
|
+
async ensureDevAuthToken(_token) {
|
|
11726
|
+
logger.warn("[nuxt-devtools] `ensureDevAuthToken` is deprecated. Auth is now handled by Vite DevTools.");
|
|
11754
11727
|
}
|
|
11755
11728
|
};
|
|
11756
11729
|
nuxt.devtools = ctx;
|
|
@@ -11769,48 +11742,47 @@ function setupRPC(nuxt, options) {
|
|
|
11769
11742
|
...setupTelemetryRPC(ctx),
|
|
11770
11743
|
...setupServerDataRPC(ctx)
|
|
11771
11744
|
});
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
on: (fn) => {
|
|
11785
|
-
ws.on("message", (e) => {
|
|
11786
|
-
try {
|
|
11787
|
-
const data = JSON.parse(String(e)) || {};
|
|
11788
|
-
if (data.type === "custom" && data.event === WS_EVENT_NAME) {
|
|
11789
|
-
fn(data.data);
|
|
11790
|
-
}
|
|
11791
|
-
} catch {
|
|
11792
|
-
}
|
|
11793
|
-
});
|
|
11794
|
-
},
|
|
11795
|
-
serialize: stringify,
|
|
11796
|
-
deserialize: parse$1
|
|
11797
|
-
};
|
|
11798
|
-
rpc.updateChannels((c) => {
|
|
11799
|
-
c.push(channel);
|
|
11800
|
-
});
|
|
11801
|
-
ws.on("close", () => {
|
|
11802
|
-
wsClients.delete(ws);
|
|
11803
|
-
rpc.updateChannels((c) => {
|
|
11804
|
-
const index = c.indexOf(channel);
|
|
11805
|
-
if (index >= 0)
|
|
11806
|
-
c.splice(index, 1);
|
|
11745
|
+
function connectRpcHost(host) {
|
|
11746
|
+
rpcHost = host;
|
|
11747
|
+
for (const { method, args } of pendingBroadcasts) {
|
|
11748
|
+
broadcast(method, ...args);
|
|
11749
|
+
}
|
|
11750
|
+
pendingBroadcasts.length = 0;
|
|
11751
|
+
for (const [name, handler] of Object.entries(serverFunctions)) {
|
|
11752
|
+
if (typeof handler === "function") {
|
|
11753
|
+
try {
|
|
11754
|
+
host.register({
|
|
11755
|
+
name,
|
|
11756
|
+
handler
|
|
11807
11757
|
});
|
|
11808
|
-
})
|
|
11809
|
-
|
|
11758
|
+
} catch (e) {
|
|
11759
|
+
logger.warn(
|
|
11760
|
+
colors.yellow(`[nuxt-devtools] Failed to register RPC function "${name}":
|
|
11761
|
+
`) + colors.red(e?.message || "")
|
|
11762
|
+
);
|
|
11763
|
+
}
|
|
11764
|
+
}
|
|
11810
11765
|
}
|
|
11811
|
-
|
|
11766
|
+
for (const [namespace, fns] of extendedRpcMap) {
|
|
11767
|
+
for (const [fnName, handler] of Object.entries(fns)) {
|
|
11768
|
+
if (typeof handler === "function") {
|
|
11769
|
+
try {
|
|
11770
|
+
host.register({
|
|
11771
|
+
name: `${namespace}:${fnName}`,
|
|
11772
|
+
handler
|
|
11773
|
+
});
|
|
11774
|
+
} catch (e) {
|
|
11775
|
+
logger.warn(
|
|
11776
|
+
colors.yellow(`[nuxt-devtools] Failed to register RPC function "${namespace}:${fnName}":
|
|
11777
|
+
`) + colors.red(e?.message || "")
|
|
11778
|
+
);
|
|
11779
|
+
}
|
|
11780
|
+
}
|
|
11781
|
+
}
|
|
11782
|
+
}
|
|
11783
|
+
}
|
|
11812
11784
|
return {
|
|
11813
|
-
|
|
11785
|
+
connectRpcHost,
|
|
11814
11786
|
...ctx
|
|
11815
11787
|
};
|
|
11816
11788
|
}
|
|
@@ -11830,6 +11802,9 @@ async function enableModule(options, nuxt) {
|
|
|
11830
11802
|
return;
|
|
11831
11803
|
}
|
|
11832
11804
|
await nuxt.callHook("devtools:before");
|
|
11805
|
+
if (nuxt.options.devtools && typeof nuxt.options.devtools !== "boolean" && "disableAuthorization" in nuxt.options.devtools) {
|
|
11806
|
+
logger.warn("[nuxt-devtools] `disableAuthorization` option is deprecated. Auth is now handled by Vite DevTools.");
|
|
11807
|
+
}
|
|
11833
11808
|
if (options.iframeProps) {
|
|
11834
11809
|
nuxt.options.runtimeConfig.app.devtools ||= {};
|
|
11835
11810
|
nuxt.options.runtimeConfig.app.devtools.iframeProps = options.iframeProps;
|
|
@@ -11845,6 +11820,7 @@ async function enableModule(options, nuxt) {
|
|
|
11845
11820
|
});
|
|
11846
11821
|
const DevTools = await import('@vitejs/devtools').then((r) => r.DevTools());
|
|
11847
11822
|
addVitePlugin(DevTools);
|
|
11823
|
+
let connectRpcHost;
|
|
11848
11824
|
addVitePlugin(defineViteDevToolsPlugin({
|
|
11849
11825
|
name: "nuxt:devtools",
|
|
11850
11826
|
devtools: {
|
|
@@ -11856,6 +11832,7 @@ async function enableModule(options, nuxt) {
|
|
|
11856
11832
|
title: "Nuxt DevTools",
|
|
11857
11833
|
url: "/__nuxt_devtools__/client/"
|
|
11858
11834
|
});
|
|
11835
|
+
connectRpcHost?.(ctx2.rpc);
|
|
11859
11836
|
}
|
|
11860
11837
|
}
|
|
11861
11838
|
}));
|
|
@@ -11898,10 +11875,10 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
11898
11875
|
config.plugins.unshift(join(runtimeDir, "nitro/inline"));
|
|
11899
11876
|
});
|
|
11900
11877
|
const {
|
|
11901
|
-
|
|
11878
|
+
connectRpcHost: _connectRpcHost,
|
|
11902
11879
|
...ctx
|
|
11903
11880
|
} = setupRPC(nuxt, options);
|
|
11904
|
-
|
|
11881
|
+
connectRpcHost = _connectRpcHost;
|
|
11905
11882
|
const clientDirExists = existsSync(clientDir);
|
|
11906
11883
|
extendViteConfig((config) => {
|
|
11907
11884
|
config.server ||= {};
|
|
@@ -11923,8 +11900,6 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
11923
11900
|
});
|
|
11924
11901
|
const ROUTE_PATH = `${nuxt.options.app.baseURL || "/"}/__nuxt_devtools__`.replace(MULTIPLE_SLASHES_RE, "/");
|
|
11925
11902
|
const ROUTE_CLIENT = `${ROUTE_PATH}/client`;
|
|
11926
|
-
const ROUTE_AUTH = `${ROUTE_PATH}/auth`;
|
|
11927
|
-
const ROUTE_AUTH_VERIFY = `${ROUTE_PATH}/auth-verify`;
|
|
11928
11903
|
const ROUTE_ANALYZE = `${ROUTE_PATH}/analyze`;
|
|
11929
11904
|
nuxt.hook("vite:serverCreated", (server) => {
|
|
11930
11905
|
const devtoolsAnalyzeDir = join(nuxt.options.rootDir, "node_modules/.cache/nuxt-devtools/analyze");
|
|
@@ -11948,27 +11923,6 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
11948
11923
|
return handleStatic(req, res, () => handleIndex(res));
|
|
11949
11924
|
});
|
|
11950
11925
|
}
|
|
11951
|
-
server.middlewares.use(ROUTE_AUTH, sirv(join(runtimeDir, "auth"), { single: true, dev: true }));
|
|
11952
|
-
server.middlewares.use(ROUTE_AUTH_VERIFY, async (req, res) => {
|
|
11953
|
-
const search = req.url?.split("?")[1];
|
|
11954
|
-
if (!search) {
|
|
11955
|
-
res.statusCode = 400;
|
|
11956
|
-
res.end("No token provided");
|
|
11957
|
-
}
|
|
11958
|
-
const query = new URLSearchParams(search);
|
|
11959
|
-
const token = query.get("token");
|
|
11960
|
-
if (!token) {
|
|
11961
|
-
res.statusCode = 400;
|
|
11962
|
-
res.end("No token provided");
|
|
11963
|
-
}
|
|
11964
|
-
if (token === await getDevAuthToken()) {
|
|
11965
|
-
res.statusCode = 200;
|
|
11966
|
-
res.end("Valid token");
|
|
11967
|
-
} else {
|
|
11968
|
-
res.statusCode = 403;
|
|
11969
|
-
res.end("Invalid token");
|
|
11970
|
-
}
|
|
11971
|
-
});
|
|
11972
11926
|
});
|
|
11973
11927
|
await import('./plugin-metrics.mjs').then(({ setup }) => setup(ctx));
|
|
11974
11928
|
if (options.vueDevTools !== false)
|
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/h9sdxxta.js"}}</script><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-d9crsfkn.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-lkbe0qhh.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-3gd0e2sv.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/h9sdxxta.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/_plugin-vue_export-helper-n58akrbk.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/rolldown-runtime-oipoa1or.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-mpqfj7dd.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/utils-c43quyky.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-ildq90cv.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/rpc-ga26o8l5.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ready-nmtplnq5.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dist-mnod32r1.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-bl8ryhiw.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue-router-imuzx5c1.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-hiscr44j.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-link-h8a2u03t.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dist-duc3zu0y.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/splitpanes.es-krbzt5ww.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dev-auth-h6radlhi.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncard-bpchuz30.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nicon-o8vtl3nv.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/state-tabs-0wkipn6s.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/storage-options-fmhmng6m.js"><script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/h9sdxxta.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"424f9fd7-bd33-4b1e-8498-929c14b6ad71",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1774256481223,false]</script></body></html>
|