@nuxt/devtools-nightly 3.2.4-29562025.ae68d3b → 3.2.4-29562036.34d136f
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 +72 -99
- package/dist/chunks/timeline.mjs +0 -1
- package/dist/chunks/vscode.mjs +6 -33
- package/dist/chunks/vue-devtools.mjs +0 -1
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/d2d46a75-49ca-480e-b7d1-e84ddfa8d8d2.json +1 -0
- package/dist/client/_nuxt/{kw5q5fgh.js → jdttf2bd.js} +2 -2
- package/dist/client/_nuxt/{overview-ief42zdl.js → overview-ioughj1v.js} +1 -1
- package/dist/client/_nuxt/{pages-okkqwdpu.js → pages-hixgzm0j.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/dirs.d.mts +1 -2
- package/dist/dirs.mjs +1 -21
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -5
- package/dist/shared/{devtools-nightly.CT6XRG-F.mjs → devtools-nightly.D8UuYYYu.mjs} +1 -7
- package/package.json +2 -5
- package/cli.mjs +0 -2
- package/dist/client/_nuxt/builds/meta/8a8fb872-0036-4085-892f-64b11a2b1c4d.json +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import fs, { existsSync, promises, statSync, realpathSync, readFileSync, accessSync, constants } from 'node:fs';
|
|
2
|
-
import
|
|
1
|
+
import fs$1, { existsSync, promises, statSync, realpathSync, readFileSync, accessSync, constants } from 'node:fs';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
3
|
import os, { homedir } from 'node:os';
|
|
4
4
|
import { logger, useNuxt, addVitePlugin, addPlugin, addTemplate, extendViteConfig, addImports } from '@nuxt/kit';
|
|
5
5
|
import { colors } from 'consola/utils';
|
|
6
6
|
import { join, dirname as dirname$1, resolve, isAbsolute } 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-nightly.
|
|
9
|
+
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools-nightly.D8UuYYYu.mjs';
|
|
10
10
|
import path, { dirname, join as join$1, relative, parse } from 'node:path';
|
|
11
11
|
import { hash } from 'ohash';
|
|
12
|
-
import { runtimeDir, clientDir, packageDir
|
|
12
|
+
import { runtimeDir, clientDir, packageDir } from '../dirs.mjs';
|
|
13
13
|
import { createBirpcGroup } from 'birpc';
|
|
14
14
|
import { parse as parse$1, stringify } from 'structured-clone-es';
|
|
15
15
|
import { startSubprocess } from '@nuxt/devtools-kit';
|
|
@@ -27,14 +27,13 @@ import assert from 'node:assert';
|
|
|
27
27
|
import v8 from 'node:v8';
|
|
28
28
|
import { format, inspect } from 'node:util';
|
|
29
29
|
import { resolveModule, getPackageInfo } from 'local-pkg';
|
|
30
|
-
import isInstalledGlobally from 'is-installed-globally';
|
|
31
30
|
import { parseModule } from 'magicast';
|
|
32
31
|
import { getDefaultExportOptions, addNuxtModule } from 'magicast/helpers';
|
|
33
32
|
import { detectPackageManager } from 'nypm';
|
|
34
33
|
import semver from 'semver';
|
|
35
34
|
import { normalizeBaseKey, normalizeKey } from 'unstorage';
|
|
36
35
|
|
|
37
|
-
const version$1 = "3.2.4-
|
|
36
|
+
const version$1 = "3.2.4-29562036.34d136f";
|
|
38
37
|
|
|
39
38
|
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
40
39
|
function randomStr(size = 16, dict = urlAlphabet) {
|
|
@@ -55,7 +54,7 @@ async function readLocalOptions(defaults, options) {
|
|
|
55
54
|
try {
|
|
56
55
|
const options2 = {
|
|
57
56
|
...defaults,
|
|
58
|
-
...JSON.parse(await
|
|
57
|
+
...JSON.parse(await fs.readFile(filePath, "utf-8")).settings || {}
|
|
59
58
|
};
|
|
60
59
|
return options2;
|
|
61
60
|
} catch (e) {
|
|
@@ -83,12 +82,12 @@ function getOptionsFilepath(options) {
|
|
|
83
82
|
async function clearLocalOptions(options) {
|
|
84
83
|
const { filePath } = getOptionsFilepath(options);
|
|
85
84
|
if (existsSync(filePath))
|
|
86
|
-
await
|
|
85
|
+
await fs.unlink(filePath);
|
|
87
86
|
}
|
|
88
87
|
async function writeLocalOptions(settings, options) {
|
|
89
88
|
const { filePath, hashedKey } = getOptionsFilepath(options);
|
|
90
|
-
await
|
|
91
|
-
await
|
|
89
|
+
await fs.mkdir(dirname(filePath), { recursive: true });
|
|
90
|
+
await fs.writeFile(
|
|
92
91
|
filePath,
|
|
93
92
|
JSON.stringify(
|
|
94
93
|
{
|
|
@@ -111,11 +110,11 @@ async function getDevAuthToken() {
|
|
|
111
110
|
const dir = join$1(home, ".nuxt/devtools");
|
|
112
111
|
const filepath = join$1(dir, "dev-auth-token.txt");
|
|
113
112
|
if (existsSync(filepath))
|
|
114
|
-
token = (await
|
|
113
|
+
token = (await fs.readFile(filepath, "utf-8")).trim();
|
|
115
114
|
if (!token)
|
|
116
115
|
token = randomStr(16);
|
|
117
|
-
await
|
|
118
|
-
await
|
|
116
|
+
await fs.mkdir(dir, { recursive: true });
|
|
117
|
+
await fs.writeFile(filepath, token, "utf-8");
|
|
119
118
|
return token;
|
|
120
119
|
}
|
|
121
120
|
|
|
@@ -162,10 +161,10 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
162
161
|
absolute: true
|
|
163
162
|
});
|
|
164
163
|
for (const file of files2) {
|
|
165
|
-
const slug = JSON.parse(await
|
|
164
|
+
const slug = JSON.parse(await fs.readFile(file, "utf-8")).slug;
|
|
166
165
|
const dir2 = dirname$1(file);
|
|
167
|
-
await
|
|
168
|
-
await
|
|
166
|
+
await fs.mkdir(devtoolsAnalyzeDir, { recursive: true });
|
|
167
|
+
await fs.rename(dir2, join(devtoolsAnalyzeDir, slug));
|
|
169
168
|
}
|
|
170
169
|
}
|
|
171
170
|
const files = await glob(["**/meta.json"], {
|
|
@@ -175,13 +174,13 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
175
174
|
});
|
|
176
175
|
builds = await Promise.all(files.map(async (file) => {
|
|
177
176
|
const dir = dirname$1(file);
|
|
178
|
-
const json = JSON.parse(await
|
|
177
|
+
const json = JSON.parse(await fs.readFile(file, "utf-8"));
|
|
179
178
|
return {
|
|
180
179
|
...json,
|
|
181
180
|
features: {
|
|
182
|
-
bundleClient: fs.existsSync(join(dir, "client.html")),
|
|
183
|
-
bundleNitro: fs.existsSync(join(dir, "nitro.html")),
|
|
184
|
-
viteInspect: fs.existsSync(join(dir, ".vite-inspect"))
|
|
181
|
+
bundleClient: fs$1.existsSync(join(dir, "client.html")),
|
|
182
|
+
bundleNitro: fs$1.existsSync(join(dir, "nitro.html")),
|
|
183
|
+
viteInspect: fs$1.existsSync(join(dir, ".vite-inspect"))
|
|
185
184
|
}
|
|
186
185
|
};
|
|
187
186
|
}));
|
|
@@ -214,10 +213,10 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
214
213
|
async clearAnalyzeBuilds(token, names) {
|
|
215
214
|
await ensureDevAuthToken(token);
|
|
216
215
|
if (!names) {
|
|
217
|
-
await
|
|
216
|
+
await fs.rm(devtoolsAnalyzeDir, { recursive: true, force: true });
|
|
218
217
|
} else {
|
|
219
218
|
const targets = builds.filter((build) => names.includes(build.name));
|
|
220
|
-
await Promise.all(targets.map((target) =>
|
|
219
|
+
await Promise.all(targets.map((target) => fs.rm(join(devtoolsAnalyzeDir, target.slug), { recursive: true, force: true })));
|
|
221
220
|
}
|
|
222
221
|
initalized = readBuildInfo();
|
|
223
222
|
refresh("getAnalyzeBuildInfo");
|
|
@@ -264,7 +263,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
264
263
|
const filePath = resolve(layerDir, path);
|
|
265
264
|
if (!filePath.startsWith(layerDir))
|
|
266
265
|
continue;
|
|
267
|
-
const stat = await
|
|
266
|
+
const stat = await fs.lstat(filePath);
|
|
268
267
|
const fullPath = join(baseURL, path);
|
|
269
268
|
if (!uniquePaths.has(fullPath)) {
|
|
270
269
|
cache.push({
|
|
@@ -291,7 +290,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
291
290
|
if (_imageMetaCache.has(filepath))
|
|
292
291
|
return _imageMetaCache.get(filepath);
|
|
293
292
|
try {
|
|
294
|
-
const meta = imageMeta(await
|
|
293
|
+
const meta = imageMeta(await fs.readFile(filepath));
|
|
295
294
|
_imageMetaCache.set(filepath, meta);
|
|
296
295
|
return meta;
|
|
297
296
|
} catch (e) {
|
|
@@ -303,7 +302,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
303
302
|
async getTextAssetContent(token, filepath, limit = 300) {
|
|
304
303
|
await ensureDevAuthToken(token);
|
|
305
304
|
try {
|
|
306
|
-
const content = await
|
|
305
|
+
const content = await fs.readFile(filepath, "utf-8");
|
|
307
306
|
return content.slice(0, limit);
|
|
308
307
|
} catch (e) {
|
|
309
308
|
console.error(e);
|
|
@@ -326,16 +325,16 @@ You can configure it in Nuxt config at \`devtools.assets.uploadExtensions\`.`);
|
|
|
326
325
|
}
|
|
327
326
|
if (!override) {
|
|
328
327
|
try {
|
|
329
|
-
await
|
|
328
|
+
await fs.stat(finalPath);
|
|
330
329
|
const base = finalPath.slice(0, finalPath.length - ext.length - 1);
|
|
331
330
|
let i = 1;
|
|
332
|
-
while (await
|
|
331
|
+
while (await fs.access(`${base}-${i}.${ext}`).then(() => true).catch(() => false))
|
|
333
332
|
i++;
|
|
334
333
|
finalPath = `${base}-${i}.${ext}`;
|
|
335
334
|
} catch {
|
|
336
335
|
}
|
|
337
336
|
}
|
|
338
|
-
await
|
|
337
|
+
await fs.writeFile(finalPath, content, {
|
|
339
338
|
encoding: encoding ?? "utf-8"
|
|
340
339
|
});
|
|
341
340
|
return finalPath;
|
|
@@ -344,14 +343,14 @@ You can configure it in Nuxt config at \`devtools.assets.uploadExtensions\`.`);
|
|
|
344
343
|
},
|
|
345
344
|
async deleteStaticAsset(token, path) {
|
|
346
345
|
await ensureDevAuthToken(token);
|
|
347
|
-
return await
|
|
346
|
+
return await fs.unlink(path);
|
|
348
347
|
},
|
|
349
348
|
async renameStaticAsset(token, oldPath, newPath) {
|
|
350
349
|
await ensureDevAuthToken(token);
|
|
351
350
|
const exist = cache?.find((asset) => asset.filePath === newPath);
|
|
352
351
|
if (exist)
|
|
353
352
|
throw new Error(`[Nuxt DevTools] File ${newPath} already exists, failed to rename`);
|
|
354
|
-
return await
|
|
353
|
+
return await fs.rename(oldPath, newPath);
|
|
355
354
|
}
|
|
356
355
|
};
|
|
357
356
|
}
|
|
@@ -7464,7 +7463,7 @@ function read(jsonPath, {base, specifier}) {
|
|
|
7464
7463
|
let string;
|
|
7465
7464
|
|
|
7466
7465
|
try {
|
|
7467
|
-
string = fs.readFileSync(path.toNamespacedPath(jsonPath), 'utf8');
|
|
7466
|
+
string = fs$1.readFileSync(path.toNamespacedPath(jsonPath), 'utf8');
|
|
7468
7467
|
} catch (error) {
|
|
7469
7468
|
const exception = /** @type {ErrnoException} */ (error);
|
|
7470
7469
|
|
|
@@ -10306,6 +10305,7 @@ function setupOptionsRPC({ nuxt }) {
|
|
|
10306
10305
|
const ABSOLUTE_PATH_RE = /^[a-z]:|^\//i;
|
|
10307
10306
|
const FILE_LINE_COL_RE = /^(.*?)(:[:\d]*)$/;
|
|
10308
10307
|
const MULTIPLE_SLASHES_RE$1 = /\/+/g;
|
|
10308
|
+
const NUXT_WELCOME_RE = /<NuxtWelcome\s*\/>/;
|
|
10309
10309
|
function setupGeneralRPC({
|
|
10310
10310
|
nuxt,
|
|
10311
10311
|
options,
|
|
@@ -10494,6 +10494,36 @@ function setupGeneralRPC({
|
|
|
10494
10494
|
return false;
|
|
10495
10495
|
}
|
|
10496
10496
|
},
|
|
10497
|
+
async enablePages(token) {
|
|
10498
|
+
await ensureDevAuthToken(token);
|
|
10499
|
+
const baseDir = nuxt.options.future.compatibilityVersion === 4 ? nuxt.options.dir.app : nuxt.options.srcDir;
|
|
10500
|
+
const pathApp = join(baseDir, "app.vue");
|
|
10501
|
+
const pathPageIndex = join(baseDir, "pages/index.vue");
|
|
10502
|
+
if (existsSync(pathPageIndex)) {
|
|
10503
|
+
logger.warn("pages/index.vue already exists, skipping");
|
|
10504
|
+
return;
|
|
10505
|
+
}
|
|
10506
|
+
const pagesIndexTemplate = `<script setup lang="ts">
|
|
10507
|
+
const route = useRoute()
|
|
10508
|
+
<\/script>
|
|
10509
|
+
|
|
10510
|
+
<template>
|
|
10511
|
+
<div>
|
|
10512
|
+
<h1>Nuxt Routing set up successfully!</h1>
|
|
10513
|
+
<p>Current route: {{ route.path }}</p>
|
|
10514
|
+
<a href="https://nuxt.com/docs/getting-started/routing" target="_blank">Learn more about Nuxt Routing</a>
|
|
10515
|
+
</div>
|
|
10516
|
+
</template>
|
|
10517
|
+
`;
|
|
10518
|
+
await fs.mkdir(dirname$1(pathPageIndex), { recursive: true });
|
|
10519
|
+
await fs.writeFile(pathPageIndex, pagesIndexTemplate, "utf-8");
|
|
10520
|
+
let appContent = existsSync(pathApp) ? await fs.readFile(pathApp, "utf-8") : void 0;
|
|
10521
|
+
if (appContent && !appContent.includes("<NuxtPage")) {
|
|
10522
|
+
appContent = appContent.replace("</template>", " <NuxtPage />\n</template>").replace(NUXT_WELCOME_RE, "");
|
|
10523
|
+
await fs.writeFile(pathApp, appContent, "utf-8");
|
|
10524
|
+
}
|
|
10525
|
+
logger.success("Routing creation completed");
|
|
10526
|
+
},
|
|
10497
10527
|
async restartNuxt(token, hard = true) {
|
|
10498
10528
|
await ensureDevAuthToken(token);
|
|
10499
10529
|
logger.info("Restarting Nuxt...");
|
|
@@ -10949,8 +10979,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
10949
10979
|
}
|
|
10950
10980
|
async function getNpmCommand(command, packageName, options = {}) {
|
|
10951
10981
|
const {
|
|
10952
|
-
dev = true
|
|
10953
|
-
global = packageName === "@nuxt/devtools" && isInstalledGlobally
|
|
10982
|
+
dev = true
|
|
10954
10983
|
} = options;
|
|
10955
10984
|
const agent = await getPackageManager();
|
|
10956
10985
|
const name = agent?.name || "npm";
|
|
@@ -10960,7 +10989,6 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
10960
10989
|
name === "npm" ? "install" : "add",
|
|
10961
10990
|
`${packageName}@latest`,
|
|
10962
10991
|
dev ? "-D" : "",
|
|
10963
|
-
global ? "-g" : "",
|
|
10964
10992
|
// In yarn berry, `--ignore-scripts` is removed
|
|
10965
10993
|
name === "yarn" && !agent?.version?.startsWith("1.") ? "" : "--ignore-scripts"
|
|
10966
10994
|
].filter(Boolean);
|
|
@@ -10969,8 +10997,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
10969
10997
|
return [
|
|
10970
10998
|
name,
|
|
10971
10999
|
name === "npm" ? "uninstall" : "remove",
|
|
10972
|
-
packageName
|
|
10973
|
-
global ? "-g" : ""
|
|
11000
|
+
packageName
|
|
10974
11001
|
].filter(Boolean);
|
|
10975
11002
|
}
|
|
10976
11003
|
}
|
|
@@ -11010,7 +11037,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
11010
11037
|
const commands = await getNpmCommand("install", name, { dev: true });
|
|
11011
11038
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
11012
11039
|
let source = latestGenerated;
|
|
11013
|
-
source ??= await
|
|
11040
|
+
source ??= await fs.readFile(filepath, "utf-8");
|
|
11014
11041
|
const generated = await magicastGuard(async () => {
|
|
11015
11042
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
11016
11043
|
addNuxtModule(mod, name);
|
|
@@ -11039,7 +11066,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
11039
11066
|
}
|
|
11040
11067
|
if (installSet.size === 0) {
|
|
11041
11068
|
latestGenerated = null;
|
|
11042
|
-
await
|
|
11069
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
11043
11070
|
}
|
|
11044
11071
|
}
|
|
11045
11072
|
return {
|
|
@@ -11053,7 +11080,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
11053
11080
|
await ensureDevAuthToken(token);
|
|
11054
11081
|
const commands = await getNpmCommand("uninstall", name);
|
|
11055
11082
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
11056
|
-
const source = await
|
|
11083
|
+
const source = await fs.readFile(filepath, "utf-8");
|
|
11057
11084
|
const generated = await magicastGuard(async () => {
|
|
11058
11085
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
11059
11086
|
const config = getDefaultExportOptions(mod);
|
|
@@ -11084,7 +11111,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
11084
11111
|
console.error(result.stderr);
|
|
11085
11112
|
throw new Error(`[Nuxt DevTools] Failed to uninstall module, process exited with ${code}`);
|
|
11086
11113
|
}
|
|
11087
|
-
await
|
|
11114
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
11088
11115
|
}
|
|
11089
11116
|
return {
|
|
11090
11117
|
configOriginal: source,
|
|
@@ -11498,7 +11525,7 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
11498
11525
|
return {
|
|
11499
11526
|
async enableTimeline(dry) {
|
|
11500
11527
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
11501
|
-
const source = await
|
|
11528
|
+
const source = await fs.readFile(filepath, "utf-8");
|
|
11502
11529
|
const generated = await magicastGuard(async () => {
|
|
11503
11530
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
11504
11531
|
const options = getDefaultExportOptions(mod);
|
|
@@ -11508,7 +11535,7 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
11508
11535
|
return mod.generate().code;
|
|
11509
11536
|
}, "\nYou can enable timeline manually by adding `devtools: { timeline: { enabled: true } }`");
|
|
11510
11537
|
if (!dry) {
|
|
11511
|
-
await
|
|
11538
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
11512
11539
|
await nuxt.callHook("restart", { hard: true });
|
|
11513
11540
|
}
|
|
11514
11541
|
return [source, generated];
|
|
@@ -11516,53 +11543,6 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
11516
11543
|
};
|
|
11517
11544
|
}
|
|
11518
11545
|
|
|
11519
|
-
const LOG_PREFIX = colors.cyan("Nuxt DevTools:");
|
|
11520
|
-
|
|
11521
|
-
const NUXT_WELCOME_RE = /<NuxtWelcome\s*\/>/;
|
|
11522
|
-
const pagesIndexTemplate = `<script setup lang="ts">
|
|
11523
|
-
const route = useRoute()
|
|
11524
|
-
<\/script>
|
|
11525
|
-
|
|
11526
|
-
<template>
|
|
11527
|
-
<div>
|
|
11528
|
-
<h1>Nuxt Routing set up successfully!</h1>
|
|
11529
|
-
<p>Current route: {{ route.path }}</p>
|
|
11530
|
-
<a href="https://nuxt.com/docs/getting-started/routing" target="_blank">Learn more about Nuxt Routing</a>
|
|
11531
|
-
</div>
|
|
11532
|
-
</template>
|
|
11533
|
-
`;
|
|
11534
|
-
async function enablePages(nuxt) {
|
|
11535
|
-
const baseDir = nuxt.options.future.compatibilityVersion === 4 ? nuxt.options.dir.app : nuxt.options.srcDir;
|
|
11536
|
-
const pathApp = join(baseDir, "app.vue");
|
|
11537
|
-
const pathPageIndex = join(baseDir, "pages/index.vue");
|
|
11538
|
-
if (fs.existsSync(pathPageIndex)) {
|
|
11539
|
-
logger.warn("pages/index.vue already exists, skipping");
|
|
11540
|
-
return;
|
|
11541
|
-
}
|
|
11542
|
-
let appContent = fs.existsSync(pathApp) ? await fsp.readFile(pathApp, "utf-8") : void 0;
|
|
11543
|
-
await fsp.mkdir(dirname$1(pathPageIndex), { recursive: true });
|
|
11544
|
-
await fsp.writeFile(pathPageIndex, pagesIndexTemplate, "utf-8");
|
|
11545
|
-
if (appContent && !appContent.includes("<NuxtPage")) {
|
|
11546
|
-
appContent = appContent.replace("</template>", " <NuxtPage />\n</template>").replace(NUXT_WELCOME_RE, "");
|
|
11547
|
-
await fsp.writeFile(pathApp, appContent, "utf-8");
|
|
11548
|
-
}
|
|
11549
|
-
logger.success("Routing creation wizard completed");
|
|
11550
|
-
}
|
|
11551
|
-
|
|
11552
|
-
const wizard = {
|
|
11553
|
-
enablePages
|
|
11554
|
-
};
|
|
11555
|
-
|
|
11556
|
-
function setupWizardRPC({ nuxt, ensureDevAuthToken }) {
|
|
11557
|
-
return {
|
|
11558
|
-
async runWizard(token, name, ...args) {
|
|
11559
|
-
await ensureDevAuthToken(token);
|
|
11560
|
-
logger.info(LOG_PREFIX, `Running wizard ${colors.green(name)}...`);
|
|
11561
|
-
return wizard[name](nuxt, ...args);
|
|
11562
|
-
}
|
|
11563
|
-
};
|
|
11564
|
-
}
|
|
11565
|
-
|
|
11566
11546
|
function setupRPC(nuxt, options) {
|
|
11567
11547
|
const serverFunctions = {};
|
|
11568
11548
|
const extendedRpcMap = /* @__PURE__ */ new Map();
|
|
@@ -11623,7 +11603,6 @@ function setupRPC(nuxt, options) {
|
|
|
11623
11603
|
...setupStorageRPC(ctx),
|
|
11624
11604
|
...setupAssetsRPC(ctx),
|
|
11625
11605
|
...setupNpmRPC(ctx),
|
|
11626
|
-
...setupWizardRPC(ctx),
|
|
11627
11606
|
...setupTerminalRPC(ctx),
|
|
11628
11607
|
...setupServerRoutesRPC(ctx),
|
|
11629
11608
|
...setupServerTasksRPC(ctx),
|
|
@@ -11802,7 +11781,7 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
11802
11781
|
server.middlewares.use(ROUTE_ANALYZE, sirv(devtoolsAnalyzeDir, { single: false, dev: true, dotfiles: true, ignores: false }));
|
|
11803
11782
|
if (clientDirExists) {
|
|
11804
11783
|
const indexHtmlPath = join(clientDir, "index.html");
|
|
11805
|
-
const indexContent =
|
|
11784
|
+
const indexContent = fs.readFile(indexHtmlPath, "utf-8");
|
|
11806
11785
|
const handleStatic = sirv(clientDir, {
|
|
11807
11786
|
dev: true,
|
|
11808
11787
|
single: false
|
|
@@ -11855,8 +11834,7 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
11855
11834
|
await Promise.all(integrations);
|
|
11856
11835
|
nuxt.hook("modules:done", () => nuxt.callHook("devtools:initialized", {
|
|
11857
11836
|
version: version$1,
|
|
11858
|
-
packagePath: packageDir
|
|
11859
|
-
isGlobalInstall: isGlobalInstall()
|
|
11837
|
+
packagePath: packageDir
|
|
11860
11838
|
}));
|
|
11861
11839
|
const isMac = os.platform() === "darwin";
|
|
11862
11840
|
logger.log([
|
|
@@ -11875,9 +11853,4 @@ function defineViteDevToolsPlugin(plugin) {
|
|
|
11875
11853
|
return plugin;
|
|
11876
11854
|
}
|
|
11877
11855
|
|
|
11878
|
-
|
|
11879
|
-
__proto__: null,
|
|
11880
|
-
enableModule: enableModule
|
|
11881
|
-
};
|
|
11882
|
-
|
|
11883
|
-
export { LOG_PREFIX as L, moduleMain as m };
|
|
11856
|
+
export { enableModule };
|
package/dist/chunks/timeline.mjs
CHANGED
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
3
|
import { hostname } from 'node:os';
|
|
4
4
|
import { resolve } from 'node:path';
|
|
5
5
|
import { startSubprocess } from '@nuxt/devtools-kit';
|
|
@@ -7,36 +7,9 @@ import { logger } from '@nuxt/kit';
|
|
|
7
7
|
import { checkPort, getPort } from 'get-port-please';
|
|
8
8
|
import { x } from 'tinyexec';
|
|
9
9
|
import which from 'which';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import 'sirv';
|
|
14
|
-
import 'vite';
|
|
15
|
-
import '../shared/devtools-nightly.CT6XRG-F.mjs';
|
|
16
|
-
import '../dirs.mjs';
|
|
17
|
-
import 'node:url';
|
|
18
|
-
import 'is-installed-globally';
|
|
19
|
-
import 'ohash';
|
|
20
|
-
import 'birpc';
|
|
21
|
-
import 'structured-clone-es';
|
|
22
|
-
import 'simple-git';
|
|
23
|
-
import 'tinyglobby';
|
|
24
|
-
import 'image-meta';
|
|
25
|
-
import 'perfect-debounce';
|
|
26
|
-
import 'destr';
|
|
27
|
-
import '../../dist/runtime/shared/hooks.js';
|
|
28
|
-
import 'node:process';
|
|
29
|
-
import 'node:module';
|
|
30
|
-
import 'pkg-types';
|
|
31
|
-
import 'node:assert';
|
|
32
|
-
import 'node:v8';
|
|
33
|
-
import 'node:util';
|
|
34
|
-
import 'local-pkg';
|
|
35
|
-
import 'magicast';
|
|
36
|
-
import 'magicast/helpers';
|
|
37
|
-
import 'nypm';
|
|
38
|
-
import 'semver';
|
|
39
|
-
import 'unstorage';
|
|
10
|
+
import { colors } from 'consola/utils';
|
|
11
|
+
|
|
12
|
+
const LOG_PREFIX = colors.cyan("Nuxt DevTools:");
|
|
40
13
|
|
|
41
14
|
const codeBinaryOptions = {
|
|
42
15
|
"ms-code-cli": {
|
|
@@ -76,7 +49,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
76
49
|
if (!existsSync(vscodeServerControllerFile))
|
|
77
50
|
return false;
|
|
78
51
|
try {
|
|
79
|
-
const { port: port2 } = JSON.parse(await
|
|
52
|
+
const { port: port2 } = JSON.parse(await fs.readFile(vscodeServerControllerFile, "utf-8"));
|
|
80
53
|
const url2 = `http://localhost:${port2}/open?path=${encodeURIComponent(`${root}/${file}`)}`;
|
|
81
54
|
await fetch(url2);
|
|
82
55
|
rpc.broadcast.navigateTo("/modules/custom-builtin-vscode");
|
|
@@ -89,7 +62,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
89
62
|
});
|
|
90
63
|
async function startCodeServer() {
|
|
91
64
|
if (existsSync(vscodeServerControllerFile))
|
|
92
|
-
await
|
|
65
|
+
await fs.rm(vscodeServerControllerFile, { force: true });
|
|
93
66
|
if (vsOptions?.reuseExistingServer && !await checkPort(port)) {
|
|
94
67
|
loaded = true;
|
|
95
68
|
url = `http://localhost:${port}/?folder=${encodeURIComponent(root)}`;
|
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/jdttf2bd.js"}}</script><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-hn1q325i.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-lkbe0qhh.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-3gd0e2sv.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/jdttf2bd.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/_plugin-vue_export-helper-n58akrbk.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/rolldown-runtime-oipoa1or.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-eojr4v24.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/utils-jupbrzo6.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ready-dadbdj5i.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dist-mnod32r1.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-otp6bp04.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue-router-jbnxw7nb.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-nwyjxodt.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-lqo1hg2n.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-k727ub0h.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-link-bumooa9d.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dist-duc3zu0y.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/splitpanes.es-gcsn48te.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dev-auth-he0eye7r.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nbutton-gygn07c2.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nicon-m1crov2l.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncard-ludmyw2u.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/npanel-grids-onrho735.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ntext-input-e8iut2en.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/state-routes-jownks2o.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/state-tabs-mtxv3h6t.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/storage-options-nzog3hhp.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/telemetry-c77tnag3.js"><script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/jdttf2bd.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"d2d46a75-49ca-480e-b7d1-e84ddfa8d8d2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1773722245229,false]</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/jdttf2bd.js"}}</script><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-hn1q325i.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-lkbe0qhh.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-3gd0e2sv.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/jdttf2bd.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/_plugin-vue_export-helper-n58akrbk.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/rolldown-runtime-oipoa1or.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-eojr4v24.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/utils-jupbrzo6.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ready-dadbdj5i.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dist-mnod32r1.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-otp6bp04.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue-router-jbnxw7nb.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-nwyjxodt.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-lqo1hg2n.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-k727ub0h.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-link-bumooa9d.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dist-duc3zu0y.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/splitpanes.es-gcsn48te.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/dev-auth-he0eye7r.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nbutton-gygn07c2.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nicon-m1crov2l.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncard-ludmyw2u.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/npanel-grids-onrho735.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ntext-input-e8iut2en.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/state-routes-jownks2o.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/state-tabs-mtxv3h6t.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/storage-options-nzog3hhp.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/telemetry-c77tnag3.js"><script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/jdttf2bd.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"d2d46a75-49ca-480e-b7d1-e84ddfa8d8d2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1773722245233,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"d2d46a75-49ca-480e-b7d1-e84ddfa8d8d2","timestamp":1773722204999}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"d2d46a75-49ca-480e-b7d1-e84ddfa8d8d2","timestamp":1773722204999,"prerendered":[]}
|