@decocms/parity 0.35.18 → 0.35.20

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 +38 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -81013,6 +81013,18 @@ function redirectsParity(ctx) {
81013
81013
  });
81014
81014
  continue;
81015
81015
  }
81016
+ const dropped = droppedQueryParams(pair.prod, pair.cand);
81017
+ if (dropped.length > 0) {
81018
+ issues.push({
81019
+ id: `redirect:query-dropped:${pair.key}`,
81020
+ severity: "medium",
81021
+ category: "seo",
81022
+ page: pair.key,
81023
+ check: "redirects-parity",
81024
+ summary: `Redirect de ${pair.key} perde a query no candidato: ${dropped.join(", ")} (prod mantém no destino)`,
81025
+ suggestedFix: "Repasse a query string da URL pedida ao destino do redirect (filtros e atribuição de campanha dependem dela)."
81026
+ });
81027
+ }
81016
81028
  const prodDest = pathOf3(pair.prod.finalUrl);
81017
81029
  const candDest = pathOf3(pair.cand.finalUrl);
81018
81030
  if (prodDest !== candDest) {
@@ -81027,15 +81039,40 @@ function redirectsParity(ctx) {
81027
81039
  });
81028
81040
  }
81029
81041
  }
81042
+ if (redirectsChecked === 0) {
81043
+ return skip3(start, "prod não redirecionou nenhuma das páginas capturadas — nada a validar");
81044
+ }
81030
81045
  return {
81031
81046
  name: "redirects-parity",
81032
81047
  status: issues.some((i) => i.severity === "high") ? "fail" : issues.length > 0 ? "warn" : "pass",
81033
81048
  severity: "high",
81034
81049
  durationMs: Date.now() - start,
81035
- 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)`,
81050
+ summary: `${redirectsChecked} redirect(s) de prod verificado(s), ${issues.length} divergência(s)`,
81036
81051
  issues
81037
81052
  };
81038
81053
  }
81054
+ function droppedQueryParams(prod, cand) {
81055
+ const requested = paramsOf(prod.url);
81056
+ const prodKept = paramsOf(prod.finalUrl);
81057
+ const candKept = paramsOf(cand.finalUrl);
81058
+ const dropped = [];
81059
+ for (const [key, value] of requested) {
81060
+ if (!prodKept.getAll(key).includes(value))
81061
+ continue;
81062
+ if (candKept.getAll(key).includes(value))
81063
+ continue;
81064
+ if (!dropped.includes(key))
81065
+ dropped.push(key);
81066
+ }
81067
+ return dropped;
81068
+ }
81069
+ function paramsOf(url) {
81070
+ try {
81071
+ return new URL(url).searchParams;
81072
+ } catch {
81073
+ return new URLSearchParams;
81074
+ }
81075
+ }
81039
81076
  function didRedirect(requested, final) {
81040
81077
  if (!requested || !final)
81041
81078
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/parity",
3
- "version": "0.35.18",
3
+ "version": "0.35.20",
4
4
  "description": "E2E parity validator for site migrations. Compares prod vs cand and reports UI, functional, SEO, visual, and Web Vitals deltas with a ranked HTML report.",
5
5
  "type": "module",
6
6
  "license": "MIT",