@reddoorla/maintenance 0.74.0 → 0.75.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.
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-XKOZUVK2.js";
22
22
  import {
23
23
  runAudits
24
- } from "./chunk-PERP7LSS.js";
24
+ } from "./chunk-TDG5Z5OT.js";
25
25
  import {
26
26
  siteLabel
27
27
  } from "./chunk-XXTZBPUY.js";
@@ -143,4 +143,4 @@ export {
143
143
  DEFAULT_INIT_STEPS,
144
144
  init
145
145
  };
146
- //# sourceMappingURL=chunk-KKL3RYFQ.js.map
146
+ //# sourceMappingURL=chunk-2AUUAJ5X.js.map
@@ -1398,19 +1398,25 @@ function summarizeBrowser(routes, links, familyCounts) {
1398
1398
  if (urls.length > 1) titleMetaProblems.push(`duplicate title "${t}": ${urls.join(" + ")}`);
1399
1399
  }
1400
1400
  const titleMetaOk = routes.length > 0 && titleMetaProblems.length === 0;
1401
+ const templateProblems = routes.flatMap(
1402
+ (r) => (r.leakedTemplateTokens ?? []).map((t) => `${r.url}: unsubstituted ${t}`)
1403
+ );
1404
+ const templateOk = templateProblems.length === 0;
1401
1405
  const engines = [...new Set(desktopChecks.map((d) => d.engine))];
1402
1406
  const devices = [...new Set(mobileChecks.map((m) => m.device))];
1403
1407
  const families = Object.entries(familyCounts).map(([f, n]) => f === "/" ? "/" : `${f} \xD7${n}`).join(", ");
1404
1408
  const firstOf = (xs, n) => xs.slice(0, n).join("; ") + (xs.length > n ? ` (+${xs.length - n} more)` : "");
1405
- const note = `${routes.length} routes (${families}); desktop ${engines.join("/") || "\u2014"}; mobile ${devices.join("/") || "\u2014"}; ${links.length} links, ${brokenLinks} broken` + (unreachableUrls.length > 0 ? `; unreachable: ${firstOf(unreachableUrls, 3)}` : "") + (titleMetaProblems.length > 0 ? `; title/meta: ${firstOf(titleMetaProblems, 3)}` : "") + (desktopFailures.length > 0 ? `; desktop failing: ${firstOf(desktopFailures, 3)}` : "") + (mobileFailures.length > 0 ? `; mobile failing: ${firstOf(mobileFailures, 3)}` : "") + (brokenLinkUrls.length > 0 ? `; broken: ${firstOf(brokenLinkUrls, 3)}` : "");
1409
+ const note = `${routes.length} routes (${families}); desktop ${engines.join("/") || "\u2014"}; mobile ${devices.join("/") || "\u2014"}; ${links.length} links, ${brokenLinks} broken` + (unreachableUrls.length > 0 ? `; unreachable: ${firstOf(unreachableUrls, 3)}` : "") + (titleMetaProblems.length > 0 ? `; title/meta: ${firstOf(titleMetaProblems, 3)}` : "") + (templateProblems.length > 0 ? `; template: ${firstOf(templateProblems, 3)}` : "") + (desktopFailures.length > 0 ? `; desktop failing: ${firstOf(desktopFailures, 3)}` : "") + (mobileFailures.length > 0 ? `; mobile failing: ${firstOf(mobileFailures, 3)}` : "") + (brokenLinkUrls.length > 0 ? `; broken: ${firstOf(brokenLinkUrls, 3)}` : "");
1406
1410
  return {
1407
1411
  desktopOk,
1408
1412
  mobileOk,
1409
1413
  linksOk,
1410
1414
  reachableOk,
1411
1415
  titleMetaOk,
1416
+ templateOk,
1412
1417
  unreachableUrls,
1413
1418
  titleMetaProblems,
1419
+ templateProblems,
1414
1420
  desktopFailures,
1415
1421
  mobileFailures,
1416
1422
  brokenLinkUrls,
@@ -1454,7 +1460,7 @@ async function browserAudit(ctx) {
1454
1460
  (v) => `${v.url}: first check saw ${v.firstStatus ?? "no response"}, plain re-fetch ${v.fetchedStatus}`
1455
1461
  );
1456
1462
  const note = summary.note + (cleared.length > 0 ? `; ${cleared.length} route(s) re-verified reachable by plain fetch after a browser-side challenge/flake` : "") + (excused.length > 0 ? `; ${excused.length} engine/device check(s) excused (challenge on a re-verified-reachable route)` : "") + (clearedLinks.length > 0 ? `; ${clearedLinks.length} link(s) re-verified ok by plain fetch after cooldown` : "");
1457
- const status = summary.desktopOk && summary.mobileOk && summary.linksOk ? "pass" : "warn";
1463
+ const status = summary.desktopOk && summary.mobileOk && summary.linksOk && summary.templateOk ? "pass" : "warn";
1458
1464
  return {
1459
1465
  audit: "browser",
1460
1466
  site: label,
@@ -1534,6 +1540,7 @@ async function defaultBrowserRunner() {
1534
1540
  let status = null;
1535
1541
  let title = null;
1536
1542
  let metaDescription = null;
1543
+ let leakedTemplateTokens = [];
1537
1544
  for (let i = 0; i < desktopEngines.length; i++) {
1538
1545
  const engine = desktopEngines[i].engine;
1539
1546
  const browser = browsers[i];
@@ -1565,6 +1572,10 @@ async function defaultBrowserRunner() {
1565
1572
  } catch {
1566
1573
  }
1567
1574
  }
1575
+ const html = resp ? await resp.text().catch(() => "") : "";
1576
+ leakedTemplateTokens = [
1577
+ ...new Set(html.match(/%sveltekit\.[a-zA-Z0-9_.]+%/g) ?? [])
1578
+ ];
1568
1579
  }
1569
1580
  } catch {
1570
1581
  ok = false;
@@ -1590,8 +1601,9 @@ async function defaultBrowserRunner() {
1590
1601
  timeout: PAGE_TIMEOUT_MS
1591
1602
  });
1592
1603
  navStatus = resp ? resp.status() : null;
1604
+ const hasMain = await page.locator("main, [role=main]").first().isVisible().catch(() => false);
1593
1605
  const overflow = await page.evaluate("document.documentElement.scrollWidth > window.innerWidth + 2").catch(() => true);
1594
- ok = !!resp && resp.ok() && errors.length === 0 && !overflow;
1606
+ ok = !!resp && resp.ok() && errors.length === 0 && !overflow && hasMain;
1595
1607
  } catch {
1596
1608
  ok = false;
1597
1609
  } finally {
@@ -1607,7 +1619,8 @@ async function defaultBrowserRunner() {
1607
1619
  links: [...linkSet],
1608
1620
  status,
1609
1621
  title,
1610
- metaDescription
1622
+ metaDescription,
1623
+ leakedTemplateTokens
1611
1624
  });
1612
1625
  }
1613
1626
  } finally {
@@ -2146,4 +2159,4 @@ export {
2146
2159
  runAudits,
2147
2160
  runAuditsAcross
2148
2161
  };
2149
- //# sourceMappingURL=chunk-PERP7LSS.js.map
2162
+ //# sourceMappingURL=chunk-TDG5Z5OT.js.map