@decocms/parity 0.26.2 → 0.26.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/cli.js +20 -350
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -37840,7 +37840,6 @@ function snapshotDom(html3) {
|
|
|
37840
37840
|
meta,
|
|
37841
37841
|
imageStats,
|
|
37842
37842
|
decoSectionsRendered: [...new Set(decoSectionsRendered)],
|
|
37843
|
-
decoSectionsOrder: decoSectionsRendered,
|
|
37844
37843
|
skeletonCount
|
|
37845
37844
|
};
|
|
37846
37845
|
}
|
|
@@ -48786,100 +48785,6 @@ function diffSitemap(prodUrls, candUrls) {
|
|
|
48786
48785
|
};
|
|
48787
48786
|
}
|
|
48788
48787
|
|
|
48789
|
-
// src/checks/analytics-beacon-parity.ts
|
|
48790
|
-
var BEACON_PATTERNS = [
|
|
48791
|
-
{
|
|
48792
|
-
id: "gtm-container",
|
|
48793
|
-
label: "Google Tag Manager (gtm.js)",
|
|
48794
|
-
match: (u) => /googletagmanager\.com\/gtm\.js/.test(u)
|
|
48795
|
-
},
|
|
48796
|
-
{
|
|
48797
|
-
id: "gtag-js",
|
|
48798
|
-
label: "Google gtag.js / Google Ads",
|
|
48799
|
-
match: (u) => /googletagmanager\.com\/gtag\/js/.test(u)
|
|
48800
|
-
},
|
|
48801
|
-
{
|
|
48802
|
-
id: "ga4-collect",
|
|
48803
|
-
label: "GA4 collect beacon",
|
|
48804
|
-
match: (u) => /google-analytics\.com\/g\/collect|analytics\.google\.com\/g\/collect/.test(u)
|
|
48805
|
-
},
|
|
48806
|
-
{
|
|
48807
|
-
id: "meta-pixel",
|
|
48808
|
-
label: "Meta (Facebook) Pixel",
|
|
48809
|
-
match: (u) => /connect\.facebook\.(net|com)\/.*\/fbevents\.js|facebook\.com\/tr\//.test(u)
|
|
48810
|
-
},
|
|
48811
|
-
{
|
|
48812
|
-
id: "tiktok-pixel",
|
|
48813
|
-
label: "TikTok Pixel",
|
|
48814
|
-
match: (u) => /analytics\.tiktok\.com\/i18n\/pixel/.test(u)
|
|
48815
|
-
},
|
|
48816
|
-
{
|
|
48817
|
-
id: "pinterest-tag",
|
|
48818
|
-
label: "Pinterest Tag",
|
|
48819
|
-
match: (u) => /ct\.pinterest\.com\/v3/.test(u)
|
|
48820
|
-
}
|
|
48821
|
-
];
|
|
48822
|
-
function analyticsBeaconParity(ctx) {
|
|
48823
|
-
const start = Date.now();
|
|
48824
|
-
if (ctx.prodPages.length === 0) {
|
|
48825
|
-
return skip(start, "sem baseline prod — nada para comparar (single-site)");
|
|
48826
|
-
}
|
|
48827
|
-
const { pairs } = pairCaptures(ctx.prodPages, ctx.candPages);
|
|
48828
|
-
const issues = [];
|
|
48829
|
-
let pairsWithAnyBeacon = 0;
|
|
48830
|
-
for (const pair of pairs) {
|
|
48831
|
-
const prodHits = detectedBeacons(pair.prod);
|
|
48832
|
-
const candHits = detectedBeacons(pair.cand);
|
|
48833
|
-
if (prodHits.size === 0 && candHits.size === 0)
|
|
48834
|
-
continue;
|
|
48835
|
-
pairsWithAnyBeacon++;
|
|
48836
|
-
for (const pattern of BEACON_PATTERNS) {
|
|
48837
|
-
const inProd = prodHits.has(pattern.id);
|
|
48838
|
-
const inCand = candHits.has(pattern.id);
|
|
48839
|
-
if (inProd && !inCand) {
|
|
48840
|
-
issues.push({
|
|
48841
|
-
id: `analytics-beacon:missing:${pattern.id}:${pair.key}`,
|
|
48842
|
-
severity: "high",
|
|
48843
|
-
category: "network",
|
|
48844
|
-
page: pair.key,
|
|
48845
|
-
check: "analytics-beacon-parity",
|
|
48846
|
-
summary: `${pattern.label} disparou em prod mas não no candidato em ${pair.key}`,
|
|
48847
|
-
suggestedFix: "Confirme o container/pixel ID no candidato — tag manager ausente derruba TODO o rastreamento a jusante dele, não só este evento."
|
|
48848
|
-
});
|
|
48849
|
-
}
|
|
48850
|
-
}
|
|
48851
|
-
}
|
|
48852
|
-
const hasHigh = issues.some((i) => i.severity === "high");
|
|
48853
|
-
return {
|
|
48854
|
-
name: "analytics-beacon-parity",
|
|
48855
|
-
status: hasHigh ? "fail" : issues.length > 0 ? "warn" : "pass",
|
|
48856
|
-
severity: "high",
|
|
48857
|
-
durationMs: Date.now() - start,
|
|
48858
|
-
summary: pairsWithAnyBeacon === 0 ? "Nenhum beacon de analytics conhecido observado em nenhum dos lados — nada a validar (ou o site usa uma ferramenta fora da lista de padrões)" : `${issues.length} beacon(s) de analytics perdido(s) em ${pairsWithAnyBeacon} página(s) com tráfego de analytics`,
|
|
48859
|
-
issues
|
|
48860
|
-
};
|
|
48861
|
-
}
|
|
48862
|
-
function detectedBeacons(page) {
|
|
48863
|
-
const hits = new Set;
|
|
48864
|
-
for (const entry of page.network) {
|
|
48865
|
-
for (const pattern of BEACON_PATTERNS) {
|
|
48866
|
-
if (pattern.match(entry.url))
|
|
48867
|
-
hits.add(pattern.id);
|
|
48868
|
-
}
|
|
48869
|
-
}
|
|
48870
|
-
return hits;
|
|
48871
|
-
}
|
|
48872
|
-
function skip(start, summary) {
|
|
48873
|
-
return {
|
|
48874
|
-
name: "analytics-beacon-parity",
|
|
48875
|
-
status: "skipped",
|
|
48876
|
-
severity: "high",
|
|
48877
|
-
durationMs: Date.now() - start,
|
|
48878
|
-
summary,
|
|
48879
|
-
issues: []
|
|
48880
|
-
};
|
|
48881
|
-
}
|
|
48882
|
-
|
|
48883
48788
|
// src/checks/banner-aspect-ratio.ts
|
|
48884
48789
|
var ASPECT_RATIO_TOLERANCE = 0.15;
|
|
48885
48790
|
function bannerAspectRatio(ctx) {
|
|
@@ -49417,7 +49322,7 @@ async function faviconParity(ctx) {
|
|
|
49417
49322
|
const prodHome = pickHome(ctx.prodPages);
|
|
49418
49323
|
const candHome = pickHome(ctx.candPages);
|
|
49419
49324
|
if (!candHome) {
|
|
49420
|
-
return
|
|
49325
|
+
return skip(start, "Nenhuma captura de home do candidato — nada para validar");
|
|
49421
49326
|
}
|
|
49422
49327
|
if (!prodHome) {
|
|
49423
49328
|
const cand2 = extractIcons(candHome);
|
|
@@ -49509,7 +49414,7 @@ function pickHome(pages) {
|
|
|
49509
49414
|
}
|
|
49510
49415
|
});
|
|
49511
49416
|
}
|
|
49512
|
-
function
|
|
49417
|
+
function skip(start, summary) {
|
|
49513
49418
|
return {
|
|
49514
49419
|
name: "favicon-parity",
|
|
49515
49420
|
status: "skipped",
|
|
@@ -50513,11 +50418,11 @@ async function ssrNoJs(ctx) {
|
|
|
50513
50418
|
const issues = [];
|
|
50514
50419
|
const candHome = pickHome5(ctx.candPages);
|
|
50515
50420
|
if (!candHome) {
|
|
50516
|
-
return
|
|
50421
|
+
return skip2(start, "Nenhuma captura de home do candidato");
|
|
50517
50422
|
}
|
|
50518
50423
|
const candText = await fetchSsrText(candHome.finalUrl);
|
|
50519
50424
|
if (candText === null) {
|
|
50520
|
-
return
|
|
50425
|
+
return skip2(start, "Não foi possível baixar o HTML SSR do candidato");
|
|
50521
50426
|
}
|
|
50522
50427
|
const prodHome = pickHome5(ctx.prodPages);
|
|
50523
50428
|
const prodText = prodHome ? await fetchSsrText(prodHome.finalUrl) : null;
|
|
@@ -50572,7 +50477,7 @@ function pickHome5(pages) {
|
|
|
50572
50477
|
}
|
|
50573
50478
|
});
|
|
50574
50479
|
}
|
|
50575
|
-
function
|
|
50480
|
+
function skip2(start, summary) {
|
|
50576
50481
|
return {
|
|
50577
50482
|
name: "ssr-no-js",
|
|
50578
50483
|
status: "skipped",
|
|
@@ -51610,80 +51515,6 @@ function buildPairEvidence2(p, c) {
|
|
|
51610
51515
|
return out;
|
|
51611
51516
|
}
|
|
51612
51517
|
|
|
51613
|
-
// src/checks/redirects-parity.ts
|
|
51614
|
-
function redirectsParity(ctx) {
|
|
51615
|
-
const start = Date.now();
|
|
51616
|
-
if (ctx.prodPages.length === 0) {
|
|
51617
|
-
return skip4(start, "sem baseline prod — nada para comparar (single-site)");
|
|
51618
|
-
}
|
|
51619
|
-
const { pairs } = pairCaptures(ctx.prodPages, ctx.candPages);
|
|
51620
|
-
const issues = [];
|
|
51621
|
-
let redirectsChecked = 0;
|
|
51622
|
-
for (const pair of pairs) {
|
|
51623
|
-
const prodRedirected = didRedirect(pair.prod.url, pair.prod.finalUrl);
|
|
51624
|
-
if (!prodRedirected)
|
|
51625
|
-
continue;
|
|
51626
|
-
redirectsChecked++;
|
|
51627
|
-
const candRedirected = didRedirect(pair.cand.url, pair.cand.finalUrl);
|
|
51628
|
-
if (!candRedirected) {
|
|
51629
|
-
issues.push({
|
|
51630
|
-
id: `redirect:not-preserved:${pair.key}`,
|
|
51631
|
-
severity: "high",
|
|
51632
|
-
category: "seo",
|
|
51633
|
-
page: pair.key,
|
|
51634
|
-
check: "redirects-parity",
|
|
51635
|
-
summary: `prod redireciona ${pair.key} para ${pathOf3(pair.prod.finalUrl)}, candidato não redireciona (serve o próprio caminho)`,
|
|
51636
|
-
suggestedFix: "Confirme se a tabela de redirects legada foi migrada para este caminho."
|
|
51637
|
-
});
|
|
51638
|
-
continue;
|
|
51639
|
-
}
|
|
51640
|
-
const prodDest = pathOf3(pair.prod.finalUrl);
|
|
51641
|
-
const candDest = pathOf3(pair.cand.finalUrl);
|
|
51642
|
-
if (prodDest !== candDest) {
|
|
51643
|
-
issues.push({
|
|
51644
|
-
id: `redirect:destination-diff:${pair.key}`,
|
|
51645
|
-
severity: "medium",
|
|
51646
|
-
category: "seo",
|
|
51647
|
-
page: pair.key,
|
|
51648
|
-
check: "redirects-parity",
|
|
51649
|
-
summary: `Destino de redirect diverge em ${pair.key}: prod→${prodDest} cand→${candDest}`,
|
|
51650
|
-
inconclusive: true
|
|
51651
|
-
});
|
|
51652
|
-
}
|
|
51653
|
-
}
|
|
51654
|
-
return {
|
|
51655
|
-
name: "redirects-parity",
|
|
51656
|
-
status: issues.some((i) => i.severity === "high") ? "fail" : issues.length > 0 ? "warn" : "pass",
|
|
51657
|
-
severity: "high",
|
|
51658
|
-
durationMs: Date.now() - start,
|
|
51659
|
-
summary: redirectsChecked === 0 ? "prod não redirecionou nenhuma das páginas capturadas — nada a validar" : `${redirectsChecked} redirect(s) de prod verificado(s), ${issues.length} divergência(s)`,
|
|
51660
|
-
issues
|
|
51661
|
-
};
|
|
51662
|
-
}
|
|
51663
|
-
function didRedirect(requested, final) {
|
|
51664
|
-
if (!requested || !final)
|
|
51665
|
-
return false;
|
|
51666
|
-
return pathOf3(requested) !== pathOf3(final);
|
|
51667
|
-
}
|
|
51668
|
-
function pathOf3(url) {
|
|
51669
|
-
try {
|
|
51670
|
-
const u = new URL(url);
|
|
51671
|
-
return u.pathname.replace(/\/+$/, "") || "/";
|
|
51672
|
-
} catch {
|
|
51673
|
-
return url;
|
|
51674
|
-
}
|
|
51675
|
-
}
|
|
51676
|
-
function skip4(start, summary) {
|
|
51677
|
-
return {
|
|
51678
|
-
name: "redirects-parity",
|
|
51679
|
-
status: "skipped",
|
|
51680
|
-
severity: "high",
|
|
51681
|
-
durationMs: Date.now() - start,
|
|
51682
|
-
summary,
|
|
51683
|
-
issues: []
|
|
51684
|
-
};
|
|
51685
|
-
}
|
|
51686
|
-
|
|
51687
51518
|
// src/checks/search-autocomplete.ts
|
|
51688
51519
|
function searchAutocomplete(ctx) {
|
|
51689
51520
|
const start = Date.now();
|
|
@@ -51979,64 +51810,6 @@ function searchResults(ctx) {
|
|
|
51979
51810
|
};
|
|
51980
51811
|
}
|
|
51981
51812
|
|
|
51982
|
-
// src/checks/section-order-parity.ts
|
|
51983
|
-
function sectionOrderParity(ctx) {
|
|
51984
|
-
const start = Date.now();
|
|
51985
|
-
if (ctx.prodPages.length === 0) {
|
|
51986
|
-
return skip5(start, "sem baseline prod — nada para comparar (single-site)");
|
|
51987
|
-
}
|
|
51988
|
-
const { pairs } = pairCaptures(ctx.prodPages, ctx.candPages);
|
|
51989
|
-
const issues = [];
|
|
51990
|
-
for (const pair of pairs) {
|
|
51991
|
-
if (!pair.prod.html || !pair.cand.html)
|
|
51992
|
-
continue;
|
|
51993
|
-
const prodOrder = snapshotDom(pair.prod.html).decoSectionsOrder;
|
|
51994
|
-
const candOrder = snapshotDom(pair.cand.html).decoSectionsOrder;
|
|
51995
|
-
if (prodOrder.length === 0 || candOrder.length === 0)
|
|
51996
|
-
continue;
|
|
51997
|
-
if (prodOrder.length !== candOrder.length)
|
|
51998
|
-
continue;
|
|
51999
|
-
const sameSet = new Set(prodOrder).size === new Set(candOrder).size && prodOrder.every((s) => candOrder.includes(s));
|
|
52000
|
-
if (!sameSet)
|
|
52001
|
-
continue;
|
|
52002
|
-
const sameOrder = prodOrder.every((s, i) => s === candOrder[i]);
|
|
52003
|
-
if (sameOrder)
|
|
52004
|
-
continue;
|
|
52005
|
-
issues.push({
|
|
52006
|
-
id: `section-order:${pair.key}`,
|
|
52007
|
-
severity: "medium",
|
|
52008
|
-
category: "functional",
|
|
52009
|
-
page: pair.key,
|
|
52010
|
-
check: "section-order-parity",
|
|
52011
|
-
summary: `Seções na mesma página em ordem diferente em ${pair.key}`,
|
|
52012
|
-
details: `prod: ${prodOrder.join(" → ")}
|
|
52013
|
-
cand: ${candOrder.join(" → ")}`,
|
|
52014
|
-
evidence: [
|
|
52015
|
-
{ kind: "screenshot", path: pair.prod.screenshotPath, label: "prod" },
|
|
52016
|
-
{ kind: "screenshot", path: pair.cand.screenshotPath, label: "cand" }
|
|
52017
|
-
]
|
|
52018
|
-
});
|
|
52019
|
-
}
|
|
52020
|
-
return {
|
|
52021
|
-
name: "section-order-parity",
|
|
52022
|
-
status: issues.length > 0 ? "warn" : "pass",
|
|
52023
|
-
severity: "medium",
|
|
52024
|
-
durationMs: Date.now() - start,
|
|
52025
|
-
summary: issues.length > 0 ? `${issues.length} página(s) com seções reordenadas` : "Ordem das seções consistente entre prod e cand",
|
|
52026
|
-
issues
|
|
52027
|
-
};
|
|
52028
|
-
}
|
|
52029
|
-
function skip5(start, summary) {
|
|
52030
|
-
return {
|
|
52031
|
-
name: "section-order-parity",
|
|
52032
|
-
status: "skipped",
|
|
52033
|
-
severity: "medium",
|
|
52034
|
-
durationMs: Date.now() - start,
|
|
52035
|
-
summary,
|
|
52036
|
-
issues: []
|
|
52037
|
-
};
|
|
52038
|
-
}
|
|
52039
|
-
|
|
52040
51813
|
// src/diff/robots.ts
|
|
52041
51814
|
async function fetchRobots(baseUrl, timeoutMs = 1e4) {
|
|
52042
51815
|
const controller = new AbortController;
|
|
@@ -52850,99 +52623,6 @@ function hydrationDuringNavIssue(viewport, side, count, step) {
|
|
|
52850
52623
|
};
|
|
52851
52624
|
}
|
|
52852
52625
|
|
|
52853
|
-
// src/checks/third-party-scripts-parity.ts
|
|
52854
|
-
function thirdPartyScriptsParity(ctx) {
|
|
52855
|
-
const start = Date.now();
|
|
52856
|
-
if (ctx.prodPages.length === 0) {
|
|
52857
|
-
return skip6(start, "sem baseline prod — nada para comparar (single-site)");
|
|
52858
|
-
}
|
|
52859
|
-
const { pairs } = pairCaptures(ctx.prodPages, ctx.candPages);
|
|
52860
|
-
const issues = [];
|
|
52861
|
-
let pairsChecked = 0;
|
|
52862
|
-
for (const pair of pairs) {
|
|
52863
|
-
if (pair.prod.network.length === 0 && pair.cand.network.length === 0)
|
|
52864
|
-
continue;
|
|
52865
|
-
pairsChecked++;
|
|
52866
|
-
const prodOrigins = thirdPartyOrigins(pair.prod);
|
|
52867
|
-
const candOrigins = thirdPartyOrigins(pair.cand);
|
|
52868
|
-
const missing = [...prodOrigins].filter((o) => !candOrigins.has(o)).sort();
|
|
52869
|
-
const added = [...candOrigins].filter((o) => !prodOrigins.has(o)).sort();
|
|
52870
|
-
if (missing.length > 0) {
|
|
52871
|
-
issues.push({
|
|
52872
|
-
id: `3p-scripts:missing:${pair.key}`,
|
|
52873
|
-
severity: "high",
|
|
52874
|
-
category: "network",
|
|
52875
|
-
page: pair.key,
|
|
52876
|
-
check: "third-party-scripts-parity",
|
|
52877
|
-
summary: `${missing.length} origem(ns) de terceiro presente(s) em prod mas ausente(s) no candidato em ${pair.key}`,
|
|
52878
|
-
details: missing.join(`
|
|
52879
|
-
`),
|
|
52880
|
-
suggestedFix: "Confirme se o script foi migrado deliberadamente ou se a tag (GTM, pixel, chat, avaliações, etc.) foi perdida na porta."
|
|
52881
|
-
});
|
|
52882
|
-
}
|
|
52883
|
-
if (added.length > 0) {
|
|
52884
|
-
issues.push({
|
|
52885
|
-
id: `3p-scripts:added:${pair.key}`,
|
|
52886
|
-
severity: "low",
|
|
52887
|
-
category: "network",
|
|
52888
|
-
page: pair.key,
|
|
52889
|
-
check: "third-party-scripts-parity",
|
|
52890
|
-
summary: `${added.length} origem(ns) de terceiro nova(s) no candidato (ausente em prod) em ${pair.key}`,
|
|
52891
|
-
details: added.join(`
|
|
52892
|
-
`),
|
|
52893
|
-
inconclusive: true
|
|
52894
|
-
});
|
|
52895
|
-
}
|
|
52896
|
-
}
|
|
52897
|
-
const hasHigh = issues.some((i) => i.severity === "high");
|
|
52898
|
-
return {
|
|
52899
|
-
name: "third-party-scripts-parity",
|
|
52900
|
-
status: hasHigh ? "fail" : issues.length > 0 ? "warn" : "pass",
|
|
52901
|
-
severity: "high",
|
|
52902
|
-
durationMs: Date.now() - start,
|
|
52903
|
-
summary: pairsChecked === 0 ? "Nenhuma página com tráfego de rede capturado" : `${issues.length} divergência(s) de terceiros em ${pairsChecked} página(s)`,
|
|
52904
|
-
issues
|
|
52905
|
-
};
|
|
52906
|
-
}
|
|
52907
|
-
function registrableDomain(hostname) {
|
|
52908
|
-
const parts = hostname.split(".");
|
|
52909
|
-
return parts.length <= 2 ? hostname : parts.slice(-2).join(".");
|
|
52910
|
-
}
|
|
52911
|
-
function thirdPartyOrigins(page) {
|
|
52912
|
-
let pageHost;
|
|
52913
|
-
try {
|
|
52914
|
-
pageHost = new URL(page.finalUrl || page.url).hostname;
|
|
52915
|
-
} catch {
|
|
52916
|
-
return new Set;
|
|
52917
|
-
}
|
|
52918
|
-
const pageDomain = registrableDomain(pageHost);
|
|
52919
|
-
const origins = new Set;
|
|
52920
|
-
for (const entry of page.network) {
|
|
52921
|
-
let host;
|
|
52922
|
-
try {
|
|
52923
|
-
host = new URL(entry.url).hostname;
|
|
52924
|
-
} catch {
|
|
52925
|
-
continue;
|
|
52926
|
-
}
|
|
52927
|
-
if (!host)
|
|
52928
|
-
continue;
|
|
52929
|
-
if (registrableDomain(host) === pageDomain)
|
|
52930
|
-
continue;
|
|
52931
|
-
origins.add(host);
|
|
52932
|
-
}
|
|
52933
|
-
return origins;
|
|
52934
|
-
}
|
|
52935
|
-
function skip6(start, summary) {
|
|
52936
|
-
return {
|
|
52937
|
-
name: "third-party-scripts-parity",
|
|
52938
|
-
status: "skipped",
|
|
52939
|
-
severity: "high",
|
|
52940
|
-
durationMs: Date.now() - start,
|
|
52941
|
-
summary,
|
|
52942
|
-
issues: []
|
|
52943
|
-
};
|
|
52944
|
-
}
|
|
52945
|
-
|
|
52946
52626
|
// src/checks/visual-regression.ts
|
|
52947
52627
|
import { existsSync as existsSync8, mkdirSync as mkdirSync8 } from "node:fs";
|
|
52948
52628
|
import { basename, join as join12 } from "node:path";
|
|
@@ -53770,11 +53450,7 @@ var ALL_CHECKS = [
|
|
|
53770
53450
|
faviconParity,
|
|
53771
53451
|
fontParity,
|
|
53772
53452
|
ssrNoJs,
|
|
53773
|
-
navLinksHealth
|
|
53774
|
-
redirectsParity,
|
|
53775
|
-
thirdPartyScriptsParity,
|
|
53776
|
-
analyticsBeaconParity,
|
|
53777
|
-
sectionOrderParity
|
|
53453
|
+
navLinksHealth
|
|
53778
53454
|
];
|
|
53779
53455
|
var ALL_CHECKS_BY_NAME = {
|
|
53780
53456
|
"http-status-parity": httpStatusParity,
|
|
@@ -53810,11 +53486,7 @@ var ALL_CHECKS_BY_NAME = {
|
|
|
53810
53486
|
"favicon-parity": faviconParity,
|
|
53811
53487
|
"font-parity": fontParity,
|
|
53812
53488
|
"ssr-no-js": ssrNoJs,
|
|
53813
|
-
"nav-links-health": navLinksHealth
|
|
53814
|
-
"redirects-parity": redirectsParity,
|
|
53815
|
-
"third-party-scripts-parity": thirdPartyScriptsParity,
|
|
53816
|
-
"analytics-beacon-parity": analyticsBeaconParity,
|
|
53817
|
-
"section-order-parity": sectionOrderParity
|
|
53489
|
+
"nav-links-health": navLinksHealth
|
|
53818
53490
|
};
|
|
53819
53491
|
var FLOW_DEPENDENT_CHECKS = new Set([
|
|
53820
53492
|
"purchase-journey-flow",
|
|
@@ -53896,8 +53568,7 @@ var MODULES = {
|
|
|
53896
53568
|
"nav-links-health",
|
|
53897
53569
|
"favicon-parity",
|
|
53898
53570
|
"plp-pagination",
|
|
53899
|
-
"http-status-parity"
|
|
53900
|
-
"redirects-parity"
|
|
53571
|
+
"http-status-parity"
|
|
53901
53572
|
],
|
|
53902
53573
|
flows: ["homepage", "plp", "pdp"],
|
|
53903
53574
|
needsSitemapPages: true
|
|
@@ -53937,15 +53608,14 @@ var MODULES = {
|
|
|
53937
53608
|
"image-loading-health",
|
|
53938
53609
|
"picture-missing-dims",
|
|
53939
53610
|
"font-parity",
|
|
53940
|
-
"ssr-no-js"
|
|
53941
|
-
"section-order-parity"
|
|
53611
|
+
"ssr-no-js"
|
|
53942
53612
|
],
|
|
53943
53613
|
flows: ["homepage", "plp", "pdp"]
|
|
53944
53614
|
},
|
|
53945
53615
|
network: {
|
|
53946
53616
|
name: "network",
|
|
53947
53617
|
description: "Network request summary delta (counts, sizes, failures) between prod and cand",
|
|
53948
|
-
checks: ["network-summary-delta"
|
|
53618
|
+
checks: ["network-summary-delta"],
|
|
53949
53619
|
flows: ["homepage", "plp", "pdp"]
|
|
53950
53620
|
}
|
|
53951
53621
|
};
|
|
@@ -54904,7 +54574,7 @@ function renderVitalsPanel(run) {
|
|
|
54904
54574
|
continue;
|
|
54905
54575
|
for (const p of fc.pages) {
|
|
54906
54576
|
const v = p.vitals;
|
|
54907
|
-
const pageKey = humanKey(`${
|
|
54577
|
+
const pageKey = humanKey(`${pathOf3(p.url)}::${p.viewport}`);
|
|
54908
54578
|
const sideLabel = p.side;
|
|
54909
54579
|
rows.push({ page: pageKey, viewport: p.viewport, metric: "LCP", prod: 0, cand: 0 });
|
|
54910
54580
|
rows.push({ page: pageKey, viewport: p.viewport, metric: "FCP", prod: 0, cand: 0 });
|
|
@@ -54919,7 +54589,7 @@ function renderVitalsPanel(run) {
|
|
|
54919
54589
|
if (fc.viewport !== "mobile")
|
|
54920
54590
|
continue;
|
|
54921
54591
|
for (const p of fc.pages) {
|
|
54922
|
-
const key =
|
|
54592
|
+
const key = pathOf3(p.url);
|
|
54923
54593
|
const entry = pageVitals.get(key) ?? { viewport: p.viewport };
|
|
54924
54594
|
if (p.side === "prod") {
|
|
54925
54595
|
entry.prod = p.vitals;
|
|
@@ -55102,7 +54772,7 @@ function formatVital2(v, unit) {
|
|
|
55102
54772
|
return v.toFixed(3);
|
|
55103
54773
|
return `${v.toFixed(0)}ms`;
|
|
55104
54774
|
}
|
|
55105
|
-
function
|
|
54775
|
+
function pathOf3(url) {
|
|
55106
54776
|
try {
|
|
55107
54777
|
return new URL(url).pathname || "/";
|
|
55108
54778
|
} catch {
|
|
@@ -55119,7 +54789,7 @@ function renderPagesTable2(run) {
|
|
|
55119
54789
|
continue;
|
|
55120
54790
|
seen.add(k);
|
|
55121
54791
|
rows.push({
|
|
55122
|
-
key: humanKey(`${
|
|
54792
|
+
key: humanKey(`${pathOf3(p.url)}::${p.viewport}`),
|
|
55123
54793
|
viewport: p.viewport,
|
|
55124
54794
|
side: p.side,
|
|
55125
54795
|
status: String(p.status),
|
|
@@ -55157,7 +54827,7 @@ function renderNetworkPanel(run) {
|
|
|
55157
54827
|
baseUrl = p.url;
|
|
55158
54828
|
candEntries.push(...p.network);
|
|
55159
54829
|
if (p.network.length > 0) {
|
|
55160
|
-
perPage.push({ label: `${
|
|
54830
|
+
perPage.push({ label: `${pathOf3(p.url)} · ${p.viewport}`, entries: p.network });
|
|
55161
54831
|
}
|
|
55162
54832
|
}
|
|
55163
54833
|
}
|
|
@@ -55726,7 +55396,7 @@ function buildSideBySidePairs(run) {
|
|
|
55726
55396
|
if (fc.side !== side || fc.viewport !== "mobile")
|
|
55727
55397
|
continue;
|
|
55728
55398
|
for (const p of fc.pages) {
|
|
55729
|
-
const path =
|
|
55399
|
+
const path = pathOf3(p.url);
|
|
55730
55400
|
if (path === "/" || path === "")
|
|
55731
55401
|
continue;
|
|
55732
55402
|
const role = classifyPath(path, !seenNonHome);
|
|
@@ -66958,7 +66628,7 @@ function extractVitalsSlice(run) {
|
|
|
66958
66628
|
for (const p of fc.pages) {
|
|
66959
66629
|
if (!p.vitals)
|
|
66960
66630
|
continue;
|
|
66961
|
-
const k = `${p.side}::${p.viewport}::${
|
|
66631
|
+
const k = `${p.side}::${p.viewport}::${pathOf4(p.url)}`;
|
|
66962
66632
|
out[k] = p.vitalsFullPage ? { ...p.vitals, fullPage: p.vitalsFullPage } : p.vitals;
|
|
66963
66633
|
}
|
|
66964
66634
|
}
|
|
@@ -67003,8 +66673,8 @@ function extractSideBySideSlice(run) {
|
|
|
67003
66673
|
for (const p of fc.pages) {
|
|
67004
66674
|
if (p.side !== "prod")
|
|
67005
66675
|
continue;
|
|
67006
|
-
const candPath =
|
|
67007
|
-
const cand = fc.pages.find((q) => q.side === "cand" &&
|
|
66676
|
+
const candPath = pathOf4(p.url);
|
|
66677
|
+
const cand = fc.pages.find((q) => q.side === "cand" && pathOf4(q.url) === candPath && q.viewport === p.viewport);
|
|
67008
66678
|
if (!cand)
|
|
67009
66679
|
continue;
|
|
67010
66680
|
pairs.push({
|
|
@@ -67017,7 +66687,7 @@ function extractSideBySideSlice(run) {
|
|
|
67017
66687
|
}
|
|
67018
66688
|
return pairs;
|
|
67019
66689
|
}
|
|
67020
|
-
function
|
|
66690
|
+
function pathOf4(url) {
|
|
67021
66691
|
try {
|
|
67022
66692
|
return new URL(url).pathname || "/";
|
|
67023
66693
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/parity",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.3",
|
|
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",
|