@decocms/parity 0.26.1 → 0.26.2
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 +428 -20
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -37840,6 +37840,7 @@ function snapshotDom(html3) {
|
|
|
37840
37840
|
meta,
|
|
37841
37841
|
imageStats,
|
|
37842
37842
|
decoSectionsRendered: [...new Set(decoSectionsRendered)],
|
|
37843
|
+
decoSectionsOrder: decoSectionsRendered,
|
|
37843
37844
|
skeletonCount
|
|
37844
37845
|
};
|
|
37845
37846
|
}
|
|
@@ -48785,6 +48786,100 @@ function diffSitemap(prodUrls, candUrls) {
|
|
|
48785
48786
|
};
|
|
48786
48787
|
}
|
|
48787
48788
|
|
|
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
|
+
|
|
48788
48883
|
// src/checks/banner-aspect-ratio.ts
|
|
48789
48884
|
var ASPECT_RATIO_TOLERANCE = 0.15;
|
|
48790
48885
|
function bannerAspectRatio(ctx) {
|
|
@@ -49322,7 +49417,7 @@ async function faviconParity(ctx) {
|
|
|
49322
49417
|
const prodHome = pickHome(ctx.prodPages);
|
|
49323
49418
|
const candHome = pickHome(ctx.candPages);
|
|
49324
49419
|
if (!candHome) {
|
|
49325
|
-
return
|
|
49420
|
+
return skip2(start, "Nenhuma captura de home do candidato — nada para validar");
|
|
49326
49421
|
}
|
|
49327
49422
|
if (!prodHome) {
|
|
49328
49423
|
const cand2 = extractIcons(candHome);
|
|
@@ -49414,7 +49509,7 @@ function pickHome(pages) {
|
|
|
49414
49509
|
}
|
|
49415
49510
|
});
|
|
49416
49511
|
}
|
|
49417
|
-
function
|
|
49512
|
+
function skip2(start, summary) {
|
|
49418
49513
|
return {
|
|
49419
49514
|
name: "favicon-parity",
|
|
49420
49515
|
status: "skipped",
|
|
@@ -50418,11 +50513,11 @@ async function ssrNoJs(ctx) {
|
|
|
50418
50513
|
const issues = [];
|
|
50419
50514
|
const candHome = pickHome5(ctx.candPages);
|
|
50420
50515
|
if (!candHome) {
|
|
50421
|
-
return
|
|
50516
|
+
return skip3(start, "Nenhuma captura de home do candidato");
|
|
50422
50517
|
}
|
|
50423
50518
|
const candText = await fetchSsrText(candHome.finalUrl);
|
|
50424
50519
|
if (candText === null) {
|
|
50425
|
-
return
|
|
50520
|
+
return skip3(start, "Não foi possível baixar o HTML SSR do candidato");
|
|
50426
50521
|
}
|
|
50427
50522
|
const prodHome = pickHome5(ctx.prodPages);
|
|
50428
50523
|
const prodText = prodHome ? await fetchSsrText(prodHome.finalUrl) : null;
|
|
@@ -50477,7 +50572,7 @@ function pickHome5(pages) {
|
|
|
50477
50572
|
}
|
|
50478
50573
|
});
|
|
50479
50574
|
}
|
|
50480
|
-
function
|
|
50575
|
+
function skip3(start, summary) {
|
|
50481
50576
|
return {
|
|
50482
50577
|
name: "ssr-no-js",
|
|
50483
50578
|
status: "skipped",
|
|
@@ -51515,6 +51610,80 @@ function buildPairEvidence2(p, c) {
|
|
|
51515
51610
|
return out;
|
|
51516
51611
|
}
|
|
51517
51612
|
|
|
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
|
+
|
|
51518
51687
|
// src/checks/search-autocomplete.ts
|
|
51519
51688
|
function searchAutocomplete(ctx) {
|
|
51520
51689
|
const start = Date.now();
|
|
@@ -51810,6 +51979,64 @@ function searchResults(ctx) {
|
|
|
51810
51979
|
};
|
|
51811
51980
|
}
|
|
51812
51981
|
|
|
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
|
+
|
|
51813
52040
|
// src/diff/robots.ts
|
|
51814
52041
|
async function fetchRobots(baseUrl, timeoutMs = 1e4) {
|
|
51815
52042
|
const controller = new AbortController;
|
|
@@ -52623,6 +52850,99 @@ function hydrationDuringNavIssue(viewport, side, count, step) {
|
|
|
52623
52850
|
};
|
|
52624
52851
|
}
|
|
52625
52852
|
|
|
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
|
+
|
|
52626
52946
|
// src/checks/visual-regression.ts
|
|
52627
52947
|
import { existsSync as existsSync8, mkdirSync as mkdirSync8 } from "node:fs";
|
|
52628
52948
|
import { basename, join as join12 } from "node:path";
|
|
@@ -53450,7 +53770,11 @@ var ALL_CHECKS = [
|
|
|
53450
53770
|
faviconParity,
|
|
53451
53771
|
fontParity,
|
|
53452
53772
|
ssrNoJs,
|
|
53453
|
-
navLinksHealth
|
|
53773
|
+
navLinksHealth,
|
|
53774
|
+
redirectsParity,
|
|
53775
|
+
thirdPartyScriptsParity,
|
|
53776
|
+
analyticsBeaconParity,
|
|
53777
|
+
sectionOrderParity
|
|
53454
53778
|
];
|
|
53455
53779
|
var ALL_CHECKS_BY_NAME = {
|
|
53456
53780
|
"http-status-parity": httpStatusParity,
|
|
@@ -53486,7 +53810,11 @@ var ALL_CHECKS_BY_NAME = {
|
|
|
53486
53810
|
"favicon-parity": faviconParity,
|
|
53487
53811
|
"font-parity": fontParity,
|
|
53488
53812
|
"ssr-no-js": ssrNoJs,
|
|
53489
|
-
"nav-links-health": navLinksHealth
|
|
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
|
|
53490
53818
|
};
|
|
53491
53819
|
var FLOW_DEPENDENT_CHECKS = new Set([
|
|
53492
53820
|
"purchase-journey-flow",
|
|
@@ -53568,7 +53896,8 @@ var MODULES = {
|
|
|
53568
53896
|
"nav-links-health",
|
|
53569
53897
|
"favicon-parity",
|
|
53570
53898
|
"plp-pagination",
|
|
53571
|
-
"http-status-parity"
|
|
53899
|
+
"http-status-parity",
|
|
53900
|
+
"redirects-parity"
|
|
53572
53901
|
],
|
|
53573
53902
|
flows: ["homepage", "plp", "pdp"],
|
|
53574
53903
|
needsSitemapPages: true
|
|
@@ -53608,14 +53937,15 @@ var MODULES = {
|
|
|
53608
53937
|
"image-loading-health",
|
|
53609
53938
|
"picture-missing-dims",
|
|
53610
53939
|
"font-parity",
|
|
53611
|
-
"ssr-no-js"
|
|
53940
|
+
"ssr-no-js",
|
|
53941
|
+
"section-order-parity"
|
|
53612
53942
|
],
|
|
53613
53943
|
flows: ["homepage", "plp", "pdp"]
|
|
53614
53944
|
},
|
|
53615
53945
|
network: {
|
|
53616
53946
|
name: "network",
|
|
53617
53947
|
description: "Network request summary delta (counts, sizes, failures) between prod and cand",
|
|
53618
|
-
checks: ["network-summary-delta"],
|
|
53948
|
+
checks: ["network-summary-delta", "third-party-scripts-parity", "analytics-beacon-parity"],
|
|
53619
53949
|
flows: ["homepage", "plp", "pdp"]
|
|
53620
53950
|
}
|
|
53621
53951
|
};
|
|
@@ -54574,7 +54904,7 @@ function renderVitalsPanel(run) {
|
|
|
54574
54904
|
continue;
|
|
54575
54905
|
for (const p of fc.pages) {
|
|
54576
54906
|
const v = p.vitals;
|
|
54577
|
-
const pageKey = humanKey(`${
|
|
54907
|
+
const pageKey = humanKey(`${pathOf4(p.url)}::${p.viewport}`);
|
|
54578
54908
|
const sideLabel = p.side;
|
|
54579
54909
|
rows.push({ page: pageKey, viewport: p.viewport, metric: "LCP", prod: 0, cand: 0 });
|
|
54580
54910
|
rows.push({ page: pageKey, viewport: p.viewport, metric: "FCP", prod: 0, cand: 0 });
|
|
@@ -54589,7 +54919,7 @@ function renderVitalsPanel(run) {
|
|
|
54589
54919
|
if (fc.viewport !== "mobile")
|
|
54590
54920
|
continue;
|
|
54591
54921
|
for (const p of fc.pages) {
|
|
54592
|
-
const key =
|
|
54922
|
+
const key = pathOf4(p.url);
|
|
54593
54923
|
const entry = pageVitals.get(key) ?? { viewport: p.viewport };
|
|
54594
54924
|
if (p.side === "prod") {
|
|
54595
54925
|
entry.prod = p.vitals;
|
|
@@ -54772,7 +55102,7 @@ function formatVital2(v, unit) {
|
|
|
54772
55102
|
return v.toFixed(3);
|
|
54773
55103
|
return `${v.toFixed(0)}ms`;
|
|
54774
55104
|
}
|
|
54775
|
-
function
|
|
55105
|
+
function pathOf4(url) {
|
|
54776
55106
|
try {
|
|
54777
55107
|
return new URL(url).pathname || "/";
|
|
54778
55108
|
} catch {
|
|
@@ -54789,7 +55119,7 @@ function renderPagesTable2(run) {
|
|
|
54789
55119
|
continue;
|
|
54790
55120
|
seen.add(k);
|
|
54791
55121
|
rows.push({
|
|
54792
|
-
key: humanKey(`${
|
|
55122
|
+
key: humanKey(`${pathOf4(p.url)}::${p.viewport}`),
|
|
54793
55123
|
viewport: p.viewport,
|
|
54794
55124
|
side: p.side,
|
|
54795
55125
|
status: String(p.status),
|
|
@@ -54827,7 +55157,7 @@ function renderNetworkPanel(run) {
|
|
|
54827
55157
|
baseUrl = p.url;
|
|
54828
55158
|
candEntries.push(...p.network);
|
|
54829
55159
|
if (p.network.length > 0) {
|
|
54830
|
-
perPage.push({ label: `${
|
|
55160
|
+
perPage.push({ label: `${pathOf4(p.url)} · ${p.viewport}`, entries: p.network });
|
|
54831
55161
|
}
|
|
54832
55162
|
}
|
|
54833
55163
|
}
|
|
@@ -55396,7 +55726,7 @@ function buildSideBySidePairs(run) {
|
|
|
55396
55726
|
if (fc.side !== side || fc.viewport !== "mobile")
|
|
55397
55727
|
continue;
|
|
55398
55728
|
for (const p of fc.pages) {
|
|
55399
|
-
const path =
|
|
55729
|
+
const path = pathOf4(p.url);
|
|
55400
55730
|
if (path === "/" || path === "")
|
|
55401
55731
|
continue;
|
|
55402
55732
|
const role = classifyPath(path, !seenNonHome);
|
|
@@ -63049,6 +63379,83 @@ Each detected component → a FastStore section:
|
|
|
63049
63379
|
Use the suggested selectors (per component, mapped to known commerce keys) to
|
|
63050
63380
|
seed Playwright/Cypress smoke tests on the migrated store.`;
|
|
63051
63381
|
|
|
63382
|
+
// src/migrate/targets/faststore-next.ts
|
|
63383
|
+
var faststoreNext = `## Target: FastStore Next
|
|
63384
|
+
|
|
63385
|
+
Next.js App Router on \`@faststore/api\`/\`sdk\`/\`ui\` — no \`@faststore/cli\`/\`core\`,
|
|
63386
|
+
Deco CMS decofiles as the content source. This is a DIFFERENT target from
|
|
63387
|
+
\`faststore-v4\` (which scaffolds \`@faststore/cli\` + the VTEX Headless CMS) —
|
|
63388
|
+
don't mix their playbooks. Load \`skills/target-faststore-next/SKILL.md\` for
|
|
63389
|
+
the full picture; this is the condensed version.
|
|
63390
|
+
|
|
63391
|
+
### Bootstrap
|
|
63392
|
+
- Scaffold by copying \`deco-sites/faststore-next-template\` (clone, copy the
|
|
63393
|
+
tree, re-init git, set the new remote) — NOT the bare FastStore starter.
|
|
63394
|
+
It ships the platform layer (PLP pagination/ISR, gradual-cutover proxy,
|
|
63395
|
+
native Synerise+VTEX-fallback search, WebOps deploy accommodations) —
|
|
63396
|
+
reinventing any of those from scratch is exactly what the template exists
|
|
63397
|
+
to avoid.
|
|
63398
|
+
- \`bun dev\` — localhost:3000 · \`bun run build\` — prod build (runs \`generate\`
|
|
63399
|
+
first) · \`bun run generate:deco\` — after adding/changing a section,
|
|
63400
|
+
restart dev after.
|
|
63401
|
+
- Set \`discovery.config.js\`'s \`api.storeId\` (public, client-bundled — not a
|
|
63402
|
+
secret) to the source VTEX account (the \`*.vtexassets.com\` subdomain in
|
|
63403
|
+
\`blocks.json\`, or the account id from \`window.__RUNTIME__\` on a live
|
|
63404
|
+
vtex-io source).
|
|
63405
|
+
|
|
63406
|
+
### Styling — Tailwind v4, not SCSS
|
|
63407
|
+
No \`--fs-*\` token contract (that's the other target). A starter
|
|
63408
|
+
\`@theme\` block was generated in this snapshot from the extracted brand
|
|
63409
|
+
tokens — merge it into the template's own \`src/styles/tailwind.css\`
|
|
63410
|
+
\`@theme inline\` block rather than adding a second token layer. Token map
|
|
63411
|
+
used: primary/secondary/text/background colors, body/heading fonts, one
|
|
63412
|
+
mid-scale radius, first shadow, and the four nearest-canonical breakpoint
|
|
63413
|
+
tiers (phone/tablet/notebook/desktop) picked from the extracted breakpoint
|
|
63414
|
+
list.
|
|
63415
|
+
|
|
63416
|
+
### Icons
|
|
63417
|
+
Sprite-based (\`public/sprites-v2.svg\` + the template's \`Icon\` component,
|
|
63418
|
+
a typed union in \`icons.ts\`) — not Phosphor, not per-icon SVG files. Add
|
|
63419
|
+
missing icons to the sprite + the union type.
|
|
63420
|
+
|
|
63421
|
+
### Brand assets
|
|
63422
|
+
Logo/favicon downloaded to \`assets/\` in this snapshot — the template ships
|
|
63423
|
+
a generic placeholder at \`public/brand/logo-placeholder.svg\`; replace it
|
|
63424
|
+
and wire it into \`src/components/header/{Desktop,Mobile}Header.tsx\`.
|
|
63425
|
+
|
|
63426
|
+
### Where components go — this target's 3-point-invariant equivalent
|
|
63427
|
+
Every section needs all three or the CMS silently drops it:
|
|
63428
|
+
1. The component in \`src/components/sections/<Path>/<Name>.tsx\` — its typed
|
|
63429
|
+
\`Props\` export IS the CMS schema (no separate \`.jsonc\` to hand-write).
|
|
63430
|
+
2. The shim in \`src/sections/<Path>.tsx\` — thin re-export,
|
|
63431
|
+
\`export { default } from "src/components/sections/<Path>/<Name>"\`, plus
|
|
63432
|
+
convention exports (\`sync\`, \`layout\`, \`cache\`, …). The file's PATH is
|
|
63433
|
+
the Studio block key.
|
|
63434
|
+
3. \`bun run generate:deco\` to regenerate \`.deco/*.gen.*\`.
|
|
63435
|
+
Global vs page-scoped: \`layout = true\` sections (Header/Footer) resolve
|
|
63436
|
+
once and cache across navigations; everything else is page content.
|
|
63437
|
+
|
|
63438
|
+
### Editability gate (check every ported section)
|
|
63439
|
+
Does it read from its decofile, or did the port hardcode the captured
|
|
63440
|
+
content into JSX? Trivial/empty \`Props\` or literal strings >~25 chars in
|
|
63441
|
+
the component body means a merchant can't edit it in Studio — visually
|
|
63442
|
+
identical to prod, but a CMS regression \`parity\`'s screenshot/HTML diff
|
|
63443
|
+
cannot see.
|
|
63444
|
+
|
|
63445
|
+
### Rendering — decide this BEFORE porting the first section
|
|
63446
|
+
CMS data renders SSR; product/search data renders CSR when the site uses a
|
|
63447
|
+
third-party search provider (its requests are shopper-session-dependent and
|
|
63448
|
+
browser-only). This is an architecture decision made once, up front — do
|
|
63449
|
+
not let \`parity\` flag the resulting SSR/CSR delta as a regression against
|
|
63450
|
+
a source that server-rendered products.
|
|
63451
|
+
|
|
63452
|
+
### Deploy
|
|
63453
|
+
WebOps builds straight from \`discovery.config.js\` + \`package.json\`
|
|
63454
|
+
scripts — no CLI, no deploy workflow to create. Two accommodations that
|
|
63455
|
+
look wrong to a generic Node reviewer but are load-bearing: build-time
|
|
63456
|
+
tooling sits in \`dependencies\` (WebOps production installs skip
|
|
63457
|
+
\`devDependencies\`), and branch names can't contain a second \`/\`.`;
|
|
63458
|
+
|
|
63052
63459
|
// src/migrate/targets/tanstack-deco.ts
|
|
63053
63460
|
var tanstackDeco = `## Target: TanStack Start + Deco CMS
|
|
63054
63461
|
|
|
@@ -63089,6 +63496,7 @@ writing raw GraphQL/REST. Key hooks: \`useCart\`, \`useUser\`, \`useProduct\`.
|
|
|
63089
63496
|
var TARGETS = {
|
|
63090
63497
|
faststore,
|
|
63091
63498
|
"faststore-v4": faststore,
|
|
63499
|
+
"faststore-next": faststoreNext,
|
|
63092
63500
|
tanstack: tanstackDeco,
|
|
63093
63501
|
"tanstack-deco": tanstackDeco
|
|
63094
63502
|
};
|
|
@@ -66550,7 +66958,7 @@ function extractVitalsSlice(run) {
|
|
|
66550
66958
|
for (const p of fc.pages) {
|
|
66551
66959
|
if (!p.vitals)
|
|
66552
66960
|
continue;
|
|
66553
|
-
const k = `${p.side}::${p.viewport}::${
|
|
66961
|
+
const k = `${p.side}::${p.viewport}::${pathOf5(p.url)}`;
|
|
66554
66962
|
out[k] = p.vitalsFullPage ? { ...p.vitals, fullPage: p.vitalsFullPage } : p.vitals;
|
|
66555
66963
|
}
|
|
66556
66964
|
}
|
|
@@ -66595,8 +67003,8 @@ function extractSideBySideSlice(run) {
|
|
|
66595
67003
|
for (const p of fc.pages) {
|
|
66596
67004
|
if (p.side !== "prod")
|
|
66597
67005
|
continue;
|
|
66598
|
-
const candPath =
|
|
66599
|
-
const cand = fc.pages.find((q) => q.side === "cand" &&
|
|
67006
|
+
const candPath = pathOf5(p.url);
|
|
67007
|
+
const cand = fc.pages.find((q) => q.side === "cand" && pathOf5(q.url) === candPath && q.viewport === p.viewport);
|
|
66600
67008
|
if (!cand)
|
|
66601
67009
|
continue;
|
|
66602
67010
|
pairs.push({
|
|
@@ -66609,7 +67017,7 @@ function extractSideBySideSlice(run) {
|
|
|
66609
67017
|
}
|
|
66610
67018
|
return pairs;
|
|
66611
67019
|
}
|
|
66612
|
-
function
|
|
67020
|
+
function pathOf5(url) {
|
|
66613
67021
|
try {
|
|
66614
67022
|
return new URL(url).pathname || "/";
|
|
66615
67023
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/parity",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
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",
|