@riddledc/riddle-proof 0.7.89 → 0.7.91
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/README.md +23 -0
- package/dist/{chunk-CEBHV23V.js → chunk-2SGLFPFX.js} +517 -6
- package/dist/cli.cjs +548 -6
- package/dist/cli.js +32 -1
- package/dist/index.cjs +517 -6
- package/dist/index.js +1 -1
- package/dist/profile.cjs +517 -6
- package/dist/profile.d.cts +9 -1
- package/dist/profile.d.ts +9 -1
- package/dist/profile.js +1 -1
- package/dist/proof-run-core.d.cts +1 -1
- package/dist/proof-run-core.d.ts +1 -1
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
profileStatusExitCode,
|
|
11
11
|
resolveRiddleProofProfileTargetUrl,
|
|
12
12
|
resolveRiddleProofProfileTimeoutSec
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2SGLFPFX.js";
|
|
14
14
|
import {
|
|
15
15
|
createRiddleApiClient,
|
|
16
16
|
parseRiddleViewport
|
|
@@ -337,6 +337,10 @@ function profileResultMarkdown(result) {
|
|
|
337
337
|
if (routeInventorySummaryLines.length) {
|
|
338
338
|
lines.push("", "## Route Inventory", "", ...routeInventorySummaryLines);
|
|
339
339
|
}
|
|
340
|
+
const linkStatusSummaryLines = profileLinkStatusSummaryMarkdown(result);
|
|
341
|
+
if (linkStatusSummaryLines.length) {
|
|
342
|
+
lines.push("", "## Link Status", "", ...linkStatusSummaryLines);
|
|
343
|
+
}
|
|
340
344
|
const environmentBlockerLines = profileEnvironmentBlockerMarkdown(result);
|
|
341
345
|
if (environmentBlockerLines.length) {
|
|
342
346
|
lines.push("", "## Environment Blocker", "", ...environmentBlockerLines);
|
|
@@ -406,6 +410,13 @@ function profileCheckMarkdownTarget(check) {
|
|
|
406
410
|
if (selector && maxOverflow !== void 0) return `${markdownInlineCode(selector)} <= ${maxOverflow}px`;
|
|
407
411
|
return selector ? markdownInlineCode(selector) : maxOverflow !== void 0 ? `<= ${maxOverflow}px` : void 0;
|
|
408
412
|
}
|
|
413
|
+
if (check.type === "link_status" || check.type === "artifact_link_status") {
|
|
414
|
+
const expectedCount = cliFiniteNumber(evidence.expected_count);
|
|
415
|
+
const minCount = cliFiniteNumber(evidence.min_count);
|
|
416
|
+
if (selector && expectedCount !== void 0) return `${markdownInlineCode(selector)} links = ${expectedCount}`;
|
|
417
|
+
if (selector && minCount !== void 0) return `${markdownInlineCode(selector)} links >= ${minCount}`;
|
|
418
|
+
return selector ? markdownInlineCode(selector) : void 0;
|
|
419
|
+
}
|
|
409
420
|
if (check.type === "no_horizontal_overflow" || check.type === "no_mobile_horizontal_overflow") {
|
|
410
421
|
const maxOverflow = cliFiniteNumber(evidence.max_overflow_px);
|
|
411
422
|
return maxOverflow !== void 0 ? `<= ${maxOverflow}px` : void 0;
|
|
@@ -599,6 +610,26 @@ function profileRouteInventorySummaryMarkdown(result) {
|
|
|
599
610
|
}
|
|
600
611
|
return lines;
|
|
601
612
|
}
|
|
613
|
+
function profileLinkStatusSummaryMarkdown(result) {
|
|
614
|
+
const linkStatusChecks = result.checks.filter((check) => check.type === "link_status" || check.type === "artifact_link_status");
|
|
615
|
+
const lines = [];
|
|
616
|
+
for (const check of linkStatusChecks) {
|
|
617
|
+
const evidence = cliRecord(check.evidence);
|
|
618
|
+
if (!evidence) continue;
|
|
619
|
+
const label = check.label || check.type;
|
|
620
|
+
const selector = cliString(evidence.selector);
|
|
621
|
+
const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
|
|
622
|
+
const totals = viewports.map((viewport) => cliFiniteNumber(viewport.total_count)).filter((count) => count !== void 0);
|
|
623
|
+
const okTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.ok_count) || 0), 0);
|
|
624
|
+
const failedTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.failed_count) || 0), 0);
|
|
625
|
+
const truncatedTotal = viewports.filter((viewport) => viewport.truncated === true).length;
|
|
626
|
+
const countText = totals.length ? totals.join("/") : "unknown";
|
|
627
|
+
lines.push(
|
|
628
|
+
`- ${label}${selector ? ` ${markdownInlineCode(selector)}` : ""}: links ${countText}, ok ${okTotal}, failures ${failedTotal}${truncatedTotal ? `, truncated viewports ${truncatedTotal}` : ""}`
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
return lines;
|
|
632
|
+
}
|
|
602
633
|
function writeProfileOutput(outputDir, result) {
|
|
603
634
|
if (!outputDir) return;
|
|
604
635
|
mkdirSync(outputDir, { recursive: true });
|