@decocms/parity 0.35.0 → 0.35.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 (2) hide show
  1. package/dist/cli.js +22 -14
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -117561,10 +117561,12 @@ function capBody(issue, run) {
117561
117561
  if (issue.expected)
117562
117562
  lines.push("", "## Esperado", issue.expected);
117563
117563
  const DETAILS = "\x00details\x00";
117564
+ const REPRO = "\x00repro\x00";
117565
+ const HINT = "\x00hint\x00";
117564
117566
  if (issue.details)
117565
117567
  lines.push("", DETAILS);
117566
117568
  if (issue.reproduction)
117567
- lines.push("", "## Como reproduzir", issue.reproduction);
117569
+ lines.push("", "## Como reproduzir", REPRO);
117568
117570
  const media = (issue.evidence ?? []).filter((e) => (e.kind === "screenshot" || e.kind === "video") && e.path);
117569
117571
  if (media.length) {
117570
117572
  lines.push("", "## Evidência");
@@ -117577,23 +117579,29 @@ function capBody(issue, run) {
117577
117579
  }
117578
117580
  }
117579
117581
  if (issue.suggestedFix)
117580
- lines.push("", "## Pista de correção", issue.suggestedFix);
117582
+ lines.push("", "## Pista de correção", HINT);
117581
117583
  lines.push("", "## Como verificar", issue.verify ?? `Com o build de produção (local: \`build\` + \`preview\`, não o dev server; na revisão: o preview do PR), abrir ${pagePath ? new URL(pagePath, run.url).pathname : "a mesma página"} e confirmar que o observado acima não acontece mais. Colar no card o que foi checado.`);
117582
117584
  lines.push("", `_${run.source ?? "parity sweep"} ${run.runId} · ${run.timestamp.slice(0, 10)}_`);
117583
117585
  const skeleton = lines.join(`
117584
117586
  `);
117585
- const details = issue.details ?? "";
117586
- const body = skeleton.replace(DETAILS, details);
117587
- if (body.length <= CARD_BODY_MAX)
117588
- return body;
117589
- const more = `…(cortado — detalhes completos em ${run.reportHtml ?? `parity-output/runs/${run.runId}/report.html`})`;
117590
- const room = CARD_BODY_MAX - (skeleton.length - DETAILS.length) - more.length - 1;
117591
- if (room > 80)
117592
- return skeleton.replace(DETAILS, `${details.slice(0, room)}
117593
- ${more}`);
117594
- return `${body.slice(0, CARD_BODY_MAX - more.length - 2)}
117595
-
117596
- ${more}`;
117587
+ const parts = [
117588
+ [DETAILS, issue.details ?? ""],
117589
+ [HINT, issue.suggestedFix ?? ""],
117590
+ [REPRO, issue.reproduction ?? ""]
117591
+ ];
117592
+ const full = parts.reduce((t, [k, v]) => t.replace(k, v), skeleton);
117593
+ if (full.length <= CARD_BODY_MAX)
117594
+ return full;
117595
+ const more = run.reportHtml ? `…(cortado — completo em ${run.reportHtml})` : "…(cortado)";
117596
+ let room = CARD_BODY_MAX - parts.reduce((t, [k]) => skeleton.includes(k) ? t - k.length : t, skeleton.length);
117597
+ const kept = new Map;
117598
+ for (const [k, v] of [...parts].reverse()) {
117599
+ const fit = v.length <= room ? v : room > 80 ? `${v.slice(0, room - more.length - 1)}
117600
+ ${more}` : room >= more.length ? more : "";
117601
+ kept.set(k, fit);
117602
+ room = Math.max(0, room - fit.length);
117603
+ }
117604
+ return parts.reduce((t, [k]) => t.replace(k, kept.get(k) ?? ""), skeleton);
117597
117605
  }
117598
117606
  function specSection(issue, run) {
117599
117607
  const spec = (issue.evidence ?? []).find((e) => e.kind === "spec");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/parity",
3
- "version": "0.35.0",
3
+ "version": "0.35.1",
4
4
  "description": "E2E parity validator for site migrations. Compares prod vs cand and reports UI, functional, SEO, visual, and Web Vitals deltas with an LLM-ranked HTML report.",
5
5
  "type": "module",
6
6
  "license": "MIT",