@nuxt/devtools 1.6.1 → 1.6.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/dist/chunks/analyze-build.mjs +3 -2
- package/dist/chunks/module-main.mjs +94 -43
- package/dist/chunks/vite-inspect.mjs +6 -4
- package/dist/chunks/vscode.mjs +1 -1
- package/dist/client/200.html +17 -17
- package/dist/client/404.html +17 -17
- package/dist/client/_nuxt/__blank-de0hkpjk.js +1 -0
- package/dist/client/_nuxt/analyze-build-j23co4xl.js +1 -0
- package/dist/client/_nuxt/{assets-jvf69cxf.js → assets-gveiuobi.js} +1 -1
- package/dist/client/_nuxt/b04z4mtb.js +17 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/9de2d2d7-41a1-455e-a918-e709c65a4eef.json +1 -0
- package/dist/client/_nuxt/{client-dgt05ivb.js → client-h8sz7blv.js} +1 -1
- package/dist/client/_nuxt/{code-diff.vue-i05ynbel.js → code-diff.vue-d033ilzm.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-17pri79b.js → code-snippets.vue-dfzf4hjg.js} +1 -1
- package/dist/client/_nuxt/components-di4szfh1.js +1 -0
- package/dist/client/_nuxt/{components-tree-gcdwuwyn.js → components-tree-kvov1ov6.js} +1 -1
- package/dist/client/_nuxt/{composable-item.vue-ihurs8kc.js → composable-item.vue-hct37ofv.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_-ik277266.js → custom-_name_-lkfamiei.js} +1 -1
- package/dist/client/_nuxt/default-mov6ggbr.js +1 -0
- package/dist/client/_nuxt/{duration-display.vue-n7a3864v.js → duration-display.vue-eesjgxfp.js} +1 -1
- package/dist/client/_nuxt/entry.css-nccln8bf.css +1 -0
- package/dist/client/_nuxt/{error-404-chhw212o.js → error-404-o0v6zwya.js} +1 -1
- package/dist/client/_nuxt/error-404.css-jbmkerk1.css +1 -0
- package/dist/client/_nuxt/{error-500-oi6j6wh4.js → error-500-nvrn53d3.js} +1 -1
- package/dist/client/_nuxt/error-500.css-ey2nctyr.css +1 -0
- package/dist/client/_nuxt/{error-kcw3c5n2.js → error-nplhidsi.js} +2 -2
- package/dist/client/_nuxt/{filepath-item.vue-jp3k05dh.js → filepath-item.vue-fxcmp74h.js} +1 -1
- package/dist/client/_nuxt/full-di1z4oob.js +1 -0
- package/dist/client/_nuxt/{help-fab.vue-kqlhhn29.js → help-fab.vue-bn738d5b.js} +1 -1
- package/dist/client/_nuxt/{hooks-bbeec6rm.js → hooks-hq8uyu2l.js} +1 -1
- package/dist/client/_nuxt/imports-kl1hqkd2.js +1 -0
- package/dist/client/_nuxt/{index-h6urifqi.js → index-gevf5c2a.js} +1 -1
- package/dist/client/_nuxt/{index-f7gtpn4a.js → index-gl2r4pge.js} +2 -2
- package/dist/client/_nuxt/launch-page.vue-mooqljf0.js +1 -0
- package/dist/client/_nuxt/{modules-dckgmu9u.js → modules-oz44fq8t.js} +1 -1
- package/dist/client/_nuxt/nbadge-ijt69lj7.js +1 -0
- package/dist/client/_nuxt/{ncheckbox.vue-ir8t2t9x.js → ncheckbox.vue-nkgx3uyq.js} +1 -1
- package/dist/client/_nuxt/{ncode-block.css-enx2fys6.css → ncode-block.css-c9cb29at.css} +1 -1
- package/dist/client/_nuxt/{ncode-block.vue-d334f2dp.js → ncode-block.vue-ljovji7o.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-fdnlfvql.js → ndrawer.vue-7slc0a0y.js} +1 -1
- package/dist/client/_nuxt/{ndropdown.vue-haoov59z.js → ndropdown.vue-707esowt.js} +1 -1
- package/dist/client/_nuxt/{nicon-title.vue-ef3vf9hr.js → nicon-title.vue-fq2kswl5.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-eq8gk3iz.js → nlink.vue-o5cnbwht.js} +1 -1
- package/dist/client/_nuxt/{nmarkdown.vue-bwv440ol.js → nmarkdown.vue-e812br8q.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-jap952ju.js → nnavbar.vue-npaum0f1.js} +1 -1
- package/dist/client/_nuxt/none-kkznunwn.js +1 -0
- package/dist/client/_nuxt/{nsection-block-hjiyf44n.js → nsection-block-nwjsicuf.js} +1 -1
- package/dist/client/_nuxt/nsection-block.css-e7kbjm7k.css +1 -0
- package/dist/client/_nuxt/{nselect-tabs.vue-ctgj28x2.js → nselect-tabs.vue-o8nb5cg8.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-kb4ychx8.js → nselect.vue-ftj5oit6.js} +1 -1
- package/dist/client/_nuxt/{open-graph-fwcucpwr.js → open-graph-o1nebcdd.js} +2 -2
- package/dist/client/_nuxt/{overview-du74wcc9.js → overview-g8z27615.js} +1 -1
- package/dist/client/_nuxt/pages-o9jycrzn.js +1 -0
- package/dist/client/_nuxt/payload-m2o6yfwm.js +1 -0
- package/dist/client/_nuxt/pinia-ia7yx3pb.js +1 -0
- package/dist/client/_nuxt/plugins-lylckcgn.js +1 -0
- package/dist/client/_nuxt/runtime-configs-eb4rnmru.js +1 -0
- package/dist/client/_nuxt/{server-route-inputs.vue-hs0k8usl.js → server-route-inputs.vue-mqgmbgbg.js} +1 -1
- package/dist/client/_nuxt/{server-routes-chengpen.js → server-routes-kvmgxxaj.js} +1 -1
- package/dist/client/_nuxt/server-tasks-d8o9ub0x.js +1 -0
- package/dist/client/_nuxt/settings-ewfhwgou.js +1 -0
- package/dist/client/_nuxt/{stacktrace-list.vue-n51hjl65.js → stacktrace-list.vue-znh71v05.js} +1 -1
- package/dist/client/_nuxt/{state-components-j9dsopcn.js → state-components-clf8fxbn.js} +1 -1
- package/dist/client/_nuxt/{state-editor.vue-eev8247c.js → state-editor.vue-g0afnqvy.js} +1 -1
- package/dist/client/_nuxt/{state-modules-jx57qxz7.js → state-modules-t9odg4rk.js} +1 -1
- package/dist/client/_nuxt/{storage-c7x4faia.js → storage-m7qw796t.js} +1 -1
- package/dist/client/_nuxt/terminals-c4kt82na.js +1 -0
- package/dist/client/_nuxt/{timeline-bpt56wqz.js → timeline-kgvttrkl.js} +2 -2
- package/dist/client/_nuxt/{unocss-runtime-ks657l4w.js → unocss-runtime-e1m6uiw9.js} +1 -1
- package/dist/client/_nuxt/vendor/json-editor-vue-nhjd65sz.js +3818 -0
- package/dist/client/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css +1 -0
- package/dist/client/_nuxt/vendor/shiki-enrzjv18.js +57 -0
- package/dist/client/_nuxt/vendor/unocss-pcs99qrd.js +2 -0
- package/dist/client/_nuxt/vendor/unocss.css-mhvipxpl.css +1 -0
- package/dist/client/_nuxt/vendor/{xterm-h0ftnevm.js → xterm-dbpzgj7s.js} +3 -3
- package/dist/client/_nuxt/vendor/xterm.css-egmhki83.css +32 -0
- package/dist/client/_nuxt/virtual-files-bbwlwv17.js +1 -0
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-dbbmx9wu.js → vue-virtual-scroller.esm-f2cudvpd.js} +1 -1
- package/dist/client/index.html +17 -17
- package/dist/dirs.mjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/devtools.client.js +1 -1
- package/dist/runtime/plugins/view/client.d.ts +1 -1
- package/dist/runtime/plugins/view/client.js +1 -1
- package/dist/runtime/plugins/view/state.d.ts +1 -1
- package/dist/shared/{devtools.68e43ed6.mjs → devtools.5ac54dae.mjs} +1 -1
- package/package.json +41 -41
- package/dist/client/_nuxt/__blank-9iu4tv0f.js +0 -1
- package/dist/client/_nuxt/analyze-build-nqeql2rs.js +0 -1
- package/dist/client/_nuxt/builds/meta/ab41567e-1b8e-4e48-840c-591dd62a1246.json +0 -1
- package/dist/client/_nuxt/components-d1yojeh6.js +0 -1
- package/dist/client/_nuxt/default-c97elafe.js +0 -1
- package/dist/client/_nuxt/entry.css-kzp9yj98.css +0 -1
- package/dist/client/_nuxt/error-404.css-l9hojrit.css +0 -1
- package/dist/client/_nuxt/error-500.css-jiufalsw.css +0 -1
- package/dist/client/_nuxt/full-j1e8c0fm.js +0 -1
- package/dist/client/_nuxt/imports-cadcbs1b.js +0 -1
- package/dist/client/_nuxt/launch-page.vue-opmg26gw.js +0 -1
- package/dist/client/_nuxt/nbadge-ggvrch1r.js +0 -1
- package/dist/client/_nuxt/none-oo3u4xub.js +0 -1
- package/dist/client/_nuxt/nsection-block.css-nz74xks7.css +0 -1
- package/dist/client/_nuxt/nxp3p1l5.js +0 -16
- package/dist/client/_nuxt/pages-m3ksw3nx.js +0 -1
- package/dist/client/_nuxt/payload-np4rk8uw.js +0 -1
- package/dist/client/_nuxt/pinia-n87t5bm8.js +0 -1
- package/dist/client/_nuxt/plugins-jcz0d5g6.js +0 -1
- package/dist/client/_nuxt/runtime-configs-h7di7gvu.js +0 -1
- package/dist/client/_nuxt/server-tasks-il5b1l64.js +0 -1
- package/dist/client/_nuxt/settings-k964fibj.js +0 -1
- package/dist/client/_nuxt/terminals-lb2z98e5.js +0 -1
- package/dist/client/_nuxt/vendor/json-editor-vue-f126ciji.js +0 -124
- package/dist/client/_nuxt/vendor/json-editor-vue.css-o0jf01nd.css +0 -1
- package/dist/client/_nuxt/vendor/shiki-hhqxa887.js +0 -161
- package/dist/client/_nuxt/vendor/unocss-mnpxkox6.js +0 -2
- package/dist/client/_nuxt/vendor/unocss.css-na153c8v.css +0 -1
- package/dist/client/_nuxt/vendor/xterm.css-egivkam7.css +0 -1
- package/dist/client/_nuxt/virtual-files-o77aoqwj.js +0 -1
- /package/dist/client/_nuxt/{assets.css-l0xw7n9m.css → assets.css-hmxl533k.css} +0 -0
- /package/dist/client/_nuxt/{help-fab.css-l22fo390.css → help-fab.css-ms50khsu.css} +0 -0
- /package/dist/client/_nuxt/{open-graph.css-np61an3p.css → open-graph.css-e21qzmvj.css} +0 -0
- /package/dist/client/_nuxt/{terminals.css-o071tnq5.css → terminals.css-mejv43xm.css} +0 -0
- /package/dist/client/_nuxt/{timeline.css-i7fpg75n.css → timeline.css-lhkpu01p.css} +0 -0
- /package/dist/client/_nuxt/{virtual-files.css-i6taatd1.css → virtual-files.css-gqpg2wnb.css} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { addVitePlugin } from '@nuxt/kit';
|
|
2
2
|
import { resolve, join } from 'pathe';
|
|
3
|
-
import Inspect from 'vite-plugin-inspect';
|
|
4
3
|
import { readdir, lstat } from 'node:fs/promises';
|
|
4
|
+
import { createVitePluginInspect } from './vite-inspect.mjs';
|
|
5
|
+
import '@nuxt/devtools-kit';
|
|
5
6
|
|
|
6
7
|
async function getFolderSize(dir) {
|
|
7
8
|
const dirents = await readdir(dir, {
|
|
@@ -38,7 +39,7 @@ async function getFolderSize(dir) {
|
|
|
38
39
|
async function setup(nuxt, options) {
|
|
39
40
|
if (options.viteInspect !== false) {
|
|
40
41
|
addVitePlugin(
|
|
41
|
-
|
|
42
|
+
await createVitePluginInspect({
|
|
42
43
|
build: true,
|
|
43
44
|
outputDir: join(nuxt.options.analyzeDir, ".vite-inspect")
|
|
44
45
|
})
|
|
@@ -6,7 +6,7 @@ import { colors } from 'consola/utils';
|
|
|
6
6
|
import { join, dirname as dirname$1, resolve } from 'pathe';
|
|
7
7
|
import sirv from 'sirv';
|
|
8
8
|
import { searchForWorkspaceRoot } from 'vite';
|
|
9
|
-
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools.
|
|
9
|
+
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools.5ac54dae.mjs';
|
|
10
10
|
import { dirname, join as join$1, relative, parse } from 'node:path';
|
|
11
11
|
import { randomStr } from '@antfu/utils';
|
|
12
12
|
import { hash } from 'ohash';
|
|
@@ -31,7 +31,7 @@ import { getPackageInfo } from 'local-pkg';
|
|
|
31
31
|
import 'pkg-types';
|
|
32
32
|
import semver from 'semver';
|
|
33
33
|
|
|
34
|
-
const version = "1.6.
|
|
34
|
+
const version = "1.6.3";
|
|
35
35
|
|
|
36
36
|
function getHomeDir() {
|
|
37
37
|
return process.env.XDG_CONFIG_HOME || homedir();
|
|
@@ -883,30 +883,51 @@ function detectResponseType(_contentType = "") {
|
|
|
883
883
|
}
|
|
884
884
|
return "blob";
|
|
885
885
|
}
|
|
886
|
-
function
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
886
|
+
function resolveFetchOptions(request, input, defaults, Headers) {
|
|
887
|
+
const headers = mergeHeaders(
|
|
888
|
+
input?.headers ?? request?.headers,
|
|
889
|
+
defaults?.headers,
|
|
890
|
+
Headers
|
|
891
|
+
);
|
|
892
|
+
let query;
|
|
893
|
+
if (defaults?.query || defaults?.params || input?.params || input?.query) {
|
|
894
|
+
query = {
|
|
893
895
|
...defaults?.params,
|
|
894
|
-
...input?.params
|
|
895
|
-
};
|
|
896
|
-
}
|
|
897
|
-
if (defaults?.query && input?.query) {
|
|
898
|
-
merged.query = {
|
|
899
896
|
...defaults?.query,
|
|
897
|
+
...input?.params,
|
|
900
898
|
...input?.query
|
|
901
899
|
};
|
|
902
900
|
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
901
|
+
return {
|
|
902
|
+
...defaults,
|
|
903
|
+
...input,
|
|
904
|
+
query,
|
|
905
|
+
params: query,
|
|
906
|
+
headers
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
function mergeHeaders(input, defaults, Headers) {
|
|
910
|
+
if (!defaults) {
|
|
911
|
+
return new Headers(input);
|
|
912
|
+
}
|
|
913
|
+
const headers = new Headers(defaults);
|
|
914
|
+
if (input) {
|
|
915
|
+
for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) {
|
|
916
|
+
headers.set(key, value);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
return headers;
|
|
920
|
+
}
|
|
921
|
+
async function callHooks(context, hooks) {
|
|
922
|
+
if (hooks) {
|
|
923
|
+
if (Array.isArray(hooks)) {
|
|
924
|
+
for (const hook of hooks) {
|
|
925
|
+
await hook(context);
|
|
926
|
+
}
|
|
927
|
+
} else {
|
|
928
|
+
await hooks(context);
|
|
907
929
|
}
|
|
908
930
|
}
|
|
909
|
-
return merged;
|
|
910
931
|
}
|
|
911
932
|
|
|
912
933
|
const retryStatusCodes = /* @__PURE__ */ new Set([
|
|
@@ -915,7 +936,7 @@ const retryStatusCodes = /* @__PURE__ */ new Set([
|
|
|
915
936
|
409,
|
|
916
937
|
// Conflict
|
|
917
938
|
425,
|
|
918
|
-
// Too Early
|
|
939
|
+
// Too Early (Experimental)
|
|
919
940
|
429,
|
|
920
941
|
// Too Many Requests
|
|
921
942
|
500,
|
|
@@ -925,7 +946,7 @@ const retryStatusCodes = /* @__PURE__ */ new Set([
|
|
|
925
946
|
503,
|
|
926
947
|
// Service Unavailable
|
|
927
948
|
504
|
|
928
|
-
//
|
|
949
|
+
// Gateway Timeout
|
|
929
950
|
]);
|
|
930
951
|
const nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]);
|
|
931
952
|
function createFetch(globalOptions = {}) {
|
|
@@ -945,7 +966,7 @@ function createFetch(globalOptions = {}) {
|
|
|
945
966
|
}
|
|
946
967
|
const responseCode = context.response && context.response.status || 500;
|
|
947
968
|
if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) {
|
|
948
|
-
const retryDelay = context.options.retryDelay || 0;
|
|
969
|
+
const retryDelay = typeof context.options.retryDelay === "function" ? context.options.retryDelay(context) : context.options.retryDelay || 0;
|
|
949
970
|
if (retryDelay > 0) {
|
|
950
971
|
await new Promise((resolve) => setTimeout(resolve, retryDelay));
|
|
951
972
|
}
|
|
@@ -964,23 +985,34 @@ function createFetch(globalOptions = {}) {
|
|
|
964
985
|
const $fetchRaw = async function $fetchRaw2(_request, _options = {}) {
|
|
965
986
|
const context = {
|
|
966
987
|
request: _request,
|
|
967
|
-
options:
|
|
988
|
+
options: resolveFetchOptions(
|
|
989
|
+
_request,
|
|
990
|
+
_options,
|
|
991
|
+
globalOptions.defaults,
|
|
992
|
+
Headers
|
|
993
|
+
),
|
|
968
994
|
response: void 0,
|
|
969
995
|
error: void 0
|
|
970
996
|
};
|
|
971
|
-
|
|
997
|
+
if (context.options.method) {
|
|
998
|
+
context.options.method = context.options.method.toUpperCase();
|
|
999
|
+
}
|
|
972
1000
|
if (context.options.onRequest) {
|
|
973
|
-
await context.options.onRequest
|
|
1001
|
+
await callHooks(context, context.options.onRequest);
|
|
974
1002
|
}
|
|
975
1003
|
if (typeof context.request === "string") {
|
|
976
1004
|
if (context.options.baseURL) {
|
|
977
1005
|
context.request = withBase(context.request, context.options.baseURL);
|
|
978
1006
|
}
|
|
979
|
-
if (context.options.query
|
|
980
|
-
context.request = withQuery(context.request,
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1007
|
+
if (context.options.query) {
|
|
1008
|
+
context.request = withQuery(context.request, context.options.query);
|
|
1009
|
+
delete context.options.query;
|
|
1010
|
+
}
|
|
1011
|
+
if ("query" in context.options) {
|
|
1012
|
+
delete context.options.query;
|
|
1013
|
+
}
|
|
1014
|
+
if ("params" in context.options) {
|
|
1015
|
+
delete context.options.params;
|
|
984
1016
|
}
|
|
985
1017
|
}
|
|
986
1018
|
if (context.options.body && isPayloadMethod(context.options.method)) {
|
|
@@ -1006,10 +1038,14 @@ function createFetch(globalOptions = {}) {
|
|
|
1006
1038
|
let abortTimeout;
|
|
1007
1039
|
if (!context.options.signal && context.options.timeout) {
|
|
1008
1040
|
const controller = new AbortController();
|
|
1009
|
-
abortTimeout = setTimeout(
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1041
|
+
abortTimeout = setTimeout(() => {
|
|
1042
|
+
const error = new Error(
|
|
1043
|
+
"[TimeoutError]: The operation was aborted due to timeout"
|
|
1044
|
+
);
|
|
1045
|
+
error.name = "TimeoutError";
|
|
1046
|
+
error.code = 23;
|
|
1047
|
+
controller.abort(error);
|
|
1048
|
+
}, context.options.timeout);
|
|
1013
1049
|
context.options.signal = controller.signal;
|
|
1014
1050
|
}
|
|
1015
1051
|
try {
|
|
@@ -1020,7 +1056,10 @@ function createFetch(globalOptions = {}) {
|
|
|
1020
1056
|
} catch (error) {
|
|
1021
1057
|
context.error = error;
|
|
1022
1058
|
if (context.options.onRequestError) {
|
|
1023
|
-
await
|
|
1059
|
+
await callHooks(
|
|
1060
|
+
context,
|
|
1061
|
+
context.options.onRequestError
|
|
1062
|
+
);
|
|
1024
1063
|
}
|
|
1025
1064
|
return await onError(context);
|
|
1026
1065
|
} finally {
|
|
@@ -1028,7 +1067,10 @@ function createFetch(globalOptions = {}) {
|
|
|
1028
1067
|
clearTimeout(abortTimeout);
|
|
1029
1068
|
}
|
|
1030
1069
|
}
|
|
1031
|
-
const hasBody = context.response.body
|
|
1070
|
+
const hasBody = (context.response.body || // https://github.com/unjs/ofetch/issues/324
|
|
1071
|
+
// https://github.com/unjs/ofetch/issues/294
|
|
1072
|
+
// https://github.com/JakeChampion/fetch/issues/1454
|
|
1073
|
+
context.response._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== "HEAD";
|
|
1032
1074
|
if (hasBody) {
|
|
1033
1075
|
const responseType = (context.options.parseResponse ? "json" : context.options.responseType) || detectResponseType(context.response.headers.get("content-type") || "");
|
|
1034
1076
|
switch (responseType) {
|
|
@@ -1039,7 +1081,7 @@ function createFetch(globalOptions = {}) {
|
|
|
1039
1081
|
break;
|
|
1040
1082
|
}
|
|
1041
1083
|
case "stream": {
|
|
1042
|
-
context.response._data = context.response.body;
|
|
1084
|
+
context.response._data = context.response.body || context.response._bodyInit;
|
|
1043
1085
|
break;
|
|
1044
1086
|
}
|
|
1045
1087
|
default: {
|
|
@@ -1048,11 +1090,17 @@ function createFetch(globalOptions = {}) {
|
|
|
1048
1090
|
}
|
|
1049
1091
|
}
|
|
1050
1092
|
if (context.options.onResponse) {
|
|
1051
|
-
await
|
|
1093
|
+
await callHooks(
|
|
1094
|
+
context,
|
|
1095
|
+
context.options.onResponse
|
|
1096
|
+
);
|
|
1052
1097
|
}
|
|
1053
1098
|
if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) {
|
|
1054
1099
|
if (context.options.onResponseError) {
|
|
1055
|
-
await
|
|
1100
|
+
await callHooks(
|
|
1101
|
+
context,
|
|
1102
|
+
context.options.onResponseError
|
|
1103
|
+
);
|
|
1056
1104
|
}
|
|
1057
1105
|
return await onError(context);
|
|
1058
1106
|
}
|
|
@@ -1064,10 +1112,12 @@ function createFetch(globalOptions = {}) {
|
|
|
1064
1112
|
};
|
|
1065
1113
|
$fetch.raw = $fetchRaw;
|
|
1066
1114
|
$fetch.native = (...args) => fetch(...args);
|
|
1067
|
-
$fetch.create = (defaultOptions = {}) => createFetch({
|
|
1115
|
+
$fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({
|
|
1068
1116
|
...globalOptions,
|
|
1117
|
+
...customGlobalOptions,
|
|
1069
1118
|
defaults: {
|
|
1070
1119
|
...globalOptions.defaults,
|
|
1120
|
+
...customGlobalOptions.defaults,
|
|
1071
1121
|
...defaultOptions
|
|
1072
1122
|
}
|
|
1073
1123
|
});
|
|
@@ -1089,7 +1139,7 @@ const _globalThis = function() {
|
|
|
1089
1139
|
}
|
|
1090
1140
|
throw new Error("unable to locate global object");
|
|
1091
1141
|
}();
|
|
1092
|
-
const fetch = _globalThis.fetch
|
|
1142
|
+
const fetch = _globalThis.fetch ? (...args) => _globalThis.fetch(...args) : () => Promise.reject(new Error("[ofetch] global.fetch is not supported!"));
|
|
1093
1143
|
const Headers = _globalThis.Headers;
|
|
1094
1144
|
const AbortController = _globalThis.AbortController;
|
|
1095
1145
|
createFetch({ fetch, Headers, AbortController });
|
|
@@ -1669,8 +1719,9 @@ const route = useRoute()
|
|
|
1669
1719
|
</template>
|
|
1670
1720
|
`;
|
|
1671
1721
|
async function enablePages(nuxt) {
|
|
1672
|
-
const
|
|
1673
|
-
const
|
|
1722
|
+
const baseDir = nuxt.options.future.compatibilityVersion === 4 ? nuxt.options.dir.app : nuxt.options.srcDir;
|
|
1723
|
+
const pathApp = join(baseDir, "app.vue");
|
|
1724
|
+
const pathPageIndex = join(baseDir, "pages/index.vue");
|
|
1674
1725
|
if (fs$1.existsSync(pathPageIndex)) {
|
|
1675
1726
|
logger.warn("pages/index.vue already exists, skipping");
|
|
1676
1727
|
return;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { addCustomTab } from '@nuxt/devtools-kit';
|
|
2
2
|
import { addVitePlugin } from '@nuxt/kit';
|
|
3
|
-
import Inspect from 'vite-plugin-inspect';
|
|
4
3
|
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
async function createVitePluginInspect(options) {
|
|
5
|
+
return await import('vite-plugin-inspect').then((r) => r.default(options));
|
|
6
|
+
}
|
|
7
|
+
async function setup({ nuxt, rpc }) {
|
|
8
|
+
const plugin = await createVitePluginInspect();
|
|
7
9
|
addVitePlugin(plugin);
|
|
8
10
|
let api;
|
|
9
11
|
nuxt.hook("vite:serverCreated", () => {
|
|
@@ -52,4 +54,4 @@ function setup({ nuxt, rpc }) {
|
|
|
52
54
|
rpc.functions.getComponentsRelationships = getComponentsRelationships;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
export { setup };
|
|
57
|
+
export { createVitePluginInspect, setup };
|
package/dist/chunks/vscode.mjs
CHANGED
package/dist/client/200.html
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
4
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-
|
|
5
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-nccln8bf.css" crossorigin>
|
|
4
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/b04z4mtb.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-nhjd65sz.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-pcs99qrd.js">
|
|
9
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-enrzjv18.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
14
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-
|
|
15
|
-
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-
|
|
17
|
-
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-
|
|
19
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
20
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-mov6ggbr.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-di1z4oob.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-kkznunwn.js">
|
|
14
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-e1m6uiw9.js">
|
|
15
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-jbmkerk1.css">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-o0v6zwya.js">
|
|
17
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-ey2nctyr.css">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-nvrn53d3.js">
|
|
19
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/b04z4mtb.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1733232942515,false]</script>
|
|
20
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"9de2d2d7-41a1-455e-a918-e709c65a4eef",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
4
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-
|
|
5
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-nccln8bf.css" crossorigin>
|
|
4
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/b04z4mtb.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-nhjd65sz.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-pcs99qrd.js">
|
|
9
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-enrzjv18.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
14
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-
|
|
15
|
-
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-
|
|
17
|
-
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-
|
|
19
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
20
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-mov6ggbr.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-di1z4oob.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-kkznunwn.js">
|
|
14
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-e1m6uiw9.js">
|
|
15
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-jbmkerk1.css">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-o0v6zwya.js">
|
|
17
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-ey2nctyr.css">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-nvrn53d3.js">
|
|
19
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/b04z4mtb.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1733232942515,false]</script>
|
|
20
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"9de2d2d7-41a1-455e-a918-e709c65a4eef",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e,S as n,Q as t}from"./vendor/json-editor-vue-nhjd65sz.js";const c={"h-screen":"","w-screen":"","bg-black":""},r=e({__name:"__blank",setup(o){return(s,_)=>(t(),n("div",c))}});export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as P,g as J,r as S,h as R,e as U,j as X,k as h,l as ee,m as ne,n as te,o as le,p as ie,q as oe,s as C,v as re,w as ue,x as se,c as ae}from"./b04z4mtb.js";import{_ as de}from"./filepath-item.vue-fxcmp74h.js";import{k as E,l as V,b as F,Q as i,S as u,U as e,F as p,ab as G,Y as j,a5 as v,W as x,u as c,a0 as d,$ as a,a6 as f,a8 as A,a9 as I,M as k}from"./vendor/json-editor-vue-nhjd65sz.js";import{_ as me}from"./ncode-block.vue-ljovji7o.js";import{_ as pe}from"./ncheckbox.vue-nkgx3uyq.js";import{_ as ve}from"./help-fab.vue-bn738d5b.js";import"./vendor/unocss-pcs99qrd.js";import"./vendor/shiki-enrzjv18.js";import"./client-h8sz7blv.js";const fe={"h-full":"",grid:"~ rows-[max-content_1fr]"},ye={flex:"~ wrap","w-full":""},be=["onClick"],ce={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},ge={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},xe=E({__name:"BuildAnalyzeDetails",props:{current:{},prev:{}},setup(N){const y=N,$=`${J().app.baseURL}/__nuxt_devtools__/analyze/`.replace(/\/+/g,"/"),b=V(()=>{const l=[{name:"Overview",id:"overview"}];return y.current.features.bundleClient&&l.push({name:"Client Bundle",id:"bundle-client"}),y.current.features.bundleNitro&&l.push({name:"Nitro Bundle",id:"bundle-nitro"}),y.current.features.viteInspect&&l.push({name:"Vite Inspect",id:"vite-inspect"}),l}),o=F(b.value[0]);function z(l){return`${((l.endTime-l.startTime)/1e3).toFixed(1)}s`}function m(l){return l<1024?`${l}B`:l<1024*1024?`${(l/1024).toFixed(1)}KB`:l<1024*1024*1024?`${(l/1024/1024).toFixed(1)}MB`:`${(l/1024/1024/1024).toFixed(1)}GB`}async function T(l){return S.clearAnalyzeBuilds(await R(),[l])}return(l,n)=>{const D=de,B=U;return i(),u("div",fe,[e("div",ye,[(i(!0),u(p,null,G(b.value,(r,t)=>(i(),u("button",{key:t,px4:"",py2:"",border:"r base",hover:"bg-active",class:j(r.id===o.value.id?"":"border-b"),onClick:_=>o.value=r},[e("div",{class:j(r.id===o.value.id?"":"op30")},v(r.name),3)],10,be))),128)),n[1]||(n[1]=e("div",{border:"b base","flex-auto":""},null,-1))]),o.value.id==="overview"?(i(),u("div",ce,[n[15]||(n[15]=e("div",{"flex-auto":""},null,-1)),e("div",ge,[n[10]||(n[10]=e("div",{"i-carbon-commit":"","text-xl":""},null,-1)),e("div",null,[n[2]||(n[2]=e("div",{"text-sm":"",op50:""}," Name ",-1)),e("div",null,v(l.current.name),1)]),n[11]||(n[11]=e("div",{"i-carbon-time":"","text-xl":""},null,-1)),e("div",null,[n[3]||(n[3]=e("div",{"text-sm":"",op50:""}," Build duration ",-1)),e("div",null,v(z(l.current)),1)]),l.current.size?.clientBundle?(i(),u(p,{key:0},[n[5]||(n[5]=e("div",{"i-carbon-cics-program":"","text-xl":""},null,-1)),e("div",null,[n[4]||(n[4]=e("div",{"text-sm":"",op50:""}," Client bundle size ",-1)),e("div",null,v(m(l.current.size.clientBundle)),1)])],64)):x("",!0),l.current.size.nitroBundle?(i(),u(p,{key:1},[n[7]||(n[7]=e("div",{"i-carbon-bare-metal-server":"","text-xl":""},null,-1)),e("div",null,[n[6]||(n[6]=e("div",{"text-sm":"",op50:""}," Nitro bundle size ",-1)),e("div",null,v(m(l.current.size.nitroBundle)),1)])],64)):x("",!0),n[12]||(n[12]=e("div",{"i-carbon-edge-node":"","text-xl":""},null,-1)),e("div",null,[n[8]||(n[8]=e("div",{"text-sm":"",op50:""}," Built ",-1)),e("div",null,v(c(P)(new Date(l.current.endTime))),1)]),n[13]||(n[13]=e("div",{"i-carbon:folder-parent":"","text-xl":""},null,-1)),e("div",null,[n[9]||(n[9]=e("div",{"text-sm":"",op50:""}," Report Path ",-1)),d(D,{filepath:l.current.analyzeDir},null,8,["filepath"])])]),n[16]||(n[16]=e("div",{"flex-auto":""},null,-1)),d(B,{n:"rose",icon:"carbon-delete",onClick:n[0]||(n[0]=r=>T(l.current.name))},{default:a(()=>n[14]||(n[14]=[f(" Delete this report ")])),_:1})])):x("",!0),n._lazyshow1||o.value.id==="bundle-client"?(n._lazyshow1=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-client"]])],64)):x("v-show-if",!0),n._lazyshow2||o.value.id==="bundle-nitro"?(n._lazyshow2=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-nitro"]])],64)):x("v-show-if",!0),n._lazyshow3||o.value.id==="vite-inspect"?(n._lazyshow3=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="vite-inspect"]])],64)):x("v-show-if",!0)])}}}),we={class:"markdown-body"},$e={__name:"analyze-build",setup(N,{expose:y}){return y({frontmatter:{}}),($,b)=>(i(),u("div",we,b[0]||(b[0]=[e("h1",null,"Build Analyze",-1),e("p",null,[f("DevTools provides a build analyze tool to help you understand the size of your app in production. Whenever you start a new build, it runs the command "),e("code",null,"nuxt build --analyze"),f(" and present the output data directly in DevTools for easy browsing and comparing.")],-1)])))}},ze={flex:"~ col"},_e=["onClick"],ke={flex:"~ gap-1 items-center wrap","w-full":"","text-sm":"",op60:""},Be={flex:"~ items-center justify-center wrap",p4:""},Ce={flex:"~ col gap-1","w-250":"",p4:""},Ne={flex:"~ gap-3",mt2:"","justify-end":""},Re=E({__name:"analyze-build",setup(N){const y=X(),w=h(),$=ee(),b=ne("analyze-build:slug",""),o=V(()=>w.value?.builds.find(r=>r.slug===b.value)??w.value?.builds[0]),z=F(!1),m=F(""),T=V(()=>w.value?.builds.some(r=>r.name===m.value.trim()));async function l(){m.value=await S.generateAnalyzeBuildName(),await y.start()&&(oe("analyze-build:start"),C.value={name:m.value,processId:await S.startAnalyzeBuild(await R(),m.value)},z.value&&B())}const n=te();function D(r){return`${((r.endTime-r.startTime)/1e3).toFixed(1)}s`}function B(){C.value?.processId&&(n.value=C.value.processId,$.push("/modules/terminals"))}return le(()=>[{id:"action:analyze-build: start",title:"Start a new analyze build",icon:"i-carbon-edge-node",action:l}]),(r,t)=>{const _=U,L=xe,M=ae,O=ie,W=re,Y=ue,q=me,H=pe,K=se,Q=$e,Z=ve;return i(),u(p,null,[d(O,{"left-size":30},{left:a(()=>[e("div",ze,[(i(!0),u(p,null,G(c(w)?.builds,s=>(i(),u(p,{key:s.slug},[e("button",{flex:"~ col gap1","hover:bg-active":"",p3:"",class:j(s.slug===o.value?.slug?"text-primary bg-active":""),onClick:g=>b.value=s.slug},[e("code",null,v(s.name),1),e("div",ke,[t[4]||(t[4]=e("div",{"i-carbon-time":""},null,-1)),e("span",null,v(D(s)),1),t[5]||(t[5]=e("div",{"flex-auto":""},null,-1)),e("span",null,v(c(P)(new Date(s.endTime))),1)])],10,_e),t[6]||(t[6]=e("div",{"x-divider":""},null,-1))],64))),128)),e("div",Be,[c(C)?(i(),k(_,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:t[1]||(t[1]=s=>B())},{default:a(()=>t[8]||(t[8]=[f(" Building... ")])),_:1})):(i(),k(_,{key:0,n:"primary",icon:"carbon-edge-node",onClick:t[0]||(t[0]=s=>l())},{default:a(()=>t[7]||(t[7]=[f(" Start a new build ")])),_:1}))])])]),right:a(()=>[o.value?(i(),k(L,{key:0,current:o.value},null,8,["current"])):(i(),k(M,{key:1}))]),_:1}),d(c(y),null,{default:a(({resolve:s})=>[d(K,{"model-value":!0,onClose:g=>s(!1)},{default:a(()=>[e("div",Ce,[t[13]||(t[13]=e("h3",{class:"text-lg font-medium leading-6",mb2:""}," Start analyze build? ",-1)),t[14]||(t[14]=e("p",{op50:""}," Enter the name of the build: ",-1)),d(W,{modelValue:m.value,"onUpdate:modelValue":t[2]||(t[2]=g=>m.value=g),placeholder:"Build name"},null,8,["modelValue"]),T.value?(i(),k(Y,{key:0,"n-orange":""},{default:a(()=>t[9]||(t[9]=[f(" A build with the same name already exists, continue would overrides the previous build result. ")])),_:1})):x("",!0),t[15]||(t[15]=e("div",{my3:"","x-divider":""},null,-1)),t[16]||(t[16]=e("p",{op50:""}," The following command will be executed in your terminal: ",-1)),d(q,{code:`npx nuxi analyze --no-serve --name=${m.value}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),d(H,{modelValue:z.value,"onUpdate:modelValue":t[3]||(t[3]=g=>z.value=g),mt2:"",n:"primary"},{default:a(()=>t[10]||(t[10]=[f(" Navigate to terminal ")])),_:1},8,["modelValue"]),e("div",Ne,[d(_,{onClick:g=>s(!1)},{default:a(()=>t[11]||(t[11]=[f(" Cancel ")])),_:2},1032,["onClick"]),d(_,{n:"solid primary",onClick:g=>s(!0)},{default:a(()=>t[12]||(t[12]=[f(" Start ")])),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),d(Z,null,{default:a(()=>[d(Q)]),_:1})],64)}}});export{Re as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{y as ee,z as H,A as ce,B as pe,q as me,r as W,h as X,C as M,e as te,D as ne,v as se,E as ve,F as fe,G as le,H as ge,I as he,J as xe,K as be,x as we,L as _e,M as ye,N as $e,b as ke,O as Ce}from"./
|
|
1
|
+
import{y as ee,z as H,A as ce,B as pe,q as me,r as W,h as X,C as M,e as te,D as ne,v as se,E as ve,F as fe,G as le,H as ge,I as he,J as xe,K as be,x as we,L as _e,M as ye,N as $e,b as ke,O as Ce}from"./b04z4mtb.js";import{_ as Ve}from"./ncheckbox.vue-nkgx3uyq.js";import{_ as Pe}from"./ndropdown.vue-707esowt.js";import{_ as Ae}from"./nnavbar.vue-npaum0f1.js";import{k as Z,b as T,ae as oe,S as i,a8 as K,a0 as d,U as t,a6 as D,F as L,ab as G,M as V,$ as h,W as S,Y as J,u as m,Q as o,l as U,X as ae,a5 as F,V as De,y as Fe,Z as Ne,al as Se}from"./vendor/json-editor-vue-nhjd65sz.js";import{_ as Ue}from"./nsection-block-nwjsicuf.js";import{_ as Ie}from"./filepath-item.vue-fxcmp74h.js";import{_ as Te}from"./code-snippets.vue-dfzf4hjg.js";import{_ as je}from"./ndrawer.vue-7slc0a0y.js";import{D as Be}from"./constants-b32h69zq.js";import"./vendor/unocss-pcs99qrd.js";import"./vendor/shiki-enrzjv18.js";import"./nicon-title.vue-fq2kswl5.js";import"./ncode-block.vue-ljovji7o.js";import"./client-h8sz7blv.js";const Ee={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},ze={for:"drop-zone-input","text-3xl":"",hover:"text-green cursor-pointer","transition-all":""},Le={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},Oe={grid:"~ cols-minmax-8rem gap-8","overflow-auto":"",p6:""},Me={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Re=["src"],Ke={flex:"~ gap1","items-center":""},qe={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},Ge=Z({__name:"AssetDropZone",props:{modelValue:{type:Boolean,required:!0},folder:{type:String,required:!0}},setup(z){const l=z,f=ee(l,"modelValue"),C=T(),n=T([]);function v(s){C.value=s.target,f.value=!0}function b(s){s.target===C.value&&(f.value=!1)}function j(s){s.preventDefault()}function P(s){s.preventDefault(),x(s.dataTransfer.files)}function x(s){const c=Array.from(s||[]);if(c.length){const g=[],_=n.value.map(u=>u.name);for(const u of c)if(_.includes(u.name)){let A=1;const[y,E]=u.name.split(".");for(;_.includes(`${y} (${A}).${E}`);)A++;const R=`${y}-${A}.${E}`,a=new Blob([u],{type:u.type}),e=new File([a],R,{lastModified:Date.now()});g.push(e),_.push(R)}else u.type===""&&M({message:"Folders are not supported yet",icon:"carbon:face-dissatisfied",classes:"text-orange"}),g.push(u);n.value=[...n.value,...g]}}async function B(){if(ce.value||pe.value)return;me("assets:upload");const s=[];for(const c of n.value){const g=new FileReader;g.readAsDataURL(c);const u=(await new Promise(A=>{g.onload=()=>A(g.result)})).split(";base64,").pop();s.push({path:c.name,encoding:"base64",content:u})}await W.writeStaticAssets(await X(),[...s],l.folder).then(()=>{p(),M({message:"Files uploaded successfully!",icon:"i-carbon:checkmark"})}).catch(c=>{p(),M({message:`Error uploading files: ${c?.message??"unknown"}`,icon:"i-carbon-warning",classes:"text-red"})}),f.value=!1}function q(s){n.value?.splice(s,1)}function O(s){return URL.createObjectURL(s)}function w(s,c){const[g,_]=s.name.split("."),u=c.replace(/\.\w+$/,""),A=`${u}.${_}`;return u.length===0?(alert("File name must be at least 1 characters long"),g):(Object.defineProperty(s,"name",{value:A,writable:!1}),n.value.splice(n.value.indexOf(s),1,s),s)}function r(){n.value=[]}function p(){f.value=!1,r()}return H("dragenter",v),H("dragleave",b),H("dragover",j),H("drop",P),(s,c)=>{const g=te,_=ne,u=se,A=oe("tooltip");return o(),i("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:J(m(f)?"opacity-100 visible":"opacity-0 invisible")},[K(d(g,{icon:"carbon-close",title:"Close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",border:!1,onClick:p},null,512),[[A,"Close",void 0,{"bottom-end":!0}]]),n.value?.length?(o(),i("div",Le,[c[4]||(c[4]=t("div",{px6:"",py6:""},[t("h1",{"text-2xl":""}," Upload "),t("p",{"text-sm":"",op50:""}," Drag and drop files to upload ")],-1)),t("div",Oe,[(o(!0),i(L,null,G(n.value,(y,E)=>(o(),i("div",{key:y.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[t("div",Me,[t("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:O(y)},null,8,Re)]),t("div",Ke,[d(u,{n:"xs","h-full":"","flex-auto":"","model-value":y.name,"onUpdate:modelValue":R=>w(y,R.target.value)},null,8,["model-value","onUpdate:modelValue"]),d(g,{n:"red",icon:"carbon-trash-can","h-full":"","flex-none":"",title:"Remove file",onClick:R=>q(E)},null,8,["onClick"])])]))),128))]),t("div",qe,[n.value.length?(o(),V(g,{key:0,n:"red",onClick:r},{default:h(()=>[d(_,{icon:"carbon-clean"}),c[2]||(c[2]=D(" Clear "))]),_:1})):S("",!0),d(g,{disabled:!n.value.length,n:"primary solid",onClick:B},{default:h(()=>[d(_,{icon:"carbon-cloud-upload"}),c[3]||(c[3]=D(" Upload "))]),_:1},8,["disabled"])])])):(o(),i("div",Ee,[t("label",ze,[d(_,{icon:"carbon-cloud-upload","mr-2":""}),c[1]||(c[1]=D(" Drop files here or click to select "))]),t("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:c[0]||(c[0]=y=>x(y.target.files))},null,32)]))],2)}}}),Ze=Z({__name:"AssetFontPreview",props:{asset:{}},setup(z){const l=z,f=U(()=>`devtools-assets-${ve(l.asset)}`);return fe(U(()=>`
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: '${f.value}';
|
|
4
4
|
src: url('${l.asset.publicPath}');
|