@decocms/parity 0.23.7 → 0.24.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 +32 -0
- package/dist/cli.js +65 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,38 @@ 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.24.0] — 2026-08-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
* **Live-capture sanitization (`sanitizeDetectedComponents`).** `parity migrate`
|
|
13
|
+
against a live-only site (no source repo — e.g. a VTEX IO storefront) used to
|
|
14
|
+
emit DOM plumbing as migratable components: `main-wrapper`, `portal-root`,
|
|
15
|
+
`overlay-container`, `modal-overlay`/`modal-dialog`, plus a separate row for
|
|
16
|
+
every spelling of the same shell (`header` + `site-header`; `navigation-menu` +
|
|
17
|
+
`main-navigation` + `navigation-mega-menu`; `footer` + `site-footer` +
|
|
18
|
+
`footer-content`). A post-detect pass now (1) drops roles built entirely from
|
|
19
|
+
structural-wrapper tokens and (2) canonicalizes global synonyms to one
|
|
20
|
+
`header`/`nav`/`footer` each — so `isGlobalRole` scopes them correctly and the
|
|
21
|
+
plan stops listing ~11 phantom/duplicate components. Content in a wrapper
|
|
22
|
+
(`newsletter-modal`, `product-hero`) is preserved; only all-structural roles
|
|
23
|
+
are dropped. Runs for both the heuristic and the LLM-refine path.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
* **Orchestrator: reconcile-only mode when the target already exists.** When
|
|
28
|
+
`scout` classifies the repo the user points at as an already-scaffolded
|
|
29
|
+
`faststore-v4`/`tanstack-deco` target, `repo-setup`/`template-bootstrap` are
|
|
30
|
+
now explicitly skipped (re-scaffolding would clobber real work) and the source
|
|
31
|
+
is the legacy live site. (`skills/migration-orchestrator`)
|
|
32
|
+
* **Discovery: never use the target's own staging as the parity `prod`.**
|
|
33
|
+
`find-prod-url` now rejects `*.vtex.app`/`*.myvtex.com`/`*.deco.site`/
|
|
34
|
+
`*.workers.dev` hosts (that's the candidate, not the legacy source), scans
|
|
35
|
+
`.env(.example)` for a legacy-gateway URL, and flags locale/currency/country
|
|
36
|
+
config that disagrees with the live host's market. Reconcile guidance now
|
|
37
|
+
says to match plan rows to target sections by CONCEPT, not just string, so a
|
|
38
|
+
mature target isn't misread as ~2 done / 25 pending. (`skills/migration-discovery`)
|
|
39
|
+
|
|
8
40
|
## [Unreleased]
|
|
9
41
|
|
|
10
42
|
### 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.
|
|
3
|
+
"version": "0.24.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",
|