@decocms/parity 0.23.7 → 0.25.0

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/CHANGELOG.md CHANGED
@@ -5,6 +5,54 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [0.25.0] — 2026-08-20
9
+
10
+ ### Added
11
+
12
+ * **Stacked-PR fix mode (`budget.stackPrs`).** The `fix` phase can now chain fix
13
+ PRs instead of merging them: each fix branches off the PREVIOUS fix's branch
14
+ (`fixer` takes a `base_branch` and opens the PR with `gh pr create --base`), so
15
+ the **top of the stack accumulates every fix and its per-PR preview deploy
16
+ shows all fixes together** — one combined preview to review before landing
17
+ anything. Nothing is merged; a new `stack-review` terminal reports the ordered
18
+ stack + the top PR's preview URL and hands off (merge bottom-up, delete
19
+ branches last). Default stays **merge mode** (independent PRs off `main`, one
20
+ at a time, with the `fix → parity` re-score loop). Set at `discovery` when the
21
+ user asks to stack fixes / see one preview with all fixes / not auto-merge.
22
+ Orchestration-only change — no CLI behavior change (version kept in lockstep).
23
+
24
+ ## [0.24.0] — 2026-08-20
25
+
26
+ ### Added
27
+
28
+ * **Live-capture sanitization (`sanitizeDetectedComponents`).** `parity migrate`
29
+ against a live-only site (no source repo — e.g. a VTEX IO storefront) used to
30
+ emit DOM plumbing as migratable components: `main-wrapper`, `portal-root`,
31
+ `overlay-container`, `modal-overlay`/`modal-dialog`, plus a separate row for
32
+ every spelling of the same shell (`header` + `site-header`; `navigation-menu` +
33
+ `main-navigation` + `navigation-mega-menu`; `footer` + `site-footer` +
34
+ `footer-content`). A post-detect pass now (1) drops roles built entirely from
35
+ structural-wrapper tokens and (2) canonicalizes global synonyms to one
36
+ `header`/`nav`/`footer` each — so `isGlobalRole` scopes them correctly and the
37
+ plan stops listing ~11 phantom/duplicate components. Content in a wrapper
38
+ (`newsletter-modal`, `product-hero`) is preserved; only all-structural roles
39
+ are dropped. Runs for both the heuristic and the LLM-refine path.
40
+
41
+ ### Changed
42
+
43
+ * **Orchestrator: reconcile-only mode when the target already exists.** When
44
+ `scout` classifies the repo the user points at as an already-scaffolded
45
+ `faststore-v4`/`tanstack-deco` target, `repo-setup`/`template-bootstrap` are
46
+ now explicitly skipped (re-scaffolding would clobber real work) and the source
47
+ is the legacy live site. (`skills/migration-orchestrator`)
48
+ * **Discovery: never use the target's own staging as the parity `prod`.**
49
+ `find-prod-url` now rejects `*.vtex.app`/`*.myvtex.com`/`*.deco.site`/
50
+ `*.workers.dev` hosts (that's the candidate, not the legacy source), scans
51
+ `.env(.example)` for a legacy-gateway URL, and flags locale/currency/country
52
+ config that disagrees with the live host's market. Reconcile guidance now
53
+ says to match plan rows to target sections by CONCEPT, not just string, so a
54
+ mature target isn't misread as ~2 done / 25 pending. (`skills/migration-discovery`)
55
+
8
56
  ## [Unreleased]
9
57
 
10
58
  ### Added
package/dist/cli.js CHANGED
@@ -58978,13 +58978,76 @@ async function detectComponents(page, opts) {
58978
58978
  const { refineComponentsWithLlm: refineComponentsWithLlm2 } = await Promise.resolve().then(() => (init_component_refine(), exports_component_refine));
58979
58979
  const refined = await refineComponentsWithLlm2(page, components);
58980
58980
  if (refined)
58981
- return refined;
58981
+ return sanitizeDetectedComponents(refined);
58982
58982
  }
58983
- return components;
58983
+ return sanitizeDetectedComponents(components);
58984
58984
  }
58985
58985
  function isComponentDetectionLlmAvailable() {
58986
58986
  return isUnderstandingAvailable();
58987
58987
  }
58988
+ var STRUCTURAL_TOKENS = new Set([
58989
+ "wrapper",
58990
+ "container",
58991
+ "root",
58992
+ "overlay",
58993
+ "portal",
58994
+ "backdrop",
58995
+ "modal",
58996
+ "dialog",
58997
+ "layout",
58998
+ "main",
58999
+ "site",
59000
+ "page",
59001
+ "app",
59002
+ "body",
59003
+ "inner",
59004
+ "outer",
59005
+ "scroll",
59006
+ "sticky",
59007
+ "shell",
59008
+ "region",
59009
+ "content"
59010
+ ]);
59011
+ var HEADER_SYNONYMS = new Set(["header", "masthead"]);
59012
+ var FOOTER_SYNONYMS = new Set(["footer"]);
59013
+ var NAV_SYNONYMS = new Set(["nav", "navbar", "navigation", "menu", "megamenu", "mega"]);
59014
+ function roleTokens(role) {
59015
+ return role.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
59016
+ }
59017
+ function isStructuralJunkRole(role) {
59018
+ const tokens = roleTokens(role);
59019
+ if (tokens.length === 0)
59020
+ return true;
59021
+ return tokens.every((t) => STRUCTURAL_TOKENS.has(t) || /^\d+$/.test(t));
59022
+ }
59023
+ function canonicalRole(role) {
59024
+ const meaningful = roleTokens(role).filter((t) => !STRUCTURAL_TOKENS.has(t));
59025
+ if (meaningful.length === 0)
59026
+ return role;
59027
+ if (meaningful.every((t) => HEADER_SYNONYMS.has(t)))
59028
+ return "header";
59029
+ if (meaningful.every((t) => FOOTER_SYNONYMS.has(t)))
59030
+ return "footer";
59031
+ if (meaningful.every((t) => NAV_SYNONYMS.has(t)))
59032
+ return "nav";
59033
+ return role;
59034
+ }
59035
+ function sanitizeDetectedComponents(components) {
59036
+ const seenGlobal = new Set;
59037
+ const out = [];
59038
+ for (const c of components) {
59039
+ if (isStructuralJunkRole(c.role))
59040
+ continue;
59041
+ const role = canonicalRole(c.role);
59042
+ if (role === "header" || role === "footer" || role === "nav") {
59043
+ if (seenGlobal.has(role))
59044
+ continue;
59045
+ seenGlobal.add(role);
59046
+ }
59047
+ out.push(role === c.role ? c : { ...c, role });
59048
+ }
59049
+ return out;
59050
+ }
58988
59051
  function dedupeByContainment(candidates) {
58989
59052
  const valid = candidates.filter((c) => c.rect.width > 0 && c.rect.height > 0);
58990
59053
  const sorted = [...valid].sort((a, b) => boxArea(b.rect) - boxArea(a.rect));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/parity",
3
- "version": "0.23.7",
3
+ "version": "0.25.0",
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",