@nuxt/devtools 0.5.5 → 0.6.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 +145 -35
- package/dist/chunks/vscode.mjs +5 -2
- package/dist/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/__blank/index.html +7 -0
- package/dist/client/_nuxt/AuthRequiredPanel.vue.19da182f.js +1 -0
- package/dist/client/_nuxt/{Badge.e58c5f84.js → Badge.067326d6.js} +1 -1
- package/dist/client/_nuxt/CodeSnippets.vue.2f33c6d1.js +1 -0
- package/dist/client/_nuxt/DrawerRight.vue.aa1fd47b.js +1 -0
- package/dist/client/_nuxt/DurationDisplay.vue.4afc40a4.js +1 -0
- package/dist/client/_nuxt/FilepathItem.vue.3587ec1f.js +1 -0
- package/dist/client/_nuxt/{HelpFab.vue.044c905c.js → HelpFab.vue.dbb954dd.js} +1 -1
- package/dist/client/_nuxt/LaunchPage.vue.f137554e.js +1 -0
- package/dist/client/_nuxt/NCheckbox.vue.060051ad.js +1 -0
- package/dist/client/_nuxt/NCodeBlock.vue.e44529a6.js +2 -0
- package/dist/client/_nuxt/NIconButton.vue.ac7efd0c.js +1 -0
- package/dist/client/_nuxt/NIconTitle.vue.ace3a05a.js +1 -0
- package/dist/client/_nuxt/NLink.vue.372e1ca0.js +1 -0
- package/dist/client/_nuxt/NMarkdown.vue.9f252ec4.js +1 -0
- package/dist/client/_nuxt/{NPanelGrids.923427b0.js → NPanelGrids.54ee09bc.js} +1 -1
- package/dist/client/_nuxt/NSectionBlock.012f83f1.css +1 -0
- package/dist/client/_nuxt/NSectionBlock.9cbe0175.js +1 -0
- package/dist/client/_nuxt/NSelect.vue.3956d7b1.js +1 -0
- package/dist/client/_nuxt/NSwitch.vue.f0f70131.js +1 -0
- package/dist/client/_nuxt/NTip.vue.f50fcd60.js +1 -0
- package/dist/client/_nuxt/{Navbar.vue.1eab843e.js → Navbar.vue.bd98686f.js} +1 -1
- package/dist/client/_nuxt/NpmVersionCheck.vue.78bff2df.js +1 -0
- package/dist/client/_nuxt/{PanelLeftRight.vue.5807516f.js → PanelLeftRight.vue.8031c7d4.js} +1 -1
- package/dist/client/_nuxt/StateEditor.vue.4439d43c.js +1 -0
- package/dist/client/_nuxt/__blank.944beb26.js +1 -0
- package/dist/client/_nuxt/analyze-build.fd781999.js +1 -0
- package/dist/client/_nuxt/assets.f876e2b9.js +16 -0
- package/dist/client/_nuxt/{client.4ef5790f.js → client.d6464981.js} +1 -1
- package/dist/client/_nuxt/{components.1cc22fdb.js → components.d23cd7b8.js} +27 -27
- package/dist/client/_nuxt/custom-_name_.3701152b.js +1 -0
- package/dist/client/_nuxt/{default.2805e636.js → default.809c6e7c.js} +1 -1
- package/dist/client/_nuxt/editor.aee50e2c.js +1 -0
- package/dist/client/_nuxt/entry.717f6486.css +1 -0
- package/dist/client/_nuxt/entry.a0dd6aac.js +19 -0
- package/dist/client/_nuxt/{error-404.61da4836.js → error-404.d560629e.js} +1 -1
- package/dist/client/_nuxt/{error-500.68195134.js → error-500.d7ca8dd1.js} +1 -1
- package/dist/client/_nuxt/{error-component.db5245e7.js → error-component.15e0d602.js} +2 -2
- package/dist/client/_nuxt/{full.cfa15ba5.js → full.76363f3f.js} +1 -1
- package/dist/client/_nuxt/hooks.3a3b761d.js +1 -0
- package/dist/client/_nuxt/imports.e0b9437d.js +1 -0
- package/dist/client/_nuxt/{index.e17aa9ce.js → index.25d3cd66.js} +1 -1
- package/dist/client/_nuxt/{index.476fd219.js → index.d7252ef5.js} +1 -1
- package/dist/client/_nuxt/json-editor-vue.b8dc29b2.js +137 -0
- package/dist/client/_nuxt/{middleware.10bb56a6.js → middleware.cbbbe53d.js} +1 -1
- package/dist/client/_nuxt/modules.092674af.js +4 -0
- package/dist/client/_nuxt/{none.a68953c7.js → none.0a084ac9.js} +1 -1
- package/dist/client/_nuxt/nuxt-docs.100caa70.js +1 -0
- package/dist/client/_nuxt/open-graph.3563ee56.js +3 -0
- package/dist/client/_nuxt/overview.e4073f57.js +1 -0
- package/dist/client/_nuxt/pages.e4cfc065.js +1 -0
- package/dist/client/_nuxt/payload.0be0c356.js +1 -0
- package/dist/client/_nuxt/plugins.88ff2e07.js +1 -0
- package/dist/client/_nuxt/runtime-configs.7810c90a.js +1 -0
- package/dist/client/_nuxt/server-routes.911ca1ca.js +9 -0
- package/dist/client/_nuxt/settings.80338150.js +1 -0
- package/dist/client/_nuxt/state-components.3e562e84.js +1 -0
- package/dist/client/_nuxt/storage.4d3f94ab.js +1 -0
- package/dist/client/_nuxt/terminals.e433a70a.js +1 -0
- package/dist/client/_nuxt/{unocss-runtime.7eface6f.js → unocss-runtime.9d0d2556.js} +2 -2
- package/dist/client/_nuxt/{virtual-files.3e66a8af.js → virtual-files.ae241a9c.js} +1 -1
- 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/virtual-files/index.html +2 -2
- package/dist/client/settings/index.html +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/auth/index.html +71 -0
- package/dist/runtime/nitro/inline.d.ts +3 -0
- package/dist/runtime/nitro/inline.mjs +6 -0
- package/dist/runtime/plugins/devtools.client.d.ts +8 -0
- package/dist/runtime/plugins/devtools.client.mjs +73 -8
- package/dist/runtime/plugins/devtools.server.d.ts +2 -0
- package/dist/runtime/plugins/devtools.server.mjs +8 -0
- package/dist/runtime/plugins/view/Frame.vue +31 -228
- package/dist/runtime/plugins/view/FrameBox.vue +167 -0
- package/dist/runtime/plugins/view/Main.vue +360 -0
- package/dist/runtime/plugins/view/client.d.ts +3 -0
- package/dist/runtime/plugins/view/client.mjs +45 -0
- package/dist/runtime/plugins/view/state.d.ts +2 -3
- package/dist/runtime/plugins/view/state.mjs +12 -9
- package/dist/runtime/plugins/view/utils.d.ts +1 -0
- package/dist/runtime/plugins/view/utils.mjs +9 -0
- package/dist/shared/{devtools.345c630c.mjs → devtools.7ab40af4.mjs} +3 -1
- package/dist/types.d.ts +1 -1
- package/package.json +30 -29
- package/dist/client/__inspecting/index.html +0 -7
- package/dist/client/_nuxt/CodeSnippets.vue.22b03a10.js +0 -1
- package/dist/client/_nuxt/DrawerRight.vue.58044cee.js +0 -1
- package/dist/client/_nuxt/DurationDisplay.vue.0d87f5bf.js +0 -1
- package/dist/client/_nuxt/FilepathItem.vue.063a2cdd.js +0 -1
- package/dist/client/_nuxt/LaunchPage.vue.59383ce6.js +0 -1
- package/dist/client/_nuxt/NCheckbox.vue.f53d5fde.js +0 -1
- package/dist/client/_nuxt/NCodeBlock.vue.e2044e41.js +0 -2
- package/dist/client/_nuxt/NIconButton.vue.6924c323.js +0 -1
- package/dist/client/_nuxt/NIconTitle.vue.19793f87.js +0 -1
- package/dist/client/_nuxt/NLink.vue.dddf8805.js +0 -1
- package/dist/client/_nuxt/NMarkdown.vue.2a7f337d.js +0 -1
- package/dist/client/_nuxt/NSectionBlock.2937e558.js +0 -1
- package/dist/client/_nuxt/NSectionBlock.63c19da9.css +0 -1
- package/dist/client/_nuxt/NSelect.vue.6bc1e782.js +0 -1
- package/dist/client/_nuxt/NSwitch.vue.e15ba847.js +0 -1
- package/dist/client/_nuxt/NTip.vue.16191ba5.js +0 -1
- package/dist/client/_nuxt/NpmVersionCheck.vue.47b612aa.js +0 -1
- package/dist/client/_nuxt/StateEditor.vue.d28666b8.js +0 -1
- package/dist/client/_nuxt/__inspecting.324d8c7c.js +0 -1
- package/dist/client/_nuxt/analyze-build.9257b30a.js +0 -1
- package/dist/client/_nuxt/assets.c3e8e0f3.js +0 -16
- package/dist/client/_nuxt/custom-_name_.e1ada273.js +0 -1
- package/dist/client/_nuxt/editor.721868d4.js +0 -1
- package/dist/client/_nuxt/entry.bf8a0e33.css +0 -1
- package/dist/client/_nuxt/entry.f02d2ccc.js +0 -19
- package/dist/client/_nuxt/hooks.a0b5858b.js +0 -1
- package/dist/client/_nuxt/imports.c13274b4.js +0 -1
- package/dist/client/_nuxt/json-editor-vue.3c153669.js +0 -137
- package/dist/client/_nuxt/modules.41d22931.js +0 -4
- package/dist/client/_nuxt/open-graph.87c9ce95.js +0 -3
- package/dist/client/_nuxt/overview.e078ddfd.js +0 -1
- package/dist/client/_nuxt/pages.2011bfab.js +0 -1
- package/dist/client/_nuxt/payload.aa12c647.js +0 -1
- package/dist/client/_nuxt/plugins.2722f367.js +0 -1
- package/dist/client/_nuxt/runtime-configs.1c597722.js +0 -1
- package/dist/client/_nuxt/server-routes.be515b73.js +0 -9
- package/dist/client/_nuxt/settings.bdc2ea51.js +0 -1
- package/dist/client/_nuxt/state-components.97be2043.js +0 -1
- package/dist/client/_nuxt/storage.b1a77fa3.js +0 -1
- package/dist/client/_nuxt/terminals.ce48c24d.js +0 -9
- package/dist/client/_nuxt/terminals.d1dcf297.css +0 -32
- package/dist/runtime/plugins/view/Container.vue +0 -97
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import fs, { existsSync } from 'node:fs';
|
|
2
|
-
import { resolve, join, dirname } from 'pathe';
|
|
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 { W as WS_EVENT_NAME,
|
|
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.7ab40af4.mjs';
|
|
9
|
+
import { homedir } from 'node:os';
|
|
10
|
+
import { join } from 'node:path';
|
|
9
11
|
import fsp from 'node:fs/promises';
|
|
10
12
|
import { imageMeta } from 'image-meta';
|
|
11
13
|
import fg from 'fast-glob';
|
|
@@ -19,16 +21,16 @@ import 'pkg-types';
|
|
|
19
21
|
import semver from 'semver';
|
|
20
22
|
import { getPackageInfo } from 'local-pkg';
|
|
21
23
|
import { resolveBuiltinPresets } from 'unimport';
|
|
24
|
+
import boxen from 'boxen';
|
|
22
25
|
import { debounce } from 'perfect-debounce';
|
|
23
26
|
import require$$0$1 from 'fs';
|
|
24
27
|
import require$$1 from 'tty';
|
|
25
28
|
import require$$1$1 from 'util';
|
|
26
29
|
import require$$0 from 'os';
|
|
27
30
|
import { spawn } from 'child_process';
|
|
28
|
-
import { homedir } from 'node:os';
|
|
29
31
|
import { runtimeDir, clientDir, packageDir, isGlobalInstall } from '../dirs.mjs';
|
|
30
32
|
|
|
31
|
-
const version = "0.
|
|
33
|
+
const version = "0.6.1";
|
|
32
34
|
|
|
33
35
|
/*! (c) 2020 Andrea Giammarchi */
|
|
34
36
|
|
|
@@ -122,13 +124,40 @@ const stringify = (value, replacer, space) => {
|
|
|
122
124
|
}
|
|
123
125
|
};
|
|
124
126
|
|
|
127
|
+
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
128
|
+
function randomStr(size = 16, dict = urlAlphabet) {
|
|
129
|
+
let id = "";
|
|
130
|
+
let i = size;
|
|
131
|
+
const len = dict.length;
|
|
132
|
+
while (i--)
|
|
133
|
+
id += dict[Math.random() * len | 0];
|
|
134
|
+
return id;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let token;
|
|
138
|
+
async function getDevAuthToken() {
|
|
139
|
+
if (token)
|
|
140
|
+
return token;
|
|
141
|
+
const home = homedir();
|
|
142
|
+
const dir = join(home, ".nuxt/devtools");
|
|
143
|
+
const filepath = join(dir, "dev-auth-token.txt");
|
|
144
|
+
if (existsSync(filepath))
|
|
145
|
+
token = (await fsp.readFile(filepath, "utf-8")).trim();
|
|
146
|
+
if (!token)
|
|
147
|
+
token = randomStr(32);
|
|
148
|
+
await fsp.mkdir(dir, { recursive: true });
|
|
149
|
+
await fsp.writeFile(filepath, token, "utf-8");
|
|
150
|
+
return token;
|
|
151
|
+
}
|
|
152
|
+
|
|
125
153
|
const IGNORE_STORAGE_MOUNTS = ["root", "build", "src", "cache"];
|
|
126
154
|
function shouldIgnoreStorageKey(key) {
|
|
127
155
|
return IGNORE_STORAGE_MOUNTS.includes(key.split(":")[0]);
|
|
128
156
|
}
|
|
129
157
|
function setupStorageRPC({
|
|
130
158
|
nuxt,
|
|
131
|
-
rpc
|
|
159
|
+
rpc,
|
|
160
|
+
ensureDevAuthToken
|
|
132
161
|
}) {
|
|
133
162
|
const storageMounts = {};
|
|
134
163
|
let storage;
|
|
@@ -166,17 +195,20 @@ function setupStorageRPC({
|
|
|
166
195
|
return [];
|
|
167
196
|
}
|
|
168
197
|
},
|
|
169
|
-
async getStorageItem(key) {
|
|
198
|
+
async getStorageItem(token, key) {
|
|
199
|
+
await ensureDevAuthToken(token);
|
|
170
200
|
if (!storage)
|
|
171
201
|
return null;
|
|
172
202
|
return await storage.getItem(key);
|
|
173
203
|
},
|
|
174
|
-
async setStorageItem(key, value) {
|
|
204
|
+
async setStorageItem(token, key, value) {
|
|
205
|
+
await ensureDevAuthToken(token);
|
|
175
206
|
if (!storage)
|
|
176
207
|
return;
|
|
177
208
|
return await storage.setItem(key, value);
|
|
178
209
|
},
|
|
179
|
-
async removeStorageItem(key) {
|
|
210
|
+
async removeStorageItem(token, key) {
|
|
211
|
+
await ensureDevAuthToken(token);
|
|
180
212
|
if (!storage)
|
|
181
213
|
return;
|
|
182
214
|
return await storage.removeItem(key);
|
|
@@ -184,7 +216,7 @@ function setupStorageRPC({
|
|
|
184
216
|
};
|
|
185
217
|
}
|
|
186
218
|
|
|
187
|
-
function setupAssetsRPC({ nuxt }) {
|
|
219
|
+
function setupAssetsRPC({ nuxt, ensureDevAuthToken }) {
|
|
188
220
|
const _imageMetaCache = /* @__PURE__ */ new Map();
|
|
189
221
|
return {
|
|
190
222
|
async getStaticAssets() {
|
|
@@ -212,7 +244,7 @@ function setupAssetsRPC({ nuxt }) {
|
|
|
212
244
|
const stat = await fsp.lstat(filePath);
|
|
213
245
|
return {
|
|
214
246
|
path,
|
|
215
|
-
publicPath: join(baseURL, path),
|
|
247
|
+
publicPath: join$1(baseURL, path),
|
|
216
248
|
filePath,
|
|
217
249
|
type: guessType(path),
|
|
218
250
|
size: stat.size,
|
|
@@ -242,7 +274,8 @@ function setupAssetsRPC({ nuxt }) {
|
|
|
242
274
|
return void 0;
|
|
243
275
|
}
|
|
244
276
|
},
|
|
245
|
-
async writeStaticAssets(files, path) {
|
|
277
|
+
async writeStaticAssets(token, files, path) {
|
|
278
|
+
await ensureDevAuthToken(token);
|
|
246
279
|
const baseDir = resolve(nuxt.options.srcDir, nuxt.options.dir.public + path);
|
|
247
280
|
return await Promise.all(
|
|
248
281
|
files.map(async ({ name, data }) => {
|
|
@@ -290,7 +323,7 @@ async function checkForUpdateOf(name, current, nuxt = useNuxt()) {
|
|
|
290
323
|
}
|
|
291
324
|
}
|
|
292
325
|
|
|
293
|
-
function setupNpmRPC({ nuxt }) {
|
|
326
|
+
function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
294
327
|
let detectPromise;
|
|
295
328
|
const updatesPromise = /* @__PURE__ */ new Map();
|
|
296
329
|
function getPackageManager() {
|
|
@@ -319,7 +352,7 @@ function setupNpmRPC({ nuxt }) {
|
|
|
319
352
|
}, {
|
|
320
353
|
id: processId,
|
|
321
354
|
name: `${command} ${packageName}`,
|
|
322
|
-
icon: "i-
|
|
355
|
+
icon: "i-logos-npm-icon",
|
|
323
356
|
restartable: false
|
|
324
357
|
});
|
|
325
358
|
return {
|
|
@@ -334,8 +367,12 @@ function setupNpmRPC({ nuxt }) {
|
|
|
334
367
|
},
|
|
335
368
|
getPackageManager,
|
|
336
369
|
getNpmCommand,
|
|
337
|
-
runNpmCommand,
|
|
338
|
-
|
|
370
|
+
async runNpmCommand(token, ...args) {
|
|
371
|
+
await ensureDevAuthToken(token);
|
|
372
|
+
return runNpmCommand(...args);
|
|
373
|
+
},
|
|
374
|
+
async installNuxtModule(token, name, dry = true) {
|
|
375
|
+
await ensureDevAuthToken(token);
|
|
339
376
|
const commands = await getNpmCommand("install", name, { dev: true });
|
|
340
377
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
341
378
|
const source = await fsp.readFile(filepath, "utf-8");
|
|
@@ -370,7 +407,8 @@ function setupNpmRPC({ nuxt }) {
|
|
|
370
407
|
processId
|
|
371
408
|
};
|
|
372
409
|
},
|
|
373
|
-
async uninstallNuxtModule(name, dry = true) {
|
|
410
|
+
async uninstallNuxtModule(token, name, dry = true) {
|
|
411
|
+
await ensureDevAuthToken(token);
|
|
374
412
|
const commands = await getNpmCommand("uninstall", name);
|
|
375
413
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
376
414
|
const source = await fsp.readFile(filepath, "utf-8");
|
|
@@ -499,7 +537,7 @@ function setupHooksDebug(hooks) {
|
|
|
499
537
|
return serverHooks;
|
|
500
538
|
}
|
|
501
539
|
|
|
502
|
-
function setupGeneralRPC({ nuxt, refresh, openInEditorHooks }) {
|
|
540
|
+
function setupGeneralRPC({ nuxt, options, refresh, openInEditorHooks }) {
|
|
503
541
|
const components = [];
|
|
504
542
|
const imports = [];
|
|
505
543
|
const importPresets = [];
|
|
@@ -555,6 +593,9 @@ function setupGeneralRPC({ nuxt, refresh, openInEditorHooks }) {
|
|
|
555
593
|
getServerConfig() {
|
|
556
594
|
return nuxt.options;
|
|
557
595
|
},
|
|
596
|
+
getModuleOptions() {
|
|
597
|
+
return options;
|
|
598
|
+
},
|
|
558
599
|
getServerApp() {
|
|
559
600
|
return serverApp;
|
|
560
601
|
},
|
|
@@ -618,6 +659,27 @@ function setupGeneralRPC({ nuxt, refresh, openInEditorHooks }) {
|
|
|
618
659
|
restartNuxt(hard = true) {
|
|
619
660
|
logger.info("Restarting Nuxt...");
|
|
620
661
|
return nuxt.callHook("restart", { hard });
|
|
662
|
+
},
|
|
663
|
+
async requestForAuth(info) {
|
|
664
|
+
const token = await getDevAuthToken();
|
|
665
|
+
const message = [
|
|
666
|
+
`A browser is requesting permissions of ${c.bold(c.yellow("writing files and running commands"))} from the DevTools UI.`,
|
|
667
|
+
c.bold(info),
|
|
668
|
+
"",
|
|
669
|
+
"Please open the following URL in the browser:",
|
|
670
|
+
c.bold(c.green(`http://localhost:${nuxt.options.devServer.port}${ROUTE_AUTH}?token=${token}`))
|
|
671
|
+
];
|
|
672
|
+
console.log(`
|
|
673
|
+
${boxen(message.join("\n"), {
|
|
674
|
+
padding: 1,
|
|
675
|
+
borderColor: "yellow",
|
|
676
|
+
borderStyle: "round",
|
|
677
|
+
title: "Permission Request"
|
|
678
|
+
})}
|
|
679
|
+
`);
|
|
680
|
+
},
|
|
681
|
+
async verifyAuthToken(token) {
|
|
682
|
+
return token === await getDevAuthToken();
|
|
621
683
|
}
|
|
622
684
|
};
|
|
623
685
|
}
|
|
@@ -635,8 +697,8 @@ const route = useRoute()
|
|
|
635
697
|
</template>
|
|
636
698
|
`;
|
|
637
699
|
async function enablePages(nuxt) {
|
|
638
|
-
const pathApp = join(nuxt.options.srcDir, "app.vue");
|
|
639
|
-
const pathPageIndex = join(nuxt.options.srcDir, "pages/index.vue");
|
|
700
|
+
const pathApp = join$1(nuxt.options.srcDir, "app.vue");
|
|
701
|
+
const pathPageIndex = join$1(nuxt.options.srcDir, "pages/index.vue");
|
|
640
702
|
if (fs.existsSync(pathPageIndex)) {
|
|
641
703
|
logger.warn("pages/index.vue already exists, skipping");
|
|
642
704
|
return;
|
|
@@ -657,9 +719,10 @@ const wizard = {
|
|
|
657
719
|
|
|
658
720
|
const LOG_PREFIX = c.cyan("Nuxt DevTools:");
|
|
659
721
|
|
|
660
|
-
function setupWizardRPC({ nuxt }) {
|
|
722
|
+
function setupWizardRPC({ nuxt, ensureDevAuthToken }) {
|
|
661
723
|
return {
|
|
662
|
-
runWizard(name, ...args) {
|
|
724
|
+
async runWizard(token, name, ...args) {
|
|
725
|
+
await ensureDevAuthToken(token);
|
|
663
726
|
logger.info(LOG_PREFIX, `Running wizard ${c.green(name)}...`);
|
|
664
727
|
return wizard[name](nuxt, ...args);
|
|
665
728
|
}
|
|
@@ -884,7 +947,7 @@ function scanFileHandler(type, prefix = "/") {
|
|
|
884
947
|
};
|
|
885
948
|
}
|
|
886
949
|
async function scanServerDir(nitro, name, mapper) {
|
|
887
|
-
const dirs = nitro.options.scanDirs.map((dir) => join(dir, name));
|
|
950
|
+
const dirs = nitro.options.scanDirs.map((dir) => join$1(dir, name));
|
|
888
951
|
const files = await scanDirs(dirs);
|
|
889
952
|
return files.map((f) => mapper(f));
|
|
890
953
|
}
|
|
@@ -6219,12 +6282,12 @@ function gitInstanceFactory(baseDir, options) {
|
|
|
6219
6282
|
init_git_response_error();
|
|
6220
6283
|
var esm_default = gitInstanceFactory;
|
|
6221
6284
|
|
|
6222
|
-
function setupAnalyzeBuildRPC({ nuxt, refresh }) {
|
|
6285
|
+
function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
6223
6286
|
let builds = [];
|
|
6224
6287
|
let promise;
|
|
6225
6288
|
let initalized;
|
|
6226
6289
|
const processId = "devtools:analyze-build";
|
|
6227
|
-
const analyzeDir = join(nuxt.options.rootDir, ".nuxt/analyze");
|
|
6290
|
+
const analyzeDir = join$1(nuxt.options.rootDir, ".nuxt/analyze");
|
|
6228
6291
|
async function startAnalyzeBuild(name) {
|
|
6229
6292
|
if (promise)
|
|
6230
6293
|
throw new Error("Already building");
|
|
@@ -6256,9 +6319,9 @@ function setupAnalyzeBuildRPC({ nuxt, refresh }) {
|
|
|
6256
6319
|
return {
|
|
6257
6320
|
...json,
|
|
6258
6321
|
features: {
|
|
6259
|
-
bundleClient: fs.existsSync(join(dir, "client.html")),
|
|
6260
|
-
bundleNitro: fs.existsSync(join(dir, "nitro.html")),
|
|
6261
|
-
viteInspect: fs.existsSync(join(dir, ".vite-inspect"))
|
|
6322
|
+
bundleClient: fs.existsSync(join$1(dir, "client.html")),
|
|
6323
|
+
bundleNitro: fs.existsSync(join$1(dir, "nitro.html")),
|
|
6324
|
+
viteInspect: fs.existsSync(join$1(dir, ".vite-inspect"))
|
|
6262
6325
|
}
|
|
6263
6326
|
};
|
|
6264
6327
|
}));
|
|
@@ -6284,18 +6347,22 @@ function setupAnalyzeBuildRPC({ nuxt, refresh }) {
|
|
|
6284
6347
|
builds
|
|
6285
6348
|
};
|
|
6286
6349
|
},
|
|
6287
|
-
async clearAnalyzeBuilds(names) {
|
|
6350
|
+
async clearAnalyzeBuilds(token, names) {
|
|
6351
|
+
await ensureDevAuthToken(token);
|
|
6288
6352
|
if (!names) {
|
|
6289
6353
|
await fsp.rm(analyzeDir, { recursive: true, force: true });
|
|
6290
6354
|
} else {
|
|
6291
6355
|
const targets = builds.filter((build) => names.includes(build.name));
|
|
6292
|
-
await Promise.all(targets.map((target) => fsp.rm(join(analyzeDir, target.slug), { recursive: true, force: true })));
|
|
6356
|
+
await Promise.all(targets.map((target) => fsp.rm(join$1(analyzeDir, target.slug), { recursive: true, force: true })));
|
|
6293
6357
|
}
|
|
6294
6358
|
initalized = readBuildInfo();
|
|
6295
6359
|
refresh("getAnalyzeBuildInfo");
|
|
6296
6360
|
},
|
|
6297
6361
|
generateAnalyzeBuildName,
|
|
6298
|
-
startAnalyzeBuild
|
|
6362
|
+
async startAnalyzeBuild(token, ...args) {
|
|
6363
|
+
await ensureDevAuthToken(token);
|
|
6364
|
+
return startAnalyzeBuild(...args);
|
|
6365
|
+
}
|
|
6299
6366
|
};
|
|
6300
6367
|
}
|
|
6301
6368
|
|
|
@@ -6888,8 +6955,8 @@ const defaults = {
|
|
|
6888
6955
|
function setupUIOptionsRPC({ nuxt }) {
|
|
6889
6956
|
const home = homedir();
|
|
6890
6957
|
const projectHash = hash(nuxt.options.rootDir);
|
|
6891
|
-
const dir = join(home, ".nuxt/devtools");
|
|
6892
|
-
const filepath = join(dir, `${projectHash}.json`);
|
|
6958
|
+
const dir = join$1(home, ".nuxt/devtools");
|
|
6959
|
+
const filepath = join$1(dir, `${projectHash}.json`);
|
|
6893
6960
|
let settings;
|
|
6894
6961
|
async function getUIOptions() {
|
|
6895
6962
|
if (!settings)
|
|
@@ -6972,7 +7039,13 @@ function setupRPC(nuxt, options) {
|
|
|
6972
7039
|
rpc,
|
|
6973
7040
|
refresh,
|
|
6974
7041
|
extendServerRpc,
|
|
6975
|
-
openInEditorHooks: []
|
|
7042
|
+
openInEditorHooks: [],
|
|
7043
|
+
async ensureDevAuthToken(token) {
|
|
7044
|
+
if (options.disableAuthorization)
|
|
7045
|
+
return;
|
|
7046
|
+
if (token !== await getDevAuthToken())
|
|
7047
|
+
throw new Error("Invalid dev auth token.");
|
|
7048
|
+
}
|
|
6976
7049
|
};
|
|
6977
7050
|
nuxt.devtools = ctx;
|
|
6978
7051
|
Object.assign(serverFunctions, {
|
|
@@ -7048,16 +7121,32 @@ async function enableModule(options, nuxt) {
|
|
|
7048
7121
|
await nuxt.callHook("devtools:before");
|
|
7049
7122
|
nuxt.options.imports.collectMeta = true;
|
|
7050
7123
|
addPlugin({
|
|
7051
|
-
src: join(runtimeDir, "plugins/devtools.client"),
|
|
7124
|
+
src: join$1(runtimeDir, "plugins/devtools.client"),
|
|
7052
7125
|
mode: "client"
|
|
7053
7126
|
});
|
|
7127
|
+
addPlugin({
|
|
7128
|
+
src: join$1(runtimeDir, "plugins/devtools.server"),
|
|
7129
|
+
mode: "server"
|
|
7130
|
+
});
|
|
7131
|
+
nuxt.hook("nitro:config", (config) => {
|
|
7132
|
+
config.externals = config.externals || {};
|
|
7133
|
+
config.externals.inline = config.externals.inline || [];
|
|
7134
|
+
config.externals.inline.push(join$1(runtimeDir, "nitro"));
|
|
7135
|
+
config.virtual = config.virtual || {};
|
|
7136
|
+
config.virtual["#nuxt-devtools-inline"] = `export const script = \`
|
|
7137
|
+
window.__NUXT_DEVTOOLS_TIME_METRIC__ = window.__NUXT_DEVTOOLS_TIME_METRIC__ || {}
|
|
7138
|
+
window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
7139
|
+
\``;
|
|
7140
|
+
config.plugins = config.plugins || [];
|
|
7141
|
+
config.plugins.push(join$1(runtimeDir, "nitro/inline"));
|
|
7142
|
+
});
|
|
7054
7143
|
const {
|
|
7055
7144
|
vitePlugin,
|
|
7056
7145
|
...ctx
|
|
7057
7146
|
} = setupRPC(nuxt, options);
|
|
7058
7147
|
addVitePlugin(vitePlugin);
|
|
7059
7148
|
const clientDirExists = existsSync(clientDir);
|
|
7060
|
-
const analyzeDir = join(nuxt.options.rootDir, ".nuxt/analyze");
|
|
7149
|
+
const analyzeDir = join$1(nuxt.options.rootDir, ".nuxt/analyze");
|
|
7061
7150
|
nuxt.hook("vite:extendConfig", (config) => {
|
|
7062
7151
|
var _a, _b, _c, _d;
|
|
7063
7152
|
config.server || (config.server = {});
|
|
@@ -7076,6 +7165,27 @@ async function enableModule(options, nuxt) {
|
|
|
7076
7165
|
server.middlewares.use(ROUTE_ANALYZE, sirv(analyzeDir, { single: false, dev: true }));
|
|
7077
7166
|
if (clientDirExists)
|
|
7078
7167
|
server.middlewares.use(ROUTE_CLIENT, sirv(clientDir, { single: true, dev: true }));
|
|
7168
|
+
server.middlewares.use(ROUTE_AUTH, sirv(join$1(runtimeDir, "auth"), { single: true, dev: true }));
|
|
7169
|
+
server.middlewares.use(ROUTE_AUTH_VERIFY, async (req, res) => {
|
|
7170
|
+
const search = req.url?.split("?")[1];
|
|
7171
|
+
if (!search) {
|
|
7172
|
+
res.statusCode = 400;
|
|
7173
|
+
res.end("No token provided");
|
|
7174
|
+
}
|
|
7175
|
+
const query = new URLSearchParams(search);
|
|
7176
|
+
const token = query.get("token");
|
|
7177
|
+
if (!token) {
|
|
7178
|
+
res.statusCode = 400;
|
|
7179
|
+
res.end("No token provided");
|
|
7180
|
+
}
|
|
7181
|
+
if (token === await getDevAuthToken()) {
|
|
7182
|
+
res.statusCode = 200;
|
|
7183
|
+
res.end("Valid token");
|
|
7184
|
+
} else {
|
|
7185
|
+
res.statusCode = 403;
|
|
7186
|
+
res.end("Invalid token");
|
|
7187
|
+
}
|
|
7188
|
+
});
|
|
7079
7189
|
});
|
|
7080
7190
|
const integrations = [
|
|
7081
7191
|
import('./plugin-metrics.mjs').then(({ setup }) => setup(ctx)),
|
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import 'vite';
|
|
|
14
14
|
import 'sirv';
|
|
15
15
|
import 'picocolors';
|
|
16
16
|
import 'birpc';
|
|
17
|
-
import '../shared/devtools.
|
|
17
|
+
import '../shared/devtools.7ab40af4.mjs';
|
|
18
18
|
import '../dirs.mjs';
|
|
19
19
|
import 'node:url';
|
|
20
20
|
import 'is-installed-globally';
|
|
@@ -28,6 +28,7 @@ import 'pkg-types';
|
|
|
28
28
|
import 'semver';
|
|
29
29
|
import 'local-pkg';
|
|
30
30
|
import 'unimport';
|
|
31
|
+
import 'boxen';
|
|
31
32
|
import 'perfect-debounce';
|
|
32
33
|
import 'fs';
|
|
33
34
|
import 'tty';
|
|
@@ -56,7 +57,8 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
56
57
|
rpc.broadcast.navigateTo("/modules/custom-builtin-vscode");
|
|
57
58
|
return true;
|
|
58
59
|
} catch (e) {
|
|
59
|
-
console.
|
|
60
|
+
console.debug(`Failed to open file "${file}" in VS Code Server`);
|
|
61
|
+
console.debug(e);
|
|
60
62
|
return false;
|
|
61
63
|
}
|
|
62
64
|
});
|
|
@@ -137,6 +139,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
137
139
|
title: "VS Code",
|
|
138
140
|
icon: "bxl-visual-studio",
|
|
139
141
|
category: "modules",
|
|
142
|
+
requireAuth: true,
|
|
140
143
|
view: !installed ? {
|
|
141
144
|
type: "launch",
|
|
142
145
|
title: "Install VS Code Server",
|
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.a0dd6aac.js"><link rel="preload" as="style" href="/__nuxt_devtools__/client/_nuxt/entry.717f6486.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.25d3cd66.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.809c6e7c.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.76363f3f.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.0a084ac9.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.9d0d2556.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-component.15e0d602.js"><link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.717f6486.css"><script>"use strict";const w=window,de=document.documentElement,knownColorSchemes=["dark","light"],preference=window.localStorage.getItem("nuxt-color-mode")||"system";let value=preference==="system"?getColorScheme():preference;const forcedColorMode=de.getAttribute("data-color-mode-forced");forcedColorMode&&(value=forcedColorMode),addColorScheme(value),w["__NUXT_COLOR_MODE__"]={preference,value,getColorScheme,addColorScheme,removeColorScheme};function addColorScheme(e){const o=""+e+"",t="";de.classList?de.classList.add(o):de.className+=" "+o,t&&de.setAttribute("data-"+t,e)}function removeColorScheme(e){const o=""+e+"",t="";de.classList?de.classList.remove(o):de.className=de.className.replace(new RegExp(o,"g"),""),t&&de.removeAttribute("data-"+t)}function prefersColorScheme(e){return w.matchMedia("(prefers-color-scheme"+e+")")}function getColorScheme(){if(w.matchMedia&&prefersColorScheme("").media!=="not all"){for(const e of knownColorSchemes)if(prefersColorScheme(":"+e).matches)return e}return"light"}
|
|
5
5
|
</script></head>
|
|
6
|
-
<body ><div id="__nuxt"></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"></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.a0dd6aac.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.a0dd6aac.js"><link rel="preload" as="style" href="/__nuxt_devtools__/client/_nuxt/entry.717f6486.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.25d3cd66.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.809c6e7c.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.76363f3f.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.0a084ac9.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.9d0d2556.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-component.15e0d602.js"><link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.717f6486.css"><script>"use strict";const w=window,de=document.documentElement,knownColorSchemes=["dark","light"],preference=window.localStorage.getItem("nuxt-color-mode")||"system";let value=preference==="system"?getColorScheme():preference;const forcedColorMode=de.getAttribute("data-color-mode-forced");forcedColorMode&&(value=forcedColorMode),addColorScheme(value),w["__NUXT_COLOR_MODE__"]={preference,value,getColorScheme,addColorScheme,removeColorScheme};function addColorScheme(e){const o=""+e+"",t="";de.classList?de.classList.add(o):de.className+=" "+o,t&&de.setAttribute("data-"+t,e)}function removeColorScheme(e){const o=""+e+"",t="";de.classList?de.classList.remove(o):de.className=de.className.replace(new RegExp(o,"g"),""),t&&de.removeAttribute("data-"+t)}function prefersColorScheme(e){return w.matchMedia("(prefers-color-scheme"+e+")")}function getColorScheme(){if(w.matchMedia&&prefersColorScheme("").media!=="not all"){for(const e of knownColorSchemes)if(prefersColorScheme(":"+e).matches)return e}return"light"}
|
|
5
5
|
</script></head>
|
|
6
|
-
<body ><div id="__nuxt"></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"></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.a0dd6aac.js" crossorigin></script></body>
|
|
7
7
|
</html>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html >
|
|
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.a0dd6aac.js"><link rel="preload" as="style" href="/__nuxt_devtools__/client/_nuxt/entry.717f6486.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/index.25d3cd66.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/default.809c6e7c.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/full.76363f3f.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/none.0a084ac9.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.9d0d2556.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt_devtools__/client/_nuxt/error-component.15e0d602.js"><link rel="stylesheet" href="/__nuxt_devtools__/client/_nuxt/entry.717f6486.css"><script>"use strict";const w=window,de=document.documentElement,knownColorSchemes=["dark","light"],preference=window.localStorage.getItem("nuxt-color-mode")||"system";let value=preference==="system"?getColorScheme():preference;const forcedColorMode=de.getAttribute("data-color-mode-forced");forcedColorMode&&(value=forcedColorMode),addColorScheme(value),w["__NUXT_COLOR_MODE__"]={preference,value,getColorScheme,addColorScheme,removeColorScheme};function addColorScheme(e){const o=""+e+"",t="";de.classList?de.classList.add(o):de.className+=" "+o,t&&de.setAttribute("data-"+t,e)}function removeColorScheme(e){const o=""+e+"",t="";de.classList?de.classList.remove(o):de.className=de.className.replace(new RegExp(o,"g"),""),t&&de.removeAttribute("data-"+t)}function prefersColorScheme(e){return w.matchMedia("(prefers-color-scheme"+e+")")}function getColorScheme(){if(w.matchMedia&&prefersColorScheme("").media!=="not all"){for(const e of knownColorSchemes)if(prefersColorScheme(":"+e).matches)return e}return"light"}
|
|
5
|
+
</script></head>
|
|
6
|
+
<body ><div id="__nuxt"></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.a0dd6aac.js" crossorigin></script></body>
|
|
7
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _,a3 as u,an as o,y as d,u as m,c as l,w as s,Z as f,o as p,f as a,b as e,j as t,h,a6 as x}from"./entry.a0dd6aac.js";import{_ as b}from"./NPanelGrids.54ee09bc.js";const g=e("h3",{class:"mb2 text-lg font-medium leading-6",flex:"~ items-center gap-1","text-orange":""},[e("span",{class:"i-carbon-information-square"}),t(" Permissions required ")],-1),k=e("p",null," This operation requires permissions for running command and access files from the browser. ",-1),q=e("p",null,[t(" A request is sent to the server."),e("br"),t(" Please check your terminal for the instructions and then come back. ")],-1),v={flex:"~ gap-3",mt2:"","justify-end":""},P=_({__name:"AuthRequiredPanel",setup(A){return u(()=>{o.value||d.requestForAuth()}),(n,N)=>{const r=h,i=x,c=b;return("isDevAuthed"in n?n.isDevAuthed:m(o))?f(n.$slots,"default",{key:1}):(p(),l(c,{key:0},{default:s(()=>[a(i,{flex:"~ col gap-2",mxa:"","items-center":"",p6:"","text-center":""},{default:s(()=>[g,k,q,e("div",v,[a(r,{disabled:"",icon:"i-carbon-time"},{default:s(()=>[t(" Waiting for authorization... ")]),_:1})])]),_:1})]),_:1}))}}});export{P as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aY as n,o,e as s,Z as t}from"./entry.a0dd6aac.js";const c={},r={class:"mx-0.5 select-none whitespace-nowrap rounded px-1.5 py-0.5 text-xs"};function a(e,_){return o(),s("span",r,[t(e.$slots,"default")])}const l=n(c,[["render",a]]);export{l as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as C}from"./NCodeBlock.vue.e44529a6.js";import{a as g,b3 as h,aj as S,o as s,e as a,b as n,F as d,m as w,p as u,u as o,t as x,f as _,w as f,j as m,c as B,q as r,h as N}from"./entry.a0dd6aac.js";import{a as V}from"./editor.aee50e2c.js";const $={key:0,relative:"","n-code-block":""},j={flex:"~ wrap","w-full":""},D=["onClick"],E=n("div",{border:"b base","flex-auto":""},null,-1),F={flex:"~ gap-2",px3:"",pb3:"",n:"sm primary"},T=g({__name:"CodeSnippets",props:{codeSnippets:{}},setup(b){const c=b,e=h(c.codeSnippets[0]),k=V();return S(()=>{c.codeSnippets.includes(e.value)||(e.value=c.codeSnippets[0])}),(l,p)=>{const v=C,i=N;return l.codeSnippets.length?(s(),a("div",$,[n("div",j,[(s(!0),a(d,null,w(l.codeSnippets,(t,y)=>(s(),a("button",{key:y,px4:"",py2:"",border:"r base",hover:"bg-active",class:u(t===o(e)?"":"border-b"),onClick:q=>e.value=t},[n("div",{class:u(t===o(e)?"":"op30"),"font-mono":""},x(t.name),3)],10,D))),128)),E]),o(e)?(s(),a(d,{key:0},[_(v,{code:o(e).code,lang:o(e).lang,lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code","lang"]),n("div",F,[_(i,{icon:"carbon-copy",onClick:p[0]||(p[0]=t=>o(k)(o(e).code))},{default:f(()=>[m(" Copy ")]),_:1}),o(e)?.docs?(s(),B(i,{key:0,to:o(e).docs,target:"_blank",icon:"carbon-catalog"},{default:f(()=>[m(" Docs ")]),_:1},8,["to"])):r("",!0)])],64)):r("",!0)])):r("",!0)}}});export{T as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as i}from"./NIconButton.vue.ac7efd0c.js";import{a as u,r as f,ac as m,ad as d,c as p,w as _,ae as b,o as s,e as v,f as g,b as h,Z as x,af as y,u as k,q as B}from"./entry.a0dd6aac.js";const C={relative:"","h-full":"","w-full":"","of-auto":""},V={inheritAttrs:!1},N=u({...V,__name:"DrawerRight",props:{modelValue:{type:Boolean},navbar:{},autoClose:{type:Boolean}},emits:["close"],setup(r,{emit:l}){const t=r,o=f(),{height:n}=m(()=>t.navbar,void 0,{box:"border-box"});return d(o,()=>{t.modelValue&&t.autoClose&&l("close")},{ignore:["a","button","summary"]}),(e,a)=>{const c=i;return s(),p(b,{"enter-active-class":"duration-200 ease-in","enter-from-class":"transform translate-x-1/1","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-out","leave-from-class":"opacity-100","leave-to-class":"transform translate-x-1/1"},{default:_(()=>[e.modelValue?(s(),v("div",y({key:0,ref_key:"el",ref:o,border:"l base",flex:"~ col gap-1",absolute:"","bottom-0":"","right-0":"","z-10":"","z-20":"","of-auto":"","text-sm":"","glass-effect":"",style:{top:`${k(n)}px`}},e.$attrs),[g(c,{absolute:"","right-2":"","top-2":"","z-20":"","text-xl":"",icon:"carbon-close",onClick:a[0]||(a[0]=$=>e.$emit("close"))}),h("div",C,[x(e.$slots,"default")])],16)):B("",!0)]),_:3})}}});export{N as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,o as s,e as i,j as u,t as f,p,b as c}from"./entry.a0dd6aac.js";const m=c("span",{"ml-1":"","text-xs":"",op50:""},"ms",-1),l=n({__name:"DurationDisplay",props:{duration:{},factor:{default:1}},setup(r){const e=r;function o(t){return t?(t=t*e.factor,t<.5?"text-gray:50":t>1e3?"text-red-400":t>500?"text-orange-400":t>200?"text-yellow-400":""):"text-gray-400"}function a(t){return t?t<1?"<1":t.toFixed(2):"-"}return(t,d)=>(s(),i("div",{class:p(o(t.duration))},[u(f(a(t.duration)),1),m],2))}});export{l as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as h}from"./editor.aee50e2c.js";import{a as f,U as c,l as k,at as v,o as t,c as y,w as B,e as s,F as l,j as m,t as n,u as a,b as C,q as b,p as N,ab as g}from"./entry.a0dd6aac.js";const w={key:0,op50:""},I=f({__name:"FilepathItem",props:{filepath:{},lineBreak:{type:Boolean},subpath:{type:Boolean},override:{}},setup(u){const r=u,d=h(),p=c(),o=k(()=>r.filepath&&p.value?v(r.filepath,p.value.rootDir):{path:r.filepath||""});return(e,i)=>(t(),y(g(e.filepath?"button":"span"),{class:N([e.filepath?"hover:underline":"",e.lineBreak?"":"ws-nowrap of-hidden truncate"]),"font-mono":"",title:e.override||e.filepath,onClick:i[0]||(i[0]=D=>e.filepath&&a(d)(e.filepath))},{default:B(()=>[e.override?(t(),s(l,{key:0},[m(n(e.override),1)],64)):a(o).moduleName?(t(),s(l,{key:1},[C("span",null,n(a(o).moduleName),1),e.subpath?(t(),s("span",w,n(a(o).path.slice(a(o).moduleName.length)),1)):b("",!0)],64)):(t(),s(l,{key:2},[m(n(a(o).path),1)],64))]),_:1},8,["class","title"]))}});export{I as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as f}from"./NIconButton.vue.
|
|
1
|
+
import{_ as f}from"./NIconButton.vue.ac7efd0c.js";import{a as _,r as m,u as o,e as s,b as d,f as a,w as i,ae as u,F as v,q as n,o as l,Z as g,a5 as k}from"./entry.a0dd6aac.js";const x=d("div",{"i-ri:question-mark":""},null,-1),h=[x],y={key:0,border:"l base",class:"prose",pos:"fixed bottom-0 right-0 top-0","z-200":"","w-150":"",px8:"",py4:"","bg-base":""},$=_({__name:"HelpFab",setup(w){const e=m(!1),{showHelpButtons:p}=k();return(b,t)=>{const c=f;return o(p)?(l(),s(v,{key:0},[d("button",{pos:"absolute bottom-5 right-5",border:"~ base rounded-full ",flex:"~ items-center justify-center","z-110":"","h-11":"","w-11":"","backdrop-blur-8":"",bg:"bg-base op50!","light:shadow":"",hover:"bg-active",title:"Help",onClick:t[0]||(t[0]=r=>e.value=!o(e))},h),a(u,{name:"fade-in"},{default:i(()=>[o(e)?(l(),s("div",{key:0,class:"fixed bottom-0 left-0 right-0 top-0 z-100","bg-black:20":"","backdrop-blur-2":"",onClick:t[1]||(t[1]=r=>e.value=!1)})):n("",!0)]),_:1}),a(u,{name:"slide-in"},{default:i(()=>[o(e)?(l(),s("div",y,[g(b.$slots,"default"),a(c,{icon:"carbon-close",pos:"absolute top-3 right-3","rounded-full":"","text-xl":"",onClick:t[2]||(t[2]=r=>e.value=!1)})])):n("",!0)]),_:3})],64)):n("",!0)}}});export{$ as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as k,c as o,w as a,o as n,f as r,b as c,t as i,q as m,e as b,m as g,af as h,j as N,F as w,aX as x,P as C,h as y,a6 as B}from"./entry.a0dd6aac.js";import{_ as $}from"./NMarkdown.vue.9f252ec4.js";import{_ as P}from"./NPanelGrids.54ee09bc.js";const V={"text-xl":""},v={flex:"~ gap2 wrap"},q=k({__name:"LaunchPage",props:{icon:{},title:{},description:{},actions:{}},emits:["action"],setup(F){return(e,I)=>{const _=x,l=$,p=C,d=y,u=B,f=P;return n(),o(f,null,{default:a(()=>[r(u,{flex:"~ col gap2",mxa:"","min-w-100":"","items-center":"",p6:""},{default:a(()=>[r(_,{mb2:"","text-5xl":"",icon:e.icon||e.icon,title:e.title},null,8,["icon","title"]),c("h1",V,i(e.title),1),e.description?(n(),o(l,{key:0,mb2:"","mt--1":"","text-center":"","text-base":"",op50:"",markdown:e.description},null,8,["markdown"])):m("",!0),c("div",v,[(n(!0),b(w,null,g(e.actions,(t,s)=>(n(),o(d,h({key:s,n:"solid primary",disabled:t.pending,to:t.src,target:t.src?"_blank":void 0},t.attrs,{onClick:()=>{t.handle?.(),e.$emit("action",s)}}),{default:a(()=>[t.pending?(n(),o(p,{key:0,icon:"carbon-circle-dash","animate-spin":""})):m("",!0),N(" "+i(t.label),1)]),_:2},1040,["disabled","to","target","onClick"]))),128))])]),_:1})]),_:1})}}});export{q as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,ar as r,e as p,v as b,bg as u,u as a,b as n,H as h,aO as k,f,Z as m,p as v,o as _,P as x}from"./entry.a0dd6aac.js";const V=["checked","disabled"],y=["disabled"],B={class:"n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition"},$=i({__name:"NCheckbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(c,{emit:t}){const e=r(c,"modelValue",t,{passive:!0});return(o,s)=>{const d=x;return _(),p("label",{class:"n-checkbox hover:n-checkbox-hover select-none items-center n-disabled:n-disabled",checked:a(e)||null,disabled:o.disabled||null},[b(n("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>h(e)?e.value=l:null),type:"checkbox",class:"peer absolute op0",disabled:o.disabled,onKeypress:s[1]||(s[1]=k(l=>e.value=!a(e),["enter"]))},null,40,y),[[u,a(e)]]),n("span",B,[f(d,{class:"n-checkbox-icon scale-0 transform op0 n-transition n-checked:scale-100 n-checked:op100"})]),n("span",{class:v([a(e)?"":"op50","n-transition"])},[m(o.$slots,"default")],2)],8,V)}}});export{$ as _};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as u}from"./client.d6464981.js";import{a as _,l as m,ai as k,o as n,e as s,p as r,b as t,F as d,m as f,t as g}from"./entry.a0dd6aac.js";const h=["innerHTML"],C={class:"shiki"},v=["textContent"],y=t("br",null,null,-1),H=_({__name:"NCodeBlock",props:{code:{},lang:{},lines:{type:Boolean,default:!0},transformRendered:{}},emits:["loaded"],setup(a,{emit:c}){const o=a,l=m(()=>{const e=u.value?.devtools.renderCodeHighlight(o.code,o.lang)||{code:o.code,supported:!1};return e.supported&&o.transformRendered&&(e.code=o.transformRendered(e.code)),e.supported&&k(()=>c("loaded")),e});return(e,b)=>e.lang&&l.value.supported?(n(),s("pre",{key:0,class:r(["n-code-block",e.lines?"n-code-block-lines":""]),innerHTML:l.value.code},null,10,h)):(n(),s("pre",{key:1,class:r(["n-code-block",e.lines?"n-code-block-lines":""])},[t("pre",C,[t("code",null,[(n(!0),s(d,null,f(e.code.split(`
|
|
2
|
+
`),(i,p)=>(n(),s(d,{key:p},[t("span",{class:"line",textContent:g(i)},null,8,v),y],64))),128))])])],2))}});export{H as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,o as e,c,w as r,f as i,af as p,ab as _,u as m,I as u,P as f}from"./entry.a0dd6aac.js";const d=s({__name:"NIconButton",props:{to:{},icon:{}},setup(n){const t=n;return(o,l)=>{const a=f;return e(),c(_(o.to?m(u):"button"),p({to:o.to},o.$attrs,{class:"n-transition n-icon-button"}),{default:r(()=>[i(a,{icon:t.icon},null,8,["icon"])]),_:1},16,["to"])}}});export{d as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t,o,e as s,p as a,q as n,Z as r,b as l,t as i}from"./entry.a0dd6aac.js";const c={flex:"~ gap-3","items-center":""},u=t({__name:"NIconTitle",props:{icon:{},text:{}},setup(p){return(e,m)=>(o(),s("div",c,[e.icon?(o(),s("div",{key:0,class:a(e.icon)},null,2)):n("",!0),r(e.$slots,"default",{},()=>[l("div",null,i(e.text),1)])]))}});export{u as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,o as a,c as o,w as r,Z as s,af as t,ab as p,u as i,I as l}from"./entry.a0dd6aac.js";const c=n({__name:"NLink",props:{to:{},href:{},target:{}},setup(_){return(e,f)=>(a(),o(p(e.href||e.target?"a":i(l)),t(e.$props,{class:"n-link n-transition hover:n-link-hover n-link-base"}),{default:r(()=>[s(e.$slots,"default")]),_:3},16))}});export{c as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as o}from"./client.d6464981.js";import{a as t,u as a,o as e,c as r,ab as s,t as d}from"./entry.a0dd6aac.js";const i=t({__name:"NMarkdown",props:{markdown:{},tag:{}},setup(m){return(n,l)=>n.markdown&&a(o)?.devtools?.renderMarkdown?(e(),r(s(n.tag||"span"),{key:0,class:"n-markdown",innerHTML:a(o).devtools.renderMarkdown(n.markdown)},null,8,["innerHTML"])):(e(),r(s(n.tag||"span"),{key:1,class:"n-markdown",textContent:d(n.markdown)},null,8,["textContent"]))}});export{i as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aY as n,o,e as s,Z as t}from"./entry.a0dd6aac.js";const c={},r={class:"n-panel-grids-center"};function _(e,a){return o(),s("div",r,[t(e.$slots,"default")])}const d=n(c,[["render",_]]);export{d as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
details[data-v-a73dbcfe]{border-style:none}summary[data-v-a73dbcfe]{border-style:none;list-style:none}details[open] summary[data-v-a73dbcfe]{border-style:none}details summary[data-v-a73dbcfe]::-webkit-details-marker{display:none}details[open] .chevron[data-v-a73dbcfe]{opacity:.75;transform:rotate(180deg)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g,ar as y,e as r,b as o,p as n,f as b,w,u as i,F as c,v as B,x as S,Z as s,q as p,o as l,j as u,t as v,c as $,ay as C,az as N,P as k,aY as x}from"./entry.a0dd6aac.js";import{_ as I}from"./NIconTitle.vue.ace3a05a.js";const f=t=>(C("data-v-a73dbcfe"),t=t(),N(),t),V=["open"],z={"text-base":""},T={key:0,"text-sm":"",op50:""},D=f(()=>o("div",{class:"flex-auto"},null,-1)),F=f(()=>o("div",{class:"x-divider"},null,-1)),j=g({__name:"NSectionBlock",props:{icon:{},text:{},description:{},containerClass:{default:""},headerClass:{},collapse:{type:Boolean,default:!0},open:{type:Boolean,default:!0},padding:{type:[Boolean,String],default:!0}},setup(t){const a=y(t,"open",void 0,{passive:!0});function _(e){a.value=e.target.open}return(e,d)=>{const m=k,h=I;return l(),r(c,null,[o("details",{open:i(a),onToggle:_},[o("summary",{class:n(["cursor-pointer select-none hover:bg-active p4",e.collapse?"":"pointer-events-none"])},[b(h,{icon:e.icon,text:e.text,"text-xl":"",transition:"",class:n([i(a)?"op100":"op60",e.headerClass])},{default:w(()=>[o("div",null,[o("div",z,[s(e.$slots,"text",{},()=>[u(v(e.text),1)],!0)]),e.description||e.$slots.description?(l(),r("div",T,[s(e.$slots,"description",{},()=>[u(v(e.description),1)],!0)])):p("",!0)]),D,s(e.$slots,"actions",{},void 0,!0),e.collapse?(l(),$(m,{key:0,icon:"carbon-chevron-down",class:"chevron","cursor-pointer":"","place-self-start":"","text-base":"",op75:"",transition:"","duration-500":""})):p("",!0)]),_:3},8,["icon","text","class"])],2),d._lazyshow1||i(a)?(d._lazyshow1=!0,l(),r(c,null,[B(o("div",{class:n(["flex flex-col flex-gap2 pb6 pt2",typeof e.padding=="string"?e.padding:e.padding?"px4":""])},[s(e.$slots,"details",{},void 0,!0),o("div",{class:n([e.containerClass,"mt1"])},[s(e.$slots,"default",{},void 0,!0)],2),s(e.$slots,"footer",{},void 0,!0)],2),[[S,i(a)]])],64)):p("v-show-if",!0)],40,V),F],64)}}});const P=x(j,[["__scopeId","data-v-a73dbcfe"]]);export{P as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,ar as p,e as t,Z as l,v as f,bh as m,u as b,b as h,t as v,q as n,H as _,o as s,c as V,P as k}from"./entry.a0dd6aac.js";const y={class:"n-text-input flex flex items-center border n-border-base rounded px-2 py-1 focus-within:n-focus-base focus-within:border-context n-bg-base"},B=["disabled"],w={key:0,value:"",disabled:"",hidden:""},g=u({__name:"NSelect",props:{modelValue:{default:void 0},placeholder:{default:""},icon:{default:""},disabled:{type:Boolean,default:!1}},setup(d,{emit:i}){const o=p(d,"modelValue",i,{passive:!0});return(e,a)=>{const r=k;return s(),t("div",y,[l(e.$slots,"icon",{},()=>[e.icon?(s(),V(r,{key:0,icon:e.icon,class:"mr-0.4em text-1.1em op50"},null,8,["icon"])):n("",!0)]),f(h("select",{"onUpdate:modelValue":a[0]||(a[0]=c=>_(o)?o.value=c:null),disabled:e.disabled,class:"w-full flex-auto n-bg-base !outline-none"},[e.placeholder?(s(),t("option",w,v(e.placeholder),1)):n("",!0),l(e.$slots,"default")],8,B),[[m,b(o)]])])}}});export{g as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,ar as c,o as r,e as u,v as h,bg as p,u as l,b as t,H as b,aO as v,Z as f}from"./entry.a0dd6aac.js";const k=["checked","disabled"],m=["disabled"],w=t("div",{class:"n-switch-slider n-checked:n-switch-slider-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition"},[t("div",{class:"n-checked:n-switch-thumb-checked n-switch-thumb n-transition"})],-1),B=i({__name:"NSwitch",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(o,{emit:d}){const e=c(o,"modelValue",d,{passive:!0});return(a,s)=>(r(),u("label",{class:"n-switch n-switch-base hover:n-switch-hover n-disabled:n-disabled",checked:l(e)||null,disabled:a.disabled||null},[h(t("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>b(e)?e.value=n:null),type:"checkbox",class:"peer absolute op0",disabled:a.disabled,onKeypress:s[1]||(s[1]=v(n=>e.value=!l(e),["enter"]))},null,40,m),[[p,l(e)]]),w,f(a.$slots,"default")],8,k))}});export{B as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,o,e as c,Z as n,c as t,q as i,b as r,P as l}from"./entry.a0dd6aac.js";const p={class:"n-tip n-tip-base"},u=a({__name:"NTip",props:{icon:{}},setup(_){return(e,m)=>{const s=l;return o(),c("div",p,[n(e.$slots,"icon",{},()=>[e.icon?(o(),t(s,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):i("",!0)]),r("div",null,[n(e.$slots,"default")])])}}});export{u as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,
|
|
1
|
+
import{a as r,e as c,b as d,Z as s,p as n,o as p,f as i,J as u}from"./entry.a0dd6aac.js";const f={flex:"~ gap4"},g=r({__name:"Navbar",props:{search:{type:String,default:void 0},noPadding:{type:Boolean,default:!1}},emits:["update:search"],setup(e,{emit:o}){function t(a){o("update:search",a.target.value)}return(a,m)=>{const l=u;return p(),c("div",{flex:"~ col gap2",border:"b base","flex-1":"","navbar-glass":"",class:n([{p4:!e.noPadding}])},[d("div",f,[s(a.$slots,"search",{},()=>[i(l,{placeholder:"Search...",icon:"carbon-search",n:"primary","flex-auto":"",class:n({"px-5 py-2":!e.noPadding}),value:e.search,onInput:t},null,8,["class","value"])]),s(a.$slots,"actions")]),s(a.$slots,"default")],2)}}});export{g as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as S}from"./Badge.067326d6.js";import{_ as E}from"./NCodeBlock.vue.e44529a6.js";import{_ as F}from"./NCheckbox.vue.060051ad.js";import{_ as q}from"./NTip.vue.f50fcd60.js";import{a as A,C as G,aT as H,r as h,aU as K,A as W,o as l,e as p,Z,u as e,t as v,q as x,F as N,f as t,c as z,w as s,b as _,H as b,j as i,h as J,K as L}from"./entry.a0dd6aac.js";const M={key:0},O={p4:"",flex:"~ col gap-1"},Q={class:"text-lg font-medium leading-6"},X=_("p",{op50:""}," The following command will be executed in your terminal: ",-1),Y={flex:"~ gap-3",mt2:"","justify-end":""},ne=A({__name:"NpmVersionCheck",props:{packageName:{},options:{},showVersion:{type:Boolean,default:!0}},setup(V){const u=V,$=G(),{info:r,update:w,state:B,processId:U,restart:R}=H(u.packageName,u.options),d=h(!0),c=h(!0),T=K(),f=W();async function g(){const o=await w(async a=>f.start(a));o&&c.value&&T.value.push({id:o,message:`${u.packageName} has been updated. Do you want to restart the Nuxt server now?`}),o&&d.value&&$.push(`/modules/terminals?id=${encodeURIComponent(o)}`)}return(o,a)=>{const k=S,D=E,y=F,P=q,C=J,j=L;return l(),p(N,null,[Z(o.$slots,"default",{id:e(U),info:e(r),update:g,state:e(B),restart:e(R)},()=>[e(r)&&o.showVersion?(l(),p("code",M,v(`v${e(r).current}`),1)):x("",!0),e(r)?.latest?(l(),p(N,{key:1},[e(r).needsUpdate?(l(),p("button",{key:0,onClick:a[0]||(a[0]=m=>g())},[t(k,{"bg-green-400:10":"","text-green-400":"",title:"updates available",textContent:"updates available"})])):(l(),z(k,{key:1,"bg-gray-400:10":"","text-gray-400":"",title:"latest",textContent:"latest"}))],64)):x("",!0)]),t(e(f),null,{default:s(({resolve:m,args:I})=>[t(j,{"model-value":!0,onClose:n=>m(!1)},{default:s(()=>[_("div",O,[_("h3",Q," Update "+v(u.packageName)+"? ",1),X,t(D,{code:I[0],lang:"bash",my3:"",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),t(y,{modelValue:e(d),"onUpdate:modelValue":a[1]||(a[1]=n=>b(d)?d.value=n:null),n:"primary"},{default:s(()=>[i(" Navigate to terminal ")]),_:1},8,["modelValue"]),t(y,{modelValue:e(c),"onUpdate:modelValue":a[2]||(a[2]=n=>b(c)?c.value=n:null),n:"primary"},{default:s(()=>[i(" Restart Nuxt server after update ")]),_:1},8,["modelValue"]),_("div",Y,[t(P,{n:"sm purple","flex-auto":"",icon:"carbon-chemistry"},{default:s(()=>[i(" Experimental feature. Please make sure to backup your project first. ")]),_:1}),t(C,{onClick:n=>m(!1)},{default:s(()=>[i(" Cancel ")]),_:2},1032,["onClick"]),t(C,{n:"solid primary",onClick:n=>m(!0)},{default:s(()=>[i(" Update ")]),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1})],64)}}});export{ne as _};
|