nuxt-link-checker 4.2.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/client/200.html +12 -12
  2. package/dist/client/404.html +12 -12
  3. package/dist/client/_nuxt/3w_68AFy.js +1 -0
  4. package/dist/client/_nuxt/BMMyXqK5.js +1 -0
  5. package/dist/client/_nuxt/Cp-IABpG.js +1 -0
  6. package/dist/client/_nuxt/DhVqxY3H.js +1 -0
  7. package/dist/client/_nuxt/Dt-P3YVb.js +181 -0
  8. package/dist/client/_nuxt/{BFWaZzNn.js → Qizr_0i3.js} +1 -1
  9. package/dist/client/_nuxt/builds/latest.json +1 -1
  10. package/dist/client/_nuxt/builds/meta/f6a7da00-2cca-4db0-b8d5-690f99691ca5.json +1 -0
  11. package/dist/client/_nuxt/{entry.xKNhWsNM.css → entry.ycyXFUel.css} +1 -1
  12. package/dist/client/_nuxt/error-404.uLshya7R.css +1 -0
  13. package/dist/client/_nuxt/error-500.Dm5awy8c.css +1 -0
  14. package/dist/client/_nuxt/wWkaIY0j.js +1 -0
  15. package/dist/client/index.html +12 -12
  16. package/dist/module.d.mts +2 -1
  17. package/dist/module.json +3 -3
  18. package/dist/module.mjs +222 -46
  19. package/dist/runtime/app/plugins/view/Main.vue +20 -28
  20. package/dist/runtime/app/plugins/view/Main.vue.d.ts +9 -0
  21. package/dist/runtime/app/plugins/view/Squiggle.vue +16 -20
  22. package/dist/runtime/app/plugins/view/Squiggle.vue.d.ts +7 -0
  23. package/dist/runtime/server/content-compat.d.ts +1 -0
  24. package/dist/runtime/server/content-compat.js +2 -0
  25. package/dist/runtime/server/providers/content-v3.d.ts +5 -1
  26. package/dist/runtime/server/providers/content-v3.js +2 -2
  27. package/dist/runtime/server/routes/__link-checker__/inspect.d.ts +1 -1
  28. package/dist/runtime/shared/crawl.d.ts +10 -6
  29. package/dist/runtime/shared/crawl.js +37 -10
  30. package/dist/runtime/shared/inspections/absolute-site-urls.d.ts +1 -1
  31. package/dist/runtime/shared/inspections/link-text.d.ts +1 -1
  32. package/dist/runtime/shared/inspections/missing-hash.d.ts +1 -1
  33. package/dist/runtime/shared/inspections/no-baseless.d.ts +1 -1
  34. package/dist/runtime/shared/inspections/no-double-slashes.d.ts +1 -1
  35. package/dist/runtime/shared/inspections/no-duplicate-query-params.d.ts +1 -1
  36. package/dist/runtime/shared/inspections/no-error-response.d.ts +1 -1
  37. package/dist/runtime/shared/inspections/no-error-response.js +1 -1
  38. package/dist/runtime/shared/inspections/no-javascript.d.ts +1 -1
  39. package/dist/runtime/shared/inspections/no-missing-href.d.ts +1 -1
  40. package/dist/runtime/shared/inspections/no-non-ascii-chars.d.ts +1 -1
  41. package/dist/runtime/shared/inspections/no-underscores.d.ts +1 -1
  42. package/dist/runtime/shared/inspections/no-uppercase-chars.d.ts +1 -1
  43. package/dist/runtime/shared/inspections/no-whitespace.d.ts +1 -1
  44. package/dist/runtime/shared/inspections/trailing-slash.d.ts +1 -1
  45. package/dist/runtime/shared/inspections/util.js +2 -1
  46. package/dist/runtime/shared/redirects.d.ts +1 -1
  47. package/dist/runtime/shared/redirects.js +1 -1
  48. package/dist/types.d.mts +4 -2
  49. package/package.json +39 -32
  50. package/dist/client/_nuxt/5p_Oaa9g.js +0 -181
  51. package/dist/client/_nuxt/B9GrqE__.js +0 -1
  52. package/dist/client/_nuxt/BGB1r09n.js +0 -1
  53. package/dist/client/_nuxt/BLmTiKMJ.js +0 -1
  54. package/dist/client/_nuxt/Cj6XDDRd.js +0 -1
  55. package/dist/client/_nuxt/DFxyEsuO.js +0 -1
  56. package/dist/client/_nuxt/builds/meta/cdbc357b-6180-4103-97aa-19c53e0b9c3c.json +0 -1
  57. package/dist/client/_nuxt/error-404.C6U-TOR-.css +0 -1
  58. package/dist/client/_nuxt/error-500.BAgFwF30.css +0 -1
  59. package/dist/module.cjs +0 -5
  60. package/dist/module.d.ts +0 -92
  61. package/dist/types.d.ts +0 -7
package/dist/module.mjs CHANGED
@@ -2,6 +2,7 @@ import { useNuxt, extendPages, defineNuxtModule, createResolver, useLogger, addP
2
2
  import { useSiteConfig, installNuxtSiteConfig } from 'nuxt-site-config/kit';
3
3
  import { resolve, relative, dirname } from 'pathe';
4
4
  import { readPackageJSON } from 'pkg-types';
5
+ import { provider } from 'std-env';
5
6
  import { existsSync } from 'node:fs';
6
7
  import { readFile, writeFile } from 'node:fs/promises';
7
8
  import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
@@ -13,7 +14,7 @@ import Fuse from 'fuse.js';
13
14
  import { parse, walkSync, ELEMENT_NODE } from 'ultrahtml';
14
15
  import { createStorage } from 'unstorage';
15
16
  import fsDriver from 'unstorage/drivers/fs';
16
- import { setLinkResponse, getLinkResponse, crawlFetch } from '../dist/runtime/shared/crawl.js';
17
+ import { setLinkResponse, getResolvedLinkResponses, getLinkResponse, crawlFetch } from '../dist/runtime/shared/crawl.js';
17
18
  import { inspect } from '../dist/runtime/shared/inspect.js';
18
19
  import { createFilter } from '../dist/runtime/shared/sharedUtils.js';
19
20
 
@@ -642,6 +643,53 @@ const htmlTemplate = html(_a || (_a = __template([`<!DOCTYPE html>
642
643
  grid-template-columns: 1fr;
643
644
  }
644
645
  }
646
+ .issues-summary {
647
+ border-radius: var(--border-radius);
648
+ padding: 1.5rem;
649
+ margin-bottom: 2rem;
650
+ box-shadow: var(--box-shadow);
651
+ background-color: var(--color-bg-secondary);
652
+ }
653
+
654
+ .common-issues-list {
655
+ list-style: none;
656
+ padding: 0;
657
+ margin: 0;
658
+ }
659
+
660
+ .common-issue {
661
+ display: flex;
662
+ align-items: flex-start;
663
+ padding: 0.5rem 0;
664
+ border-bottom: 1px solid var(--color-border);
665
+ }
666
+
667
+ .common-issue:last-child {
668
+ border-bottom: none;
669
+ }
670
+
671
+ .common-issue.error {
672
+ color: var(--color-error);
673
+ }
674
+
675
+ .common-issue.warning {
676
+ color: var(--color-warning);
677
+ }
678
+
679
+ .issue-count {
680
+ font-weight: bold;
681
+ margin-right: 0.75rem;
682
+ min-width: 2em;
683
+ text-align: right;
684
+ }
685
+
686
+ .error-icon, .warning-icon {
687
+ margin-right: 0.5rem;
688
+ }
689
+
690
+ .issue-text {
691
+ flex: 1;
692
+ }
645
693
  </style>
646
694
  </head>
647
695
  <body>
@@ -1148,6 +1196,53 @@ document.addEventListener('DOMContentLoaded', () => {
1148
1196
  grid-template-columns: 1fr;
1149
1197
  }
1150
1198
  }
1199
+ .issues-summary {
1200
+ border-radius: var(--border-radius);
1201
+ padding: 1.5rem;
1202
+ margin-bottom: 2rem;
1203
+ box-shadow: var(--box-shadow);
1204
+ background-color: var(--color-bg-secondary);
1205
+ }
1206
+
1207
+ .common-issues-list {
1208
+ list-style: none;
1209
+ padding: 0;
1210
+ margin: 0;
1211
+ }
1212
+
1213
+ .common-issue {
1214
+ display: flex;
1215
+ align-items: flex-start;
1216
+ padding: 0.5rem 0;
1217
+ border-bottom: 1px solid var(--color-border);
1218
+ }
1219
+
1220
+ .common-issue:last-child {
1221
+ border-bottom: none;
1222
+ }
1223
+
1224
+ .common-issue.error {
1225
+ color: var(--color-error);
1226
+ }
1227
+
1228
+ .common-issue.warning {
1229
+ color: var(--color-warning);
1230
+ }
1231
+
1232
+ .issue-count {
1233
+ font-weight: bold;
1234
+ margin-right: 0.75rem;
1235
+ min-width: 2em;
1236
+ text-align: right;
1237
+ }
1238
+
1239
+ .error-icon, .warning-icon {
1240
+ margin-right: 0.5rem;
1241
+ }
1242
+
1243
+ .issue-text {
1244
+ flex: 1;
1245
+ }
1151
1246
  </style>
1152
1247
  </head>
1153
1248
  <body>
@@ -1196,10 +1291,52 @@ async function generateReports(reports, ctx) {
1196
1291
  });
1197
1292
  }
1198
1293
  }
1199
- async function generateHtmlReport(reports, { storage, storageFilepath, totalRoutes, version }) {
1294
+ async function generateHtmlReport(reports, {
1295
+ storage,
1296
+ storageFilepath,
1297
+ totalRoutes,
1298
+ version
1299
+ }) {
1200
1300
  const timestamp = (/* @__PURE__ */ new Date()).toLocaleString();
1201
1301
  const totalErrors = reports.reduce((sum, { reports: reports2 }) => sum + reports2.filter((r) => r.error?.length).length, 0);
1202
1302
  const totalWarnings = reports.reduce((sum, { reports: reports2 }) => sum + reports2.filter((r) => r.warning?.length).length, 0);
1303
+ const issueFrequency = {};
1304
+ reports.forEach(({ reports: routeReports }) => {
1305
+ routeReports.forEach((report) => {
1306
+ report.error?.forEach((err) => {
1307
+ const key = `${err.name}: ${err.message}`;
1308
+ if (!issueFrequency[key]) {
1309
+ issueFrequency[key] = { count: 0, type: "error" };
1310
+ }
1311
+ issueFrequency[key].count++;
1312
+ });
1313
+ report.warning?.forEach((warning) => {
1314
+ const key = `${warning.name}: ${warning.message}`;
1315
+ if (!issueFrequency[key]) {
1316
+ issueFrequency[key] = { count: 0, type: "warning" };
1317
+ }
1318
+ issueFrequency[key].count++;
1319
+ });
1320
+ });
1321
+ });
1322
+ const issuesList = Object.entries(issueFrequency).sort((a, b) => b[1].count - a[1].count).map(([issue, { count, type }]) => {
1323
+ const iconClass = type === "error" ? "error-icon" : "warning-icon";
1324
+ const icon = type === "error" ? "\u2716" : "\u26A0";
1325
+ return `
1326
+ <li class="common-issue ${type}">
1327
+ <span class="${iconClass}" aria-hidden="true">${icon}</span>
1328
+ <span class="issue-count">${count}</span>
1329
+ <span class="issue-text">${issue}</span>
1330
+ </li>
1331
+ `;
1332
+ }).join("");
1333
+ const issueSummary = issuesList ? `
1334
+ <div class="issues-summary">
1335
+ <ul class="common-issues-list">
1336
+ ${issuesList}
1337
+ </ul>
1338
+ </div>
1339
+ ` : "";
1203
1340
  const reportMeta = `
1204
1341
  <div class="report-meta">
1205
1342
  <div class="version">Nuxt Link Checker v${version}</div>
@@ -1238,8 +1375,9 @@ async function generateHtmlReport(reports, { storage, storageFilepath, totalRout
1238
1375
  warnings > 0 ? `${warnings} warning${warnings > 1 ? "s" : ""}` : ""
1239
1376
  ].filter(Boolean).join(", ");
1240
1377
  return `<li class="${statusClass}">
1241
- <a href="#route-${createAnchor(route)}">${statusEmoji} ${route}</a>
1378
+ <a style="display: block;" href="#route-${createAnchor(route)}">${statusEmoji} ${route}
1242
1379
  ${statusString ? `<span class="toc-status">(${statusString})</span>` : ""}
1380
+ </a>
1243
1381
  </li>`;
1244
1382
  }).join("");
1245
1383
  const reportHtml = reports.map(({ route, reports: reports2 }) => {
@@ -1292,8 +1430,8 @@ async function generateHtmlReport(reports, { storage, storageFilepath, totalRout
1292
1430
  </section>`;
1293
1431
  }).join("");
1294
1432
  const tableOfContents = `
1295
- <div id="toc" class="table-of-contents">
1296
1433
  <h2>Table of Contents</h2>
1434
+ <div id="toc" class="table-of-contents">
1297
1435
  <ul class="toc-list">
1298
1436
  ${tocHtml || "<li>No issues found</li>"}
1299
1437
  </ul>
@@ -1301,6 +1439,7 @@ async function generateHtmlReport(reports, { storage, storageFilepath, totalRout
1301
1439
  `;
1302
1440
  const html = htmlTemplate.replace("<!-- REPORT -->", `${reportMeta}
1303
1441
  ${summary}
1442
+ ${issueSummary}
1304
1443
  ${tableOfContents}
1305
1444
  ${reportHtml || '<div class="no-issues">All links are valid! \u{1F389}</div>'}`).replaceAll("<!-- SiteName -->", `Link Report - ${useSiteConfig()?.name || ""}`);
1306
1445
  await storage.setItem("link-checker-report.html", html);
@@ -1414,6 +1553,32 @@ async function generateJsonReport(reports, { storage, storageFilepath }) {
1414
1553
  return resolve(storageFilepath, "link-checker-report.json");
1415
1554
  }
1416
1555
 
1556
+ async function runParallel(inputs, cb, opts) {
1557
+ const tasks = /* @__PURE__ */ new Set();
1558
+ function queueNext() {
1559
+ const route = inputs.values().next().value;
1560
+ if (!route) {
1561
+ return;
1562
+ }
1563
+ inputs.delete(route);
1564
+ const task = (opts.interval ? new Promise((resolve) => setTimeout(resolve, opts.interval)) : Promise.resolve()).then(() => cb(route)).catch((error) => {
1565
+ console.error(error);
1566
+ });
1567
+ tasks.add(task);
1568
+ return task.then(() => {
1569
+ tasks.delete(task);
1570
+ if (inputs.size > 0) {
1571
+ return refillQueue();
1572
+ }
1573
+ });
1574
+ }
1575
+ function refillQueue() {
1576
+ const workers = Math.min(opts.concurrency - tasks.size, inputs.size);
1577
+ return Promise.all(Array.from({ length: workers }, () => queueNext()));
1578
+ }
1579
+ await refillQueue();
1580
+ }
1581
+
1417
1582
  const { gray, yellow, dim, red, white } = colors;
1418
1583
  const linkMap = {};
1419
1584
  async function extractPayload(html, rootNodeId = "#__nuxt") {
@@ -1495,7 +1660,13 @@ function prerender(config, version, nuxt = useNuxt()) {
1495
1660
  const route = decodeURI(ctx.route);
1496
1661
  if (ctx.contents && !ctx.error && ctx.fileName?.endsWith(".html") && !route.endsWith(".html") && urlFilter(route))
1497
1662
  linkMap[route] = await extractPayload(ctx.contents, nuxt.options.app.rootAttrs?.id || "");
1498
- setLinkResponse(route, Promise.resolve({ status: Number(ctx.error?.statusCode) || 200, statusText: ctx.error?.statusMessage || "", headers: {} }));
1663
+ setLinkResponse(route, Promise.resolve({
1664
+ status: Number(ctx.error?.statusCode) || 200,
1665
+ statusText: ctx.error?.statusMessage || "",
1666
+ headers: {
1667
+ "Content-Type": ctx.contentType
1668
+ }
1669
+ }));
1499
1670
  });
1500
1671
  nitro.hooks.hook("prerender:done", async () => {
1501
1672
  const payloads = Object.entries(linkMap);
@@ -1514,6 +1685,7 @@ function prerender(config, version, nuxt = useNuxt()) {
1514
1685
  version,
1515
1686
  storage,
1516
1687
  storageFilepath,
1688
+ isPrerenderingAllRoutes: isNuxtGenerate(nuxt) || Boolean(nuxt.options.nitro.prerender?.crawlLinks),
1517
1689
  totalRoutes: payloads.length
1518
1690
  };
1519
1691
  const { allReports, errorCount } = await runInspections(payloads, inspectionCtx);
@@ -1521,6 +1693,9 @@ function prerender(config, version, nuxt = useNuxt()) {
1521
1693
  ({ reports }) => reports.some((r) => r.error?.length || r.warning?.length)
1522
1694
  );
1523
1695
  await generateReports(reportsWithContent, inspectionCtx);
1696
+ if (config.debug) {
1697
+ await storage.setItem("debug-link-responses.json", JSON.stringify(await getResolvedLinkResponses()));
1698
+ }
1524
1699
  if (errorCount > 0 && config.failOnError) {
1525
1700
  nitro.logger.error(`Nuxt Link Checker found ${errorCount} errors, failing build.`);
1526
1701
  nitro.logger.log(gray('You can disable this by setting "linkChecker: { failOnError: false }" in your nuxt.config.'));
@@ -1556,11 +1731,11 @@ async function runInspections(payloads, context) {
1556
1731
  let warningCount = 0;
1557
1732
  let routeWithIssuesCount = 0;
1558
1733
  const totalRoutes = payloads.length;
1559
- const batchSize = 10;
1560
1734
  const allReports = [];
1561
- for (let i = 0; i < payloads.length; i += batchSize) {
1562
- const batch = payloads.slice(i, i + batchSize);
1563
- const batchReports = await Promise.all(batch.map(async ([route, payload]) => {
1735
+ const inputs = new Set(payloads);
1736
+ await runParallel(
1737
+ inputs,
1738
+ async ([route, payload]) => {
1564
1739
  const reports = await processRouteLinks(route, payload, context);
1565
1740
  const routeErrors = reports.filter((r) => r.error?.length).length;
1566
1741
  const routeWarnings = reports.filter((r) => r.warning?.length).length;
@@ -1572,11 +1747,11 @@ async function runInspections(payloads, context) {
1572
1747
  logRouteIssues(route, reports, routeErrors, routeWarnings, nitro);
1573
1748
  }
1574
1749
  }
1575
- return { route, reports };
1576
- }));
1577
- allReports.push(...batchReports);
1578
- await new Promise((resolve2) => setTimeout(resolve2, 0));
1579
- }
1750
+ allReports.push({ route, reports });
1751
+ },
1752
+ { concurrency: 5, interval: 10 }
1753
+ // Process 5 routes in parallel with small delay between starts
1754
+ );
1580
1755
  logSummary(
1581
1756
  totalRoutes,
1582
1757
  routeWithIssuesCount,
@@ -1589,13 +1764,15 @@ async function runInspections(payloads, context) {
1589
1764
  async function processRouteLinks(route, payload, context) {
1590
1765
  const { urlFilter, config, nuxt, siteConfig, pageSearcher } = context;
1591
1766
  const links = payload.links || [];
1592
- const linkBatchSize = 10;
1593
1767
  const allReports = [];
1594
- for (let i = 0; i < links.length; i += linkBatchSize) {
1595
- const linkBatch = links.slice(i, i + linkBatchSize);
1596
- let batchReports = await Promise.all(linkBatch.map(async ({ link, textContent }) => {
1597
- if (!urlFilter(link) || !link)
1598
- return { error: [], warning: [], link };
1768
+ const inputs = new Set(links);
1769
+ await runParallel(
1770
+ inputs,
1771
+ async ({ link, textContent }) => {
1772
+ if (!urlFilter(link) || !link) {
1773
+ allReports.push({ error: [], warning: [], link });
1774
+ return;
1775
+ }
1599
1776
  const response = await getLinkResponse({
1600
1777
  link,
1601
1778
  timeout: config.fetchTimeout,
@@ -1604,7 +1781,7 @@ async function processRouteLinks(route, payload, context) {
1604
1781
  return existsSync(resolve(nuxt.options.rootDir, nuxt.options.dir.public, withoutLeadingSlash(link)));
1605
1782
  }
1606
1783
  });
1607
- return inspect({
1784
+ const report = inspect({
1608
1785
  ids: linkMap[route].ids,
1609
1786
  fromPath: route,
1610
1787
  pageSearch: pageSearcher,
@@ -1614,13 +1791,11 @@ async function processRouteLinks(route, payload, context) {
1614
1791
  response,
1615
1792
  skipInspections: config.skipInspections
1616
1793
  });
1617
- }));
1618
- allReports.push(...batchReports);
1619
- batchReports = null;
1620
- if (links.length > linkBatchSize) {
1621
- await new Promise((resolve2) => setTimeout(resolve2, 10));
1622
- }
1623
- }
1794
+ allReports.push(report);
1795
+ },
1796
+ { concurrency: 5, interval: 5 }
1797
+ // Process 5 links in parallel with small delay
1798
+ );
1624
1799
  return allReports;
1625
1800
  }
1626
1801
  function logSummary(totalRoutes, routesWithIssues, errorCount, warningCount, nitro) {
@@ -1711,18 +1886,19 @@ const module = defineNuxtModule({
1711
1886
  },
1712
1887
  configKey: "linkChecker"
1713
1888
  },
1714
- defaults: {
1715
- strictNuxtContentPaths: false,
1716
- fetchRemoteUrls: false,
1717
- // provider !== 'stackblitz',
1718
- runOnBuild: true,
1719
- debug: false,
1720
- showLiveInspections: false,
1721
- enabled: true,
1722
- fetchTimeout: 1e4,
1723
- failOnError: false,
1724
- excludeLinks: [],
1725
- skipInspections: []
1889
+ defaults(nuxt) {
1890
+ return {
1891
+ strictNuxtContentPaths: false,
1892
+ fetchRemoteUrls: nuxt.options._build && provider !== "stackblitz",
1893
+ runOnBuild: true,
1894
+ debug: false,
1895
+ showLiveInspections: false,
1896
+ enabled: true,
1897
+ fetchTimeout: 1e4,
1898
+ failOnError: false,
1899
+ excludeLinks: [],
1900
+ skipInspections: []
1901
+ };
1726
1902
  },
1727
1903
  async setup(config, nuxt) {
1728
1904
  const { resolve } = createResolver(import.meta.url);
@@ -1735,7 +1911,8 @@ const module = defineNuxtModule({
1735
1911
  }
1736
1912
  await installNuxtSiteConfig();
1737
1913
  if (config.fetchRemoteUrls) {
1738
- config.fetchRemoteUrls = (await crawlFetch("https://google.com")).status === 200;
1914
+ const { status } = await crawlFetch("https://nuxtseo.com/robots.txt").catch(() => ({ status: 404 }));
1915
+ config.fetchRemoteUrls = status < 400;
1739
1916
  if (!config.fetchRemoteUrls)
1740
1917
  logger.warn("Remote URL fetching is disabled because you appear to be offline.");
1741
1918
  }
@@ -1774,8 +1951,11 @@ const module = defineNuxtModule({
1774
1951
  const isNuxtContentV3 = usingNuxtContent && await hasNuxtModuleCompatibility("@nuxt/content", "^3");
1775
1952
  if (usingNuxtContent) {
1776
1953
  if (isNuxtContentV3) {
1954
+ if (await hasNuxtModuleCompatibility("@nuxt/content", "<3.6.0")) {
1955
+ nuxt.options.alias["@nuxt/content/nitro"] = resolve("./runtime/server/content-compat");
1956
+ nuxt.options.alias["#link-checker/content-v3-nitro-path"] = resolve(dirname(resolveModule("@nuxt/content")), "runtime/nitro");
1957
+ }
1777
1958
  nuxt.options.nitro.alias["#link-checker/content-provider"] = resolve("./runtime/server/providers/content-v3");
1778
- nuxt.options.alias["#sitemap/content-v3-nitro-path"] = resolve(dirname(resolveModule("@nuxt/content")), "runtime/nitro");
1779
1959
  } else {
1780
1960
  nuxt.options.nitro.alias["#link-checker/content-provider"] = resolve("./runtime/server/providers/content-v2");
1781
1961
  }
@@ -1796,10 +1976,6 @@ const module = defineNuxtModule({
1796
1976
  setupDevToolsUI(config, resolve);
1797
1977
  }
1798
1978
  if (config.runOnBuild) {
1799
- const isRenderingAllRoutes = isNuxtGenerate(nuxt) && !nuxt.options.nitro.prerender?.crawlLinks;
1800
- if (!nuxt.options._prepare && !nuxt.options.dev && nuxt.options.build && !isRenderingAllRoutes) {
1801
- config.skipInspections.push("no-error-response");
1802
- }
1803
1979
  prerender(config, version);
1804
1980
  }
1805
1981
  }
@@ -1,35 +1,27 @@
1
- <script setup lang="ts">
2
- import type { Ref } from 'vue'
3
- import type { NuxtLinkCheckerClient } from '../../../types'
4
- import { computed, ref } from 'vue'
5
- import Squiggle from './Squiggle.vue'
6
- import { useEventListener } from './utils'
7
-
8
- const props = defineProps<{
9
- client: NuxtLinkCheckerClient
10
- highlightedLink: Ref<string | null>
11
- inspections: NuxtLinkCheckerClient['inspectionEls']
12
- }>()
13
-
14
- function openDevtools(link: string) {
15
- return props.client.openDevtoolsToLink(link)
1
+ <script setup>
2
+ import { computed, ref } from "vue";
3
+ import Squiggle from "./Squiggle.vue";
4
+ import { useEventListener } from "./utils";
5
+ const props = defineProps({
6
+ client: { type: Object, required: true },
7
+ highlightedLink: { type: Object, required: true },
8
+ inspections: { type: Object, required: true }
9
+ });
10
+ function openDevtools(link) {
11
+ return props.client.openDevtoolsToLink(link);
16
12
  }
17
-
18
- const renderKey = ref(0)
19
-
13
+ const renderKey = ref(0);
20
14
  if (import.meta.hot) {
21
- import.meta.hot.on('vite:afterUpdate', () => {
22
- renderKey.value++
23
- })
15
+ import.meta.hot.on("vite:afterUpdate", () => {
16
+ renderKey.value++;
17
+ });
24
18
  }
25
-
26
- useEventListener(window, 'resize', () => {
27
- renderKey.value++
28
- })
29
-
19
+ useEventListener(window, "resize", () => {
20
+ renderKey.value++;
21
+ });
30
22
  const showInspections = computed(() => {
31
- return props.client.showInspections.value
32
- })
23
+ return props.client.showInspections.value;
24
+ });
33
25
  </script>
34
26
 
35
27
  <template>
@@ -0,0 +1,9 @@
1
+ import type { Ref } from 'vue';
2
+ import type { NuxtLinkCheckerClient } from '../../../types.js';
3
+ type __VLS_Props = {
4
+ client: NuxtLinkCheckerClient;
5
+ highlightedLink: Ref<string | null>;
6
+ inspections: NuxtLinkCheckerClient['inspectionEls'];
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -1,28 +1,24 @@
1
- <script lang="ts" setup>
2
- import { onMounted, ref, watchEffect } from '#imports'
3
-
4
- const props = defineProps<{
5
- el: Element
6
- color: string
7
- highlighted: boolean
8
- }>()
9
-
10
- defineEmits(['click'])
11
-
12
- const box = ref({ x: 0, y: 0, width: 0, height: 0 })
13
- const position = ref({ top: '0px', left: '0px', width: '0px' })
14
-
1
+ <script setup>
2
+ import { onMounted, ref, watchEffect } from "#imports";
3
+ const props = defineProps({
4
+ el: { type: null, required: true },
5
+ color: { type: String, required: true },
6
+ highlighted: { type: Boolean, required: true }
7
+ });
8
+ defineEmits(["click"]);
9
+ const box = ref({ x: 0, y: 0, width: 0, height: 0 });
10
+ const position = ref({ top: "0px", left: "0px", width: "0px" });
15
11
  onMounted(() => {
16
- box.value = props.el.getBoundingClientRect()
12
+ box.value = props.el.getBoundingClientRect();
17
13
  watchEffect(() => {
18
- const { x, y, width, height } = box.value
14
+ const { x, y, width, height } = box.value;
19
15
  position.value = {
20
16
  top: `${document.documentElement.scrollTop + y + height}px`,
21
17
  left: `${x}px`,
22
- width: `${width}px`,
23
- }
24
- })
25
- })
18
+ width: `${width}px`
19
+ };
20
+ });
21
+ });
26
22
  </script>
27
23
 
28
24
  <template>
@@ -0,0 +1,7 @@
1
+ type __VLS_Props = {
2
+ el: Element;
3
+ color: string;
4
+ highlighted: boolean;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ export default _default;
@@ -0,0 +1 @@
1
+ export declare const queryCollection: any;
@@ -0,0 +1,2 @@
1
+ import { queryCollectionWithEvent } from "#link-checker/content-v3-nitro-path";
2
+ export const queryCollection = queryCollectionWithEvent;
@@ -1,3 +1,7 @@
1
1
  import type { H3Event } from 'h3';
2
- declare const _default: (e: H3Event) => Promise<any>;
2
+ declare const _default: (e: H3Event) => Promise<{
3
+ link: never;
4
+ title: never;
5
+ file: never;
6
+ }[]>;
3
7
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import manifest from "#content/manifest";
2
- import { queryCollectionWithEvent } from "#sitemap/content-v3-nitro-path";
2
+ import { queryCollection } from "@nuxt/content/nitro";
3
3
  export default async (e) => {
4
4
  const collections = [];
5
5
  for (const collection in manifest) {
@@ -9,7 +9,7 @@ export default async (e) => {
9
9
  }
10
10
  const contentList = [];
11
11
  for (const collection of collections) {
12
- contentList.push(queryCollectionWithEvent(e, collection).select("id", "path", "title").where("path", "IS NOT NULL").all());
12
+ contentList.push(queryCollection(e, collection).select("id", "path", "title").where("path", "IS NOT NULL").all());
13
13
  }
14
14
  const results = await Promise.all(contentList);
15
15
  return results.flat().map((d) => {
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Partial<import("../../../types").LinkInspectionResult>[]>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Partial<import("../../../types.js").LinkInspectionResult>[]>>;
2
2
  export default _default;
@@ -1,24 +1,28 @@
1
+ interface LinkResponse {
2
+ status: number;
3
+ statusText: string;
4
+ headers: Record<string, any>;
5
+ }
1
6
  export declare function getLinkResponse({ link, timeout, fetchRemoteUrls, baseURL, isInStorage }: {
2
7
  link: string;
3
8
  baseURL?: string;
4
9
  timeout?: number;
5
10
  fetchRemoteUrls?: boolean;
6
11
  isInStorage: () => boolean;
7
- }): Promise<{
8
- status: number;
9
- statusText: string;
10
- headers: Record<string, any>;
11
- }>;
12
+ }): Promise<LinkResponse | null>;
12
13
  export declare function setLinkResponse(link: string, response: Promise<{
13
14
  status: number;
14
15
  statusText: string;
15
16
  headers: Record<string, any>;
16
17
  }>): void;
18
+ export declare function getResolvedLinkResponses(): Promise<Record<string, LinkResponse>>;
17
19
  export declare function crawlFetch(link: string, options?: {
18
20
  timeout?: number;
19
21
  baseURL?: string;
20
22
  }): Promise<{
21
23
  status: number;
22
24
  statusText: string;
23
- headers: Headers | {};
25
+ headers: Record<string, string>;
26
+ time: number;
24
27
  }>;
28
+ export {};