@nuxt/devtools-nightly 2.0.0-beta.4-28972036.a28ca5b → 2.0.0-beta.7-28979078.dd9a91a
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 +82 -43
- package/dist/chunks/vscode.mjs +3 -3
- package/dist/chunks/vue-devtools.mjs +5 -17
- package/dist/client/200.html +24 -15
- package/dist/client/404.html +24 -15
- package/dist/client/_nuxt/__blank-i73w98ot.js +1 -0
- package/dist/client/_nuxt/analyze-build-osypvinl.js +1 -0
- package/dist/client/_nuxt/assets-kabfym3l.js +16 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c09c67b3-1799-4690-9b4b-e93e60520f9c.json +1 -0
- package/dist/client/_nuxt/{client-bvu6p7m4.js → client-kpmlv67d.js} +1 -1
- package/dist/client/_nuxt/{code-diff.vue-mke5i5ht.js → code-diff.vue-j7k3a6r3.js} +3 -3
- package/dist/client/_nuxt/code-snippets.vue-o376xgrr.js +1 -0
- package/dist/client/_nuxt/components-j500sapl.js +1 -0
- package/dist/client/_nuxt/composable-item.vue-ne7y5jza.js +1 -0
- package/dist/client/_nuxt/custom-_name_-g0vgtf0l.js +1 -0
- package/dist/client/_nuxt/data-schema-button.vue-nqa7vss8.js +1 -0
- package/dist/client/_nuxt/data-schema-drawer-mr2wbyy1.js +2 -0
- package/dist/client/_nuxt/default-dscxupqw.js +1 -0
- package/dist/client/_nuxt/duration-display.vue-dzttyi5n.js +1 -0
- package/dist/client/_nuxt/{entry.css-egk2z7qr.css → entry.css-gcfkqtar.css} +1 -1
- package/dist/client/_nuxt/{error-404-donj9nx3.js → error-404-eg5womw1.js} +1 -1
- package/dist/client/_nuxt/error-404.css-fwe7gpvk.css +1 -0
- package/dist/client/_nuxt/{error-500-guu8hu4a.js → error-500-ins5mmhy.js} +1 -1
- package/dist/client/_nuxt/error-500.css-djemplc9.css +1 -0
- package/dist/client/_nuxt/{error-h4c4ee89.js → error-bgufcoup.js} +5 -5
- package/dist/client/_nuxt/filepath-item.vue-ipkw48nj.js +1 -0
- package/dist/client/_nuxt/full-nrro384i.js +1 -0
- package/dist/client/_nuxt/{help-fab.vue-kjnf5h3g.js → help-fab.vue-p3sb2h0t.js} +1 -1
- package/dist/client/_nuxt/hooks-i4vk7gi5.js +1 -0
- package/dist/client/_nuxt/imports-k7recz0n.js +1 -0
- package/dist/client/_nuxt/index-jorw6bxa.js +1 -0
- package/dist/client/_nuxt/index-kaszxz8x.js +2 -0
- package/dist/client/_nuxt/launch-page.vue-gca7uxfe.js +1 -0
- package/dist/client/_nuxt/modules-m680c0mj.js +1 -0
- package/dist/client/_nuxt/nbadge-lmur87ty.js +1 -0
- package/dist/client/_nuxt/ncheckbox.vue-feskyxd0.js +1 -0
- package/dist/client/_nuxt/ncode-block.vue-dt6krs6h.js +2 -0
- package/dist/client/_nuxt/ndrawer.vue-b09njjbc.js +1 -0
- package/dist/client/_nuxt/ndropdown.vue-j9ga9cm2.js +1 -0
- package/dist/client/_nuxt/nicon-title.vue-hzhi6u0u.js +1 -0
- package/dist/client/_nuxt/nlink.vue-n6hbz6nn.js +1 -0
- package/dist/client/_nuxt/nmarkdown.vue-jpbjhala.js +1 -0
- package/dist/client/_nuxt/nnavbar.vue-fsgszvqg.js +1 -0
- package/dist/client/_nuxt/none-eo3diko6.js +1 -0
- package/dist/client/_nuxt/nsection-block-iefigwly.js +1 -0
- package/dist/client/_nuxt/nselect-tabs.vue-lh4in903.js +1 -0
- package/dist/client/_nuxt/nselect.vue-7oki02k8.js +1 -0
- package/dist/client/_nuxt/nswitch.vue-iu20lc9i.js +1 -0
- package/dist/client/_nuxt/{open-graph-lnevntcs.js → open-graph-gj21w2an.js} +2 -2
- package/dist/client/_nuxt/ork67mdr.js +17 -0
- package/dist/client/_nuxt/{overview-lggw2g8n.js → overview-m1kjwsk2.js} +1 -1
- package/dist/client/_nuxt/pages-haifvw2e.js +1 -0
- package/dist/client/_nuxt/payload-ig1oqqar.js +1 -0
- package/dist/client/_nuxt/pinia-kied7w5j.js +1 -0
- package/dist/client/_nuxt/plugins-hmadqzxz.js +1 -0
- package/dist/client/_nuxt/render-tree-hu59echi.js +1 -0
- package/dist/client/_nuxt/runtime-configs-ievg11jo.js +1 -0
- package/dist/client/_nuxt/server-discovery-fydvq0gt.js +1 -0
- package/dist/client/_nuxt/server-route-inputs.vue-n7a1uel1.js +1 -0
- package/dist/client/_nuxt/server-routes-dpgoyzw9.js +9 -0
- package/dist/client/_nuxt/server-tasks-ab1nq458.js +1 -0
- package/dist/client/_nuxt/settings-lt1pi5fu.js +1 -0
- package/dist/client/_nuxt/stacktrace-list.vue-nd6leugh.js +1 -0
- package/dist/client/_nuxt/{state-components-fb7dlw2d.js → state-components-h1pv8gv7.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-fofa87a8.js +1 -0
- package/dist/client/_nuxt/{state-modules-h8uf7h8d.js → state-modules-cgbrs35c.js} +1 -1
- package/dist/client/_nuxt/storage-oi52w3em.js +1 -0
- package/dist/client/_nuxt/terminals-g9pq9aij.js +1 -0
- package/dist/client/_nuxt/timeline-c4zyui8l.js +31 -0
- package/dist/client/_nuxt/{unocss-runtime-abddx8lv.js → unocss-runtime-cb61k1ql.js} +1 -1
- package/dist/client/_nuxt/vendor/{json-editor-vue-hrh84odz.js → json-editor-vue-kcahofzr.js} +4 -4
- package/dist/client/_nuxt/vendor/quicktype-core-lnbp3n5r.js +1006 -0
- package/dist/client/_nuxt/vendor/{shiki-nyzr6cds.js → shiki-ja073547.js} +151 -18
- package/dist/client/_nuxt/vendor/{unocss-cbkcukyd.js → unocss-mstcul8h.js} +1 -1
- package/dist/client/_nuxt/virtual-files-f10idtc4.js +1 -0
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-btin7frf.js → vue-virtual-scroller.esm-ryb7s73q.js} +2 -2
- package/dist/client/index.html +24 -15
- package/dist/module.json +1 -1
- package/dist/runtime/vue-devtools-client.d.ts +2 -0
- package/dist/runtime/vue-devtools-client.js +8 -0
- package/package.json +17 -17
- package/dist/client/_nuxt/__blank-ohgur088.js +0 -1
- package/dist/client/_nuxt/analyze-build-k4mk9yun.js +0 -1
- package/dist/client/_nuxt/assets-l2ksml1j.js +0 -16
- package/dist/client/_nuxt/b02f8h4y.js +0 -17
- package/dist/client/_nuxt/builds/meta/0b18b2cb-e292-49a5-84bc-8034f148e947.json +0 -1
- package/dist/client/_nuxt/code-snippets.vue-kz39ylf7.js +0 -1
- package/dist/client/_nuxt/components-5jpwg4jr.js +0 -1
- package/dist/client/_nuxt/composable-item.vue-krvb1hx6.js +0 -1
- package/dist/client/_nuxt/custom-_name_-e39sqimm.js +0 -1
- package/dist/client/_nuxt/default-okvqvker.js +0 -1
- package/dist/client/_nuxt/duration-display.vue-onla0yr8.js +0 -1
- package/dist/client/_nuxt/error-404.css-hipm8rzk.css +0 -1
- package/dist/client/_nuxt/error-500.css-ncq7dpos.css +0 -1
- package/dist/client/_nuxt/filepath-item.vue-f3958elb.js +0 -1
- package/dist/client/_nuxt/full-p3k4lso2.js +0 -1
- package/dist/client/_nuxt/hooks-m100lq90.js +0 -1
- package/dist/client/_nuxt/imports-lgznszn5.js +0 -1
- package/dist/client/_nuxt/index-jwebz8s6.js +0 -2
- package/dist/client/_nuxt/index-og3vi7fw.js +0 -1
- package/dist/client/_nuxt/launch-page.vue-fzp5jez3.js +0 -1
- package/dist/client/_nuxt/modules-gzb89d9p.js +0 -1
- package/dist/client/_nuxt/nbadge-le6qglrd.js +0 -1
- package/dist/client/_nuxt/ncheckbox.vue-mnhptb1i.js +0 -1
- package/dist/client/_nuxt/ncode-block.vue-bazndqbc.js +0 -2
- package/dist/client/_nuxt/ndrawer.vue-xvdipzno.js +0 -1
- package/dist/client/_nuxt/ndropdown.vue-nlyuq8dr.js +0 -1
- package/dist/client/_nuxt/nicon-title.vue-evdbm4ef.js +0 -1
- package/dist/client/_nuxt/nlink.vue-l5e2nrsl.js +0 -1
- package/dist/client/_nuxt/nmarkdown.vue-ffthu1ys.js +0 -1
- package/dist/client/_nuxt/nnavbar.vue-med0h49f.js +0 -1
- package/dist/client/_nuxt/none-d4srol4h.js +0 -1
- package/dist/client/_nuxt/nsection-block-mwhk66gw.js +0 -1
- package/dist/client/_nuxt/nselect-tabs.vue-lw6b1oce.js +0 -1
- package/dist/client/_nuxt/nselect.vue-cpd2bgtt.js +0 -1
- package/dist/client/_nuxt/pages-cmfmwr2p.js +0 -1
- package/dist/client/_nuxt/payload-cxg8buvj.js +0 -1
- package/dist/client/_nuxt/pinia-nc122g2e.js +0 -1
- package/dist/client/_nuxt/plugins-emvg7eig.js +0 -1
- package/dist/client/_nuxt/render-tree-k13q5r2i.js +0 -1
- package/dist/client/_nuxt/runtime-configs-joak20f6.js +0 -1
- package/dist/client/_nuxt/server-discovery-gfxffs3t.js +0 -1
- package/dist/client/_nuxt/server-route-inputs.vue-cci8vi7h.js +0 -1
- package/dist/client/_nuxt/server-routes-mxv29exp.js +0 -9
- package/dist/client/_nuxt/server-tasks-i6n4zfmj.js +0 -1
- package/dist/client/_nuxt/settings-hb6178w8.js +0 -1
- package/dist/client/_nuxt/stacktrace-list.vue-mbkojt56.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-n8pkn9an.js +0 -1
- package/dist/client/_nuxt/storage-dbjnpbvw.js +0 -1
- package/dist/client/_nuxt/terminals-m00yl3x9.js +0 -1
- package/dist/client/_nuxt/timeline-m1v5ujmi.js +0 -31
- package/dist/client/_nuxt/virtual-files-mvbbim6p.js +0 -1
- package/dist/runtime/vue-devtools/overlay.d.ts +0 -1
- package/dist/runtime/vue-devtools/overlay.js +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import fs$
|
|
2
|
-
import
|
|
1
|
+
import fs$8, { existsSync, promises, statSync as statSync$1, realpathSync, accessSync, constants as constants$5, readFileSync } from 'node:fs';
|
|
2
|
+
import fsp from 'node:fs/promises';
|
|
3
3
|
import os$1, { homedir } from 'node:os';
|
|
4
4
|
import { logger, useNuxt, addPlugin, addTemplate, addVitePlugin } from '@nuxt/kit';
|
|
5
5
|
import { colors } from 'consola/utils';
|
|
@@ -48,7 +48,7 @@ import __cjs_mod__ from 'module';
|
|
|
48
48
|
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
49
49
|
const __dirname = __cjs_path__.dirname(__filename);
|
|
50
50
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
51
|
-
const version$1 = "2.0.0-beta.
|
|
51
|
+
const version$1 = "2.0.0-beta.7-28979078.dd9a91a";
|
|
52
52
|
|
|
53
53
|
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
54
54
|
function randomStr(size = 16, dict = urlAlphabet) {
|
|
@@ -69,7 +69,7 @@ async function readLocalOptions(defaults, options) {
|
|
|
69
69
|
try {
|
|
70
70
|
const options2 = {
|
|
71
71
|
...defaults,
|
|
72
|
-
...JSON.parse(await
|
|
72
|
+
...JSON.parse(await fsp.readFile(filePath, "utf-8")).settings || {}
|
|
73
73
|
};
|
|
74
74
|
return options2;
|
|
75
75
|
} catch (e) {
|
|
@@ -97,12 +97,12 @@ function getOptionsFilepath(options) {
|
|
|
97
97
|
async function clearLocalOptions(options) {
|
|
98
98
|
const { filePath } = getOptionsFilepath(options);
|
|
99
99
|
if (existsSync(filePath))
|
|
100
|
-
await
|
|
100
|
+
await fsp.unlink(filePath);
|
|
101
101
|
}
|
|
102
102
|
async function writeLocalOptions(settings, options) {
|
|
103
103
|
const { filePath, hashedKey } = getOptionsFilepath(options);
|
|
104
|
-
await
|
|
105
|
-
await
|
|
104
|
+
await fsp.mkdir(dirname(filePath), { recursive: true });
|
|
105
|
+
await fsp.writeFile(
|
|
106
106
|
filePath,
|
|
107
107
|
JSON.stringify(
|
|
108
108
|
{
|
|
@@ -125,11 +125,11 @@ async function getDevAuthToken() {
|
|
|
125
125
|
const dir = join$1(home, ".nuxt/devtools");
|
|
126
126
|
const filepath = join$1(dir, "dev-auth-token.txt");
|
|
127
127
|
if (existsSync(filepath))
|
|
128
|
-
token = (await
|
|
128
|
+
token = (await fsp.readFile(filepath, "utf-8")).trim();
|
|
129
129
|
if (!token)
|
|
130
130
|
token = randomStr(16);
|
|
131
|
-
await
|
|
132
|
-
await
|
|
131
|
+
await fsp.mkdir(dir, { recursive: true });
|
|
132
|
+
await fsp.writeFile(filepath, token, "utf-8");
|
|
133
133
|
return token;
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -138,7 +138,7 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
138
138
|
let promise;
|
|
139
139
|
let initalized;
|
|
140
140
|
const processId = "devtools:analyze-build";
|
|
141
|
-
const
|
|
141
|
+
const devtoolsAnalyzeDir = join(nuxt.options.rootDir, "node_modules/.cache/nuxt-devtools/analyze");
|
|
142
142
|
async function startAnalyzeBuild(name) {
|
|
143
143
|
if (promise)
|
|
144
144
|
throw new Error("Already building");
|
|
@@ -152,6 +152,7 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
152
152
|
icon: "logos-nuxt-icon"
|
|
153
153
|
}, nuxt);
|
|
154
154
|
refresh("getAnalyzeBuildInfo");
|
|
155
|
+
initalized = void 0;
|
|
155
156
|
promise = result.getProcess().then(() => {
|
|
156
157
|
refresh("getAnalyzeBuildInfo");
|
|
157
158
|
return readBuildInfo();
|
|
@@ -163,16 +164,37 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
163
164
|
return processId;
|
|
164
165
|
}
|
|
165
166
|
async function readBuildInfo() {
|
|
166
|
-
|
|
167
|
+
for (const dir of /* @__PURE__ */ new Set([
|
|
168
|
+
join(nuxt.options.rootDir, ".nuxt/analyze"),
|
|
169
|
+
join(nuxt.options.rootDir, "node_modules/.cache/nuxt/.nuxt/analyze"),
|
|
170
|
+
nuxt.options.analyzeDir
|
|
171
|
+
])) {
|
|
172
|
+
const files2 = await glob(["**/meta.json", "meta.json"], {
|
|
173
|
+
cwd: dir,
|
|
174
|
+
onlyFiles: true,
|
|
175
|
+
absolute: true
|
|
176
|
+
});
|
|
177
|
+
for (const file of files2) {
|
|
178
|
+
const slug = JSON.parse(await fsp.readFile(file, "utf-8")).slug;
|
|
179
|
+
const dir2 = dirname$1(file);
|
|
180
|
+
await fsp.mkdir(devtoolsAnalyzeDir, { recursive: true });
|
|
181
|
+
await fsp.rename(dir2, join(devtoolsAnalyzeDir, slug));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const files = await glob(["**/meta.json"], {
|
|
185
|
+
cwd: devtoolsAnalyzeDir,
|
|
186
|
+
onlyFiles: true,
|
|
187
|
+
absolute: true
|
|
188
|
+
});
|
|
167
189
|
builds = await Promise.all(files.map(async (file) => {
|
|
168
190
|
const dir = dirname$1(file);
|
|
169
|
-
const json = JSON.parse(await
|
|
191
|
+
const json = JSON.parse(await fsp.readFile(file, "utf-8"));
|
|
170
192
|
return {
|
|
171
193
|
...json,
|
|
172
194
|
features: {
|
|
173
|
-
bundleClient: fs$
|
|
174
|
-
bundleNitro: fs$
|
|
175
|
-
viteInspect: fs$
|
|
195
|
+
bundleClient: fs$8.existsSync(join(dir, "client.html")),
|
|
196
|
+
bundleNitro: fs$8.existsSync(join(dir, "nitro.html")),
|
|
197
|
+
viteInspect: fs$8.existsSync(join(dir, ".vite-inspect"))
|
|
176
198
|
}
|
|
177
199
|
};
|
|
178
200
|
}));
|
|
@@ -205,10 +227,10 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
205
227
|
async clearAnalyzeBuilds(token, names) {
|
|
206
228
|
await ensureDevAuthToken(token);
|
|
207
229
|
if (!names) {
|
|
208
|
-
await
|
|
230
|
+
await fsp.rm(devtoolsAnalyzeDir, { recursive: true, force: true });
|
|
209
231
|
} else {
|
|
210
232
|
const targets = builds.filter((build) => names.includes(build.name));
|
|
211
|
-
await Promise.all(targets.map((target) =>
|
|
233
|
+
await Promise.all(targets.map((target) => fsp.rm(join(devtoolsAnalyzeDir, target.slug), { recursive: true, force: true })));
|
|
212
234
|
}
|
|
213
235
|
initalized = readBuildInfo();
|
|
214
236
|
refresh("getAnalyzeBuildInfo");
|
|
@@ -253,7 +275,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
253
275
|
for (const { layerDir, files } of dirs) {
|
|
254
276
|
for (const path of files) {
|
|
255
277
|
const filePath = resolve(layerDir, path);
|
|
256
|
-
const stat = await
|
|
278
|
+
const stat = await fsp.lstat(filePath);
|
|
257
279
|
const fullPath = join(baseURL, path);
|
|
258
280
|
if (!uniquePaths.has(fullPath)) {
|
|
259
281
|
cache.push({
|
|
@@ -280,7 +302,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
280
302
|
if (_imageMetaCache.has(filepath))
|
|
281
303
|
return _imageMetaCache.get(filepath);
|
|
282
304
|
try {
|
|
283
|
-
const meta = imageMeta(await
|
|
305
|
+
const meta = imageMeta(await fsp.readFile(filepath));
|
|
284
306
|
_imageMetaCache.set(filepath, meta);
|
|
285
307
|
return meta;
|
|
286
308
|
} catch (e) {
|
|
@@ -292,7 +314,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
292
314
|
async getTextAssetContent(token, filepath, limit = 300) {
|
|
293
315
|
await ensureDevAuthToken(token);
|
|
294
316
|
try {
|
|
295
|
-
const content = await
|
|
317
|
+
const content = await fsp.readFile(filepath, "utf-8");
|
|
296
318
|
return content.slice(0, limit);
|
|
297
319
|
} catch (e) {
|
|
298
320
|
console.error(e);
|
|
@@ -313,16 +335,16 @@ You can configure it in Nuxt config at \`devtools.assets.uploadExtensions\`.`);
|
|
|
313
335
|
}
|
|
314
336
|
if (!override) {
|
|
315
337
|
try {
|
|
316
|
-
await
|
|
338
|
+
await fsp.stat(finalPath);
|
|
317
339
|
const base = finalPath.slice(0, finalPath.length - ext.length - 1);
|
|
318
340
|
let i = 1;
|
|
319
|
-
while (await
|
|
341
|
+
while (await fsp.access(`${base}-${i}.${ext}`).then(() => true).catch(() => false))
|
|
320
342
|
i++;
|
|
321
343
|
finalPath = `${base}-${i}.${ext}`;
|
|
322
344
|
} catch {
|
|
323
345
|
}
|
|
324
346
|
}
|
|
325
|
-
await
|
|
347
|
+
await fsp.writeFile(finalPath, content, {
|
|
326
348
|
encoding: encoding ?? "utf-8"
|
|
327
349
|
});
|
|
328
350
|
return finalPath;
|
|
@@ -331,14 +353,14 @@ You can configure it in Nuxt config at \`devtools.assets.uploadExtensions\`.`);
|
|
|
331
353
|
},
|
|
332
354
|
async deleteStaticAsset(token, path) {
|
|
333
355
|
await ensureDevAuthToken(token);
|
|
334
|
-
return await
|
|
356
|
+
return await fsp.unlink(path);
|
|
335
357
|
},
|
|
336
358
|
async renameStaticAsset(token, oldPath, newPath) {
|
|
337
359
|
await ensureDevAuthToken(token);
|
|
338
360
|
const exist = cache?.find((asset) => asset.filePath === newPath);
|
|
339
361
|
if (exist)
|
|
340
362
|
throw new Error(`File ${newPath} already exists`);
|
|
341
|
-
return await
|
|
363
|
+
return await fsp.rename(oldPath, newPath);
|
|
342
364
|
}
|
|
343
365
|
};
|
|
344
366
|
}
|
|
@@ -7355,7 +7377,7 @@ function read$4(jsonPath, {base, specifier}) {
|
|
|
7355
7377
|
let string;
|
|
7356
7378
|
|
|
7357
7379
|
try {
|
|
7358
|
-
string = fs$
|
|
7380
|
+
string = fs$8.readFileSync(path$a.toNamespacedPath(jsonPath), 'utf8');
|
|
7359
7381
|
} catch (error) {
|
|
7360
7382
|
const exception = /** @type {ErrnoException} */ (error);
|
|
7361
7383
|
|
|
@@ -17450,7 +17472,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
17450
17472
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
17451
17473
|
let source = latestGenerated;
|
|
17452
17474
|
if (source == null)
|
|
17453
|
-
source = await
|
|
17475
|
+
source = await fsp.readFile(filepath, "utf-8");
|
|
17454
17476
|
const generated = await magicastGuard(async () => {
|
|
17455
17477
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
17456
17478
|
addNuxtModule(mod, name);
|
|
@@ -17480,7 +17502,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
17480
17502
|
}
|
|
17481
17503
|
if (installSet.size === 0) {
|
|
17482
17504
|
latestGenerated = null;
|
|
17483
|
-
await
|
|
17505
|
+
await fsp.writeFile(filepath, generated, "utf-8");
|
|
17484
17506
|
}
|
|
17485
17507
|
}
|
|
17486
17508
|
return {
|
|
@@ -17494,7 +17516,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
17494
17516
|
await ensureDevAuthToken(token);
|
|
17495
17517
|
const commands = await getNpmCommand("uninstall", name);
|
|
17496
17518
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
17497
|
-
const source = await
|
|
17519
|
+
const source = await fsp.readFile(filepath, "utf-8");
|
|
17498
17520
|
const generated = await magicastGuard(async () => {
|
|
17499
17521
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
17500
17522
|
const config = getDefaultExportOptions(mod);
|
|
@@ -17526,7 +17548,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
17526
17548
|
console.error(result.stderr);
|
|
17527
17549
|
throw new Error(`Failed to uninstall module', process exited with ${code}`);
|
|
17528
17550
|
}
|
|
17529
|
-
await
|
|
17551
|
+
await fsp.writeFile(filepath, generated, "utf-8");
|
|
17530
17552
|
}
|
|
17531
17553
|
return {
|
|
17532
17554
|
configOriginal: source,
|
|
@@ -17545,6 +17567,22 @@ function setupServerDataRPC({
|
|
|
17545
17567
|
let nitro;
|
|
17546
17568
|
let viteServer;
|
|
17547
17569
|
let viteClient;
|
|
17570
|
+
function normalizeViteConfig(config) {
|
|
17571
|
+
return {
|
|
17572
|
+
...config,
|
|
17573
|
+
environments: Object.fromEntries(
|
|
17574
|
+
Object.entries(config.env).map(([key, _]) => {
|
|
17575
|
+
return [key, null];
|
|
17576
|
+
})
|
|
17577
|
+
),
|
|
17578
|
+
plugins: config.plugins.map((i) => {
|
|
17579
|
+
const clone = { ...i };
|
|
17580
|
+
delete clone.api;
|
|
17581
|
+
return clone;
|
|
17582
|
+
}),
|
|
17583
|
+
inlineConfig: null
|
|
17584
|
+
};
|
|
17585
|
+
}
|
|
17548
17586
|
nuxt.hook("nitro:build:before", (_nitro) => {
|
|
17549
17587
|
nitro = _nitro;
|
|
17550
17588
|
});
|
|
@@ -17555,7 +17593,7 @@ function setupServerDataRPC({
|
|
|
17555
17593
|
name: "nuxt:devtools:config-retriever",
|
|
17556
17594
|
enforce: "post",
|
|
17557
17595
|
configResolved(config) {
|
|
17558
|
-
viteServer = config;
|
|
17596
|
+
viteServer = normalizeViteConfig(config);
|
|
17559
17597
|
}
|
|
17560
17598
|
});
|
|
17561
17599
|
} else if (options.isClient) {
|
|
@@ -17564,7 +17602,7 @@ function setupServerDataRPC({
|
|
|
17564
17602
|
name: "nuxt:devtools:config-retriever",
|
|
17565
17603
|
enforce: "post",
|
|
17566
17604
|
configResolved(config) {
|
|
17567
|
-
viteClient = config;
|
|
17605
|
+
viteClient = normalizeViteConfig(config);
|
|
17568
17606
|
}
|
|
17569
17607
|
});
|
|
17570
17608
|
}
|
|
@@ -17883,7 +17921,7 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
17883
17921
|
return {
|
|
17884
17922
|
async enableTimeline(dry) {
|
|
17885
17923
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
17886
|
-
const source = await
|
|
17924
|
+
const source = await fsp.readFile(filepath, "utf-8");
|
|
17887
17925
|
const generated = await magicastGuard(async () => {
|
|
17888
17926
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
17889
17927
|
const options = getDefaultExportOptions(mod);
|
|
@@ -17893,7 +17931,7 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
17893
17931
|
return mod.generate().code;
|
|
17894
17932
|
}, "\nYou can enable timeline manually by adding `devtools: { timeline: { enabled: true } }`");
|
|
17895
17933
|
if (!dry) {
|
|
17896
|
-
await
|
|
17934
|
+
await fsp.writeFile(filepath, generated, "utf-8");
|
|
17897
17935
|
await nuxt.callHook("restart", { hard: true });
|
|
17898
17936
|
}
|
|
17899
17937
|
return [source, generated];
|
|
@@ -17919,16 +17957,16 @@ async function enablePages(nuxt) {
|
|
|
17919
17957
|
const baseDir = nuxt.options.future.compatibilityVersion === 4 ? nuxt.options.dir.app : nuxt.options.srcDir;
|
|
17920
17958
|
const pathApp = join(baseDir, "app.vue");
|
|
17921
17959
|
const pathPageIndex = join(baseDir, "pages/index.vue");
|
|
17922
|
-
if (fs$
|
|
17960
|
+
if (fs$8.existsSync(pathPageIndex)) {
|
|
17923
17961
|
logger.warn("pages/index.vue already exists, skipping");
|
|
17924
17962
|
return;
|
|
17925
17963
|
}
|
|
17926
|
-
let appContent = fs$
|
|
17927
|
-
await
|
|
17928
|
-
await
|
|
17964
|
+
let appContent = fs$8.existsSync(pathApp) ? await fsp.readFile(pathApp, "utf-8") : void 0;
|
|
17965
|
+
await fsp.mkdir(dirname$1(pathPageIndex), { recursive: true });
|
|
17966
|
+
await fsp.writeFile(pathPageIndex, pagesIndexTemplate, "utf-8");
|
|
17929
17967
|
if (appContent && !appContent.includes("<NuxtPage")) {
|
|
17930
17968
|
appContent = appContent.replace("</template>", " <NuxtPage />\n</template>").replace(/<NuxtWelcome\s*\/>/, "");
|
|
17931
|
-
await
|
|
17969
|
+
await fsp.writeFile(pathApp, appContent, "utf-8");
|
|
17932
17970
|
}
|
|
17933
17971
|
logger.success("Routing creation wizard completed");
|
|
17934
17972
|
}
|
|
@@ -18132,7 +18170,6 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
18132
18170
|
} = setupRPC(nuxt, options);
|
|
18133
18171
|
addVitePlugin(vitePlugin);
|
|
18134
18172
|
const clientDirExists = existsSync(clientDir);
|
|
18135
|
-
const analyzeDir = join(nuxt.options.rootDir, ".nuxt/analyze");
|
|
18136
18173
|
nuxt.hook("vite:extendConfig", (config) => {
|
|
18137
18174
|
config.server ||= {};
|
|
18138
18175
|
config.server.fs ||= {};
|
|
@@ -18145,6 +18182,7 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
18145
18182
|
if (!Array.isArray(config.server.watch.ignored))
|
|
18146
18183
|
config.server.watch.ignored = [config.server.watch.ignored];
|
|
18147
18184
|
config.server.watch.ignored.push("**/.nuxt/analyze/**");
|
|
18185
|
+
config.server.watch.ignored.push("**/.cache/nuxt-devtools/**");
|
|
18148
18186
|
});
|
|
18149
18187
|
nuxt.hook("imports:extend", (imports) => {
|
|
18150
18188
|
imports.push({
|
|
@@ -18158,10 +18196,11 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
18158
18196
|
const ROUTE_AUTH_VERIFY = `${ROUTE_PATH}/auth-verify`;
|
|
18159
18197
|
const ROUTE_ANALYZE = `${ROUTE_PATH}/analyze`;
|
|
18160
18198
|
nuxt.hook("vite:serverCreated", (server) => {
|
|
18161
|
-
|
|
18199
|
+
const devtoolsAnalyzeDir = join(nuxt.options.rootDir, "node_modules/.cache/nuxt-devtools/analyze");
|
|
18200
|
+
server.middlewares.use(ROUTE_ANALYZE, sirv(devtoolsAnalyzeDir, { single: false, dev: true, dotfiles: true, ignores: false }));
|
|
18162
18201
|
if (clientDirExists) {
|
|
18163
18202
|
const indexHtmlPath = join(clientDir, "index.html");
|
|
18164
|
-
const indexContent =
|
|
18203
|
+
const indexContent = fsp.readFile(indexHtmlPath, "utf-8");
|
|
18165
18204
|
const handleStatic = sirv(clientDir, {
|
|
18166
18205
|
dev: true,
|
|
18167
18206
|
single: false
|
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import
|
|
2
|
+
import fsp from 'node:fs/promises';
|
|
3
3
|
import { hostname } from 'node:os';
|
|
4
4
|
import { resolve } from 'node:path';
|
|
5
5
|
import { startSubprocess } from '@nuxt/devtools-kit';
|
|
@@ -81,7 +81,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
81
81
|
if (!existsSync(vscodeServerControllerFile))
|
|
82
82
|
return false;
|
|
83
83
|
try {
|
|
84
|
-
const { port: port2 } = JSON.parse(await
|
|
84
|
+
const { port: port2 } = JSON.parse(await fsp.readFile(vscodeServerControllerFile, "utf-8"));
|
|
85
85
|
const url2 = `http://localhost:${port2}/open?path=${encodeURIComponent(`${root}/${file}`)}`;
|
|
86
86
|
await fetch(url2);
|
|
87
87
|
rpc.broadcast.navigateTo("/modules/custom-builtin-vscode");
|
|
@@ -94,7 +94,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
94
94
|
});
|
|
95
95
|
async function startCodeServer() {
|
|
96
96
|
if (existsSync(vscodeServerControllerFile))
|
|
97
|
-
await
|
|
97
|
+
await fsp.rm(vscodeServerControllerFile, { force: true });
|
|
98
98
|
if (vsOptions?.reuseExistingServer && !await checkPort(port)) {
|
|
99
99
|
loaded = true;
|
|
100
100
|
url = `http://localhost:${port}/?folder=${encodeURIComponent(root)}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { addPluginTemplate } from '@nuxt/kit';
|
|
2
2
|
import { join } from 'pathe';
|
|
3
3
|
import { runtimeDir } from '../dirs.mjs';
|
|
4
4
|
import 'node:path';
|
|
@@ -8,22 +8,10 @@ import 'is-installed-globally';
|
|
|
8
8
|
function setup({ nuxt }) {
|
|
9
9
|
if (!nuxt.options.dev || nuxt.options.test)
|
|
10
10
|
return;
|
|
11
|
-
|
|
12
|
-
name: "vue
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const resolved = importee.replace("virtual:vue-devtools-path:", join(runtimeDir, "vue-devtools/"));
|
|
16
|
-
return resolved;
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
transform(code, id, options) {
|
|
20
|
-
const [filename] = id.split("?", 2);
|
|
21
|
-
const appendTo = /\/entry\.m?js$/;
|
|
22
|
-
if (!options?.ssr && appendTo.test(filename))
|
|
23
|
-
code = `import 'virtual:vue-devtools-path:overlay.js';
|
|
24
|
-
${code}`;
|
|
25
|
-
return code;
|
|
26
|
-
}
|
|
11
|
+
addPluginTemplate({
|
|
12
|
+
name: "vue-devtools-client",
|
|
13
|
+
mode: "client",
|
|
14
|
+
src: join(runtimeDir, "vue-devtools-client.js")
|
|
27
15
|
});
|
|
28
16
|
}
|
|
29
17
|
|
package/dist/client/200.html
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-gcfkqtar.css" crossorigin>
|
|
4
4
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
5
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ork67mdr.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-kcahofzr.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-mstcul8h.js">
|
|
9
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-ja073547.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
14
|
-
<link rel="prefetch" as="
|
|
15
|
-
<link rel="prefetch" as="
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
17
|
-
<link rel="prefetch" as="
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
19
|
-
<
|
|
20
|
-
<
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-dscxupqw.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-nrro384i.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-eo3diko6.js">
|
|
14
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.css-lvdc77tw.css">
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-mr2wbyy1.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-7oki02k8.js">
|
|
17
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch.vue-iu20lc9i.js">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-j9ga9cm2.js">
|
|
19
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-dt6krs6h.js">
|
|
20
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-kpmlv67d.js">
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-b09njjbc.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-lnbp3n5r.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-cb61k1ql.js">
|
|
24
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-fwe7gpvk.css">
|
|
25
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-eg5womw1.js">
|
|
26
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-djemplc9.css">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-ins5mmhy.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/ork67mdr.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1738744729300,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"c09c67b3-1799-4690-9b4b-e93e60520f9c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-gcfkqtar.css" crossorigin>
|
|
4
4
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
5
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ork67mdr.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-kcahofzr.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-mstcul8h.js">
|
|
9
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-ja073547.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
14
|
-
<link rel="prefetch" as="
|
|
15
|
-
<link rel="prefetch" as="
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
17
|
-
<link rel="prefetch" as="
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
19
|
-
<
|
|
20
|
-
<
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-dscxupqw.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-nrro384i.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-eo3diko6.js">
|
|
14
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.css-lvdc77tw.css">
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-mr2wbyy1.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-7oki02k8.js">
|
|
17
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch.vue-iu20lc9i.js">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-j9ga9cm2.js">
|
|
19
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-dt6krs6h.js">
|
|
20
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-kpmlv67d.js">
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-b09njjbc.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-lnbp3n5r.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-cb61k1ql.js">
|
|
24
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-fwe7gpvk.css">
|
|
25
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-eg5womw1.js">
|
|
26
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-djemplc9.css">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-ins5mmhy.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/ork67mdr.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1738744729301,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"c09c67b3-1799-4690-9b4b-e93e60520f9c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./ork67mdr.js";import{p as e,W as t,U as o}from"./vendor/json-editor-vue-kcahofzr.js";import"./vendor/unocss-mstcul8h.js";import"./vendor/shiki-ja073547.js";const n={"h-screen":"","w-screen":"","bg-black":""},i=e({__name:"__blank",setup(r){return(c,s)=>(o(),t("div",n))}});export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as P,l as J,r as S,m as R,_ as U,n as Q,o as h,p as ee,q as ne,s as te,v as le,w as ie,x as oe,y as k,z as re,A as ue,B as se,h as ae}from"./ork67mdr.js";import{_ as de}from"./filepath-item.vue-ipkw48nj.js";import{p as j,q as V,f as F,U as i,W as u,X as e,F as p,ae as L,a0 as E,a8 as v,Z as g,u as b,a3 as d,a2 as a,a9 as f,ab as D,ac as I,P as B}from"./vendor/json-editor-vue-kcahofzr.js";import{_ as me}from"./ncode-block.vue-dt6krs6h.js";import{_ as pe}from"./ncheckbox.vue-feskyxd0.js";import{_ as ve}from"./help-fab.vue-p3sb2h0t.js";import"./vendor/unocss-mstcul8h.js";import"./vendor/shiki-ja073547.js";import"./client-kpmlv67d.js";const fe={"h-full":"",grid:"~ rows-[max-content_1fr]"},ye={flex:"~ wrap","w-full":""},ce=["onClick"],be={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},xe={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},ge="/__nuxt_devtools__/client",we=j({__name:"BuildAnalyzeDetails",props:{current:{},prev:{}},setup(N){const y=N,_=`${J().app.baseURL.replace(ge,"/")}/__nuxt_devtools__/analyze/`.replace(/\/+/g,"/"),c=V(()=>{const l=[{name:"Overview",id:"overview"}];return y.current.features.bundleClient&&l.push({name:"Client Bundle",id:"bundle-client"}),y.current.features.bundleNitro&&l.push({name:"Nitro Bundle",id:"bundle-nitro"}),y.current.features.viteInspect&&l.push({name:"Vite Inspect",id:"vite-inspect"}),l}),o=F(c.value[0]);function $(l){return`${((l.endTime-l.startTime)/1e3).toFixed(1)}s`}function m(l){return l<1024?`${l}B`:l<1024*1024?`${(l/1024).toFixed(1)}KB`:l<1024*1024*1024?`${(l/1024/1024).toFixed(1)}MB`:`${(l/1024/1024/1024).toFixed(1)}GB`}async function T(l){return S.clearAnalyzeBuilds(await R(),[l])}return(l,n)=>{const A=de,C=U;return i(),u("div",fe,[e("div",ye,[(i(!0),u(p,null,L(c.value,(r,t)=>(i(),u("button",{key:t,px4:"",py2:"",border:"r base",hover:"bg-active",class:E(r.id===o.value.id?"":"border-b"),onClick:z=>o.value=r},[e("div",{class:E(r.id===o.value.id?"":"op30")},v(r.name),3)],10,ce))),128)),n[1]||(n[1]=e("div",{border:"b base","flex-auto":""},null,-1))]),o.value.id==="overview"?(i(),u("div",be,[n[15]||(n[15]=e("div",{"flex-auto":""},null,-1)),e("div",xe,[n[10]||(n[10]=e("div",{"i-carbon-commit":"","text-xl":""},null,-1)),e("div",null,[n[2]||(n[2]=e("div",{"text-sm":"",op50:""}," Name ",-1)),e("div",null,v(l.current.name),1)]),n[11]||(n[11]=e("div",{"i-carbon-time":"","text-xl":""},null,-1)),e("div",null,[n[3]||(n[3]=e("div",{"text-sm":"",op50:""}," Build duration ",-1)),e("div",null,v($(l.current)),1)]),l.current.size?.clientBundle?(i(),u(p,{key:0},[n[5]||(n[5]=e("div",{"i-carbon-cics-program":"","text-xl":""},null,-1)),e("div",null,[n[4]||(n[4]=e("div",{"text-sm":"",op50:""}," Client bundle size ",-1)),e("div",null,v(m(l.current.size.clientBundle)),1)])],64)):g("",!0),l.current.size?.nitroBundle?(i(),u(p,{key:1},[n[7]||(n[7]=e("div",{"i-carbon-bare-metal-server":"","text-xl":""},null,-1)),e("div",null,[n[6]||(n[6]=e("div",{"text-sm":"",op50:""}," Nitro bundle size ",-1)),e("div",null,v(m(l.current.size.nitroBundle)),1)])],64)):g("",!0),n[12]||(n[12]=e("div",{"i-carbon-edge-node":"","text-xl":""},null,-1)),e("div",null,[n[8]||(n[8]=e("div",{"text-sm":"",op50:""}," Built ",-1)),e("div",null,v(b(P)(new Date(l.current.endTime))),1)]),n[13]||(n[13]=e("div",{"i-carbon:folder-parent":"","text-xl":""},null,-1)),e("div",null,[n[9]||(n[9]=e("div",{"text-sm":"",op50:""}," Report Path ",-1)),d(A,{filepath:l.current.analyzeDir},null,8,["filepath"])])]),n[16]||(n[16]=e("div",{"flex-auto":""},null,-1)),d(C,{n:"rose",icon:"carbon-delete",onClick:n[0]||(n[0]=r=>T(l.current.name))},{default:a(()=>n[14]||(n[14]=[f(" Delete this report ")])),_:1})])):g("",!0),n._lazyshow1||o.value.id==="bundle-client"?(n._lazyshow1=!0,i(),u(p,null,[D(e("iframe",{src:`${b(_)}${l.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-client"]])],64)):g("v-show-if",!0),n._lazyshow2||o.value.id==="bundle-nitro"?(n._lazyshow2=!0,i(),u(p,null,[D(e("iframe",{src:`${b(_)}${l.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-nitro"]])],64)):g("v-show-if",!0),n._lazyshow3||o.value.id==="vite-inspect"?(n._lazyshow3=!0,i(),u(p,null,[D(e("iframe",{src:`${b(_)}${l.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="vite-inspect"]])],64)):g("v-show-if",!0)])}}}),_e={class:"markdown-body"},$e={__name:"analyze-build",setup(N,{expose:y}){return y({frontmatter:{}}),(_,c)=>(i(),u("div",_e,c[0]||(c[0]=[e("h1",null,"Build Analyze",-1),e("p",null,[f("DevTools provides a build analyze tool to help you understand the size of your app in production. Whenever you start a new build, it runs the command "),e("code",null,"nuxt build --analyze"),f(" and present the output data directly in DevTools for easy browsing and comparing.")],-1)])))}},ze={flex:"~ col"},Be=["onClick"],Ce={flex:"~ gap-1 items-center wrap","w-full":"","text-sm":"",op60:""},ke={flex:"~ items-center justify-center wrap",p4:""},Ne={flex:"~ col gap-1","w-250":"",p4:""},Te={flex:"~ gap-3",mt2:"","justify-end":""},Ue=j({__name:"analyze-build",setup(N){const y=Q(),w=h(),_=ee(),c=ne("analyze-build:slug",""),o=V(()=>w.value?.builds.find(r=>r.slug===c.value)??w.value?.builds[0]),$=F(!1),m=F(""),T=V(()=>w.value?.builds.some(r=>r.name===m.value.trim()));async function l(){m.value=await S.generateAnalyzeBuildName(),await y.start()&&(oe("analyze-build:start"),k.value={name:m.value,processId:await S.startAnalyzeBuild(await R(),m.value)},$.value&&C())}const n=te();function A(r){return`${((r.endTime-r.startTime)/1e3).toFixed(1)}s`}function C(){k.value?.processId&&(n.value=k.value.processId,_.push("/modules/terminals"))}return le(()=>[{id:"action:analyze-build: start",title:"Start a new analyze build",icon:"i-carbon-edge-node",action:l}]),(r,t)=>{const z=U,G=we,q=ae,O=ie,W=re,Z=ue,H=me,K=pe,M=se,X=$e,Y=ve;return i(),u(p,null,[d(O,{"left-size":30},{left:a(()=>[e("div",ze,[(i(!0),u(p,null,L(b(w)?.builds,s=>(i(),u(p,{key:s.slug},[e("button",{flex:"~ col gap1","hover:bg-active":"",p3:"",class:E(s.slug===o.value?.slug?"text-primary bg-active":""),onClick:x=>c.value=s.slug},[e("code",null,v(s.name),1),e("div",Ce,[t[4]||(t[4]=e("div",{"i-carbon-time":""},null,-1)),e("span",null,v(A(s)),1),t[5]||(t[5]=e("div",{"flex-auto":""},null,-1)),e("span",null,v(b(P)(new Date(s.endTime))),1)])],10,Be),t[6]||(t[6]=e("div",{"x-divider":""},null,-1))],64))),128)),e("div",ke,[b(k)?(i(),B(z,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:t[1]||(t[1]=s=>C())},{default:a(()=>t[8]||(t[8]=[f(" Building... ")])),_:1})):(i(),B(z,{key:0,n:"primary",icon:"carbon-edge-node",onClick:t[0]||(t[0]=s=>l())},{default:a(()=>t[7]||(t[7]=[f(" Start a new build ")])),_:1}))])])]),right:a(()=>[o.value?(i(),B(G,{key:0,current:o.value},null,8,["current"])):(i(),B(q,{key:1}))]),_:1}),d(b(y),null,{default:a(({resolve:s})=>[d(M,{"model-value":!0,onClose:x=>s(!1)},{default:a(()=>[e("div",Ne,[t[13]||(t[13]=e("h3",{class:"text-lg font-medium leading-6",mb2:""}," Start analyze build? ",-1)),t[14]||(t[14]=e("p",{op50:""}," Enter the name of the build: ",-1)),d(W,{modelValue:m.value,"onUpdate:modelValue":t[2]||(t[2]=x=>m.value=x),placeholder:"Build name"},null,8,["modelValue"]),T.value?(i(),B(Z,{key:0,"n-orange":""},{default:a(()=>t[9]||(t[9]=[f(" A build with the same name already exists, continue would overrides the previous build result. ")])),_:1})):g("",!0),t[15]||(t[15]=e("div",{my3:"","x-divider":""},null,-1)),t[16]||(t[16]=e("p",{op50:""}," The following command will be executed in your terminal: ",-1)),d(H,{code:`npx nuxi analyze --no-serve --name=${m.value}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),d(K,{modelValue:$.value,"onUpdate:modelValue":t[3]||(t[3]=x=>$.value=x),mt2:"",n:"primary"},{default:a(()=>t[10]||(t[10]=[f(" Navigate to terminal ")])),_:1},8,["modelValue"]),e("div",Te,[d(z,{onClick:x=>s(!1)},{default:a(()=>t[11]||(t[11]=[f(" Cancel ")])),_:2},1032,["onClick"]),d(z,{n:"solid primary",onClick:x=>s(!0)},{default:a(()=>t[12]||(t[12]=[f(" Start ")])),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),d(Y,null,{default:a(()=>[d(X)]),_:1})],64)}}});export{Ue as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{C as ee,D as H,E as ce,F as pe,x as me,r as W,m as X,G as M,_ as te,H as ne,z as se,I as ve,J as fe,c as le,K as ge,a as he,L as xe,M as be,B as we,N as _e,O as ye,P as $e,g as ke,Q as Ce}from"./ork67mdr.js";import{_ as Ve}from"./ncheckbox.vue-feskyxd0.js";import{_ as Pe}from"./ndropdown.vue-j9ga9cm2.js";import{_ as Ae}from"./nnavbar.vue-fsgszvqg.js";import{p as Z,f as T,ag as oe,W as i,ab as K,a3 as d,X as t,a9 as D,F as L,ae as G,P as V,a2 as h,Z as U,a0 as J,u as m,U as o,q as I,$ as ae,a8 as F,Y as De,A as Fe,a1 as Ne,an as Ue}from"./vendor/json-editor-vue-kcahofzr.js";import{_ as Ie}from"./nsection-block-iefigwly.js";import{_ as Se}from"./filepath-item.vue-ipkw48nj.js";import{_ as Te}from"./code-snippets.vue-o376xgrr.js";import{_ as je}from"./ndrawer.vue-b09njjbc.js";import{D as Be}from"./constants-b32h69zq.js";import"./vendor/unocss-mstcul8h.js";import"./vendor/shiki-ja073547.js";import"./nicon-title.vue-hzhi6u0u.js";import"./ncode-block.vue-dt6krs6h.js";import"./client-kpmlv67d.js";const Ee={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},ze={for:"drop-zone-input","text-3xl":"",hover:"text-green cursor-pointer","transition-all":""},Le={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},Oe={grid:"~ cols-minmax-8rem gap-8","overflow-auto":"",p6:""},Me={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Re=["src"],Ke={flex:"~ gap1","items-center":""},qe={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},Ge=Z({__name:"AssetDropZone",props:{modelValue:{type:Boolean,required:!0},folder:{type:String,required:!0}},setup(z){const l=z,f=ee(l,"modelValue"),C=T(),n=T([]);function v(s){C.value=s.target,f.value=!0}function b(s){s.target===C.value&&(f.value=!1)}function j(s){s.preventDefault()}function P(s){s.preventDefault(),x(s.dataTransfer.files)}function x(s){const c=Array.from(s||[]);if(c.length){const g=[],_=n.value.map(u=>u.name);for(const u of c)if(_.includes(u.name)){let A=1;const[y,E]=u.name.split(".");for(;_.includes(`${y} (${A}).${E}`);)A++;const R=`${y}-${A}.${E}`,a=new Blob([u],{type:u.type}),e=new File([a],R,{lastModified:Date.now()});g.push(e),_.push(R)}else u.type===""&&M({message:"Folders are not supported yet",icon:"carbon:face-dissatisfied",classes:"text-orange"}),g.push(u);n.value=[...n.value,...g]}}async function B(){if(ce.value||pe.value)return;me("assets:upload");const s=[];for(const c of n.value){const g=new FileReader;g.readAsDataURL(c);const u=(await new Promise(A=>{g.onload=()=>A(g.result)})).split(";base64,").pop();s.push({path:c.name,encoding:"base64",content:u})}await W.writeStaticAssets(await X(),[...s],l.folder).then(()=>{p(),M({message:"Files uploaded successfully!",icon:"i-carbon:checkmark"})}).catch(c=>{p(),M({message:`Error uploading files: ${c?.message??"unknown"}`,icon:"i-carbon-warning",classes:"text-red"})}),f.value=!1}function q(s){n.value?.splice(s,1)}function O(s){return URL.createObjectURL(s)}function w(s,c){const[g,_]=s.name.split("."),u=c.replace(/\.\w+$/,""),A=`${u}.${_}`;return u.length===0?(alert("File name must be at least 1 characters long"),g):(Object.defineProperty(s,"name",{value:A,writable:!1}),n.value.splice(n.value.indexOf(s),1,s),s)}function r(){n.value=[]}function p(){f.value=!1,r()}return H("dragenter",v),H("dragleave",b),H("dragover",j),H("drop",P),(s,c)=>{const g=te,_=ne,u=se,A=oe("tooltip");return o(),i("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:J(m(f)?"opacity-100 visible":"opacity-0 invisible")},[K(d(g,{icon:"carbon-close",title:"Close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",border:!1,onClick:p},null,512),[[A,"Close",void 0,{"bottom-end":!0}]]),n.value?.length?(o(),i("div",Le,[c[4]||(c[4]=t("div",{px6:"",py6:""},[t("h1",{"text-2xl":""}," Upload "),t("p",{"text-sm":"",op50:""}," Drag and drop files to upload ")],-1)),t("div",Oe,[(o(!0),i(L,null,G(n.value,(y,E)=>(o(),i("div",{key:y.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[t("div",Me,[t("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:O(y)},null,8,Re)]),t("div",Ke,[d(u,{n:"xs","h-full":"","flex-auto":"","model-value":y.name,"onUpdate:modelValue":R=>w(y,R.target.value)},null,8,["model-value","onUpdate:modelValue"]),d(g,{n:"red",icon:"carbon-trash-can","h-full":"","flex-none":"",title:"Remove file",onClick:R=>q(E)},null,8,["onClick"])])]))),128))]),t("div",qe,[n.value.length?(o(),V(g,{key:0,n:"red",onClick:r},{default:h(()=>[d(_,{icon:"carbon-clean"}),c[2]||(c[2]=D(" Clear "))]),_:1})):U("",!0),d(g,{disabled:!n.value.length,n:"primary solid",onClick:B},{default:h(()=>[d(_,{icon:"carbon-cloud-upload"}),c[3]||(c[3]=D(" Upload "))]),_:1},8,["disabled"])])])):(o(),i("div",Ee,[t("label",ze,[d(_,{icon:"carbon-cloud-upload","mr-2":""}),c[1]||(c[1]=D(" Drop files here or click to select "))]),t("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:c[0]||(c[0]=y=>x(y.target.files))},null,32)]))],2)}}}),Ze=Z({__name:"AssetFontPreview",props:{asset:{}},setup(z){const l=z,f=I(()=>`devtools-assets-${ve(l.asset)}`);return fe(I(()=>`
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: '${f.value}';
|
|
4
|
+
src: url('${l.asset.publicPath}');
|
|
5
|
+
}
|
|
6
|
+
`)),(C,n)=>(o(),i("div",{"of-hidden":"",style:ae({fontFamily:`'${f.value}'`})}," Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz ",4))}}),We={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},Xe=["src"],He={key:2,"i-carbon-document":"","text-3xl":"",op20:""},Je={key:3,"w-full":"","self-start":"",p4:""},Qe=["textContent"],Ye={key:4},et=["src","autoplay","controls"],tt={key:5},nt={key:0,"i-carbon-volume-up":"","text-3xl":"",op20:""},ot=["src"],lt={key:6,"i-carbon-help":"","text-3xl":"",op20:""},ie=Z({__name:"AssetPreview",props:{asset:{},textContent:{},detail:{type:Boolean}},setup(z){return(l,f)=>{const C=Ze;return o(),i("div",We,[l.asset.type==="image"?(o(),i("img",{key:0,src:l.asset.publicPath},null,8,Xe)):l.asset.type==="font"?(o(),V(C,{key:l.asset.publicPath,asset:l.asset,"self-stretch":"",p2:"","text-2xl":""},null,8,["asset"])):l.asset.type==="text"&&!l.textContent?(o(),i("div",He)):l.asset.type==="text"&&l.textContent?(o(),i("div",Je,[t("pre",{"max-h-10rem":"","of-hidden":"","text-xs":"","font-mono":"",textContent:F(l.textContent)},null,8,Qe)])):l.asset.type==="video"?(o(),i("div",Ye,[t("video",{src:l.asset.publicPath,autoplay:l.detail,controls:l.detail},null,8,et)])):l.asset.type==="audio"?(o(),i("div",tt,[l.detail?(o(),i("audio",{key:1,src:l.asset.publicPath,controls:""},null,8,ot)):(o(),i("div",nt))])):(o(),i("div",lt))])}}}),st={relative:"",flex:"~ col gap-1",hover:"bg-active","items-center":"","of-hidden":"",rounded:"",p2:""},at={"w-full":"","of-hidden":"",truncate:"","ws-nowrap":"","text-center":"","text-xs":""},it=Z({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(z){const l=z,f=I(()=>l.folder&&l.asset.path.startsWith(l.folder)?l.asset.path.slice(l.folder.length):l.asset.path);return(C,n)=>{const v=ne,b=ie;return o(),i("button",st,[C.asset.layer?(o(),V(v,{key:0,icon:"i-carbon-layers",absolute:"","right-4":"","top-4":"","bg-primary":""})):U("",!0),d(b,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:C.asset},null,8,["asset"]),t("div",at,F(f.value),1)])}}}),re=Z({__name:"AssetListItem",props:{item:{},index:{default:0},modelValue:{}},setup(z,{emit:l}){const f=z,n=ee(f,"modelValue",l,{passive:!0}),v=I(()=>f.item?.children?.length),b=T(!0),j=I(()=>v.value?"i-carbon-folder":f.item.type==="image"?"i-carbon-image":f.item.type==="video"?"i-carbon-video":f.item.type==="audio"?"i-carbon-volume-up":f.item.type==="font"?"i-carbon-text-small-caps":f.item.type==="text"?"i-carbon-document":f.item.type==="json"?"i-carbon-json":"i-carbon-document-blank");return(P,x)=>{const B=ne,q=re;return o(),i("div",null,[t("button",{flex:"~ gap-2","w-full":"","items-center":"",hover:"bg-active",px4:"",py1:"",style:ae({paddingLeft:`calc(1rem + ${P.index*1.5}em)`}),class:J({"bg-active":!v.value&&m(n)?.filePath===P.item?.filePath}),border:"b base",onClick:x[0]||(x[0]=O=>v.value?b.value=!b.value:n.value=P.item)},[t("div",{class:J(j.value)},null,2),t("span",{class:J({"flex items-center":v.value}),"flex-auto":"","text-start":"","text-sm":"","font-mono":""},[D(F(P.item.path)+" ",1),P.item.layer?(o(),V(B,{key:0,icon:"i-carbon-layers","bg-primary":""})):U("",!0)],2),v.value?(o(),V(B,{key:0,icon:"carbon:chevron-right","transform-rotate":b.value?90:0,transition:""},null,8,["transform-rotate"])):U("",!0)],6),b.value?De(P.$slots,"default",{key:0},()=>[(o(!0),i(L,null,G(P.item?.children,O=>(o(),V(q,{key:O.filepath,modelValue:m(n),"onUpdate:modelValue":x[1]||(x[1]=w=>Fe(n)?n.value=w:null),item:O,index:P.index+1},null,8,["modelValue","item","index"]))),128))]):U("",!0)])}}}),rt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},ut={flex:"~","items-center":"","justify-center":""},dt={"max-w-full":"","w-full":"","table-fixed":""},ct={flex:"~ gap-1","w-full":"","items-center":""},pt={flex:"~ gap-1","w-full":"","items-center":"","of-hidden":""},mt={"flex-auto":"","of-hidden":"",truncate:"","ws-pre":"","font-mono":""},vt={capitalize:""},ft={key:0},gt={op70:""},ht={flex:"~ gap2 wrap"},xt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},bt={flex:"~ gap2 wrap justify-center"},wt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},_t={flex:"~ gap2 wrap justify-center"},yt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},$t={flex:"","justify-end":"","gap-4":""},kt=Z({__name:"AssetDetails",props:{modelValue:{}},setup(z,{emit:l}){const n=ee(z,"modelValue",l,{passive:!0}),v=le(async()=>{if(n.value.type==="image")return W.getImageMeta(await X(),n.value.filePath)}),b=T(!1),j=T(),P=T(0),x=le(async()=>{if(n.value.type!=="text")return;P.value;const a=await W.getTextAssetContent(await X(),n.value.filePath);return j.value=a,a});async function B(){if(x.value!==j.value)try{await W.writeStaticAssets(await X(),[{path:n.value.path,content:j.value,override:!0}],""),b.value=!1,P.value++,M({message:"Updated",icon:"i-carbon-checkmark",classes:"text-green"})}catch(a){console.error(a),M({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const q=ge(),O=I(()=>(q.value?._installedModules||[]).some(e=>e.meta?.name==="@nuxt/image"||e.meta?.name==="@nuxt/image-edge"||e.meta?.name==="@nuxt/image-nightly")),w=I(()=>{const a=[];if(n.value.type==="image"){const e=v.value?.width?`
|
|
7
|
+
width="${v.value.width}"
|
|
8
|
+
height="${v.value.height}" `:" ";return a.push({lang:"vue-html",code:`<img${e}
|
|
9
|
+
src="${n.value.publicPath}"
|
|
10
|
+
/>`,name:"Plain Image"}),O.value&&a.push({lang:"vue-html",code:`<NuxtImg${e}
|
|
11
|
+
src="${n.value.publicPath}"
|
|
12
|
+
/>`,name:"Nuxt Img",docs:"https://image.nuxt.com/usage/nuxt-img"},{lang:"vue-html",code:`<NuxtPicture${e}
|
|
13
|
+
src="${n.value.publicPath}"
|
|
14
|
+
/>`,name:"Nuxt Picture",docs:"https://image.nuxt.com/usage/nuxt-picture"}),a}return a.push({lang:"html",code:`<a download href="${n.value.publicPath}">
|
|
15
|
+
Download ${n.value.path.split("/").slice(-1)[0]}
|
|
16
|
+
</a>`,name:"Download link"}),a}),r=he(),p=xe(),s=be(()=>n.value.mtime),c=I(()=>{const a=n.value.size;return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(2)} KB`:`${(a/1024/1024).toFixed(2)} MB`}),g=I(()=>{if(!v.value?.width||!v.value?.height)return"";const a=($,S)=>S?a(S,$%S):$,e=a(v.value.width,v.value.height);return e>3?`${v.value.width/e}:${v.value.height/e}`:""}),_=I(()=>["image","text","video","audio","font"].includes(n.value.type)),u=T(!1);async function A(){try{await W.deleteStaticAsset(await X(),n.value.filePath),n.value=void 0,u.value=!1,M({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch(a){console.error(a),M({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const y=T(!1),E=T("");async function R(){const a=n.value.filePath.split("/"),e=a.slice(-1)[0].split(".").slice(0,-1).join(".");if(!E.value||E.value===e)return M({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const $=a.slice(-1)[0].split(".").slice(-1)[0],S=`${a.slice(0,-1).join("/")}/${E.value}.${$}`;await W.renameStaticAsset(await X(),n.value.filePath,S),n.value=void 0,y.value=!1,M({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch($){console.error($),M({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(a,e)=>{const $=ie,S=Se,N=te,ue=Te,Q=we,de=se,Y=oe("tooltip");return o(),i(L,null,[t("div",rt,[_.value?(o(),i(L,{key:0},[e[13]||(e[13]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Preview "),t("div",{"x-divider":""})],-1)),t("div",ut,[d($,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:m(n),"text-content":m(x)},null,8,["asset","text-content"])])],64)):U("",!0),e[25]||(e[25]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Details "),t("div",{"x-divider":""})],-1)),t("table",dt,[t("tbody",null,[t("tr",null,[e[14]||(e[14]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Filepath ",-1)),t("td",null,[t("div",ct,[d(S,{filepath:m(n).filePath,"text-left":""},null,8,["filepath"]),K(d(N,{"flex-none":"",title:"Open in Editor",icon:"carbon-launch",border:!1,onClick:e[0]||(e[0]=k=>m(p)(m(n).filePath))},null,512),[[Y,"Open in Editor"]])])])]),t("tr",null,[e[15]||(e[15]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Public Path ",-1)),t("td",null,[t("div",pt,[t("div",mt,F(m(n).publicPath),1),K(d(N,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",border:!1,onClick:e[1]||(e[1]=k=>m(r)(m(n).publicPath,"assets-public-path"))},null,512),[[Y,"Copy public path"]]),K(d(N,{"flex-none":"",to:m(n).publicPath,icon:"carbon-launch",target:"_blank",border:!1,title:"Open in browser"},null,8,["to"]),[[Y,"Open in browser"]])])])]),t("tr",null,[e[16]||(e[16]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Type ",-1)),t("td",vt,F(m(n).type),1)]),m(v)?.width?(o(),i(L,{key:0},[t("tr",null,[e[17]||(e[17]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Image Size ",-1)),t("td",null,F(m(v).width)+" x "+F(m(v).height),1)]),g.value?(o(),i("tr",ft,[e[18]||(e[18]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1)),t("td",null,F(g.value),1)])):U("",!0)],64)):U("",!0),t("tr",null,[e[19]||(e[19]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1)),t("td",null,F(c.value),1)]),t("tr",null,[e[20]||(e[20]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Last modified ",-1)),t("td",null,[D(F(new Date(m(n).mtime).toLocaleString())+" ",1),t("span",gt,"("+F(m(s))+")",1)])])])]),e[26]||(e[26]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Actions "),t("div",{"x-divider":""})],-1)),t("div",ht,[d(N,{to:m(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:h(()=>e[21]||(e[21]=[D(" Download ")])),_:1},8,["to"]),m(n).type==="text"?(o(),V(N,{key:0,icon:"carbon-edit",n:"cyan",onClick:e[2]||(e[2]=k=>b.value=!b.value)},{default:h(()=>e[22]||(e[22]=[D(" Edit ")])),_:1})):U("",!0),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:e[3]||(e[3]=k=>y.value=!y.value)},{default:h(()=>e[23]||(e[23]=[D(" Rename ")])),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:e[4]||(e[4]=k=>u.value=!u.value)},{default:h(()=>e[24]||(e[24]=[D(" Delete ")])),_:1})]),e[27]||(e[27]=t("div",{"flex-auto":""},null,-1)),w.value.length?(o(),V(ue,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":w.value},null,8,["code-snippets"])):U("",!0)]),d(Q,{modelValue:u.value,"onUpdate:modelValue":e[6]||(e[6]=k=>u.value=k)},{default:h(()=>[t("div",xt,[e[30]||(e[30]=t("span",null," Are you sure you want to delete this asset? ",-1)),t("div",bt,[d(N,{icon:"carbon-close",onClick:e[5]||(e[5]=k=>u.value=!1)},{default:h(()=>e[28]||(e[28]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:A},{default:h(()=>e[29]||(e[29]=[D(" Delete ")])),_:1})])])]),_:1},8,["modelValue"]),d(Q,{modelValue:y.value,"onUpdate:modelValue":e[9]||(e[9]=k=>y.value=k)},{default:h(()=>[t("div",wt,[d(de,{modelValue:E.value,"onUpdate:modelValue":e[7]||(e[7]=k=>E.value=k),placeholder:"New name",n:"blue"},null,8,["modelValue"]),t("div",_t,[d(N,{icon:"carbon-close",onClick:e[8]||(e[8]=k=>y.value=!1)},{default:h(()=>e[31]||(e[31]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:R},{default:h(()=>e[32]||(e[32]=[D(" Rename ")])),_:1})])])]),_:1},8,["modelValue"]),m(n).type==="text"?(o(),V(Q,{key:0,modelValue:b.value,"onUpdate:modelValue":e[12]||(e[12]=k=>b.value=k)},{default:h(()=>[t("div",yt,[K(t("textarea",{"onUpdate:modelValue":e[10]||(e[10]=k=>j.value=k),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:Ne(B,["enter"])},null,544),[[Ue,j.value]]),t("div",$t,[d(N,{icon:"carbon-close",onClick:e[11]||(e[11]=k=>b.value=!1)},{default:h(()=>e[33]||(e[33]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon:save",n:"primary",onClick:B},{default:h(()=>e[34]||(e[34]=[D(" save ")])),_:1})])])]),_:1},8,["modelValue"])):U("",!0)],64)}}}),Ct={"h-full":"","of-auto":""},Vt={"flex-none":"",flex:"~ gap2 items-center","text-lg":""},Pt={flex:"~ items-center justify-center",absolute:"","bottom--1":"","right--1":"","h-4":"","w-4":"","rounded-full":"","bg-primary:30":"","text-8px":""},At={flex:"~ col","w-30":"","of-auto":""},Dt={"text-xs":"",op75:""},Ft={op50:""},Nt={key:0},Ut={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},It={key:1,p2:"",grid:"~ cols-minmax-8rem"},St={key:1},Ht=Z({__name:"assets",setup(z){const l=_e(),f=T(!1),C=T(""),n=I(()=>new ye(l.value||[],{keys:["path"]})),v=$e(()=>{const w=[];for(const r of l.value||[]){const p=r.path.split(".").pop();p&&!w.find(s=>s.name===p)&&w.push({name:p,value:!0})}return w}),b=I(()=>(C.value?n.value.search(C.value).map(r=>r.item):l.value||[]).filter(r=>{const p=r.path.split(".").pop();return!p||v.some(s=>s.name===p&&s.value)})),j=I(()=>{const w={};for(const r of b.value){const p=`${r.path.split("/").slice(0,-1).join("/")}/`;w[p]||(w[p]=[]),w[p].push(r)}return Object.entries(w).sort(([r],[p])=>r.localeCompare(p))}),P=I(()=>{const w={path:"public",children:[]},r=(p,s,c)=>{const[g,..._]=s;let u=p.children.find(A=>A.path===g);u||(u={...c,path:g,children:[]},p.children.push(u)),_.length>1?r(u,_,c):_.length===1&&u.children.push({...c,path:_[0]})};return b.value.forEach(p=>{const s=p.path.split("/").filter(c=>c!=="");r(w,s,p)}),w.children}),x=T(),{view:B}=ke("assets");function q(){B.value=B.value==="list"?"grid":"list"}Ce("Escape",()=>{x.value=void 0});const O=T();return(w,r)=>{const p=te,s=Ve,c=Pe,g=Ae,_=Ge,u=it,A=Ie,y=re,E=kt,R=je,a=oe("tooltip");return o(),i("div",Ct,[d(g,{ref_key:"navbar",ref:O,search:C.value,"onUpdate:search":r[1]||(r[1]=e=>C.value=e),pb2:""},{actions:h(()=>[t("div",Vt,[K(d(p,{icon:"carbon:cloud-upload",title:"File Upload",border:!1,onClick:r[0]||(r[0]=e=>f.value=!f.value)},null,512),[[a,"File Upload",void 0,{"bottom-end":!0}]]),m(v).length?(o(),V(c,{key:0,direction:"end",n:"sm primary"},{trigger:h(({click:e})=>[K(d(p,{icon:"carbon-filter",border:!1,title:"Filter",p3:"","text-lg":"",onClick:$=>e()},null,8,["onClick"]),[[a,"Filter",void 0,{"bottom-end":!0}]]),t("span",Pt,F(m(v).length),1)]),default:h(()=>[t("div",At,[(o(!0),i(L,null,G(m(v),e=>(o(),V(s,{key:e.name,modelValue:e.value,"onUpdate:modelValue":$=>e.value=$,flex:"~ gap-2",rounded:"",px2:"",py2:""},{default:h(()=>[t("span",Dt,F(e.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))])]),_:1})):U("",!0),K(d(p,{"text-lg":"",border:!1,icon:m(B)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:q},null,8,["icon"]),[[a,"Toggle View",void 0,{"bottom-end":!0}]])])]),default:h(()=>[t("div",Ft,[C.value?(o(),i("span",Nt,F(b.value.length)+" matched · ",1)):U("",!0),t("span",null,F(m(l)?.length)+" assets in total",1)])]),_:1},8,["search"]),d(_,{modelValue:f.value,"onUpdate:modelValue":r[2]||(r[2]=e=>f.value=e),folder:"/"},null,8,["modelValue"]),m(B)==="grid"?(o(),i(L,{key:0},[j.value.length>1?(o(!0),i(L,{key:0},G(j.value,([e,$])=>(o(),V(A,{key:e,text:e,description:`${$.length} items`,open:$.length<=m(Be),padding:!1},{default:h(()=>[t("div",Ut,[(o(!0),i(L,null,G($,S=>(o(),V(u,{key:S.path,asset:S,folder:e,onClick:N=>x.value=S},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(o(),i("div",It,[(o(!0),i(L,null,G(b.value,e=>(o(),V(u,{key:e.path,asset:e,onClick:$=>x.value=e},null,8,["asset","onClick"]))),128))]))],64)):(o(),i("div",St,[(o(!0),i(L,null,G(P.value,(e,$)=>(o(),V(y,{key:$,modelValue:x.value,"onUpdate:modelValue":r[3]||(r[3]=S=>x.value=S),item:e},null,8,["modelValue","item"]))),128))])),d(R,{"model-value":!!x.value,"auto-close":"","w-120":"",top:O.value,onClose:r[5]||(r[5]=e=>x.value=void 0)},{default:h(()=>[x.value?(o(),V(E,{key:0,modelValue:x.value,"onUpdate:modelValue":r[4]||(r[4]=e=>x.value=e)},null,8,["modelValue"])):U("",!0)]),_:1},8,["model-value","top"])])}}});export{Ht as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"c09c67b3-1799-4690-9b4b-e93e60520f9c","timestamp":1738744693817}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"c09c67b3-1799-4690-9b4b-e93e60520f9c","timestamp":1738744693817,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|