@nuxt/devtools-nightly 2.0.0-beta.6-28978839.578ecfc → 2.0.0-beta.7-28980749.c20c724
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 +64 -41
- package/dist/chunks/vscode.mjs +3 -3
- package/dist/chunks/vue-devtools.mjs +3 -3
- package/dist/client/200.html +13 -13
- package/dist/client/404.html +13 -13
- package/dist/client/_nuxt/__blank-lg13rweu.js +1 -0
- package/dist/client/_nuxt/analyze-build-hl3z5moi.js +1 -0
- package/dist/client/_nuxt/{assets-epc1omtv.js → assets-hg8y65bo.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/0c7d4b11-3960-472e-aa5e-814f5fa473f1.json +1 -0
- package/dist/client/_nuxt/{code-diff.vue-btv1bdr0.js → code-diff.vue-dw4253xo.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-k1eonni6.js → code-snippets.vue-h63l3ga8.js} +1 -1
- package/dist/client/_nuxt/components-g4671hrj.js +1 -0
- package/dist/client/_nuxt/composable-item.vue-awv2fe0i.js +1 -0
- package/dist/client/_nuxt/{custom-_name_-h79rq3oa.js → custom-_name_-lehsfv4z.js} +1 -1
- package/dist/client/_nuxt/{data-schema-button.vue-g5f288wb.js → data-schema-button.vue-cvp49yv0.js} +1 -1
- package/dist/client/_nuxt/{data-schema-drawer-d3uykogs.js → data-schema-drawer-gj6u0k3q.js} +1 -1
- package/dist/client/_nuxt/{default-bn98asj3.js → default-n5abea1i.js} +1 -1
- package/dist/client/_nuxt/entry.css-mj1nvcy6.css +1 -0
- package/dist/client/_nuxt/{error-404-ili7zuvo.js → error-404-k1azvkry.js} +1 -1
- package/dist/client/_nuxt/{error-500-ig9h4vyo.js → error-500-fl4i136a.js} +1 -1
- package/dist/client/_nuxt/{error-e30hod5e.js → error-epn2rlwx.js} +1 -1
- package/dist/client/_nuxt/{filepath-item.vue-dv8t36m8.js → filepath-item.vue-ocz0upxz.js} +1 -1
- package/dist/client/_nuxt/{full-nquao1nk.js → full-cofqwlaq.js} +1 -1
- package/dist/client/_nuxt/{help-fab.vue-b4km25gy.js → help-fab.vue-jti43xum.js} +1 -1
- package/dist/client/_nuxt/{hooks-g3c0b4rq.js → hooks-fm2xz72g.js} +1 -1
- package/dist/client/_nuxt/imports-jajy765b.js +1 -0
- package/dist/client/_nuxt/{index-mrfaxiq8.js → index-8ojfxtmp.js} +1 -1
- package/dist/client/_nuxt/{index-bejc4xe2.js → index-mkx27gf0.js} +1 -1
- package/dist/client/_nuxt/index-obsucz0g.js +1 -0
- package/dist/client/_nuxt/{launch-page.vue-h9zld33t.js → launch-page.vue-fip61omh.js} +1 -1
- package/dist/client/_nuxt/{jl98s4wc.js → lbm7brd5.js} +4 -4
- package/dist/client/_nuxt/{modules-g323nw4w.js → modules-ozt4x0g5.js} +1 -1
- package/dist/client/_nuxt/{nbadge-n0d7cbpa.js → nbadge-lm8ruxdz.js} +1 -1
- package/dist/client/_nuxt/{ncheckbox.vue-b8l374zk.js → ncheckbox.vue-o34fufk3.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-oa1cbosx.js → ndrawer.vue-den3x6bs.js} +1 -1
- package/dist/client/_nuxt/{ndropdown.vue-khy1smu9.js → ndropdown.vue-h1rzwvol.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-i4iopkha.js → nlink.vue-geo1m3b0.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-bv8o4xzs.js → nnavbar.vue-e4gbvuiu.js} +1 -1
- package/dist/client/_nuxt/{none-dw53b7ia.js → none-hq61ikv8.js} +1 -1
- package/dist/client/_nuxt/{nsection-block-mriokuc1.js → nsection-block-j74ks6nb.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs.vue-ao6503xs.js → nselect-tabs.vue-omvwf3ky.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-o1duk8yi.js → nselect.vue-mcse0obw.js} +1 -1
- package/dist/client/_nuxt/{open-graph-leid1e5b.js → open-graph-fgxh745s.js} +1 -1
- package/dist/client/_nuxt/{overview-nu9skx1l.js → overview-cqqn59w9.js} +1 -1
- package/dist/client/_nuxt/{pages-h0bb9ypc.js → pages-i073875q.js} +1 -1
- package/dist/client/_nuxt/{payload-lbd3p8p1.js → payload-lpa4xzf7.js} +1 -1
- package/dist/client/_nuxt/{pinia-g6dl9fs6.js → pinia-icj8n3eh.js} +1 -1
- package/dist/client/_nuxt/{plugins-hdaiapq8.js → plugins-mrm4erax.js} +1 -1
- package/dist/client/_nuxt/{render-tree-leowmac1.js → render-tree-c8m9uiit.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-bjj77u3n.js → runtime-configs-jgrd3nvs.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-kioko3v9.js → server-discovery-nz1q58ac.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-iawhla30.js → server-route-inputs.vue-k7nz89da.js} +1 -1
- package/dist/client/_nuxt/{server-routes-jmwia5lf.js → server-routes-dgw2yb8s.js} +1 -1
- package/dist/client/_nuxt/{server-tasks-iuh8y4kj.js → server-tasks-ohziocip.js} +1 -1
- package/dist/client/_nuxt/{settings-oqdnemhy.js → settings-mdfl1baf.js} +1 -1
- package/dist/client/_nuxt/{stacktrace-list.vue-d60b1azo.js → stacktrace-list.vue-ju2yzl1a.js} +1 -1
- package/dist/client/_nuxt/{state-components-ktgnlmib.js → state-components-hu0vwgq9.js} +1 -1
- package/dist/client/_nuxt/{state-editor.vue-d6gklqvj.js → state-editor.vue-fey2xg3o.js} +1 -1
- package/dist/client/_nuxt/{state-modules-c1b0tmxl.js → state-modules-ou3w6py8.js} +1 -1
- package/dist/client/_nuxt/{storage-f2vxig9a.js → storage-fg7uqyfv.js} +1 -1
- package/dist/client/_nuxt/{terminals-hjrk2rfj.js → terminals-km35rk4z.js} +1 -1
- package/dist/client/_nuxt/timeline-ji41jouc.js +31 -0
- package/dist/client/_nuxt/{virtual-files-fxck5vf1.js → virtual-files-pdvx204m.js} +1 -1
- package/dist/client/index.html +13 -13
- package/dist/module.json +1 -1
- package/package.json +4 -4
- package/dist/client/_nuxt/__blank-lb5ijdpb.js +0 -1
- package/dist/client/_nuxt/analyze-build-gb0rp3n4.js +0 -1
- package/dist/client/_nuxt/builds/meta/6fb951a3-6558-4617-923d-4f90820a2e3c.json +0 -1
- package/dist/client/_nuxt/components-m3ya561d.js +0 -1
- package/dist/client/_nuxt/composable-item.vue-hmfpyqv3.js +0 -1
- package/dist/client/_nuxt/entry.css-gcfkqtar.css +0 -1
- package/dist/client/_nuxt/imports-k9wjonrq.js +0 -1
- package/dist/client/_nuxt/timeline-j1c4u20v.js +0 -31
|
@@ -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-28980749.c20c724";
|
|
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,
|
|
@@ -17899,7 +17921,7 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
17899
17921
|
return {
|
|
17900
17922
|
async enableTimeline(dry) {
|
|
17901
17923
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
17902
|
-
const source = await
|
|
17924
|
+
const source = await fsp.readFile(filepath, "utf-8");
|
|
17903
17925
|
const generated = await magicastGuard(async () => {
|
|
17904
17926
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
17905
17927
|
const options = getDefaultExportOptions(mod);
|
|
@@ -17909,7 +17931,7 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
17909
17931
|
return mod.generate().code;
|
|
17910
17932
|
}, "\nYou can enable timeline manually by adding `devtools: { timeline: { enabled: true } }`");
|
|
17911
17933
|
if (!dry) {
|
|
17912
|
-
await
|
|
17934
|
+
await fsp.writeFile(filepath, generated, "utf-8");
|
|
17913
17935
|
await nuxt.callHook("restart", { hard: true });
|
|
17914
17936
|
}
|
|
17915
17937
|
return [source, generated];
|
|
@@ -17935,16 +17957,16 @@ async function enablePages(nuxt) {
|
|
|
17935
17957
|
const baseDir = nuxt.options.future.compatibilityVersion === 4 ? nuxt.options.dir.app : nuxt.options.srcDir;
|
|
17936
17958
|
const pathApp = join(baseDir, "app.vue");
|
|
17937
17959
|
const pathPageIndex = join(baseDir, "pages/index.vue");
|
|
17938
|
-
if (fs$
|
|
17960
|
+
if (fs$8.existsSync(pathPageIndex)) {
|
|
17939
17961
|
logger.warn("pages/index.vue already exists, skipping");
|
|
17940
17962
|
return;
|
|
17941
17963
|
}
|
|
17942
|
-
let appContent = fs$
|
|
17943
|
-
await
|
|
17944
|
-
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");
|
|
17945
17967
|
if (appContent && !appContent.includes("<NuxtPage")) {
|
|
17946
17968
|
appContent = appContent.replace("</template>", " <NuxtPage />\n</template>").replace(/<NuxtWelcome\s*\/>/, "");
|
|
17947
|
-
await
|
|
17969
|
+
await fsp.writeFile(pathApp, appContent, "utf-8");
|
|
17948
17970
|
}
|
|
17949
17971
|
logger.success("Routing creation wizard completed");
|
|
17950
17972
|
}
|
|
@@ -18148,7 +18170,6 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
18148
18170
|
} = setupRPC(nuxt, options);
|
|
18149
18171
|
addVitePlugin(vitePlugin);
|
|
18150
18172
|
const clientDirExists = existsSync(clientDir);
|
|
18151
|
-
const analyzeDir = join(nuxt.options.rootDir, ".nuxt/analyze");
|
|
18152
18173
|
nuxt.hook("vite:extendConfig", (config) => {
|
|
18153
18174
|
config.server ||= {};
|
|
18154
18175
|
config.server.fs ||= {};
|
|
@@ -18161,6 +18182,7 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
18161
18182
|
if (!Array.isArray(config.server.watch.ignored))
|
|
18162
18183
|
config.server.watch.ignored = [config.server.watch.ignored];
|
|
18163
18184
|
config.server.watch.ignored.push("**/.nuxt/analyze/**");
|
|
18185
|
+
config.server.watch.ignored.push("**/.cache/nuxt-devtools/**");
|
|
18164
18186
|
});
|
|
18165
18187
|
nuxt.hook("imports:extend", (imports) => {
|
|
18166
18188
|
imports.push({
|
|
@@ -18174,10 +18196,11 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
18174
18196
|
const ROUTE_AUTH_VERIFY = `${ROUTE_PATH}/auth-verify`;
|
|
18175
18197
|
const ROUTE_ANALYZE = `${ROUTE_PATH}/analyze`;
|
|
18176
18198
|
nuxt.hook("vite:serverCreated", (server) => {
|
|
18177
|
-
|
|
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 }));
|
|
18178
18201
|
if (clientDirExists) {
|
|
18179
18202
|
const indexHtmlPath = join(clientDir, "index.html");
|
|
18180
|
-
const indexContent =
|
|
18203
|
+
const indexContent = fsp.readFile(indexHtmlPath, "utf-8");
|
|
18181
18204
|
const handleStatic = sirv(clientDir, {
|
|
18182
18205
|
dev: true,
|
|
18183
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,17 +1,17 @@
|
|
|
1
|
-
import { addPluginTemplate } from '@nuxt/kit';
|
|
1
|
+
import { addPluginTemplate, resolvePath } from '@nuxt/kit';
|
|
2
2
|
import { join } from 'pathe';
|
|
3
3
|
import { runtimeDir } from '../dirs.mjs';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'is-installed-globally';
|
|
7
7
|
|
|
8
|
-
function setup({ nuxt }) {
|
|
8
|
+
async function setup({ nuxt }) {
|
|
9
9
|
if (!nuxt.options.dev || nuxt.options.test)
|
|
10
10
|
return;
|
|
11
11
|
addPluginTemplate({
|
|
12
12
|
name: "vue-devtools-client",
|
|
13
13
|
mode: "client",
|
|
14
|
-
src: join(runtimeDir, "vue-devtools-client
|
|
14
|
+
src: await resolvePath(join(runtimeDir, "vue-devtools-client"))
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
|
package/dist/client/200.html
CHANGED
|
@@ -1,29 +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-mj1nvcy6.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/
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/lbm7brd5.js">
|
|
7
7
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-kcahofzr.js">
|
|
8
8
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-mstcul8h.js">
|
|
9
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-
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-n5abea1i.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-cofqwlaq.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-hq61ikv8.js">
|
|
14
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-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-gj6u0k3q.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-mcse0obw.js">
|
|
17
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-
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-h1rzwvol.js">
|
|
19
19
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-dt6krs6h.js">
|
|
20
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-
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-den3x6bs.js">
|
|
22
22
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-lnbp3n5r.js">
|
|
23
23
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-cb61k1ql.js">
|
|
24
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-
|
|
25
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-k1azvkry.js">
|
|
26
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-
|
|
28
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
29
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-fl4i136a.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/lbm7brd5.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},1738844982570,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"0c7d4b11-3960-472e-aa5e-814f5fa473f1",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,29 +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-mj1nvcy6.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/
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/lbm7brd5.js">
|
|
7
7
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-kcahofzr.js">
|
|
8
8
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-mstcul8h.js">
|
|
9
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-
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-n5abea1i.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-cofqwlaq.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-hq61ikv8.js">
|
|
14
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-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-gj6u0k3q.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-mcse0obw.js">
|
|
17
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-
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-h1rzwvol.js">
|
|
19
19
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-dt6krs6h.js">
|
|
20
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-
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-den3x6bs.js">
|
|
22
22
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-lnbp3n5r.js">
|
|
23
23
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-cb61k1ql.js">
|
|
24
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-
|
|
25
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-k1azvkry.js">
|
|
26
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-
|
|
28
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
29
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-fl4i136a.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/lbm7brd5.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},1738844982571,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"0c7d4b11-3960-472e-aa5e-814f5fa473f1",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,W as n,U as t}from"./vendor/json-editor-vue-kcahofzr.js";const c={"h-screen":"","w-screen":"","bg-black":""},r=e({__name:"__blank",setup(o){return(s,_)=>(t(),n("div",c))}});export{r 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"./lbm7brd5.js";import{_ as de}from"./filepath-item.vue-ocz0upxz.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-o34fufk3.js";import{_ as ve}from"./help-fab.vue-jti43xum.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
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"./
|
|
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"./lbm7brd5.js";import{_ as Ve}from"./ncheckbox.vue-o34fufk3.js";import{_ as Pe}from"./ndropdown.vue-h1rzwvol.js";import{_ as Ae}from"./nnavbar.vue-e4gbvuiu.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-j74ks6nb.js";import{_ as Se}from"./filepath-item.vue-ocz0upxz.js";import{_ as Te}from"./code-snippets.vue-h63l3ga8.js";import{_ as je}from"./ndrawer.vue-den3x6bs.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
2
|
@font-face {
|
|
3
3
|
font-family: '${f.value}';
|
|
4
4
|
src: url('${l.asset.publicPath}');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"0c7d4b11-3960-472e-aa5e-814f5fa473f1","timestamp":1738844946757}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"0c7d4b11-3960-472e-aa5e-814f5fa473f1","timestamp":1738844946757,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as G}from"./ncode-block.vue-dt6krs6h.js";import{bj as H}from"./
|
|
1
|
+
import{_ as G}from"./ncode-block.vue-dt6krs6h.js";import{bj as H}from"./lbm7brd5.js";import{p as Q,q as X,f as Y,z as j,U as W,P as S}from"./vendor/json-editor-vue-kcahofzr.js";function g(){}g.prototype={diff:function(e,r){var t,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=u.callback;typeof u=="function"&&(o=u,u={});var i=this;function f(v){return v=i.postProcess(v,u),o?(setTimeout(function(){o(v)},0),!0):v}e=this.castInput(e,u),r=this.castInput(r,u),e=this.removeEmpty(this.tokenize(e,u)),r=this.removeEmpty(this.tokenize(r,u));var l=r.length,s=e.length,a=1,c=l+s;u.maxEditLength!=null&&(c=Math.min(c,u.maxEditLength));var p=(t=u.timeout)!==null&&t!==void 0?t:1/0,d=Date.now()+p,m=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(m[0],r,e,0,u);if(m[0].oldPos+1>=s&&h+1>=l)return f(F(i,m[0].lastComponent,r,e,i.useLongestToken));var y=-1/0,T=1/0;function z(){for(var v=Math.max(y,-a);v<=Math.min(T,a);v+=2){var C=void 0,w=m[v-1],E=m[v+1];w&&(m[v-1]=void 0);var q=!1;if(E){var M=E.oldPos-v;q=E&&0<=M&&M<l}var B=w&&w.oldPos+1<s;if(!q&&!B){m[v]=void 0;continue}if(!B||q&&w.oldPos<E.oldPos?C=i.addToPath(E,!0,!1,0,u):C=i.addToPath(w,!1,!0,1,u),h=i.extractCommon(C,r,e,v,u),C.oldPos+1>=s&&h+1>=l)return f(F(i,C.lastComponent,r,e,i.useLongestToken));m[v]=C,C.oldPos+1>=s&&(T=Math.min(T,v-1)),h+1>=l&&(y=Math.max(y,v+1))}a++}if(o)(function v(){setTimeout(function(){if(a>c||Date.now()>d)return o();z()||v()},0)})();else for(;a<=c&&Date.now()<=d;){var x=z();if(x)return x}},addToPath:function(e,r,t,u,o){var i=e.lastComponent;return i&&!o.oneChangePerToken&&i.added===r&&i.removed===t?{oldPos:e.oldPos+u,lastComponent:{count:i.count+1,added:r,removed:t,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+u,lastComponent:{count:1,added:r,removed:t,previousComponent:i}}},extractCommon:function(e,r,t,u,o){for(var i=r.length,f=t.length,l=e.oldPos,s=l-u,a=0;s+1<i&&l+1<f&&this.equals(t[l+1],r[s+1],o);)s++,l++,a++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return a&&!o.oneChangePerToken&&(e.lastComponent={count:a,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,s},equals:function(e,r,t){return t.comparator?t.comparator(e,r):e===r||t.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],t=0;t<e.length;t++)e[t]&&r.push(e[t]);return r},castInput:function(e){return e},tokenize:function(e){return Array.from(e)},join:function(e){return e.join("")},postProcess:function(e){return e}};function F(n,e,r,t,u){for(var o=[],i;e;)o.push(e),i=e.previousComponent,delete e.previousComponent,e=i;o.reverse();for(var f=0,l=o.length,s=0,a=0;f<l;f++){var c=o[f];if(c.removed)c.value=n.join(t.slice(a,a+c.count)),a+=c.count;else{if(!c.added&&u){var p=r.slice(s,s+c.count);p=p.map(function(d,m){var h=t[a+m];return h.length>d.length?h:d}),c.value=n.join(p)}else c.value=n.join(r.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}return o}function V(n,e){var r;for(r=0;r<n.length&&r<e.length;r++)if(n[r]!=e[r])return n.slice(0,r);return n.slice(0,r)}function P(n,e){var r;if(!n||!e||n[n.length-1]!=e[e.length-1])return"";for(r=0;r<n.length&&r<e.length;r++)if(n[n.length-(r+1)]!=e[e.length-(r+1)])return n.slice(-r);return n.slice(-r)}function _(n,e,r){if(n.slice(0,e.length)!=e)throw Error("string ".concat(JSON.stringify(n)," doesn't start with prefix ").concat(JSON.stringify(e),"; this is a bug"));return r+n.slice(e.length)}function N(n,e,r){if(!e)return n+r;if(n.slice(-e.length)!=e)throw Error("string ".concat(JSON.stringify(n)," doesn't end with suffix ").concat(JSON.stringify(e),"; this is a bug"));return n.slice(0,-e.length)+r}function L(n,e){return _(n,e,"")}function I(n,e){return N(n,e,"")}function U(n,e){return e.slice(0,b(n,e))}function b(n,e){var r=0;n.length>e.length&&(r=n.length-e.length);var t=e.length;n.length<e.length&&(t=n.length);var u=Array(t),o=0;u[0]=0;for(var i=1;i<t;i++){for(e[i]==e[o]?u[i]=u[o]:u[i]=o;o>0&&e[i]!=e[o];)o=u[o];e[i]==e[o]&&o++}o=0;for(var f=r;f<n.length;f++){for(;o>0&&n[f]!=e[o];)o=u[o];n[f]==e[o]&&o++}return o}var O="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",K=new RegExp("[".concat(O,"]+|\\s+|[^").concat(O,"]"),"ug"),$=new g;$.equals=function(n,e,r){return r.ignoreCase&&(n=n.toLowerCase(),e=e.toLowerCase()),n.trim()===e.trim()};$.tokenize=function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r;if(e.intlSegmenter){if(e.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=Array.from(e.intlSegmenter.segment(n),function(o){return o.segment})}else r=n.match(K)||[];var t=[],u=null;return r.forEach(function(o){/\s/.test(o)?u==null?t.push(o):t.push(t.pop()+o):/\s/.test(u)?t[t.length-1]==u?t.push(t.pop()+o):t.push(u+o):t.push(o),u=o}),t};$.join=function(n){return n.map(function(e,r){return r==0?e:e.replace(/^\s+/,"")}).join("")};$.postProcess=function(n,e){if(!n||e.oneChangePerToken)return n;var r=null,t=null,u=null;return n.forEach(function(o){o.added?t=o:o.removed?u=o:((t||u)&&Z(r,u,t,o),r=o,t=null,u=null)}),(t||u)&&Z(r,u,t,null),n};function Z(n,e,r,t){if(e&&r){var u=e.value.match(/^\s*/)[0],o=e.value.match(/\s*$/)[0],i=r.value.match(/^\s*/)[0],f=r.value.match(/\s*$/)[0];if(n){var l=V(u,i);n.value=N(n.value,i,l),e.value=L(e.value,l),r.value=L(r.value,l)}if(t){var s=P(o,f);t.value=_(t.value,f,s),e.value=I(e.value,s),r.value=I(r.value,s)}}else if(r)n&&(r.value=r.value.replace(/^\s*/,"")),t&&(t.value=t.value.replace(/^\s*/,""));else if(n&&t){var a=t.value.match(/^\s*/)[0],c=e.value.match(/^\s*/)[0],p=e.value.match(/\s*$/)[0],d=V(a,c);e.value=L(e.value,d);var m=P(L(a,d),p);e.value=I(e.value,m),t.value=_(t.value,a,m),n.value=N(n.value,a,a.slice(0,a.length-m.length))}else if(t){var h=t.value.match(/^\s*/)[0],y=e.value.match(/\s*$/)[0],T=U(y,h);e.value=I(e.value,T)}else if(n){var z=n.value.match(/\s*$/)[0],x=e.value.match(/^\s*/)[0],v=U(z,x);e.value=L(e.value,v)}}var ee=new g;ee.tokenize=function(n){var e=new RegExp("(\\r?\\n)|[".concat(O,"]+|[^\\S\\n\\r]+|[^").concat(O,"]"),"ug");return n.match(e)||[]};var k=new g;k.tokenize=function(n,e){e.stripTrailingCr&&(n=n.replace(/\r\n/g,`
|
|
2
2
|
`));var r=[],t=n.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var u=0;u<t.length;u++){var o=t[u];u%2&&!e.newlineIsToken?r[r.length-1]+=o:r.push(o)}return r};k.equals=function(n,e,r){return r.ignoreWhitespace?((!r.newlineIsToken||!n.includes(`
|
|
3
3
|
`))&&(n=n.trim()),(!r.newlineIsToken||!e.includes(`
|
|
4
4
|
`))&&(e=e.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(n.endsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as g}from"./ncode-block.vue-dt6krs6h.js";import{a as C,_ as S}from"./
|
|
1
|
+
import{_ as g}from"./ncode-block.vue-dt6krs6h.js";import{a as C,_ as S}from"./lbm7brd5.js";import{p as w,m as x,q as B,w as N,U as a,W as n,X as s,F as d,ae as $,a0 as i,a8 as V,a3 as u,a2 as m,a9 as v,u as T,P as h,Z as r}from"./vendor/json-editor-vue-kcahofzr.js";const D={key:0,relative:"","n-code-block":""},E={flex:"~ wrap","w-full":""},F=["onClick"],L={flex:"~ gap-2",px3:"",pb3:"",n:"sm primary"},U=w({__name:"CodeSnippets",props:{codeSnippets:{},eventType:{}},setup(f){const l=f,e=x(l.codeSnippets[0]),_=C(),b=B(()=>e.value?.lang||"text");return N(()=>{l.codeSnippets.includes(e.value)||(e.value=l.codeSnippets[0])}),(p,o)=>{const k=g,c=S;return p.codeSnippets.length?(a(),n("div",D,[s("div",E,[(a(!0),n(d,null,$(p.codeSnippets,(t,y)=>(a(),n("button",{key:y,px4:"",py2:"",border:"r base",hover:"bg-active",class:i(t===e.value?"":"border-b"),onClick:q=>e.value=t},[s("div",{class:i(t===e.value?"":"op30"),"font-mono":""},V(t.name),3)],10,F))),128)),o[1]||(o[1]=s("div",{border:"b base","flex-auto":""},null,-1))]),e.value?(a(),n(d,{key:0},[u(k,{code:e.value.code,lang:b.value,lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code","lang"]),s("div",L,[u(c,{icon:"carbon-copy",onClick:o[0]||(o[0]=t=>T(_)(e.value.code,p.eventType||`code-snippet-${e.value.name}`))},{default:m(()=>o[2]||(o[2]=[v(" Copy ")])),_:1}),e.value?.docs?(a(),h(c,{key:0,to:e.value.docs,target:"_blank",icon:"carbon-catalog"},{default:m(()=>o[3]||(o[3]=[v(" Docs ")])),_:1},8,["to"])):r("",!0)])],64)):r("",!0)])):r("",!0)}}});export{U as _};
|