@nuxt/devtools 0.6.6 → 0.7.0
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 +189 -126
- 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/_nuxt/AuthRequiredPanel.vue.d0cfb6b2.js +1 -0
- package/dist/client/_nuxt/Badge.51add8bd.js +1 -0
- package/dist/client/_nuxt/CodeDiff.vue.ef3840bb.js +3 -0
- package/dist/client/_nuxt/CodeSnippets.vue.ac1ba0c8.js +1 -0
- package/dist/client/_nuxt/ComposableItem.vue.a20c44a4.js +1 -0
- package/dist/client/_nuxt/DrawerRight.vue.53f21930.js +1 -0
- package/dist/client/_nuxt/DurationDisplay.vue.8283fdb3.js +1 -0
- package/dist/client/_nuxt/FilepathItem.vue.6f4d3680.js +1 -0
- package/dist/client/_nuxt/HelpFab.vue.58531843.js +1 -0
- package/dist/client/_nuxt/LaunchPage.vue.36ead88c.js +1 -0
- package/dist/client/_nuxt/NCheckbox.vue.a57ff0bb.js +1 -0
- package/dist/client/_nuxt/NCodeBlock.vue.2012eb81.js +2 -0
- package/dist/client/_nuxt/NIconTitle.vue.c1ac3b5f.js +1 -0
- package/dist/client/_nuxt/NLink.vue.c45070c9.js +1 -0
- package/dist/client/_nuxt/{NMarkdown.vue.a51cc795.js → NMarkdown.vue.6bccbb92.js} +1 -1
- package/dist/client/_nuxt/NSectionBlock.7613319f.js +1 -0
- package/dist/client/_nuxt/NSelect.vue.b9c29645.js +1 -0
- package/dist/client/_nuxt/NSwitch.vue.fa9b060a.js +1 -0
- package/dist/client/_nuxt/NTip.vue.95e4ec9e.js +1 -0
- package/dist/client/_nuxt/Navbar.vue.6c01dcab.js +1 -0
- package/dist/client/_nuxt/StateEditor.vue.c5cc22ae.js +1 -0
- package/dist/client/_nuxt/__blank.87af3281.js +1 -0
- package/dist/client/_nuxt/analyze-build.cf3dea6a.js +1 -0
- package/dist/client/_nuxt/assets.4f097b22.js +16 -0
- package/dist/client/_nuxt/client.247a64bd.js +1 -0
- package/dist/client/_nuxt/{components.7102fe12.js → components.07744e27.js} +6 -6
- package/dist/client/_nuxt/{constants.d7bcda3c.js → constants.2fec5dff.js} +1 -1
- package/dist/client/_nuxt/custom-_name_.6e463663.js +1 -0
- package/dist/client/_nuxt/default.3a13b5c9.js +1 -0
- package/dist/client/_nuxt/entry.185d6835.css +1 -0
- package/dist/client/_nuxt/entry.33b5be03.js +21 -0
- package/dist/client/_nuxt/{error-404.c083e948.js → error-404.b216bd73.js} +1 -1
- package/dist/client/_nuxt/{error-500.87865939.js → error-500.1bc58b0e.js} +1 -1
- package/dist/client/_nuxt/full.92d6a5f8.js +1 -0
- package/dist/client/_nuxt/hooks.259d0a69.js +1 -0
- package/dist/client/_nuxt/imports.cc27dbf7.js +1 -0
- package/dist/client/_nuxt/{index.d1b4d52b.js → index.064a7a87.js} +1 -1
- package/dist/client/_nuxt/{index.bb6f436a.js → index.8f3e434d.js} +1 -1
- package/dist/client/_nuxt/{json-editor-vue.51bb18e8.js → json-editor-vue.af845b1c.js} +1 -1
- package/dist/client/_nuxt/{middleware.e1b5c8c8.js → middleware.fcdb1770.js} +1 -1
- package/dist/client/_nuxt/modules.5891e891.js +2 -0
- package/dist/client/_nuxt/none.e5b666cf.js +1 -0
- package/dist/client/_nuxt/open-graph.1141dd15.js +3 -0
- package/dist/client/_nuxt/overview.2af20256.js +1 -0
- package/dist/client/_nuxt/pages.b3fe162f.js +1 -0
- package/dist/client/_nuxt/payload.2d5cef36.js +1 -0
- package/dist/client/_nuxt/plugins.f25d8e7c.js +1 -0
- package/dist/client/_nuxt/runtime-configs.68765f10.js +1 -0
- package/dist/client/_nuxt/server-routes.ab41fbf6.js +9 -0
- package/dist/client/_nuxt/settings.cb26edfb.js +1 -0
- package/dist/client/_nuxt/{state-components.b4d7e657.js → state-components.3bf21c12.js} +1 -1
- package/dist/client/_nuxt/state-modules.dfd5fe81.js +1 -0
- package/dist/client/_nuxt/storage.921a198c.js +1 -0
- package/dist/client/_nuxt/{terminals.78500161.js → terminals.67898f73.js} +7 -7
- package/dist/client/_nuxt/timeline.289e5c9e.css +1 -0
- package/dist/client/_nuxt/timeline.6b8e8f78.js +57 -0
- package/dist/client/_nuxt/{unocss-runtime.0f8c7b1b.js → unocss-runtime.5034abfc.js} +2 -2
- package/dist/client/_nuxt/virtual-files.e3271a06.js +1 -0
- package/dist/client/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.7ab40af4.mjs → devtools.d198e7a9.mjs} +27 -1
- package/dist/types.d.ts +1 -1
- package/package.json +27 -26
- package/dist/client/__blank/index.html +0 -7
- package/dist/client/_nuxt/AuthRequiredPanel.vue.783e1d98.js +0 -1
- package/dist/client/_nuxt/Badge.01153451.js +0 -1
- package/dist/client/_nuxt/CodeSnippets.vue.62990bc2.js +0 -1
- package/dist/client/_nuxt/DrawerRight.vue.a92525c1.js +0 -1
- package/dist/client/_nuxt/DurationDisplay.vue.c3ae9764.js +0 -1
- package/dist/client/_nuxt/FilepathItem.vue.b4bdb03f.js +0 -1
- package/dist/client/_nuxt/HelpFab.vue.a9df2aac.js +0 -1
- package/dist/client/_nuxt/LaunchPage.vue.8ecfdb82.js +0 -1
- package/dist/client/_nuxt/NCheckbox.vue.09c2faa0.js +0 -1
- package/dist/client/_nuxt/NCodeBlock.vue.5e6a2196.js +0 -2
- package/dist/client/_nuxt/NIconButton.vue.b41ef4b9.js +0 -1
- package/dist/client/_nuxt/NIconTitle.vue.9b97e25e.js +0 -1
- package/dist/client/_nuxt/NLink.vue.8c655f8a.js +0 -1
- package/dist/client/_nuxt/NPanelGrids.16564aae.js +0 -1
- package/dist/client/_nuxt/NSectionBlock.722f4ebc.js +0 -1
- package/dist/client/_nuxt/NSelect.vue.80dc04cd.js +0 -1
- package/dist/client/_nuxt/NSwitch.vue.608eedef.js +0 -1
- package/dist/client/_nuxt/NTip.vue.0823a0e1.js +0 -1
- package/dist/client/_nuxt/Navbar.vue.6fef9034.js +0 -1
- package/dist/client/_nuxt/PanelLeftRight.vue.17bcbe2c.js +0 -1
- package/dist/client/_nuxt/StateEditor.vue.85e49f31.js +0 -1
- package/dist/client/_nuxt/__blank.474106e2.js +0 -1
- package/dist/client/_nuxt/analyze-build.25e4c0e1.js +0 -1
- package/dist/client/_nuxt/assets.6a9fdb70.js +0 -16
- package/dist/client/_nuxt/client.853ad100.js +0 -1
- package/dist/client/_nuxt/custom-_name_.a07051a8.js +0 -1
- package/dist/client/_nuxt/default.3da0acde.js +0 -1
- package/dist/client/_nuxt/entry.11fe2cd7.js +0 -21
- package/dist/client/_nuxt/entry.1e4f7d58.css +0 -1
- package/dist/client/_nuxt/full.01cd9940.js +0 -1
- package/dist/client/_nuxt/hooks.f820d9c5.js +0 -1
- package/dist/client/_nuxt/imports.cf6a0be0.js +0 -1
- package/dist/client/_nuxt/modules.f0ddf45f.js +0 -4
- package/dist/client/_nuxt/none.0c5c4a11.js +0 -1
- package/dist/client/_nuxt/open-graph.99e6c2ca.js +0 -3
- package/dist/client/_nuxt/overview.37671f14.js +0 -1
- package/dist/client/_nuxt/pages.cfc87f05.js +0 -1
- package/dist/client/_nuxt/payload.f2eb3709.js +0 -1
- package/dist/client/_nuxt/plugins.3f102534.js +0 -1
- package/dist/client/_nuxt/runtime-configs.35ac3b1b.js +0 -1
- package/dist/client/_nuxt/server-routes.5ddb6496.js +0 -9
- package/dist/client/_nuxt/settings.74004c21.js +0 -1
- package/dist/client/_nuxt/state-modules.d846f6f5.js +0 -1
- package/dist/client/_nuxt/storage.5d1c4325.js +0 -1
- package/dist/client/_nuxt/virtual-files.a7d5699b.js +0 -1
- package/dist/client/modules/analyze-build/index.html +0 -7
- package/dist/client/modules/assets/index.html +0 -7
- package/dist/client/modules/components/index.html +0 -7
- package/dist/client/modules/hooks/index.html +0 -7
- package/dist/client/modules/imports/index.html +0 -7
- package/dist/client/modules/middleware/index.html +0 -7
- package/dist/client/modules/modules/index.html +0 -7
- package/dist/client/modules/open-graph/index.html +0 -7
- package/dist/client/modules/overview/index.html +0 -7
- package/dist/client/modules/pages/index.html +0 -7
- package/dist/client/modules/payload/index.html +0 -7
- package/dist/client/modules/plugins/index.html +0 -7
- package/dist/client/modules/runtime-configs/index.html +0 -7
- package/dist/client/modules/server-routes/index.html +0 -7
- package/dist/client/modules/storage/index.html +0 -7
- package/dist/client/modules/terminals/index.html +0 -7
- package/dist/client/modules/virtual-files/index.html +0 -7
- package/dist/client/settings/index.html +0 -7
|
@@ -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, 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.0";
|
|
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");
|
|
@@ -6263,7 +6292,7 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
6263
6292
|
};
|
|
6264
6293
|
}
|
|
6265
6294
|
|
|
6266
|
-
const defaults
|
|
6295
|
+
const defaults = {
|
|
6267
6296
|
ignoreUnknown: false,
|
|
6268
6297
|
respectType: false,
|
|
6269
6298
|
respectFunctionNames: false,
|
|
@@ -6273,7 +6302,7 @@ const defaults$1 = {
|
|
|
6273
6302
|
unorderedSets: false
|
|
6274
6303
|
};
|
|
6275
6304
|
function objectHash(object, options = {}) {
|
|
6276
|
-
options = { ...defaults
|
|
6305
|
+
options = { ...defaults, ...options };
|
|
6277
6306
|
const hasher = createHasher(options);
|
|
6278
6307
|
hasher.dispatch(object);
|
|
6279
6308
|
return hasher.toString();
|
|
@@ -6836,62 +6865,94 @@ function hash(object, options = {}) {
|
|
|
6836
6865
|
return sha256base64(hashed).slice(0, 10);
|
|
6837
6866
|
}
|
|
6838
6867
|
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
}
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
const
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6868
|
+
async function readOptions(defaults, options) {
|
|
6869
|
+
let hashedKey;
|
|
6870
|
+
if (options.key)
|
|
6871
|
+
hashedKey = hash(`${options.root}:${options.key}`);
|
|
6872
|
+
else
|
|
6873
|
+
hashedKey = hash(options.root);
|
|
6874
|
+
const filePath = join$1(homedir(), ".nuxt/devtools", `${hashedKey}.json`);
|
|
6875
|
+
if (existsSync(filePath)) {
|
|
6876
|
+
const options2 = {
|
|
6877
|
+
...defaults,
|
|
6878
|
+
...JSON.parse(await fs.readFile(filePath, "utf-8")).settings || {}
|
|
6879
|
+
};
|
|
6880
|
+
return options2;
|
|
6881
|
+
} else {
|
|
6882
|
+
return { ...defaults };
|
|
6883
|
+
}
|
|
6884
|
+
}
|
|
6885
|
+
async function writeOptions(settings, options) {
|
|
6886
|
+
const dir = join$1(homedir(), ".nuxt/devtools");
|
|
6887
|
+
if (!existsSync(dir))
|
|
6888
|
+
await fs.mkdir(dir, { recursive: true });
|
|
6889
|
+
let hashedKey;
|
|
6890
|
+
if (options.key)
|
|
6891
|
+
hashedKey = hash(`${options.root}:${options.key}`);
|
|
6892
|
+
else
|
|
6893
|
+
hashedKey = hash(options.root);
|
|
6894
|
+
const filePath = join$1(dir, `${hashedKey}.json`);
|
|
6895
|
+
await fs.writeFile(
|
|
6896
|
+
filePath,
|
|
6897
|
+
JSON.stringify(
|
|
6898
|
+
{
|
|
6899
|
+
root: options.root,
|
|
6900
|
+
hash: hashedKey,
|
|
6901
|
+
settings
|
|
6902
|
+
},
|
|
6903
|
+
null,
|
|
6904
|
+
2
|
|
6905
|
+
),
|
|
6906
|
+
"utf-8"
|
|
6907
|
+
);
|
|
6908
|
+
}
|
|
6909
|
+
|
|
6910
|
+
function setupOptionsRPC({ nuxt }) {
|
|
6911
|
+
let options;
|
|
6912
|
+
async function getOptions(tab) {
|
|
6913
|
+
if (!options || options[tab]) {
|
|
6914
|
+
options = defaultTabOptions;
|
|
6915
|
+
await read(tab);
|
|
6872
6916
|
}
|
|
6873
|
-
return
|
|
6874
|
-
}
|
|
6875
|
-
async function
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
root: nuxt.options.rootDir,
|
|
6882
|
-
hash: projectHash,
|
|
6883
|
-
settings: settings2
|
|
6884
|
-
}, null, 2),
|
|
6885
|
-
"utf-8"
|
|
6886
|
-
);
|
|
6917
|
+
return options[tab];
|
|
6918
|
+
}
|
|
6919
|
+
async function read(tab) {
|
|
6920
|
+
options[tab] = await readOptions(defaultTabOptions[tab], {
|
|
6921
|
+
root: nuxt.options.rootDir,
|
|
6922
|
+
key: tab !== "ui" && tab
|
|
6923
|
+
});
|
|
6924
|
+
return options;
|
|
6887
6925
|
}
|
|
6888
6926
|
return {
|
|
6889
|
-
async
|
|
6890
|
-
const
|
|
6891
|
-
Object.assign(
|
|
6892
|
-
await
|
|
6927
|
+
async updateOptions(tab, _settings) {
|
|
6928
|
+
const settings = await getOptions(tab);
|
|
6929
|
+
Object.assign(settings, _settings);
|
|
6930
|
+
await writeOptions({ ...settings }, {
|
|
6931
|
+
root: nuxt.options.rootDir,
|
|
6932
|
+
key: tab !== "ui" && tab
|
|
6933
|
+
});
|
|
6893
6934
|
},
|
|
6894
|
-
|
|
6935
|
+
getOptions
|
|
6936
|
+
};
|
|
6937
|
+
}
|
|
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
|
+
}
|
|
6895
6956
|
};
|
|
6896
6957
|
}
|
|
6897
6958
|
|
|
@@ -6956,7 +7017,8 @@ function setupRPC(nuxt, options) {
|
|
|
6956
7017
|
...setupTerminalRPC(ctx),
|
|
6957
7018
|
...setupServerRoutesRPC(ctx),
|
|
6958
7019
|
...setupAnalyzeBuildRPC(ctx),
|
|
6959
|
-
...
|
|
7020
|
+
...setupOptionsRPC(ctx),
|
|
7021
|
+
...setupTimelineRPC(ctx)
|
|
6960
7022
|
});
|
|
6961
7023
|
const wsClients = /* @__PURE__ */ new Set();
|
|
6962
7024
|
const vitePlugin = {
|
|
@@ -7089,7 +7151,8 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
7089
7151
|
import('./plugin-metrics.mjs').then(({ setup }) => setup(ctx)),
|
|
7090
7152
|
options.viteInspect !== false ? import('./vite-inspect.mjs').then(({ setup }) => setup(ctx)) : null,
|
|
7091
7153
|
options.componentInspector !== false ? import('./vue-inspector.mjs').then(({ setup }) => setup(ctx)) : null,
|
|
7092
|
-
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
|
|
7093
7156
|
];
|
|
7094
7157
|
await Promise.all(integrations);
|
|
7095
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)}`;
|