@nuxt/devtools 1.0.1 → 1.0.3
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 +71 -42
- package/dist/chunks/timeline.mjs +6 -2
- package/dist/chunks/vscode.mjs +4 -4
- package/dist/client/200.html +35 -35
- package/dist/client/404.html +35 -35
- package/dist/client/_nuxt/{CodeDiff.vue.72250861.js → CodeDiff.vue.0700b533.js} +1 -1
- package/dist/client/_nuxt/{ComposableItem.vue.5fcac467.js → ComposableItem.vue.869f4305.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaButton.vue.b4fc42f9.js → DataSchemaButton.vue.72b202db.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaDrawer.ecd92b92.js → DataSchemaDrawer.3aeebd14.js} +3 -3
- package/dist/client/_nuxt/{DurationDisplay.vue.7b02ae9f.js → DurationDisplay.vue.37c54f2c.js} +1 -1
- package/dist/client/_nuxt/{FilepathItem.vue.6cdabcd4.js → FilepathItem.vue.ca308ea2.js} +1 -1
- package/dist/client/_nuxt/{HelpFab.vue.31b87f2a.js → HelpFab.vue.6bf23ece.js} +1 -1
- package/dist/client/_nuxt/LaunchPage.vue.c8e4a567.js +1 -0
- package/dist/client/_nuxt/{NBadge.681f2fb6.js → NBadge.0b42c7f8.js} +1 -1
- package/dist/client/_nuxt/{NCheckbox.vue.23790c32.js → NCheckbox.vue.6b5ce38f.js} +1 -1
- package/dist/client/_nuxt/{NCodeBlock.vue.7cb5f01d.js → NCodeBlock.vue.c80c8282.js} +1 -1
- package/dist/client/_nuxt/{NDrawer.vue.15b4d748.js → NDrawer.vue.e2617b9c.js} +1 -1
- package/dist/client/_nuxt/{NDropdown.vue.54157271.js → NDropdown.vue.ff9a8df2.js} +1 -1
- package/dist/client/_nuxt/{NIconTitle.vue.2d1e44fb.js → NIconTitle.vue.83cd82be.js} +1 -1
- package/dist/client/_nuxt/{NLink.vue.e913f358.js → NLink.vue.92e49c8b.js} +1 -1
- package/dist/client/_nuxt/{NMarkdown.vue.20899182.js → NMarkdown.vue.07fe8875.js} +1 -1
- package/dist/client/_nuxt/{NNavbar.vue.c506a970.js → NNavbar.vue.823096f1.js} +1 -1
- package/dist/client/_nuxt/{NSectionBlock.d66bb8c4.js → NSectionBlock.c3646235.js} +1 -1
- package/dist/client/_nuxt/{NSelect.vue.9e5ebac9.js → NSelect.vue.c8c511ae.js} +1 -1
- package/dist/client/_nuxt/{NSelectTabs.vue.9bf6517b.js → NSelectTabs.vue.ec21a846.js} +1 -1
- package/dist/client/_nuxt/{NSwitch.vue.2e265fe1.js → NSwitch.vue.1cea2bc6.js} +1 -1
- package/dist/client/_nuxt/{NTip.vue.51a4b91d.js → NTip.vue.ca2f8e8a.js} +1 -1
- package/dist/client/_nuxt/{StateEditor.vue.420289e1.js → StateEditor.vue.2abb9bb3.js} +1 -1
- package/dist/client/_nuxt/{__blank.95ba7574.js → __blank.aff34a18.js} +1 -1
- package/dist/client/_nuxt/analyze-build.76d0de73.js +1 -0
- package/dist/client/_nuxt/{assets.f0ad2218.js → assets.2cb4325d.js} +3 -3
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c6495541-4f21-430a-9b71-cda3f41cbf03.json +1 -0
- package/dist/client/_nuxt/{client.b2473ec3.js → client.b8ca1554.js} +1 -1
- package/dist/client/_nuxt/{components.dcc368d1.js → components.f8fde87c.js} +5 -5
- package/dist/client/_nuxt/{custom-_name_.129bf0b8.js → custom-_name_.779ca3e5.js} +1 -1
- package/dist/client/_nuxt/{default.b857d80c.js → default.50175b13.js} +1 -1
- package/dist/client/_nuxt/{entry.7cb87d02.js → entry.9a5af3dc.js} +8 -8
- package/dist/client/_nuxt/{error-404.6518563d.js → error-404.0dae1ccf.js} +1 -1
- package/dist/client/_nuxt/{error-500.94c551da.js → error-500.0a479375.js} +1 -1
- package/dist/client/_nuxt/{full.169e4977.js → full.f21cfe4d.js} +1 -1
- package/dist/client/_nuxt/{hooks.f1018405.js → hooks.08bf14b9.js} +1 -1
- package/dist/client/_nuxt/{imports.dda10442.js → imports.10f1634a.js} +1 -1
- package/dist/client/_nuxt/{index.02ce2a44.js → index.06e4cc9c.js} +1 -1
- package/dist/client/_nuxt/{index.05d4e5a2.js → index.b567c37e.js} +1 -1
- package/dist/client/_nuxt/{json-editor-vue.b5b3ad21.js → json-editor-vue.c3cbb111.js} +1 -1
- package/dist/client/_nuxt/{modules.25c79d85.js → modules.63cf2a03.js} +2 -2
- package/dist/client/_nuxt/{none.cebdb11e.js → none.7a39bbba.js} +1 -1
- package/dist/client/_nuxt/{open-graph.4871f819.js → open-graph.7c382b87.js} +2 -2
- package/dist/client/_nuxt/overview.ea00b3f6.js +1 -0
- package/dist/client/_nuxt/{pages.b6c85de5.js → pages.e4e22a03.js} +1 -1
- package/dist/client/_nuxt/{payload.5d97df2d.js → payload.d7e93a46.js} +1 -1
- package/dist/client/_nuxt/{plugins.f3bd0c25.js → plugins.b2f10668.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs.92408de9.js → runtime-configs.9fe5125f.js} +1 -1
- package/dist/client/_nuxt/{server-routes.90d653e7.js → server-routes.95c3caa5.js} +2 -2
- package/dist/client/_nuxt/{settings.9790bb1a.js → settings.78f334a8.js} +1 -1
- package/dist/client/_nuxt/state-components.d81178a3.js +1 -0
- package/dist/client/_nuxt/{state-modules.c1654bb7.js → state-modules.b9e84f85.js} +1 -1
- package/dist/client/_nuxt/{storage-options.035e7403.js → storage-options.2b389201.js} +1 -1
- package/dist/client/_nuxt/storage.44a95fac.js +1 -0
- package/dist/client/_nuxt/{terminals.41bf8c60.js → terminals.539d48eb.js} +1 -1
- package/dist/client/_nuxt/timeline.5deddf7e.js +29 -0
- package/dist/client/_nuxt/unocss-runtime.dfaa24d0.js +2 -0
- package/dist/client/_nuxt/{virtual-files.7d0bcad0.js → virtual-files.46ad04c9.js} +1 -1
- package/dist/client/index.html +35 -35
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/view/FrameBox.vue +1 -1
- package/dist/runtime/plugins/view/client.mjs +3 -2
- package/dist/shared/{devtools.ca660ec5.mjs → devtools.6f6e0f47.mjs} +3 -6
- package/package.json +24 -24
- package/dist/client/__blank/index.html +0 -42
- package/dist/client/_nuxt/LaunchPage.vue.06fcb257.js +0 -1
- package/dist/client/_nuxt/analyze-build.5b09c13b.js +0 -1
- package/dist/client/_nuxt/builds/meta/10bb1edc-fde3-4c52-91c9-404c411ae86d.json +0 -1
- package/dist/client/_nuxt/overview.a8b5c91e.js +0 -1
- package/dist/client/_nuxt/state-components.ca15f9b7.js +0 -1
- package/dist/client/_nuxt/storage.c7339fe7.js +0 -1
- package/dist/client/_nuxt/timeline.ed636d87.js +0 -29
- package/dist/client/_nuxt/unocss-runtime.16c4cc56.js +0 -2
- package/dist/client/modules/analyze-build/index.html +0 -42
- package/dist/client/modules/assets/index.html +0 -42
- package/dist/client/modules/components/index.html +0 -42
- package/dist/client/modules/hooks/index.html +0 -42
- package/dist/client/modules/imports/index.html +0 -42
- package/dist/client/modules/modules/index.html +0 -42
- package/dist/client/modules/open-graph/index.html +0 -42
- package/dist/client/modules/overview/index.html +0 -42
- package/dist/client/modules/pages/index.html +0 -42
- package/dist/client/modules/payload/index.html +0 -42
- package/dist/client/modules/plugins/index.html +0 -42
- package/dist/client/modules/runtime-configs/index.html +0 -42
- package/dist/client/modules/server-routes/index.html +0 -42
- package/dist/client/modules/storage/index.html +0 -42
- package/dist/client/modules/terminals/index.html +0 -42
- package/dist/client/modules/timeline/index.html +0 -42
- package/dist/client/modules/virtual-files/index.html +0 -42
- package/dist/client/settings/index.html +0 -42
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import fs, { existsSync } from 'node:fs';
|
|
1
|
+
import fs$1, { existsSync } from 'node:fs';
|
|
2
2
|
import os, { homedir } from 'node:os';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
3
4
|
import { resolve, join as join$1, dirname } from 'pathe';
|
|
4
5
|
import { logger, useNuxt, addPlugin, addTemplate, addVitePlugin } from '@nuxt/kit';
|
|
5
6
|
import { searchForWorkspaceRoot } from 'vite';
|
|
@@ -7,9 +8,8 @@ import sirv from 'sirv';
|
|
|
7
8
|
import { colors } from 'consola/utils';
|
|
8
9
|
import { createBirpcGroup } from 'birpc';
|
|
9
10
|
import { stringify, parse as parse$1 } from 'flatted';
|
|
10
|
-
import { d as defaultAllowedExtensions,
|
|
11
|
+
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools.6f6e0f47.mjs';
|
|
11
12
|
import { join, parse, dirname as dirname$1 } from 'node:path';
|
|
12
|
-
import fsp from 'node:fs/promises';
|
|
13
13
|
import { randomStr } from '@antfu/utils';
|
|
14
14
|
import { imageMeta } from 'image-meta';
|
|
15
15
|
import { debounce } from 'perfect-debounce';
|
|
@@ -30,7 +30,7 @@ import Git from 'simple-git';
|
|
|
30
30
|
import { hash } from 'ohash';
|
|
31
31
|
import { runtimeDir, clientDir, packageDir, isGlobalInstall } from '../dirs.mjs';
|
|
32
32
|
|
|
33
|
-
const version = "1.0.
|
|
33
|
+
const version = "1.0.3";
|
|
34
34
|
|
|
35
35
|
let token;
|
|
36
36
|
async function getDevAuthToken() {
|
|
@@ -40,11 +40,11 @@ async function getDevAuthToken() {
|
|
|
40
40
|
const dir = join(home, ".nuxt/devtools");
|
|
41
41
|
const filepath = join(dir, "dev-auth-token.txt");
|
|
42
42
|
if (existsSync(filepath))
|
|
43
|
-
token = (await
|
|
43
|
+
token = (await fs.readFile(filepath, "utf-8")).trim();
|
|
44
44
|
if (!token)
|
|
45
45
|
token = randomStr(16);
|
|
46
|
-
await
|
|
47
|
-
await
|
|
46
|
+
await fs.mkdir(dir, { recursive: true });
|
|
47
|
+
await fs.writeFile(filepath, token, "utf-8");
|
|
48
48
|
return token;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -150,7 +150,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
150
150
|
}
|
|
151
151
|
cache = await Promise.all(files.map(async (path) => {
|
|
152
152
|
const filePath = resolve(publicDir, path);
|
|
153
|
-
const stat = await
|
|
153
|
+
const stat = await fs.lstat(filePath);
|
|
154
154
|
return {
|
|
155
155
|
path,
|
|
156
156
|
publicPath: join$1(baseURL, path),
|
|
@@ -170,7 +170,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
170
170
|
if (_imageMetaCache.has(filepath))
|
|
171
171
|
return _imageMetaCache.get(filepath);
|
|
172
172
|
try {
|
|
173
|
-
const meta = imageMeta(await
|
|
173
|
+
const meta = imageMeta(await fs.readFile(filepath));
|
|
174
174
|
_imageMetaCache.set(filepath, meta);
|
|
175
175
|
return meta;
|
|
176
176
|
} catch (e) {
|
|
@@ -181,7 +181,7 @@ function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }) {
|
|
|
181
181
|
},
|
|
182
182
|
async getTextAssetContent(filepath, limit = 300) {
|
|
183
183
|
try {
|
|
184
|
-
const content = await
|
|
184
|
+
const content = await fs.readFile(filepath, "utf-8");
|
|
185
185
|
return content.slice(0, limit);
|
|
186
186
|
} catch (e) {
|
|
187
187
|
console.error(e);
|
|
@@ -202,16 +202,16 @@ You can configure it in Nuxt config at \`devtools.assets.uploadExtensions\`.`);
|
|
|
202
202
|
}
|
|
203
203
|
if (!override) {
|
|
204
204
|
try {
|
|
205
|
-
await
|
|
205
|
+
await fs.stat(finalPath);
|
|
206
206
|
const base = finalPath.slice(0, finalPath.length - ext.length - 1);
|
|
207
207
|
let i = 1;
|
|
208
|
-
while (await
|
|
208
|
+
while (await fs.access(`${base}-${i}.${ext}`).then(() => true).catch(() => false))
|
|
209
209
|
i++;
|
|
210
210
|
finalPath = `${base}-${i}.${ext}`;
|
|
211
211
|
} catch (err) {
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
await
|
|
214
|
+
await fs.writeFile(finalPath, content, {
|
|
215
215
|
encoding: encoding ?? "utf-8"
|
|
216
216
|
});
|
|
217
217
|
return finalPath;
|
|
@@ -220,14 +220,14 @@ You can configure it in Nuxt config at \`devtools.assets.uploadExtensions\`.`);
|
|
|
220
220
|
},
|
|
221
221
|
async deleteStaticAsset(token, path) {
|
|
222
222
|
await ensureDevAuthToken(token);
|
|
223
|
-
return await
|
|
223
|
+
return await fs.unlink(path);
|
|
224
224
|
},
|
|
225
225
|
async renameStaticAsset(token, oldPath, newPath) {
|
|
226
226
|
await ensureDevAuthToken(token);
|
|
227
227
|
const exist = cache?.find((asset) => asset.filePath === newPath);
|
|
228
228
|
if (exist)
|
|
229
229
|
throw new Error(`File ${newPath} already exists`);
|
|
230
|
-
return await
|
|
230
|
+
return await fs.rename(oldPath, newPath);
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
233
|
}
|
|
@@ -341,7 +341,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
341
341
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
342
342
|
let source = latestGenerated;
|
|
343
343
|
if (source == null)
|
|
344
|
-
source = await
|
|
344
|
+
source = await fs.readFile(filepath, "utf-8");
|
|
345
345
|
const generated = await magicastGuard(async () => {
|
|
346
346
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
347
347
|
addNuxtModule(mod, name);
|
|
@@ -371,7 +371,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
371
371
|
}
|
|
372
372
|
if (installSet.size === 0) {
|
|
373
373
|
latestGenerated = null;
|
|
374
|
-
await
|
|
374
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
return {
|
|
@@ -385,7 +385,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
385
385
|
await ensureDevAuthToken(token);
|
|
386
386
|
const commands = await getNpmCommand("uninstall", name);
|
|
387
387
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
388
|
-
const source = await
|
|
388
|
+
const source = await fs.readFile(filepath, "utf-8");
|
|
389
389
|
const generated = await magicastGuard(async () => {
|
|
390
390
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
391
391
|
const config = getDefaultExportOptions(mod);
|
|
@@ -417,7 +417,7 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
417
417
|
console.error(result.stderr);
|
|
418
418
|
throw new Error(`Failed to uninstall module', process exited with ${code}`);
|
|
419
419
|
}
|
|
420
|
-
await
|
|
420
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
421
421
|
}
|
|
422
422
|
return {
|
|
423
423
|
configOriginal: source,
|
|
@@ -669,6 +669,7 @@ function setupGeneralRPC({ nuxt, options, refresh, openInEditorHooks }) {
|
|
|
669
669
|
return;
|
|
670
670
|
const token = await getDevAuthToken();
|
|
671
671
|
origin ||= `${nuxt.options.devServer.https ? "https" : "http"}://${nuxt.options.devServer.host === "::" ? "localhost" : nuxt.options.devServer.host || "localhost"}:${nuxt.options.devServer.port}`;
|
|
672
|
+
const ROUTE_AUTH = `${nuxt.options.app.baseURL || "/"}/__nuxt_devtools__/auth`.replace(/\/+/g, "/");
|
|
672
673
|
const message = [
|
|
673
674
|
`A browser is requesting permissions of ${colors.bold(colors.yellow("writing files and running commands"))} from the DevTools UI.`,
|
|
674
675
|
colors.bold(info),
|
|
@@ -711,16 +712,16 @@ const route = useRoute()
|
|
|
711
712
|
async function enablePages(nuxt) {
|
|
712
713
|
const pathApp = join$1(nuxt.options.srcDir, "app.vue");
|
|
713
714
|
const pathPageIndex = join$1(nuxt.options.srcDir, "pages/index.vue");
|
|
714
|
-
if (fs.existsSync(pathPageIndex)) {
|
|
715
|
+
if (fs$1.existsSync(pathPageIndex)) {
|
|
715
716
|
logger.warn("pages/index.vue already exists, skipping");
|
|
716
717
|
return;
|
|
717
718
|
}
|
|
718
|
-
let appContent = fs.existsSync(pathApp) ? await
|
|
719
|
-
await
|
|
720
|
-
await
|
|
719
|
+
let appContent = fs$1.existsSync(pathApp) ? await fs.readFile(pathApp, "utf-8") : void 0;
|
|
720
|
+
await fs.mkdir(dirname(pathPageIndex), { recursive: true });
|
|
721
|
+
await fs.writeFile(pathPageIndex, pagesIndexTemplate, "utf-8");
|
|
721
722
|
if (appContent && !appContent.includes("<NuxtPage")) {
|
|
722
723
|
appContent = appContent.replace("</template>", " <NuxtPage />\n</template>").replace(/<NuxtWelcome\s*\/>/, "");
|
|
723
|
-
await
|
|
724
|
+
await fs.writeFile(pathApp, appContent, "utf-8");
|
|
724
725
|
}
|
|
725
726
|
logger.success("Routing creation wizard completed");
|
|
726
727
|
}
|
|
@@ -907,13 +908,13 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
907
908
|
const files = await fg("*/meta.json", { cwd: analyzeDir, onlyFiles: true, absolute: true });
|
|
908
909
|
builds = await Promise.all(files.map(async (file) => {
|
|
909
910
|
const dir = dirname(file);
|
|
910
|
-
const json = JSON.parse(await
|
|
911
|
+
const json = JSON.parse(await fs.readFile(file, "utf-8"));
|
|
911
912
|
return {
|
|
912
913
|
...json,
|
|
913
914
|
features: {
|
|
914
|
-
bundleClient: fs.existsSync(join$1(dir, "client.html")),
|
|
915
|
-
bundleNitro: fs.existsSync(join$1(dir, "nitro.html")),
|
|
916
|
-
viteInspect: fs.existsSync(join$1(dir, ".vite-inspect"))
|
|
915
|
+
bundleClient: fs$1.existsSync(join$1(dir, "client.html")),
|
|
916
|
+
bundleNitro: fs$1.existsSync(join$1(dir, "nitro.html")),
|
|
917
|
+
viteInspect: fs$1.existsSync(join$1(dir, ".vite-inspect"))
|
|
917
918
|
}
|
|
918
919
|
};
|
|
919
920
|
}));
|
|
@@ -946,10 +947,10 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
946
947
|
async clearAnalyzeBuilds(token, names) {
|
|
947
948
|
await ensureDevAuthToken(token);
|
|
948
949
|
if (!names) {
|
|
949
|
-
await
|
|
950
|
+
await fs.rm(analyzeDir, { recursive: true, force: true });
|
|
950
951
|
} else {
|
|
951
952
|
const targets = builds.filter((build) => names.includes(build.name));
|
|
952
|
-
await Promise.all(targets.map((target) =>
|
|
953
|
+
await Promise.all(targets.map((target) => fs.rm(join$1(analyzeDir, target.slug), { recursive: true, force: true })));
|
|
953
954
|
}
|
|
954
955
|
initalized = readBuildInfo();
|
|
955
956
|
refresh("getAnalyzeBuildInfo");
|
|
@@ -965,11 +966,17 @@ function setupAnalyzeBuildRPC({ nuxt, refresh, ensureDevAuthToken }) {
|
|
|
965
966
|
async function readLocalOptions(defaults, options) {
|
|
966
967
|
const { filePath } = getOptionsFilepath(options);
|
|
967
968
|
if (existsSync(filePath)) {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
969
|
+
try {
|
|
970
|
+
const options2 = {
|
|
971
|
+
...defaults,
|
|
972
|
+
...JSON.parse(await fs.readFile(filePath, "utf-8")).settings || {}
|
|
973
|
+
};
|
|
974
|
+
return options2;
|
|
975
|
+
} catch (e) {
|
|
976
|
+
console.error(`[DevTools] failed to parse local options file: ${filePath}, fallback to defaults`);
|
|
977
|
+
console.error(e);
|
|
978
|
+
return { ...defaults };
|
|
979
|
+
}
|
|
973
980
|
} else {
|
|
974
981
|
return { ...defaults };
|
|
975
982
|
}
|
|
@@ -989,12 +996,12 @@ function getOptionsFilepath(options) {
|
|
|
989
996
|
async function clearLocalOptions(options) {
|
|
990
997
|
const { filePath } = getOptionsFilepath(options);
|
|
991
998
|
if (existsSync(filePath))
|
|
992
|
-
await
|
|
999
|
+
await fs.unlink(filePath);
|
|
993
1000
|
}
|
|
994
1001
|
async function writeLocalOptions(settings, options) {
|
|
995
1002
|
const { filePath, hashedKey } = getOptionsFilepath(options);
|
|
996
|
-
await
|
|
997
|
-
await
|
|
1003
|
+
await fs.mkdir(dirname$1(filePath), { recursive: true });
|
|
1004
|
+
await fs.writeFile(
|
|
998
1005
|
filePath,
|
|
999
1006
|
JSON.stringify(
|
|
1000
1007
|
{
|
|
@@ -1061,7 +1068,7 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
1061
1068
|
return {
|
|
1062
1069
|
async enableTimeline(dry) {
|
|
1063
1070
|
const filepath = nuxt.options._nuxtConfigFile;
|
|
1064
|
-
const source = await
|
|
1071
|
+
const source = await fs.readFile(filepath, "utf-8");
|
|
1065
1072
|
const generated = await magicastGuard(async () => {
|
|
1066
1073
|
const mod = parseModule(source, { sourceFileName: filepath });
|
|
1067
1074
|
const options = getDefaultExportOptions(mod);
|
|
@@ -1071,7 +1078,7 @@ function setupTimelineRPC({ nuxt }) {
|
|
|
1071
1078
|
return mod.generate().code;
|
|
1072
1079
|
}, "\nYou can enable timeline manually by adding `devtools: { timeline: { enabled: true } }`");
|
|
1073
1080
|
if (!dry) {
|
|
1074
|
-
await
|
|
1081
|
+
await fs.writeFile(filepath, generated, "utf-8");
|
|
1075
1082
|
await nuxt.callHook("restart", { hard: true });
|
|
1076
1083
|
}
|
|
1077
1084
|
return [source, generated];
|
|
@@ -1324,10 +1331,32 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
|
1324
1331
|
from: join$1(runtimeDir, "use-nuxt-devtools")
|
|
1325
1332
|
});
|
|
1326
1333
|
});
|
|
1334
|
+
const ROUTE_PATH = `${nuxt.options.app.baseURL || "/"}/__nuxt_devtools__`.replace(/\/+/g, "/");
|
|
1335
|
+
const ROUTE_CLIENT = `${ROUTE_PATH}/client`;
|
|
1336
|
+
const ROUTE_AUTH = `${ROUTE_PATH}/auth`;
|
|
1337
|
+
const ROUTE_AUTH_VERIFY = `${ROUTE_PATH}/auth-verify`;
|
|
1338
|
+
const ROUTE_ANALYZE = `${ROUTE_PATH}/analyze`;
|
|
1327
1339
|
nuxt.hook("vite:serverCreated", (server) => {
|
|
1328
1340
|
server.middlewares.use(ROUTE_ANALYZE, sirv(analyzeDir, { single: false, dev: true }));
|
|
1329
|
-
if (clientDirExists)
|
|
1330
|
-
|
|
1341
|
+
if (clientDirExists) {
|
|
1342
|
+
const indexHtmlPath = join$1(clientDir, "index.html");
|
|
1343
|
+
const indexContent = fs.readFile(indexHtmlPath, "utf-8");
|
|
1344
|
+
const handleStatic = sirv(clientDir, {
|
|
1345
|
+
dev: true,
|
|
1346
|
+
single: false
|
|
1347
|
+
});
|
|
1348
|
+
const handleIndex = async (res) => {
|
|
1349
|
+
res.setHeader("Content-Type", "text/html");
|
|
1350
|
+
res.statusCode = 200;
|
|
1351
|
+
res.write((await indexContent).replace(/\/__NUXT_DEVTOOLS_BASE__\//g, `${ROUTE_CLIENT}/`));
|
|
1352
|
+
res.end();
|
|
1353
|
+
};
|
|
1354
|
+
server.middlewares.use(ROUTE_CLIENT, (req, res) => {
|
|
1355
|
+
if (req.url === "/")
|
|
1356
|
+
return handleIndex(res);
|
|
1357
|
+
return handleStatic(req, res, () => handleIndex(res));
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1331
1360
|
server.middlewares.use(ROUTE_AUTH, sirv(join$1(runtimeDir, "auth"), { single: true, dev: true }));
|
|
1332
1361
|
server.middlewares.use(ROUTE_AUTH_VERIFY, async (req, res) => {
|
|
1333
1362
|
const search = req.url?.split("?")[1];
|
package/dist/chunks/timeline.mjs
CHANGED
|
@@ -34,7 +34,9 @@ async function setup({ nuxt, options }) {
|
|
|
34
34
|
throw new Error(`[Nuxt DevTools] The timeline feature requires \`unimport\` >= v3.1.0, but got \`${ctx.version || "(unknown)"}\`. Please upgrade using \`nuxi upgrade --force\`.`);
|
|
35
35
|
ctx.addons.push(
|
|
36
36
|
{
|
|
37
|
-
injectImportsResolved(imports) {
|
|
37
|
+
injectImportsResolved(imports, _code, id) {
|
|
38
|
+
if (id?.includes("?macro=true"))
|
|
39
|
+
return;
|
|
38
40
|
return imports.map((i) => {
|
|
39
41
|
if (!filter(i))
|
|
40
42
|
return i;
|
|
@@ -48,7 +50,9 @@ async function setup({ nuxt, options }) {
|
|
|
48
50
|
};
|
|
49
51
|
});
|
|
50
52
|
},
|
|
51
|
-
injectImportsStringified(str, imports, s) {
|
|
53
|
+
injectImportsStringified(str, imports, s, id) {
|
|
54
|
+
if (id?.includes("?macro=true"))
|
|
55
|
+
return;
|
|
52
56
|
const code = s.toString();
|
|
53
57
|
const injected = imports.filter((i) => i.meta?.wrapperOriginalAs);
|
|
54
58
|
if (injected.length) {
|
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hostname } from 'node:os';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import { logger } from '@nuxt/kit';
|
|
6
6
|
import { execa } from 'execa';
|
|
@@ -14,7 +14,7 @@ import 'sirv';
|
|
|
14
14
|
import 'consola/utils';
|
|
15
15
|
import 'birpc';
|
|
16
16
|
import 'flatted';
|
|
17
|
-
import '../shared/devtools.
|
|
17
|
+
import '../shared/devtools.6f6e0f47.mjs';
|
|
18
18
|
import '../dirs.mjs';
|
|
19
19
|
import 'node:url';
|
|
20
20
|
import 'is-installed-globally';
|
|
@@ -50,7 +50,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
50
50
|
if (!existsSync(vscodeServerControllerFile))
|
|
51
51
|
return false;
|
|
52
52
|
try {
|
|
53
|
-
const { port: port2 } = JSON.parse(await
|
|
53
|
+
const { port: port2 } = JSON.parse(await fs.readFile(vscodeServerControllerFile, "utf-8"));
|
|
54
54
|
const url2 = `http://localhost:${port2}/open?path=${encodeURIComponent(file)}`;
|
|
55
55
|
await fetch(url2);
|
|
56
56
|
rpc.broadcast.navigateTo("/modules/custom-builtin-vscode");
|
|
@@ -63,7 +63,7 @@ async function setup({ nuxt, options, openInEditorHooks, rpc }) {
|
|
|
63
63
|
});
|
|
64
64
|
async function startCodeServer() {
|
|
65
65
|
if (existsSync(vscodeServerControllerFile))
|
|
66
|
-
await
|
|
66
|
+
await fs.rm(vscodeServerControllerFile, { force: true });
|
|
67
67
|
if (vsOptions?.reuseExistingServer && !await checkPort(port)) {
|
|
68
68
|
loaded = true;
|
|
69
69
|
url = `http://localhost:${port}/?folder=${encodeURIComponent(root)}`;
|
package/dist/client/200.html
CHANGED
|
@@ -2,41 +2,41 @@
|
|
|
2
2
|
<html >
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
-
<link rel="stylesheet" href="/
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
8
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
9
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
10
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
14
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
15
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
17
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
19
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
20
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
21
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
22
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
23
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
24
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
25
|
-
<link rel="prefetch" as="style" href="/
|
|
26
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
27
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
28
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
29
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
30
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
31
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
32
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
33
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
34
|
-
<link rel="prefetch" as="style" href="/
|
|
35
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
36
|
-
<link rel="prefetch" as="style" href="/
|
|
37
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
38
|
-
<script type="module" src="/
|
|
5
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.aa8c94e8.css">
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.9a5af3dc.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/index.06e4cc9c.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/onig.0c57a370.js">
|
|
9
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vitesse-dark.ff0e7dcb.js">
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vitesse-light.c6996724.js">
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/json.709f1c4d.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/yaml.b29e536f.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/css.f61fd02b.js">
|
|
14
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/javascript.b7d6d348.js">
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/typescript.24e7badf.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue.7ad3b25a.js">
|
|
17
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/html.14085b69.js">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue-html.88dda4a8.js">
|
|
19
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/diff.22e0b108.js">
|
|
20
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/shellscript.e25d1410.js">
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default.50175b13.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full.f21cfe4d.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none.7a39bbba.js">
|
|
24
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-docs.100caa70.js">
|
|
25
|
+
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NCodeBlock.6994516c.css">
|
|
26
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/DataSchemaDrawer.3aeebd14.js">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NSelect.vue.c8c511ae.js">
|
|
28
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NSwitch.vue.1cea2bc6.js">
|
|
29
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NDropdown.vue.ff9a8df2.js">
|
|
30
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NCodeBlock.vue.c80c8282.js">
|
|
31
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client.b8ca1554.js">
|
|
32
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NDrawer.vue.e2617b9c.js">
|
|
33
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime.dfaa24d0.js">
|
|
34
|
+
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.82ac0ec5.css">
|
|
35
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.0dae1ccf.js">
|
|
36
|
+
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.ff959f66.css">
|
|
37
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.0a479375.js">
|
|
38
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.9a5af3dc.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window&&window.localStorage&&window.localStorage.getItem&&window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?d():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:d,addColorScheme:i,removeColorScheme:f};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function f(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function d(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
|
|
39
39
|
</script></head>
|
|
40
40
|
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script>
|
|
41
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/
|
|
41
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
|
|
42
42
|
</html>
|
package/dist/client/404.html
CHANGED
|
@@ -2,41 +2,41 @@
|
|
|
2
2
|
<html >
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
-
<link rel="stylesheet" href="/
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
8
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
9
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
10
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
14
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
15
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
17
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
19
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
20
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
21
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
22
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
23
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
24
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
25
|
-
<link rel="prefetch" as="style" href="/
|
|
26
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
27
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
28
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
29
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
30
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
31
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
32
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
33
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
34
|
-
<link rel="prefetch" as="style" href="/
|
|
35
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
36
|
-
<link rel="prefetch" as="style" href="/
|
|
37
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
38
|
-
<script type="module" src="/
|
|
5
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.aa8c94e8.css">
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.9a5af3dc.js">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/index.06e4cc9c.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/onig.0c57a370.js">
|
|
9
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vitesse-dark.ff0e7dcb.js">
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vitesse-light.c6996724.js">
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/json.709f1c4d.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/yaml.b29e536f.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/css.f61fd02b.js">
|
|
14
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/javascript.b7d6d348.js">
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/typescript.24e7badf.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue.7ad3b25a.js">
|
|
17
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/html.14085b69.js">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vue-html.88dda4a8.js">
|
|
19
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/diff.22e0b108.js">
|
|
20
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/shellscript.e25d1410.js">
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default.50175b13.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full.f21cfe4d.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none.7a39bbba.js">
|
|
24
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nuxt-docs.100caa70.js">
|
|
25
|
+
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NCodeBlock.6994516c.css">
|
|
26
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/DataSchemaDrawer.3aeebd14.js">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NSelect.vue.c8c511ae.js">
|
|
28
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NSwitch.vue.1cea2bc6.js">
|
|
29
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NDropdown.vue.ff9a8df2.js">
|
|
30
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NCodeBlock.vue.c80c8282.js">
|
|
31
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client.b8ca1554.js">
|
|
32
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/NDrawer.vue.e2617b9c.js">
|
|
33
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime.dfaa24d0.js">
|
|
34
|
+
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.82ac0ec5.css">
|
|
35
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.0dae1ccf.js">
|
|
36
|
+
<link rel="prefetch" as="style" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.ff959f66.css">
|
|
37
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.0a479375.js">
|
|
38
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.9a5af3dc.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window&&window.localStorage&&window.localStorage.getItem&&window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?d():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:d,addColorScheme:i,removeColorScheme:f};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function f(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function d(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
|
|
39
39
|
</script></head>
|
|
40
40
|
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script>
|
|
41
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/
|
|
41
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{fixture4:"public runtime config from nuxt.config.ts"},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
|
|
42
42
|
</html>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as R}from"./NCodeBlock.vue.
|
|
1
|
+
import{_ as R}from"./NCodeBlock.vue.c80c8282.js";import{d as _,a as N,r as F,am as W,bE as A,o as B,h as J,f as V}from"./entry.9a5af3dc.js";function m(){}m.prototype={diff:function(e,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},f=o.callback;typeof o=="function"&&(f=o,o={}),this.options=o;var r=this;function l(c){return f?(setTimeout(function(){f(void 0,c)},0),!0):c}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var i=t.length,s=e.length,u=1,d=i+s;o.maxEditLength&&(d=Math.min(d,o.maxEditLength));var a=[{newPos:-1,components:[]}],p=this.extractCommon(a[0],t,e,0);if(a[0].newPos+1>=i&&p+1>=s)return l([{value:this.join(t),count:t.length}]);function v(){for(var c=-1*u;c<=u;c+=2){var h=void 0,w=a[c-1],C=a[c+1],g=(C?C.newPos:0)-c;w&&(a[c-1]=void 0);var q=w&&w.newPos+1<i,$=C&&0<=g&&g<s;if(!q&&!$){a[c]=void 0;continue}if(!q||$&&w.newPos<C.newPos?(h=Z(C),r.pushComponent(h.components,void 0,!0)):(h=w,h.newPos++,r.pushComponent(h.components,!0,void 0)),g=r.extractCommon(h,t,e,c),h.newPos+1>=i&&g+1>=s)return l(M(r,h.components,t,e,r.useLongestToken));a[c]=h}u++}if(f)(function c(){setTimeout(function(){if(u>d)return f();v()||c()},0)})();else for(;u<=d;){var y=v();if(y)return y}},pushComponent:function(e,t,o){var f=e[e.length-1];f&&f.added===t&&f.removed===o?e[e.length-1]={count:f.count+1,added:t,removed:o}:e.push({count:1,added:t,removed:o})},extractCommon:function(e,t,o,f){for(var r=t.length,l=o.length,i=e.newPos,s=i-f,u=0;i+1<r&&s+1<l&&this.equals(t[i+1],o[s+1]);)i++,s++,u++;return u&&e.components.push({count:u}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],o=0;o<e.length;o++)e[o]&&t.push(e[o]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function M(n,e,t,o,f){for(var r=0,l=e.length,i=0,s=0;r<l;r++){var u=e[r];if(u.removed){if(u.value=n.join(o.slice(s,s+u.count)),s+=u.count,r&&e[r-1].added){var a=e[r-1];e[r-1]=e[r],e[r]=a}}else{if(!u.added&&f){var d=t.slice(i,i+u.count);d=d.map(function(v,y){var c=o[s+y];return c.length>v.length?c:v}),u.value=n.join(d)}else u.value=n.join(t.slice(i,i+u.count));i+=u.count,u.added||(s+=u.count)}}var p=e[l-1];return l>1&&typeof p.value=="string"&&(p.added||p.removed)&&n.equals("",p.value)&&(e[l-2].value+=p.value,e.pop()),e}function Z(n){return{newPos:n.newPos,components:n.components.slice(0)}}var I=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,T=/\S/,O=new m;O.equals=function(n,e){return this.options.ignoreCase&&(n=n.toLowerCase(),e=e.toLowerCase()),n===e||this.options.ignoreWhitespace&&!T.test(n)&&!T.test(e)};O.tokenize=function(n){for(var e=n.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),t=0;t<e.length-1;t++)!e[t+1]&&e[t+2]&&I.test(e[t])&&I.test(e[t+2])&&(e[t]+=e[t+2],e.splice(t+1,2),t--);return e};var D=new m;D.tokenize=function(n){var e=[],t=n.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var o=0;o<t.length;o++){var f=t[o];o%2&&!this.options.newlineIsToken?e[e.length-1]+=f:(this.options.ignoreWhitespace&&(f=f.trim()),e.push(f))}return e};function k(n,e,t){return D.diff(n,e,t)}var G=new m;G.tokenize=function(n){return n.split(/(\S.+?[.!?])(?=\s+|$)/)};var H=new m;H.tokenize=function(n){return n.split(/([{}:;,]|\s+)/)};function E(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(e){return typeof e}:E=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(n)}var Q=Object.prototype.toString,L=new m;L.useLongestToken=!0;L.tokenize=D.tokenize;L.castInput=function(n){var e=this.options,t=e.undefinedReplacement,o=e.stringifyReplacer,f=o===void 0?function(r,l){return typeof l>"u"?t:l}:o;return typeof n=="string"?n:JSON.stringify(z(n,null,null,f),f," ")};L.equals=function(n,e){return m.prototype.equals.call(L,n.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function z(n,e,t,o,f){e=e||[],t=t||[],o&&(n=o(f,n));var r;for(r=0;r<e.length;r+=1)if(e[r]===n)return t[r];var l;if(Q.call(n)==="[object Array]"){for(e.push(n),l=new Array(n.length),t.push(l),r=0;r<n.length;r+=1)l[r]=z(n[r],e,t,o,f);return e.pop(),t.pop(),l}if(n&&n.toJSON&&(n=n.toJSON()),E(n)==="object"&&n!==null){e.push(n),l={},t.push(l);var i=[],s;for(s in n)n.hasOwnProperty(s)&&i.push(s);for(i.sort(),r=0;r<i.length;r+=1)s=i[r],l[s]=z(n[s],e,t,o,s);e.pop(),t.pop()}else l=n;return l}var x=new m;x.tokenize=function(n){return n.slice()};x.join=x.removeEmpty=function(n){return n};const Y=_({__name:"CodeDiff",props:{from:{},to:{},lang:{}},setup(n){const e=n;function t(i,s){const u=k(i.trim(),s.trim()),d=[],a=[],p=[];for(const v of u){const y=v.value.trimEnd().split(`
|
|
2
2
|
`);for(const c of y)v.added?(d.push(p.length),p.push(c)):(v.removed&&a.push(p.length),p.push(c))}return{added:d,removed:a,result:p.join(`
|
|
3
3
|
`)}}const o=N(()=>t(e.from,e.to));function f(i){let s=0;return i.replace(/class="shiki/,'class="shiki diff').replace(/class="line"/g,u=>(s++,o.value.added.includes(s-1)?'class="line line-added"':o.value.removed.includes(s-1)?'class="line line-removed"':u))}const r=F();W(l);function l(){const i=A(r);i&&i.querySelector(".line-added,.line-removed")?.scrollIntoView()}return(i,s)=>{const u=R;return B(),J(u,{ref_key:"elRef",ref:r,code:V(o).result,lang:i.lang,"transform-rendered":f,onLoaded:l},null,8,["code","lang"])}}});export{Y as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as I}from"./NMarkdown.vue.
|
|
1
|
+
import{_ as I}from"./NMarkdown.vue.07fe8875.js";import{d as V,e as D,aa as U,a as c,ao as $,o as s,h as r,j as i,k as o,p as l,i as j,f as e,v as u,m as _,F as v,t as h,n as E,G as F,_ as S}from"./entry.9a5af3dc.js";import{_ as z}from"./FilepathItem.vue.ca308ea2.js";import{C as k}from"./constants.2cc6e981.js";const G={"hover:text-primary":""},L={key:0,"text-primary":""},M={"max-w-100":""},O={px4:"",py3:"","text-sm":""},T={flex:"~ gap2",n:"primary xs"},W={border:"t base","max-h-60":"","of-auto":"",px4:"",py3:""},q={"text-sm":""},A=o("span",{op50:""},"It has been referenced ",-1),H={"text-primary":""},J=o("span",{op50:""}," times by:",-1),K={flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},P={key:1,"text-sm":"",op50:""},Z=V({__name:"ComposableItem",props:{item:{},metadata:{},filepath:{},counter:{type:Boolean,default:!0},classes:{default:"px2 py1 text-sm bg-gray:5 "}},setup(x){const t=x,b=D(),g=U(),m=c(()=>t.item.as||t.item.name),n=c(()=>t.metadata?.injectionUsage?.[m.value]?.count||0),C=c(()=>(t.metadata?.injectionUsage?.[m.value]?.moduleIds||[]).filter(a=>!a.endsWith("?macro=true"))),y=c(()=>{if(t.item.meta?.docsUrl)return t.item.meta.docsUrl;if(["nuxt","#app","nuxt3"].includes(t.item.from))return k.nuxt[t.item.name];if(t.item.from==="vue")return k.vue[t.item.name]});return(a,p)=>{const w=I,f=S,N=z,B=$("VDropdown");return s(),r(B,{disabled:!t.metadata},{popper:i(()=>[o("div",M,[o("div",O,[a.item.meta?.description?(s(),r(w,{key:0,tag:"div",pb3:"","text-sm":"",markdown:a.item.meta.description},null,8,["markdown"])):l("",!0),o("div",T,[j(f,{icon:"carbon-copy",onClick:p[0]||(p[0]=d=>e(b)(e(m),"imports-name"))},{default:i(()=>[u(" Copy ")]),_:1}),a.filepath?(s(),r(f,{key:0,icon:"carbon-code",onClick:p[1]||(p[1]=d=>a.filepath&&e(g)(a.filepath))},{default:i(()=>[u(" Source ")]),_:1})):l("",!0),e(y)?(s(),r(f,{key:1,icon:"carbon-catalog",to:e(y),target:"_blank"},{default:i(()=>[u(" Docs ")]),_:1},8,["to"])):l("",!0)])]),o("div",W,[e(n)?(s(),_(v,{key:0},[o("div",q,[A,o("strong",H,h(e(n)),1),J]),o("div",K,[(s(!0),_(v,null,E(e(C),d=>(s(),r(N,{key:d,filepath:d},null,8,["filepath"]))),128))])],64)):(s(),_("div",P," Not in use via auto import. "))])])]),default:i(()=>[o("button",G,[o("code",{rounded:"","font-mono":"",class:F([a.metadata&&!e(n)?"op30 hover:op100":"",a.classes])},[u(h(e(m))+" ",1),e(n)&&a.counter?(s(),_("sup",L,"x"+h(e(n)),1)):l("",!0)],2)])]),_:1},8,["disabled"])}}});export{Z as _};
|
package/dist/client/_nuxt/{DataSchemaButton.vue.b4fc42f9.js → DataSchemaButton.vue.72b202db.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as r,u as s,
|
|
1
|
+
import{d as r,u as s,a1 as c,I as i,o as p,h as _,_ as u}from"./entry.9a5af3dc.js";const f=r({__name:"DataSchemaButton",props:{getter:{type:Function}},setup(l){const t=s();return(n,e)=>{const o=u,a=c("tooltip");return i((p(),_(o,{title:"Generate Data Schema",icon:"carbon:container-services",border:!1,onClick:e[0]||(e[0]=m=>t.value=n.getter())},null,512)),[[a,"Generate Data Schema"]])}}});export{f as _};
|