@nuxt/devtools 0.6.7 → 0.7.1
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/module-main.mjs +126 -75
- package/dist/chunks/plugin-metrics.mjs +15 -12
- package/dist/chunks/timeline.mjs +69 -0
- package/dist/chunks/vscode.mjs +5 -5
- package/dist/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/__blank/index.html +2 -2
- package/dist/client/_nuxt/AuthRequiredPanel.vue.17c2a7bd.js +1 -0
- package/dist/client/_nuxt/Badge.8d650e3b.js +1 -0
- package/dist/client/_nuxt/CodeDiff.vue.cc3f76a7.js +3 -0
- package/dist/client/_nuxt/CodeSnippets.vue.b4698473.js +1 -0
- package/dist/client/_nuxt/ComposableItem.vue.6d7b799a.js +1 -0
- package/dist/client/_nuxt/DrawerRight.vue.3ab85e5b.js +1 -0
- package/dist/client/_nuxt/DurationDisplay.vue.aba5fa70.js +1 -0
- package/dist/client/_nuxt/FilepathItem.vue.84aa0a31.js +1 -0
- package/dist/client/_nuxt/HelpFab.vue.a8d95bd1.js +1 -0
- package/dist/client/_nuxt/LaunchPage.vue.00d3a484.js +1 -0
- package/dist/client/_nuxt/NCheckbox.vue.63949e52.js +1 -0
- package/dist/client/_nuxt/NCodeBlock.vue.77e54b2e.js +2 -0
- package/dist/client/_nuxt/NIconTitle.vue.0a904b99.js +1 -0
- package/dist/client/_nuxt/NLink.vue.ec1f69e3.js +1 -0
- package/dist/client/_nuxt/{NMarkdown.vue.31d61f61.js → NMarkdown.vue.a74698d6.js} +1 -1
- package/dist/client/_nuxt/NSectionBlock.b074e0b8.js +1 -0
- package/dist/client/_nuxt/NSelect.vue.9556d6e0.js +1 -0
- package/dist/client/_nuxt/NSwitch.vue.6c2556d0.js +1 -0
- package/dist/client/_nuxt/NTip.vue.861372f7.js +1 -0
- package/dist/client/_nuxt/Navbar.vue.1a2a587f.js +1 -0
- package/dist/client/_nuxt/StateEditor.vue.05c4fc16.js +1 -0
- package/dist/client/_nuxt/__blank.3f7b27a6.js +1 -0
- package/dist/client/_nuxt/analyze-build.c314de67.js +1 -0
- package/dist/client/_nuxt/assets.722939b7.js +16 -0
- package/dist/client/_nuxt/client.ece13385.js +1 -0
- package/dist/client/_nuxt/{components.3a437d73.js → components.27bdfae4.js} +6 -6
- package/dist/client/_nuxt/{constants.d7bcda3c.js → constants.4e5eba24.js} +1 -1
- package/dist/client/_nuxt/custom-_name_.95a8297c.js +1 -0
- package/dist/client/_nuxt/default.7e3f9818.js +1 -0
- package/dist/client/_nuxt/entry.6507cb32.js +21 -0
- package/dist/client/_nuxt/entry.6f7d64f9.css +1 -0
- package/dist/client/_nuxt/{error-404.eb07c617.js → error-404.66ff8897.js} +1 -1
- package/dist/client/_nuxt/{error-500.8214e786.js → error-500.34984f69.js} +1 -1
- package/dist/client/_nuxt/full.748a1c93.js +1 -0
- package/dist/client/_nuxt/hooks.3ec974a8.js +1 -0
- package/dist/client/_nuxt/imports.8485b75c.js +1 -0
- package/dist/client/_nuxt/{index.98d48447.js → index.5152a001.js} +1 -1
- package/dist/client/_nuxt/{index.6a0822c9.js → index.7ae8a638.js} +2 -2
- package/dist/client/_nuxt/{json-editor-vue.9acffc14.js → json-editor-vue.bbdad521.js} +1 -1
- package/dist/client/_nuxt/{middleware.c2f916df.js → middleware.3c73e553.js} +1 -1
- package/dist/client/_nuxt/modules.67fd6240.js +2 -0
- package/dist/client/_nuxt/none.2f8cf810.js +1 -0
- package/dist/client/_nuxt/open-graph.79a7c77c.js +3 -0
- package/dist/client/_nuxt/overview.d953fa7e.js +1 -0
- package/dist/client/_nuxt/pages.7b386c55.js +1 -0
- package/dist/client/_nuxt/payload.f36f4355.js +1 -0
- package/dist/client/_nuxt/plugins.1c37e55d.js +1 -0
- package/dist/client/_nuxt/runtime-configs.67f4f0b3.js +1 -0
- package/dist/client/_nuxt/server-routes.64373863.js +9 -0
- package/dist/client/_nuxt/settings.b7df1779.js +1 -0
- package/dist/client/_nuxt/{state-components.493c1b8d.js → state-components.cd34df16.js} +1 -1
- package/dist/client/_nuxt/state-modules.c2527930.js +1 -0
- package/dist/client/_nuxt/storage.13c667f3.js +1 -0
- package/dist/client/_nuxt/{terminals.714ad795.js → terminals.1c5a4ee9.js} +7 -7
- package/dist/client/_nuxt/timeline.1ad3a70f.css +1 -0
- package/dist/client/_nuxt/timeline.741d9e72.js +57 -0
- package/dist/client/_nuxt/{unocss-runtime.552cd61f.js → unocss-runtime.d07b0096.js} +2 -2
- package/dist/client/_nuxt/virtual-files.4e8316be.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/client/modules/analyze-build/index.html +2 -2
- package/dist/client/modules/assets/index.html +2 -2
- package/dist/client/modules/components/index.html +2 -2
- package/dist/client/modules/hooks/index.html +2 -2
- package/dist/client/modules/imports/index.html +2 -2
- package/dist/client/modules/middleware/index.html +2 -2
- package/dist/client/modules/modules/index.html +2 -2
- package/dist/client/modules/open-graph/index.html +2 -2
- package/dist/client/modules/overview/index.html +2 -2
- package/dist/client/modules/pages/index.html +2 -2
- package/dist/client/modules/payload/index.html +2 -2
- package/dist/client/modules/plugins/index.html +2 -2
- package/dist/client/modules/runtime-configs/index.html +2 -2
- package/dist/client/modules/server-routes/index.html +2 -2
- package/dist/client/modules/storage/index.html +2 -2
- package/dist/client/modules/terminals/index.html +2 -2
- package/dist/client/modules/timeline/index.html +7 -0
- package/dist/client/modules/virtual-files/index.html +2 -2
- package/dist/client/settings/index.html +2 -2
- package/dist/{global-20ccb74c.d.ts → global-ea55645c.d.ts} +7 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/function-metrics-helpers.d.ts +3 -0
- package/dist/runtime/function-metrics-helpers.mjs +63 -0
- package/dist/runtime/plugins/devtools.client.mjs +2 -1
- package/dist/runtime/plugins/view/client.d.ts +3 -1
- package/dist/runtime/plugins/view/client.mjs +60 -23
- package/dist/runtime/plugins/view/state.mjs +1 -1
- package/dist/runtime/plugins/view/utils.d.ts +1 -1
- package/dist/runtime/plugins/view/utils.mjs +15 -15
- package/dist/shared/{devtools.ce3f2385.mjs → devtools.d198e7a9.mjs} +7 -1
- package/dist/types.d.ts +1 -1
- package/package.json +26 -25
- package/dist/client/_nuxt/AuthRequiredPanel.vue.fc7f2968.js +0 -1
- package/dist/client/_nuxt/Badge.e05fc69f.js +0 -1
- package/dist/client/_nuxt/CodeSnippets.vue.a1fe908d.js +0 -1
- package/dist/client/_nuxt/DrawerRight.vue.3adebf89.js +0 -1
- package/dist/client/_nuxt/DurationDisplay.vue.c6aa67b3.js +0 -1
- package/dist/client/_nuxt/FilepathItem.vue.7520a5eb.js +0 -1
- package/dist/client/_nuxt/HelpFab.vue.6c2e0089.js +0 -1
- package/dist/client/_nuxt/LaunchPage.vue.ace7e996.js +0 -1
- package/dist/client/_nuxt/NCheckbox.vue.660c8c34.js +0 -1
- package/dist/client/_nuxt/NCodeBlock.vue.12f6d4d2.js +0 -2
- package/dist/client/_nuxt/NIconButton.vue.9dc5b644.js +0 -1
- package/dist/client/_nuxt/NIconTitle.vue.0db956c8.js +0 -1
- package/dist/client/_nuxt/NLink.vue.f3f95732.js +0 -1
- package/dist/client/_nuxt/NPanelGrids.cfd60e85.js +0 -1
- package/dist/client/_nuxt/NSectionBlock.216523d8.js +0 -1
- package/dist/client/_nuxt/NSelect.vue.38f0d91b.js +0 -1
- package/dist/client/_nuxt/NSwitch.vue.4e114eb7.js +0 -1
- package/dist/client/_nuxt/NTip.vue.d602d31e.js +0 -1
- package/dist/client/_nuxt/Navbar.vue.72301b0e.js +0 -1
- package/dist/client/_nuxt/PanelLeftRight.vue.d1539d19.js +0 -1
- package/dist/client/_nuxt/StateEditor.vue.c8fd02b3.js +0 -1
- package/dist/client/_nuxt/__blank.58b4eaa9.js +0 -1
- package/dist/client/_nuxt/analyze-build.66f9bc20.js +0 -1
- package/dist/client/_nuxt/assets.b60a4d67.js +0 -16
- package/dist/client/_nuxt/client.1e3208e3.js +0 -1
- package/dist/client/_nuxt/custom-_name_.1614dd97.js +0 -1
- package/dist/client/_nuxt/default.a69a326f.js +0 -1
- package/dist/client/_nuxt/entry.559460ac.js +0 -21
- package/dist/client/_nuxt/entry.e49b0ddd.css +0 -1
- package/dist/client/_nuxt/full.1f3e7ba7.js +0 -1
- package/dist/client/_nuxt/hooks.7a294c4b.js +0 -1
- package/dist/client/_nuxt/imports.8b3c700a.js +0 -1
- package/dist/client/_nuxt/modules.a1aceff5.js +0 -4
- package/dist/client/_nuxt/none.bf6672f1.js +0 -1
- package/dist/client/_nuxt/open-graph.f68f3562.js +0 -3
- package/dist/client/_nuxt/overview.9fbd51a4.js +0 -1
- package/dist/client/_nuxt/pages.8b6a187c.js +0 -1
- package/dist/client/_nuxt/payload.5851379a.js +0 -1
- package/dist/client/_nuxt/plugins.20750545.js +0 -1
- package/dist/client/_nuxt/runtime-configs.ce330378.js +0 -1
- package/dist/client/_nuxt/server-routes.08ebdd45.js +0 -9
- package/dist/client/_nuxt/settings.63ba52d8.js +0 -1
- package/dist/client/_nuxt/state-modules.c72270b1.js +0 -1
- package/dist/client/_nuxt/storage.d37c76d1.js +0 -1
- package/dist/client/_nuxt/virtual-files.7bf5357c.js +0 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import fs, { existsSync } from 'node:fs';
|
|
1
|
+
import fs$1, { existsSync } from 'node:fs';
|
|
2
2
|
import { resolve, join as join$1, dirname } from 'pathe';
|
|
3
3
|
import { logger, useNuxt, addPlugin, addVitePlugin } from '@nuxt/kit';
|
|
4
4
|
import { searchForWorkspaceRoot } from 'vite';
|
|
5
5
|
import sirv from 'sirv';
|
|
6
6
|
import c from 'picocolors';
|
|
7
7
|
import { createBirpcGroup } from 'birpc';
|
|
8
|
-
import { R as ROUTE_AUTH, d as defaultTabOptions, W as WS_EVENT_NAME, a as ROUTE_ANALYZE, b as ROUTE_CLIENT, c as ROUTE_AUTH_VERIFY } from '../shared/devtools.
|
|
8
|
+
import { R as ROUTE_AUTH, d as defaultTabOptions, W as WS_EVENT_NAME, a as ROUTE_ANALYZE, b as ROUTE_CLIENT, c as ROUTE_AUTH_VERIFY } from '../shared/devtools.d198e7a9.mjs';
|
|
9
9
|
import { homedir } from 'node:os';
|
|
10
10
|
import { join } from 'node:path';
|
|
11
|
-
import
|
|
11
|
+
import fs from 'node:fs/promises';
|
|
12
12
|
import { imageMeta } from 'image-meta';
|
|
13
|
+
import { debounce } from 'perfect-debounce';
|
|
13
14
|
import fg from 'fast-glob';
|
|
14
15
|
import { startSubprocess } from '@nuxt/devtools-kit';
|
|
15
16
|
import isInstalledGlobally from 'is-installed-globally';
|
|
@@ -22,7 +23,6 @@ import semver from 'semver';
|
|
|
22
23
|
import { getPackageInfo } from 'local-pkg';
|
|
23
24
|
import { resolveBuiltinPresets } from 'unimport';
|
|
24
25
|
import boxen from 'boxen';
|
|
25
|
-
import { debounce } from 'perfect-debounce';
|
|
26
26
|
import require$$0$1 from 'fs';
|
|
27
27
|
import require$$1 from 'tty';
|
|
28
28
|
import require$$1$1 from 'util';
|
|
@@ -30,7 +30,7 @@ import require$$0 from 'os';
|
|
|
30
30
|
import { spawn } from 'child_process';
|
|
31
31
|
import { runtimeDir, clientDir, packageDir, isGlobalInstall } from '../dirs.mjs';
|
|
32
32
|
|
|
33
|
-
const version = "0.
|
|
33
|
+
const version = "0.7.1";
|
|
34
34
|
|
|
35
35
|
/*! (c) 2020 Andrea Giammarchi */
|
|
36
36
|
|
|
@@ -142,11 +142,11 @@ async function getDevAuthToken() {
|
|
|
142
142
|
const dir = join(home, ".nuxt/devtools");
|
|
143
143
|
const filepath = join(dir, "dev-auth-token.txt");
|
|
144
144
|
if (existsSync(filepath))
|
|
145
|
-
token = (await
|
|
145
|
+
token = (await fs.readFile(filepath, "utf-8")).trim();
|
|
146
146
|
if (!token)
|
|
147
147
|
token = randomStr(32);
|
|
148
|
-
await
|
|
149
|
-
await
|
|
148
|
+
await fs.mkdir(dir, { recursive: true });
|
|
149
|
+
await fs.writeFile(filepath, token, "utf-8");
|
|
150
150
|
return token;
|
|
151
151
|
}
|
|
152
152
|
|
|
@@ -216,47 +216,62 @@ function setupStorageRPC({
|
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
function setupAssetsRPC({ nuxt, ensureDevAuthToken }) {
|
|
219
|
+
function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh }) {
|
|
220
220
|
const _imageMetaCache = /* @__PURE__ */ new Map();
|
|
221
|
+
let cache = null;
|
|
222
|
+
const publicDir = resolve(nuxt.options.srcDir, nuxt.options.dir.public);
|
|
223
|
+
const refreshDebounced = debounce(() => {
|
|
224
|
+
cache = null;
|
|
225
|
+
refresh("getStaticAssets");
|
|
226
|
+
}, 500);
|
|
227
|
+
nuxt.hook("builder:watch", (event, key) => {
|
|
228
|
+
if (key.startsWith(publicDir) && (event === "add" || event === "unlink"))
|
|
229
|
+
refreshDebounced();
|
|
230
|
+
});
|
|
231
|
+
async function scan() {
|
|
232
|
+
if (cache)
|
|
233
|
+
return cache;
|
|
234
|
+
const baseURL = nuxt.options.app.baseURL;
|
|
235
|
+
const files = await fg(["**/*"], {
|
|
236
|
+
cwd: publicDir,
|
|
237
|
+
onlyFiles: true
|
|
238
|
+
});
|
|
239
|
+
function guessType(path) {
|
|
240
|
+
if (/\.(png|jpe?g|jxl|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path))
|
|
241
|
+
return "image";
|
|
242
|
+
if (/\.(mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|ts|mts|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)$/i.test(path))
|
|
243
|
+
return "video";
|
|
244
|
+
if (/\.(mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)$/i.test(path))
|
|
245
|
+
return "audio";
|
|
246
|
+
if (/\.(woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)/i.test(path))
|
|
247
|
+
return "font";
|
|
248
|
+
if (/\.(json[5c]?|te?xt|[mc]?[jt]sx?|md[cx]?|markdown)/i.test(path))
|
|
249
|
+
return "text";
|
|
250
|
+
return "other";
|
|
251
|
+
}
|
|
252
|
+
cache = await Promise.all(files.map(async (path) => {
|
|
253
|
+
const filePath = resolve(publicDir, path);
|
|
254
|
+
const stat = await fs.lstat(filePath);
|
|
255
|
+
return {
|
|
256
|
+
path,
|
|
257
|
+
publicPath: join$1(baseURL, path),
|
|
258
|
+
filePath,
|
|
259
|
+
type: guessType(path),
|
|
260
|
+
size: stat.size,
|
|
261
|
+
mtime: stat.mtimeMs
|
|
262
|
+
};
|
|
263
|
+
}));
|
|
264
|
+
return cache;
|
|
265
|
+
}
|
|
221
266
|
return {
|
|
222
267
|
async getStaticAssets() {
|
|
223
|
-
|
|
224
|
-
const baseURL = nuxt.options.app.baseURL;
|
|
225
|
-
const files = await fg(["**/*"], {
|
|
226
|
-
cwd: dir,
|
|
227
|
-
onlyFiles: true
|
|
228
|
-
});
|
|
229
|
-
function guessType(path) {
|
|
230
|
-
if (/\.(png|jpe?g|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path))
|
|
231
|
-
return "image";
|
|
232
|
-
if (/\.(mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|ts|mts|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)$/i.test(path))
|
|
233
|
-
return "video";
|
|
234
|
-
if (/\.(mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)$/i.test(path))
|
|
235
|
-
return "audio";
|
|
236
|
-
if (/\.(woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)/i.test(path))
|
|
237
|
-
return "font";
|
|
238
|
-
if (/\.(json[5c]?|te?xt|[mc]?[jt]sx?|md[cx]?|markdown)/i.test(path))
|
|
239
|
-
return "text";
|
|
240
|
-
return "other";
|
|
241
|
-
}
|
|
242
|
-
return await Promise.all(files.map(async (path) => {
|
|
243
|
-
const filePath = resolve(dir, path);
|
|
244
|
-
const stat = await fsp.lstat(filePath);
|
|
245
|
-
return {
|
|
246
|
-
path,
|
|
247
|
-
publicPath: join$1(baseURL, path),
|
|
248
|
-
filePath,
|
|
249
|
-
type: guessType(path),
|
|
250
|
-
size: stat.size,
|
|
251
|
-
mtime: stat.mtimeMs
|
|
252
|
-
};
|
|
253
|
-
}));
|
|
268
|
+
return await scan();
|
|
254
269
|
},
|
|
255
270
|
async getImageMeta(filepath) {
|
|
256
271
|
if (_imageMetaCache.has(filepath))
|
|
257
272
|
return _imageMetaCache.get(filepath);
|
|
258
273
|
try {
|
|
259
|
-
const meta = imageMeta(await
|
|
274
|
+
const meta = imageMeta(await fs.readFile(filepath));
|
|
260
275
|
_imageMetaCache.set(filepath, meta);
|
|
261
276
|
return meta;
|
|
262
277
|
} catch (e) {
|
|
@@ -267,7 +282,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
267
282
|
},
|
|
268
283
|
async getTextAssetContent(filepath, limit = 300) {
|
|
269
284
|
try {
|
|
270
|
-
const content = await
|
|
285
|
+
const content = await fs.readFile(filepath, "utf-8");
|
|
271
286
|
return content.slice(0, limit);
|
|
272
287
|
} catch (e) {
|
|
273
288
|
console.error(e);
|
|
@@ -281,16 +296,16 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
281
296
|
files.map(async ({ name, data }) => {
|
|
282
297
|
let dir = resolve(baseDir, name);
|
|
283
298
|
try {
|
|
284
|
-
await
|
|
299
|
+
await fs.stat(dir);
|
|
285
300
|
const ext = dir.split(".").pop();
|
|
286
301
|
const base = dir.slice(0, dir.length - ext.length - 1);
|
|
287
302
|
let i = 1;
|
|
288
|
-
while (await
|
|
303
|
+
while (await fs.access(`${base}-${i}.${ext}`).then(() => true).catch(() => false))
|
|
289
304
|
i++;
|
|
290
305
|
dir = `${base}-${i}.${ext}`;
|
|
291
306
|
} catch (err) {
|
|
292
307
|
}
|
|
293
|
-
await
|
|
308
|
+
await fs.writeFile(dir, data, "base64");
|
|
294
309
|
return dir;
|
|
295
310
|
})
|
|
296
311
|
);
|
|
@@ -359,6 +374,8 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
359
374
|
processId
|
|
360
375
|
};
|
|
361
376
|
}
|
|
377
|
+
const installSet = /* @__PURE__ */ new Set();
|
|
378
|
+
let latestGenerated = null;
|
|
362
379
|
return {
|
|
363
380
|
checkForUpdateFor(name) {
|
|
364
381
|
if (!updatesPromise.has(name))
|
|
@@ -375,12 +392,16 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
375
392
|
await ensureDevAuthToken(token);
|
|
376
393
|
const commands = await getNpmCommand("install", name, { dev: true });
|
|
377
394
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
378
|
-
|
|
379
|
-
|
|
395
|
+
let source = latestGenerated;
|
|
396
|
+
if (source == null)
|
|
397
|
+
source = await fs.readFile(filepath, "utf-8");
|
|
398
|
+
const mod = parseModule(source, { sourceFileName: filepath });
|
|
380
399
|
addNuxtModule(mod, name);
|
|
381
400
|
const generated = mod.generate().code;
|
|
382
401
|
const processId = `nuxt:add-module:${name}`;
|
|
383
402
|
if (!dry) {
|
|
403
|
+
latestGenerated = generated;
|
|
404
|
+
installSet.add(name);
|
|
384
405
|
const process = startSubprocess({
|
|
385
406
|
command: commands[0],
|
|
386
407
|
args: commands.slice(1)
|
|
@@ -393,12 +414,16 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
393
414
|
const execa = process.getProcess();
|
|
394
415
|
const result = await execa;
|
|
395
416
|
await Promise.resolve();
|
|
417
|
+
installSet.delete(name);
|
|
396
418
|
const code = result.exitCode;
|
|
397
419
|
if (code !== 0) {
|
|
398
420
|
console.error(result.stderr);
|
|
399
421
|
throw new Error(`Failed to install module, process exited with ${code}`);
|
|
400
422
|
}
|
|
401
|
-
|
|
423
|
+
if (installSet.size === 0) {
|
|
424
|
+
latestGenerated = null;
|
|
425
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
426
|
+
}
|
|
402
427
|
}
|
|
403
428
|
return {
|
|
404
429
|
configOriginal: source,
|
|
@@ -411,7 +436,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
411
436
|
await ensureDevAuthToken(token);
|
|
412
437
|
const commands = await getNpmCommand("uninstall", name);
|
|
413
438
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
414
|
-
const source = await
|
|
439
|
+
const source = await fs.readFile(filepath, "utf-8");
|
|
415
440
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
416
441
|
const config = getDefaultExportOptions(mod);
|
|
417
442
|
config.modules || (config.modules = []);
|
|
@@ -441,7 +466,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
441
466
|
console.error(result.stderr);
|
|
442
467
|
throw new Error(`Failed to uninstall module', process exited with ${code}`);
|
|
443
468
|
}
|
|
444
|
-
await
|
|
469
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
445
470
|
}
|
|
446
471
|
return {
|
|
447
472
|
configOriginal: source,
|
|
@@ -667,7 +692,7 @@ function setupGeneralRPC({ nuxt, options, refresh, openInEditorHooks }) {
|
|
|
667
692
|
c.bold(info),
|
|
668
693
|
"",
|
|
669
694
|
"Please open the following URL in the browser:",
|
|
670
|
-
c.bold(c.green(
|
|
695
|
+
c.bold(c.green(`${nuxt.options.devServer.https ? "https" : "http"}://${nuxt.options.devServer.host || "localhost"}:${nuxt.options.devServer.port}${ROUTE_AUTH}?token=${token}`)),
|
|
671
696
|
"",
|
|
672
697
|
"Or manually copy and paste the following token:",
|
|
673
698
|
c.bold(c.cyan(token))
|
|
@@ -702,16 +727,16 @@ const route = useRoute()
|
|
|
702
727
|
async function enablePages(nuxt) {
|
|
703
728
|
const pathApp = join$1(nuxt.options.srcDir, "app.vue");
|
|
704
729
|
const pathPageIndex = join$1(nuxt.options.srcDir, "pages/index.vue");
|
|
705
|
-
if (fs.existsSync(pathPageIndex)) {
|
|
730
|
+
if (fs$1.existsSync(pathPageIndex)) {
|
|
706
731
|
logger.warn("pages/index.vue already exists, skipping");
|
|
707
732
|
return;
|
|
708
733
|
}
|
|
709
|
-
let appContent = fs.existsSync(pathApp) ? await
|
|
710
|
-
await
|
|
711
|
-
await
|
|
734
|
+
let appContent = fs$1.existsSync(pathApp) ? await fs.readFile(pathApp, "utf-8") : void 0;
|
|
735
|
+
await fs.mkdir(dirname(pathPageIndex), { recursive: true });
|
|
736
|
+
await fs.writeFile(pathPageIndex, pagesIndexTemplate, "utf-8");
|
|
712
737
|
if (appContent && !appContent.includes("<NuxtPage")) {
|
|
713
738
|
appContent = appContent.replace("</template>", " <NuxtPage />\n</template>").replace(/<NuxtWelcome\s*\/>/, "");
|
|
714
|
-
await
|
|
739
|
+
await fs.writeFile(pathApp, appContent, "utf-8");
|
|
715
740
|
}
|
|
716
741
|
logger.success("Routing creation wizard completed");
|
|
717
742
|
}
|
|
@@ -6212,27 +6237,31 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
6212
6237
|
const files = await fg("*/meta.json", { cwd: analyzeDir, onlyFiles: true, absolute: true });
|
|
6213
6238
|
builds = await Promise.all(files.map(async (file) => {
|
|
6214
6239
|
const dir = dirname(file);
|
|
6215
|
-
const json = JSON.parse(await
|
|
6240
|
+
const json = JSON.parse(await fs.readFile(file, "utf-8"));
|
|
6216
6241
|
return {
|
|
6217
6242
|
...json,
|
|
6218
6243
|
features: {
|
|
6219
|
-
bundleClient: fs.existsSync(join$1(dir, "client.html")),
|
|
6220
|
-
bundleNitro: fs.existsSync(join$1(dir, "nitro.html")),
|
|
6221
|
-
viteInspect: fs.existsSync(join$1(dir, ".vite-inspect"))
|
|
6244
|
+
bundleClient: fs$1.existsSync(join$1(dir, "client.html")),
|
|
6245
|
+
bundleNitro: fs$1.existsSync(join$1(dir, "nitro.html")),
|
|
6246
|
+
viteInspect: fs$1.existsSync(join$1(dir, ".vite-inspect"))
|
|
6222
6247
|
}
|
|
6223
6248
|
};
|
|
6224
6249
|
}));
|
|
6225
6250
|
return builds.sort((a, b) => b.endTime - a.endTime);
|
|
6226
6251
|
}
|
|
6227
6252
|
async function generateAnalyzeBuildName() {
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6253
|
+
try {
|
|
6254
|
+
const git = esm_default(nuxt.options.rootDir);
|
|
6255
|
+
const branch = await git.branch();
|
|
6256
|
+
const branchName = branch.current || "head";
|
|
6257
|
+
const sha = await git.revparse(["--short", "HEAD"]);
|
|
6258
|
+
const isWorkingTreeClean = (await git.status()).isClean();
|
|
6259
|
+
if (isWorkingTreeClean)
|
|
6260
|
+
return `${branchName}#${sha}`;
|
|
6261
|
+
return `${branchName}#${sha}-dirty`;
|
|
6262
|
+
} catch (e) {
|
|
6263
|
+
return (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-");
|
|
6264
|
+
}
|
|
6236
6265
|
}
|
|
6237
6266
|
return {
|
|
6238
6267
|
async getAnalyzeBuildInfo() {
|
|
@@ -6247,10 +6276,10 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
6247
6276
|
async clearAnalyzeBuilds(token, names) {
|
|
6248
6277
|
await ensureDevAuthToken(token);
|
|
6249
6278
|
if (!names) {
|
|
6250
|
-
await
|
|
6279
|
+
await fs.rm(analyzeDir, { recursive: true, force: true });
|
|
6251
6280
|
} else {
|
|
6252
6281
|
const targets = builds.filter((build) => names.includes(build.name));
|
|
6253
|
-
await Promise.all(targets.map((target) =>
|
|
6282
|
+
await Promise.all(targets.map((target) => fs.rm(join$1(analyzeDir, target.slug), { recursive: true, force: true })));
|
|
6254
6283
|
}
|
|
6255
6284
|
initalized = readBuildInfo();
|
|
6256
6285
|
refresh("getAnalyzeBuildInfo");
|
|
@@ -6846,7 +6875,7 @@ async function readOptions(defaults, options) {
|
|
|
6846
6875
|
if (existsSync(filePath)) {
|
|
6847
6876
|
const options2 = {
|
|
6848
6877
|
...defaults,
|
|
6849
|
-
...JSON.parse(await
|
|
6878
|
+
...JSON.parse(await fs.readFile(filePath, "utf-8")).settings || {}
|
|
6850
6879
|
};
|
|
6851
6880
|
return options2;
|
|
6852
6881
|
} else {
|
|
@@ -6856,14 +6885,14 @@ async function readOptions(defaults, options) {
|
|
|
6856
6885
|
async function writeOptions(settings, options) {
|
|
6857
6886
|
const dir = join$1(homedir(), ".nuxt/devtools");
|
|
6858
6887
|
if (!existsSync(dir))
|
|
6859
|
-
await
|
|
6888
|
+
await fs.mkdir(dir, { recursive: true });
|
|
6860
6889
|
let hashedKey;
|
|
6861
6890
|
if (options.key)
|
|
6862
6891
|
hashedKey = hash(`${options.root}:${options.key}`);
|
|
6863
6892
|
else
|
|
6864
6893
|
hashedKey = hash(options.root);
|
|
6865
6894
|
const filePath = join$1(dir, `${hashedKey}.json`);
|
|
6866
|
-
await
|
|
6895
|
+
await fs.writeFile(
|
|
6867
6896
|
filePath,
|
|
6868
6897
|
JSON.stringify(
|
|
6869
6898
|
{
|
|
@@ -6907,6 +6936,26 @@ function setupOptionsRPC({ nuxt }) {
|
|
|
6907
6936
|
};
|
|
6908
6937
|
}
|
|
6909
6938
|
|
|
6939
|
+
function setupTimelineRPC({ nuxt }) {
|
|
6940
|
+
return {
|
|
6941
|
+
async enableTimeline(dry) {
|
|
6942
|
+
const filepath = nuxt.options._nuxtConfigFile;
|
|
6943
|
+
const source = await fs.readFile(filepath, "utf-8");
|
|
6944
|
+
const mod = await parseModule(source, { sourceFileName: filepath });
|
|
6945
|
+
const options = getDefaultExportOptions(mod);
|
|
6946
|
+
options.devtools = options.devtools || {};
|
|
6947
|
+
options.devtools.timeline = options.devtools.timeline || {};
|
|
6948
|
+
options.devtools.timeline.enabled = true;
|
|
6949
|
+
const generated = mod.generate().code;
|
|
6950
|
+
if (!dry) {
|
|
6951
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
6952
|
+
await nuxt.callHook("restart", { hard: true });
|
|
6953
|
+
}
|
|
6954
|
+
return [source, generated];
|
|
6955
|
+
}
|
|
6956
|
+
};
|
|
6957
|
+
}
|
|
6958
|
+
|
|
6910
6959
|
function setupRPC(nuxt, options) {
|
|
6911
6960
|
const serverFunctions = {};
|
|
6912
6961
|
const extendedRpcMap = /* @__PURE__ */ new Map();
|
|
@@ -6968,7 +7017,8 @@ function setupRPC(nuxt, options) {
|
|
|
6968
7017
|
...setupTerminalRPC(ctx),
|
|
6969
7018
|
...setupServerRoutesRPC(ctx),
|
|
6970
7019
|
...setupAnalyzeBuildRPC(ctx),
|
|
6971
|
-
...setupOptionsRPC(ctx)
|
|
7020
|
+
...setupOptionsRPC(ctx),
|
|
7021
|
+
...setupTimelineRPC(ctx)
|
|
6972
7022
|
});
|
|
6973
7023
|
const wsClients = /* @__PURE__ */ new Set();
|
|
6974
7024
|
const vitePlugin = {
|
|
@@ -7101,7 +7151,8 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
7101
7151
|
import('./plugin-metrics.mjs').then(({ setup }) => setup(ctx)),
|
|
7102
7152
|
options.viteInspect !== false ? import('./vite-inspect.mjs').then(({ setup }) => setup(ctx)) : null,
|
|
7103
7153
|
options.componentInspector !== false ? import('./vue-inspector.mjs').then(({ setup }) => setup(ctx)) : null,
|
|
7104
|
-
options.vscode?.enabled ? import('./vscode.mjs').then(({ setup }) => setup(ctx)) : null
|
|
7154
|
+
options.vscode?.enabled ? import('./vscode.mjs').then(({ setup }) => setup(ctx)) : null,
|
|
7155
|
+
options.experimental?.timeline || options.timeline?.enabled ? import('./timeline.mjs').then(({ setup }) => setup(ctx)) : null
|
|
7105
7156
|
];
|
|
7106
7157
|
await Promise.all(integrations);
|
|
7107
7158
|
await nuxt.callHook("devtools:initialized", {
|
|
@@ -18,18 +18,21 @@ function ${WRAPPER_KEY} (plugin, src) {
|
|
|
18
18
|
if (!plugin)
|
|
19
19
|
return plugin
|
|
20
20
|
|
|
21
|
-
return defineNuxtPlugin(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
return defineNuxtPlugin({
|
|
22
|
+
...plugin,
|
|
23
|
+
async setup (...args) {
|
|
24
|
+
const start = performance.now()
|
|
25
|
+
const result = await plugin.apply(this, args)
|
|
26
|
+
const end = performance.now()
|
|
27
|
+
globalThis.${PAYLOAD_KEY}.push({
|
|
28
|
+
src,
|
|
29
|
+
start,
|
|
30
|
+
end,
|
|
31
|
+
duration: end - start,
|
|
32
|
+
})
|
|
33
|
+
return result
|
|
34
|
+
}
|
|
35
|
+
})
|
|
33
36
|
}
|
|
34
37
|
`;
|
|
35
38
|
const imports = Array.from(content.matchAll(/(?:\n|^)import (.*) from ['"](.*)['"]/g)).map(([, name, path]) => ({ name, path }));
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { resolve } from 'pathe';
|
|
2
|
+
import semver from 'semver';
|
|
3
|
+
import { runtimeDir } from '../dirs.mjs';
|
|
4
|
+
import 'node:path';
|
|
5
|
+
import 'node:url';
|
|
6
|
+
import 'is-installed-globally';
|
|
7
|
+
|
|
8
|
+
async function setup({ nuxt, options }) {
|
|
9
|
+
const helperPath = resolve(runtimeDir, "function-metrics-helpers");
|
|
10
|
+
const includeFrom = options.timeline?.functions?.includeFrom || [
|
|
11
|
+
"#app",
|
|
12
|
+
"@unhead/vue"
|
|
13
|
+
];
|
|
14
|
+
const include = options.timeline?.functions?.include || [
|
|
15
|
+
(i) => includeFrom.includes(i.from),
|
|
16
|
+
(i) => i.from.includes("composables")
|
|
17
|
+
];
|
|
18
|
+
const exclude = options.timeline?.functions?.exclude || [
|
|
19
|
+
/^define[A-Z]/
|
|
20
|
+
];
|
|
21
|
+
function filter(item) {
|
|
22
|
+
if (item.type)
|
|
23
|
+
return false;
|
|
24
|
+
const name = item.as || item.name;
|
|
25
|
+
if (!include.some((f) => typeof f === "function" ? f(item) : typeof f === "string" ? name === f : f.test(name)))
|
|
26
|
+
return false;
|
|
27
|
+
if (exclude.some((f) => typeof f === "function" ? f(item) : typeof f === "string" ? name === f : f.test(name)))
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
nuxt.hook("imports:context", (unimport) => {
|
|
32
|
+
const ctx = unimport.getInternalContext();
|
|
33
|
+
if (!ctx.version || !semver.gte(ctx.version, "3.1.0"))
|
|
34
|
+
throw new Error(`[Nuxt DevTools] The timeline feature requires \`unimport\` >= v3.1.0, but got \`${ctx.version || "(unknown)"}\`. Please upgrade using \`nuxi upgrade --force\`.`);
|
|
35
|
+
ctx.addons.push(
|
|
36
|
+
{
|
|
37
|
+
injectImportsResolved(imports) {
|
|
38
|
+
return imports.map((i) => {
|
|
39
|
+
if (!filter(i))
|
|
40
|
+
return i;
|
|
41
|
+
const name = i.as || i.name;
|
|
42
|
+
return {
|
|
43
|
+
...i,
|
|
44
|
+
meta: {
|
|
45
|
+
wrapperOriginalAs: name
|
|
46
|
+
},
|
|
47
|
+
as: `_$__${name}`
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
injectImportsStringified(str, imports, s) {
|
|
52
|
+
const code = s.toString();
|
|
53
|
+
const injected = imports.filter((i) => i.meta?.wrapperOriginalAs);
|
|
54
|
+
if (injected.length) {
|
|
55
|
+
const result = [
|
|
56
|
+
str,
|
|
57
|
+
code.includes("__nuxtTimelineWrap") ? "" : `import { __nuxtTimelineWrap } from ${JSON.stringify(helperPath)}`,
|
|
58
|
+
...injected.map((i) => `const ${i.meta.wrapperOriginalAs} = __nuxtTimelineWrap(${JSON.stringify(i.name)}, ${i.as})`),
|
|
59
|
+
""
|
|
60
|
+
].join(";");
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { setup };
|
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hostname } from 'node:os';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import { logger } from '@nuxt/kit';
|
|
6
6
|
import { execa } from 'execa';
|
|
@@ -14,11 +14,12 @@ import 'vite';
|
|
|
14
14
|
import 'sirv';
|
|
15
15
|
import 'picocolors';
|
|
16
16
|
import 'birpc';
|
|
17
|
-
import '../shared/devtools.
|
|
17
|
+
import '../shared/devtools.d198e7a9.mjs';
|
|
18
18
|
import '../dirs.mjs';
|
|
19
19
|
import 'node:url';
|
|
20
20
|
import 'is-installed-globally';
|
|
21
21
|
import 'image-meta';
|
|
22
|
+
import 'perfect-debounce';
|
|
22
23
|
import 'fast-glob';
|
|
23
24
|
import 'nypm';
|
|
24
25
|
import 'magicast';
|
|
@@ -29,7 +30,6 @@ import 'semver';
|
|
|
29
30
|
import 'local-pkg';
|
|
30
31
|
import 'unimport';
|
|
31
32
|
import 'boxen';
|
|
32
|
-
import 'perfect-debounce';
|
|
33
33
|
import 'fs';
|
|
34
34
|
import 'tty';
|
|
35
35
|
import 'util';
|
|
@@ -51,7 +51,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
51
51
|
if (!existsSync(vscodeServerControllerFile))
|
|
52
52
|
return false;
|
|
53
53
|
try {
|
|
54
|
-
const { port: port2 } = JSON.parse(await
|
|
54
|
+
const { port: port2 } = JSON.parse(await fs.readFile(vscodeServerControllerFile, "utf-8"));
|
|
55
55
|
const url2 = `http://localhost:${port2}/open?path=${encodeURIComponent(file)}`;
|
|
56
56
|
await fetch(url2);
|
|
57
57
|
rpc.broadcast.navigateTo("/modules/custom-builtin-vscode");
|
|
@@ -64,7 +64,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
64
64
|
});
|
|
65
65
|
async function startCodeServer() {
|
|
66
66
|
if (existsSync(vscodeServerControllerFile))
|
|
67
|
-
await
|
|
67
|
+
await fs.rm(vscodeServerControllerFile, { force: true });
|
|
68
68
|
if (vsOptions?.reuseExistingServer && !await checkPort(port)) {
|
|
69
69
|
loaded = true;
|
|
70
70
|
url = `http://localhost:${port}/?folder=${encodeURIComponent(root)}`;
|
package/dist/client/200.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html >
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.6507cb32.js"><link rel="preload" as="style" href="/__nuxt_devtools__/client/_nuxt/entry.6f7d64f9.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.7ae8a638.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.7e3f9818.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.748a1c93.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.2f8cf810.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/nuxt-docs.100caa70.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/unocss-runtime.d07b0096.js"><link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-404.91003ceb.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-404.66ff8897.js"><link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-500.7e02f53c.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-500.34984f69.js"><link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.6f7d64f9.css"><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?f():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function d(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
|
|
5
5
|
</script></head>
|
|
6
|
-
<body ><div id="__nuxt"><svg class="nuxt-spa-loading" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 25" fill="none" width="80"><path d="M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567"></path></svg><style>.nuxt-spa-loading{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%)}.nuxt-spa-loading>path{fill:none;stroke:#00DC82;stroke-width:4px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:128;stroke-dashoffset:128;animation:nuxt-spa-loading-move 3s linear infinite}@keyframes nuxt-spa-loading-move{100%{stroke-dashoffset:-128}}</style></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__nuxt_devtools__/client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.
|
|
6
|
+
<body ><div id="__nuxt"><svg class="nuxt-spa-loading" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 25" fill="none" width="80"><path d="M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567"></path></svg><style>.nuxt-spa-loading{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%)}.nuxt-spa-loading>path{fill:none;stroke:#00DC82;stroke-width:4px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:128;stroke-dashoffset:128;animation:nuxt-spa-loading-move 3s linear infinite}@keyframes nuxt-spa-loading-move{100%{stroke-dashoffset:-128}}</style></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__nuxt_devtools__/client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.6507cb32.js" crossorigin></script></body>
|
|
7
7
|
</html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html >
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.6507cb32.js"><link rel="preload" as="style" href="/__nuxt_devtools__/client/_nuxt/entry.6f7d64f9.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.7ae8a638.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.7e3f9818.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.748a1c93.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.2f8cf810.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/nuxt-docs.100caa70.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/unocss-runtime.d07b0096.js"><link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-404.91003ceb.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-404.66ff8897.js"><link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-500.7e02f53c.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-500.34984f69.js"><link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.6f7d64f9.css"><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?f():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function d(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
|
|
5
5
|
</script></head>
|
|
6
|
-
<body ><div id="__nuxt"><svg class="nuxt-spa-loading" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 25" fill="none" width="80"><path d="M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567"></path></svg><style>.nuxt-spa-loading{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%)}.nuxt-spa-loading>path{fill:none;stroke:#00DC82;stroke-width:4px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:128;stroke-dashoffset:128;animation:nuxt-spa-loading-move 3s linear infinite}@keyframes nuxt-spa-loading-move{100%{stroke-dashoffset:-128}}</style></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__nuxt_devtools__/client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.
|
|
6
|
+
<body ><div id="__nuxt"><svg class="nuxt-spa-loading" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 25" fill="none" width="80"><path d="M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567"></path></svg><style>.nuxt-spa-loading{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%)}.nuxt-spa-loading>path{fill:none;stroke:#00DC82;stroke-width:4px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:128;stroke-dashoffset:128;animation:nuxt-spa-loading-move 3s linear infinite}@keyframes nuxt-spa-loading-move{100%{stroke-dashoffset:-128}}</style></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__nuxt_devtools__/client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.6507cb32.js" crossorigin></script></body>
|
|
7
7
|
</html>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html >
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="modulepreload" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/entry.6507cb32.js"><link rel="preload" as="style" href="/__nuxt_devtools__/client/_nuxt/entry.6f7d64f9.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.7ae8a638.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.7e3f9818.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.748a1c93.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.2f8cf810.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/nuxt-docs.100caa70.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/unocss-runtime.d07b0096.js"><link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-404.91003ceb.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-404.66ff8897.js"><link rel="prefetch" as="style" href="/__nuxt_devtools__/client/_nuxt/error-500.7e02f53c.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-500.34984f69.js"><link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.6f7d64f9.css"><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?f():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function d(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
|
|
5
5
|
</script></head>
|
|
6
|
-
<body ><div id="__nuxt"><svg class="nuxt-spa-loading" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 25" fill="none" width="80"><path d="M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567"></path></svg><style>.nuxt-spa-loading{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%)}.nuxt-spa-loading>path{fill:none;stroke:#00DC82;stroke-width:4px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:128;stroke-dashoffset:128;animation:nuxt-spa-loading-move 3s linear infinite}@keyframes nuxt-spa-loading-move{100%{stroke-dashoffset:-128}}</style></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__nuxt_devtools__/client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.
|
|
6
|
+
<body ><div id="__nuxt"><svg class="nuxt-spa-loading" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 25" fill="none" width="80"><path d="M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567"></path></svg><style>.nuxt-spa-loading{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%)}.nuxt-spa-loading>path{fill:none;stroke:#00DC82;stroke-width:4px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:128;stroke-dashoffset:128;animation:nuxt-spa-loading-move 3s linear infinite}@keyframes nuxt-spa-loading-move{100%{stroke-dashoffset:-128}}</style></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__nuxt_devtools__/client",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="module" src="/__nuxt_devtools__/client/_nuxt/entry.6507cb32.js" crossorigin></script></body>
|
|
7
7
|
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as y,aa as x,ar as n,bm as _,A as l,r as m,s as c,h as g,w as d,Y as A,i as w,o as N,b as s,a as e,d as i,L as T,aR as q,a$ as V,bn as B,k as $,M as C,S as D,ad as P}from"./entry.6507cb32.js";const S=e("h3",{class:"mb2 text-lg font-medium leading-6",flex:"~ items-center gap-1","text-orange":""},[e("span",{class:"i-carbon-information-square"}),i(" Permissions required ")],-1),I=e("p",null," This operation requires permissions for running command and access files from the browser. ",-1),K=e("p",null,[i(" A request is sent to the server."),e("br"),i(" Please check your terminal for the instructions and then come back. ")],-1),M={flex:"~ gap-3",mt2:"","justify-end":""},R=e("p",null,"Or you can manually paste the token here:",-1),F=["onSubmit"],E=y({__name:"AuthRequiredPanel",setup(j){x(async()=>{n.value||_.value&&await l.verifyAuthToken(_.value)&&(n.value=!0),n.value||l.requestForAuth()});const o=m(""),r=m(!1);async function u(){const t=o.value.trim();r.value=!1,await l.verifyAuthToken(t).then(a=>{a?(n.value=!0,B(t)):r.value=!0})}return(t,a)=>{const f=$,p=C,h=D,v=P,k=w;return("isDevAuthed"in t?t.isDevAuthed:c(n))?A(t.$slots,"default",{key:1}):(N(),g(k,{key:0},{default:d(()=>[s(v,{flex:"~ col gap-2",mxa:"","items-center":"",p6:"","text-center":""},{default:d(()=>[S,I,K,e("div",M,[s(f,{disabled:"",icon:"i-carbon-time"},{default:d(()=>[i(" Waiting for authorization... ")]),_:1})]),R,e("form",{flex:"~ inline gap-2 items-center",onSubmit:V(u,["prevent"])},[s(p,{modelValue:c(o),"onUpdate:modelValue":a[0]||(a[0]=b=>T(o)?o.value=b:null),placeholder:"Enter token here",n:c(r)?"red":void 0,onKeydown:q(u,["enter"])},null,8,["modelValue","n","onKeydown"]),s(h,{icon:"i-carbon-arrow-right",onClick:u})],40,F)]),_:1})]),_:1}))}}});export{E as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as n,o,c as s,Y as t}from"./entry.6507cb32.js";const c={},r={class:"mx-0.5 select-none whitespace-nowrap rounded px-1.5 py-0.5 text-xs"};function _(e,a){return o(),s("span",r,[t(e.$slots,"default")])}const l=n(c,[["render",_]]);export{l as _};
|