@decocms/parity 0.18.0 → 0.19.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cli.js +331 -63
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.19.0] — 2026-08-17
11
+
12
+ ### Added
13
+
14
+ * **`parity migrate` HTML visual report + `--open`.** A self-contained `index.html` (theme color swatches + tokens, per-viewport screenshots, brand assets, component table, VTEX IO → FastStore block map) written alongside `index.md`; `--open` launches it in the browser (same `open` package `parity run`/`audit` use). (#207)
15
+
16
+ ### Fixed
17
+
18
+ * **`migrate` theme primary election skips translucent overlays.** Primary/secondary are now elected from the most frequent non-neutral, **opaque** color across all usages (text/border/bg + interactive) instead of interactive backgrounds only — a translucent hover overlay could otherwise win (e.g. Electrolux came out `rgba(123,138,156,0.24)` instead of the brand navy). (#206)
19
+
10
20
  ## [0.18.0] — 2026-08-17
11
21
 
12
22
  ### Added
package/dist/cli.js CHANGED
@@ -58417,9 +58417,10 @@ function listCommand(output) {
58417
58417
  }
58418
58418
 
58419
58419
  // src/commands/migrate.ts
58420
- import { existsSync as existsSync11, mkdirSync as mkdirSync14, readFileSync as readFileSync13, writeFileSync as writeFileSync19 } from "node:fs";
58420
+ import { existsSync as existsSync11, mkdirSync as mkdirSync14, readFileSync as readFileSync14, writeFileSync as writeFileSync20 } from "node:fs";
58421
58421
  import { resolve as resolve3 } from "node:path";
58422
58422
  import chalk16 from "chalk";
58423
+ import open from "open";
58423
58424
 
58424
58425
  // src/migrate/pdp-discovery.ts
58425
58426
  var PLATFORM_PATTERNS = {
@@ -58567,7 +58568,31 @@ async function collectSiteAssets(page) {
58567
58568
  const appleTouchIcon = linkHref("link[rel='apple-touch-icon']");
58568
58569
  const manifest = linkHref("link[rel='manifest']");
58569
58570
  const ogImage = abs(document.querySelector("meta[property='og:image']")?.getAttribute("content"));
58570
- const fonts = Array.from(document.querySelectorAll("link[rel='preload'][as='font']")).map((l) => abs(l.getAttribute("href"))).filter((u) => Boolean(u));
58571
+ const fontUrls = new Set;
58572
+ for (const l of Array.from(document.querySelectorAll("link[rel='preload'][as='font']"))) {
58573
+ const u = abs(l.getAttribute("href"));
58574
+ if (u)
58575
+ fontUrls.add(u);
58576
+ }
58577
+ for (const sheet of Array.from(document.styleSheets)) {
58578
+ let rules;
58579
+ try {
58580
+ rules = sheet.cssRules;
58581
+ } catch {
58582
+ continue;
58583
+ }
58584
+ for (const rule of Array.from(rules)) {
58585
+ if (rule.constructor.name !== "CSSFontFaceRule")
58586
+ continue;
58587
+ const src = rule.style.getPropertyValue("src");
58588
+ for (const m of src.matchAll(/url\((['"]?)([^'")]+)\1\)/gi)) {
58589
+ const u = abs(m[2]);
58590
+ if (u && /\.(woff2?|ttf|otf)(\?|$)/i.test(u))
58591
+ fontUrls.add(u);
58592
+ }
58593
+ }
58594
+ }
58595
+ const fonts = [...fontUrls].slice(0, 20);
58571
58596
  const header = document.querySelector("header, [role='banner']") || document.body;
58572
58597
  let logo = null;
58573
58598
  if (header) {
@@ -58577,6 +58602,7 @@ async function collectSiteAssets(page) {
58577
58602
  });
58578
58603
  const el = hinted ?? header.querySelector("a[href='/'] img, a[href='/'] svg") ?? header.querySelector("img, svg");
58579
58604
  if (el) {
58605
+ el.setAttribute("data-parity-logo", "1");
58580
58606
  if (el.tagName.toLowerCase() === "img") {
58581
58607
  const url = abs(el.getAttribute("src"));
58582
58608
  if (url)
@@ -58684,6 +58710,17 @@ async function downloadSiteAssets(raw, runDir, fetchBytes) {
58684
58710
  raw.appleTouchIcon ? downloadTo(raw.appleTouchIcon, dir, "apple-touch-icon", fetchBytes) : Promise.resolve(null),
58685
58711
  raw.ogImage ? downloadTo(raw.ogImage, dir, "og-image", fetchBytes) : Promise.resolve(null)
58686
58712
  ]);
58713
+ const fontsDir = join17(dir, "fonts");
58714
+ mkdirSync12(fontsDir, { recursive: true });
58715
+ const fontFiles = [];
58716
+ for (const [i, url] of raw.fonts.entries()) {
58717
+ const got = await fetchBytes(url);
58718
+ if (!got)
58719
+ continue;
58720
+ const base = safeFontName(url, i);
58721
+ writeFileSync16(join17(fontsDir, base), got.buf);
58722
+ fontFiles.push(`assets/fonts/${base}`);
58723
+ }
58687
58724
  return {
58688
58725
  logo,
58689
58726
  logoSource,
@@ -58693,9 +58730,21 @@ async function downloadSiteAssets(raw, runDir, fetchBytes) {
58693
58730
  ogImage,
58694
58731
  manifest: raw.manifest,
58695
58732
  fonts: raw.fonts,
58733
+ fontFiles,
58696
58734
  icons: raw.icons
58697
58735
  };
58698
58736
  }
58737
+ function safeFontName(url, i) {
58738
+ try {
58739
+ const base = new URL(url).pathname.split("/").pop() ?? "";
58740
+ if (/^[\w.-]+\.(woff2?|ttf|otf)$/i.test(base))
58741
+ return base;
58742
+ const ext = base.match(/\.(woff2?|ttf|otf)$/i)?.[0] ?? ".woff2";
58743
+ return `font-${i}${ext}`;
58744
+ } catch {
58745
+ return `font-${i}.woff2`;
58746
+ }
58747
+ }
58699
58748
 
58700
58749
  // src/migrate/browser-fetch.ts
58701
58750
  async function browserFetchText(page, url) {
@@ -59088,7 +59137,7 @@ function renderIndex2(bundle, dirNames, notes) {
59088
59137
  if (bundle.vtex) {
59089
59138
  md("## VTEX IO → FastStore blocks");
59090
59139
  md("");
59091
- md(`_${bundle.vtex.blocks.length} block instances from the store runtime. \`custom-component\` = build from captured DOM/CSS; see component-map.json._`);
59140
+ md(`_${bundle.vtex.blocks.length} block instances from the store runtime · ${bundle.vtex.blocks.filter((x) => x.props).length} carry CMS content (props) → \`blocks.json\`. \`confidence\` (0–1) = how sure the deterministic mapper is; \`custom-component\` = build from captured DOM/CSS. See component-map.json._`);
59092
59141
  md("");
59093
59142
  md("| VTEX block | → FastStore | confidence | count |");
59094
59143
  md("|---|---|---|---|");
@@ -59146,7 +59195,7 @@ function renderAssets(md, assets) {
59146
59195
  md(`- **Apple touch icon**: ${assets.appleTouchIcon ? `\`${assets.appleTouchIcon}\`` : "—"}`);
59147
59196
  md(`- **OG image**: ${assets.ogImage ? `\`${assets.ogImage}\`` : "—"}`);
59148
59197
  md(`- **Web app manifest**: ${assets.manifest ? assets.manifest : "—"}`);
59149
- md(`- **Web fonts**: ${listOrNone2(assets.fonts)}`);
59198
+ md(`- **Web fonts**: ${assets.fontFiles.length}/${assets.fonts.length} downloaded${assets.fontFiles.length ? ` → ${listOrNone2(assets.fontFiles)}` : ""}`);
59150
59199
  md("");
59151
59200
  if (assets.icons.length) {
59152
59201
  md(`## Icons (${assets.icons.length})`);
@@ -59225,6 +59274,165 @@ function escapePipes2(s) {
59225
59274
  return s.replace(/\|/g, "\\|");
59226
59275
  }
59227
59276
 
59277
+ // src/migrate/exporters/html.ts
59278
+ import { readFileSync as readFileSync13, writeFileSync as writeFileSync19 } from "node:fs";
59279
+ import { join as join20 } from "node:path";
59280
+ var htmlExporter = {
59281
+ name: "html",
59282
+ async export(bundle, outDir) {
59283
+ writeFileSync19(join20(outDir, "index.html"), renderHtml(bundle, (p) => p ?? null), "utf8");
59284
+ const inline = (p) => p ? dataUri(join20(outDir, p)) ?? p : null;
59285
+ writeFileSync19(join20(outDir, "report.html"), renderHtml(bundle, inline), "utf8");
59286
+ }
59287
+ };
59288
+ var MIME = {
59289
+ ".png": "image/png",
59290
+ ".jpg": "image/jpeg",
59291
+ ".jpeg": "image/jpeg",
59292
+ ".webp": "image/webp",
59293
+ ".gif": "image/gif",
59294
+ ".svg": "image/svg+xml",
59295
+ ".ico": "image/x-icon"
59296
+ };
59297
+ function dataUri(absPath) {
59298
+ try {
59299
+ const ext = absPath.slice(absPath.lastIndexOf(".")).toLowerCase();
59300
+ const mime = MIME[ext];
59301
+ if (!mime)
59302
+ return null;
59303
+ return `data:${mime};base64,${readFileSync13(absPath).toString("base64")}`;
59304
+ } catch {
59305
+ return null;
59306
+ }
59307
+ }
59308
+ function esc(s) {
59309
+ return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
59310
+ }
59311
+ function swatch(label, value) {
59312
+ if (!value)
59313
+ return `<div class="sw"><div class="chip empty"></div><b>${label}</b><span>—</span></div>`;
59314
+ return `<div class="sw"><div class="chip" style="background:${esc(value)}"></div><b>${label}</b><span>${esc(value)}</span></div>`;
59315
+ }
59316
+ function chips(items) {
59317
+ return items.length ? items.map((i) => `<code>${esc(i)}</code>`).join(" ") : "<em>none</em>";
59318
+ }
59319
+ function renderHtml(b, embed) {
59320
+ const t = b.theme;
59321
+ const shots = (b.screenshots ?? []).map((s) => {
59322
+ const src = embed(s.path);
59323
+ return src ? `<figure><figcaption>${esc(s.viewport)}</figcaption><img src="${esc(src)}" alt="${esc(s.viewport)}"></figure>` : "";
59324
+ }).join("");
59325
+ const componentRows = b.components.map((c, i) => {
59326
+ const keys = [...new Set(c.interactions.map((x) => x.e2eKey).filter(Boolean))];
59327
+ const folder = componentDirName(c.role, i + 1);
59328
+ return `<tr><td>${esc(c.scope)}</td><td><code>${esc(c.role)}</code>${c.repeated && c.repeated > 1 ? ` <span class="badge">×${c.repeated}</span>` : ""}</td><td>${c.tailwind.length}</td><td>${c.interactions.length}</td><td>${keys.length ? keys.map((k) => `<code>${esc(String(k))}</code>`).join(" ") : "—"}</td><td><a href="components/${esc(folder)}/README.md">${esc(folder)}</a></td></tr>`;
59329
+ }).join("");
59330
+ const vtexRows = b.vtex ? b.vtex.map.slice(0, 80).map((m) => `<tr><td><code>${esc(m.vtex)}</code></td><td>${m.faststore ? `<code>${esc(m.faststore)}</code>` : "<em>custom-component</em>"}</td><td>${m.confidence || "—"}</td><td>${m.count}</td></tr>`).join("") : "";
59331
+ const iconRows = t && b.assets.icons.length ? b.assets.icons.slice(0, 40).map((ic) => `<tr><td>${esc(ic.kind)}</td><td><code>${esc(ic.id)}</code></td><td>${ic.count}</td></tr>`).join("") : "";
59332
+ return `<!doctype html>
59333
+ <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
59334
+ <title>parity migrate — ${esc(b.url)}</title>
59335
+ <style>
59336
+ :root { --bg:#0d1117; --card:#161b22; --line:#30363d; --fg:#e6edf3; --dim:#8b949e; --accent:#2f81f7; }
59337
+ * { box-sizing:border-box; }
59338
+ body { margin:0; background:var(--bg); color:var(--fg); font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; }
59339
+ header { padding:24px 32px; border-bottom:1px solid var(--line); }
59340
+ h1 { margin:0 0 6px; font-size:20px; }
59341
+ h2 { font-size:15px; text-transform:uppercase; letter-spacing:.04em; color:var(--dim); margin:0 0 12px; }
59342
+ .meta { color:var(--dim); font-size:13px; }
59343
+ .meta code { color:var(--fg); }
59344
+ main { padding:24px 32px; max-width:1100px; margin:0 auto; display:grid; gap:24px; }
59345
+ .card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:20px; }
59346
+ .swatches { display:flex; gap:20px; flex-wrap:wrap; }
59347
+ .sw { display:flex; flex-direction:column; gap:4px; }
59348
+ .sw b { font-size:12px; } .sw span { color:var(--dim); font-size:12px; font-family:monospace; }
59349
+ .chip { width:64px; height:64px; border-radius:8px; border:1px solid var(--line); }
59350
+ .chip.empty { background:repeating-linear-gradient(45deg,#222,#222 6px,#333 6px,#333 12px); }
59351
+ figure { margin:0; } figure img { max-width:100%; border:1px solid var(--line); border-radius:8px; display:block; }
59352
+ figcaption { color:var(--dim); font-size:12px; margin-bottom:6px; text-transform:capitalize; }
59353
+ .shots { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
59354
+ table { width:100%; border-collapse:collapse; font-size:13px; }
59355
+ th,td { text-align:left; padding:6px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
59356
+ th { color:var(--dim); font-weight:600; }
59357
+ code { background:#0b0f14; padding:1px 5px; border-radius:4px; font-size:12px; }
59358
+ a { color:var(--accent); text-decoration:none; } a:hover { text-decoration:underline; }
59359
+ .badge { background:#1f6feb33; color:#79c0ff; padding:0 6px; border-radius:10px; font-size:11px; }
59360
+ .assets { display:flex; gap:24px; align-items:center; flex-wrap:wrap; }
59361
+ .assets img { max-height:48px; max-width:200px; background:#fff; padding:6px; border-radius:6px; }
59362
+ ul.kv { list-style:none; padding:0; margin:0; display:grid; gap:6px; }
59363
+ .links a { margin-right:16px; }
59364
+ .dim { color:var(--dim); }
59365
+ </style></head>
59366
+ <body>
59367
+ <header>
59368
+ <h1>parity migrate — ${esc(b.url)}</h1>
59369
+ <div class="meta">
59370
+ <code>${esc(b.platform)}</code>${b.target ? ` → <code>${esc(b.target)}</code>` : ""}
59371
+ · viewports: <code>${esc((b.viewports ?? [b.viewport]).join(", "))}</code>
59372
+ · pages: ${b.pages.map((p) => `<code>${esc(p.kind)}</code>`).join(" ") || "—"}
59373
+ · <span class="dim">${esc(b.timestamp)}</span>
59374
+ </div>
59375
+ </header>
59376
+ <main>
59377
+
59378
+ <section class="card">
59379
+ <h2>Theme</h2>
59380
+ <div class="swatches">
59381
+ ${swatch("primary", t.colors.primary)}
59382
+ ${swatch("secondary", t.colors.secondary)}
59383
+ ${swatch("background", t.colors.background)}
59384
+ ${swatch("text", t.colors.text)}
59385
+ </div>
59386
+ <ul class="kv" style="margin-top:16px">
59387
+ <li><b>Fonts:</b> ${chips(t.typography.fontFamilies)}</li>
59388
+ <li><b>Font sizes:</b> ${chips(t.typography.sizeScale)}</li>
59389
+ <li><b>Spacing:</b> ${chips(t.spacingScale)}</li>
59390
+ <li><b>Radii:</b> ${chips(t.radii)}</li>
59391
+ <li><b>Breakpoints:</b> ${chips(t.breakpoints)}</li>
59392
+ <li><b>Motion:</b> ${chips([...t.motion.durations, ...t.motion.easings])}</li>
59393
+ </ul>
59394
+ </section>
59395
+
59396
+ ${shots ? `<section class="card"><h2>Screenshots by viewport</h2><div class="shots">${shots}</div></section>` : ""}
59397
+
59398
+ <section class="card">
59399
+ <h2>Brand assets</h2>
59400
+ <div class="assets">
59401
+ ${(() => {
59402
+ const s = embed(b.assets.logo);
59403
+ return s ? `<div><div class="dim">logo</div><img src="${esc(s)}" alt="logo"></div>` : '<span class="dim">no logo</span>';
59404
+ })()}
59405
+ ${(() => {
59406
+ const s = embed(b.assets.favicon);
59407
+ return s ? `<div><div class="dim">favicon</div><img src="${esc(s)}" alt="favicon" style="max-height:32px"></div>` : "";
59408
+ })()}
59409
+ <div class="dim">${b.assets.icons.length} icons · ${b.assets.fontFiles.length}/${b.assets.fonts.length} web fonts downloaded${b.assets.fontFiles.length ? " → assets/fonts/" : ""}</div>
59410
+ </div>
59411
+ ${iconRows ? `<table style="margin-top:16px"><tr><th>kind</th><th>id</th><th>count</th></tr>${iconRows}</table>` : ""}
59412
+ </section>
59413
+
59414
+ ${b.vtex ? `<section class="card"><h2>VTEX IO → FastStore blocks</h2><p class="dim">${b.vtex.blocks.length} block instances from the store runtime · ${b.vtex.blocks.filter((x) => x.props).length} carry CMS content (props) → see <code>blocks.json</code>. <b>confidence</b> = how sure the deterministic mapper is (0–1).</p><table><tr><th>VTEX block</th><th>→ FastStore</th><th>confidence</th><th>count</th></tr>${vtexRows}</table></section>` : ""}
59415
+
59416
+ <section class="card">
59417
+ <h2>Components (${b.components.length})</h2>
59418
+ <table>
59419
+ <tr><th>scope</th><th>role</th><th>tw</th><th>interactions</th><th>e2e keys</th><th>folder</th></tr>
59420
+ ${componentRows}
59421
+ </table>
59422
+ </section>
59423
+
59424
+ <section class="card links">
59425
+ <h2>Files</h2>
59426
+ <a href="MIGRATION_PROMPT.md">MIGRATION_PROMPT.md</a>
59427
+ <a href="index.md">index.md</a>
59428
+ ${b.target === "faststore" ? '<a href="custom-theme.scss">custom-theme.scss</a>' : ""}
59429
+ ${b.vtex ? '<a href="component-map.json">component-map.json</a> <a href="blocks.json">blocks.json</a>' : ""}
59430
+ <a href="manifest.json">manifest.json (full)</a>
59431
+ </section>
59432
+
59433
+ </main></body></html>`;
59434
+ }
59435
+
59228
59436
  // src/migrate/prompt.ts
59229
59437
  function buildMigrationPrompt(bundle, playbook) {
59230
59438
  const lines = [];
@@ -59470,10 +59678,28 @@ function mergeRawThemeSamples(list) {
59470
59678
  motionEasings: concat("motionEasings")
59471
59679
  };
59472
59680
  }
59681
+ function plausibleDuration(d) {
59682
+ const v = d.trim();
59683
+ if (!v || v === "0s" || v === "0ms")
59684
+ return false;
59685
+ const n = Number.parseFloat(v);
59686
+ if (Number.isNaN(n))
59687
+ return false;
59688
+ const seconds = v.endsWith("ms") ? n / 1000 : n;
59689
+ return seconds > 0 && seconds <= 10;
59690
+ }
59691
+ function isOpaque(color) {
59692
+ const c = parseRgb(color);
59693
+ return !c || c.a >= 0.5;
59694
+ }
59473
59695
  function aggregateTheme(raw) {
59474
59696
  const paletteRanked = rank([...raw.colors, ...raw.backgrounds]);
59475
- const interactiveRanked = rank(raw.interactiveBackgrounds);
59476
- const chromatic = [...interactiveRanked.keys()].filter((c) => !isNeutral(c));
59697
+ const chromaticRanked = rank([
59698
+ ...raw.colors,
59699
+ ...raw.backgrounds,
59700
+ ...raw.interactiveBackgrounds
59701
+ ]);
59702
+ const chromatic = [...chromaticRanked.keys()].filter((c) => !isNeutral(c) && isOpaque(c));
59477
59703
  const primary = chromatic[0] ?? null;
59478
59704
  const secondary = chromatic.find((c) => c !== primary) ?? null;
59479
59705
  const tokens = {};
@@ -59481,8 +59707,10 @@ function aggregateTheme(raw) {
59481
59707
  tokens.primary = primary;
59482
59708
  if (secondary)
59483
59709
  tokens.secondary = secondary;
59484
- if (raw.bodyBackground && !TRANSPARENT.has(raw.bodyBackground.trim()))
59485
- tokens.background = raw.bodyBackground.trim();
59710
+ const bodyBg = raw.bodyBackground.trim();
59711
+ const background = bodyBg && !TRANSPARENT.has(bodyBg) && isOpaque(bodyBg) ? bodyBg : [...rank(raw.backgrounds).keys()].find((c) => isOpaque(c)) ?? null;
59712
+ if (background)
59713
+ tokens.background = background;
59486
59714
  if (raw.bodyText)
59487
59715
  tokens.text = raw.bodyText.trim();
59488
59716
  const palette = [...paletteRanked.entries()].map(([value, count]) => ({
@@ -59505,9 +59733,9 @@ function aggregateTheme(raw) {
59505
59733
  spacingScale: sortByPx(raw.spacings),
59506
59734
  radii: sortByPx(raw.radii).filter((r) => r !== "0px"),
59507
59735
  shadows: [...new Set(raw.shadows.map((s) => s.trim()))].filter((s) => s && s !== "none"),
59508
- breakpoints: sortByPx(raw.breakpoints),
59736
+ breakpoints: sortByPx([...rank(raw.breakpoints).keys()].slice(0, 14)),
59509
59737
  motion: {
59510
- durations: [...new Set(raw.motionDurations.map((d) => d.trim()))].filter((d) => d && d !== "0s" && d !== "0ms"),
59738
+ durations: [...new Set(raw.motionDurations.map((d) => d.trim()))].filter(plausibleDuration),
59511
59739
  easings: [...new Set(raw.motionEasings.map((e) => e.trim()))].filter((e) => e && e !== "ease" && e !== "linear")
59512
59740
  },
59513
59741
  tokens
@@ -59664,10 +59892,21 @@ async function readVtexBlockTree(page) {
59664
59892
  const rt = window.__RUNTIME__;
59665
59893
  if (!rt || !rt.extensions || typeof rt.extensions !== "object")
59666
59894
  return null;
59667
- return Object.entries(rt.extensions).map(([treePath, ext]) => ({
59668
- treePath,
59669
- component: ext && typeof ext === "object" && "component" in ext ? ext.component ?? null : null
59670
- }));
59895
+ return Object.entries(rt.extensions).map(([treePath, ext]) => {
59896
+ const e = ext && typeof ext === "object" ? ext : {};
59897
+ let props = null;
59898
+ if (e.props && typeof e.props === "object") {
59899
+ try {
59900
+ const clean = JSON.parse(JSON.stringify(e.props));
59901
+ for (const k of ["children", "__context", "context"])
59902
+ delete clean[k];
59903
+ props = Object.keys(clean).length ? clean : null;
59904
+ } catch {
59905
+ props = null;
59906
+ }
59907
+ }
59908
+ return { treePath, component: e.component ?? null, props };
59909
+ });
59671
59910
  });
59672
59911
  } catch {
59673
59912
  return null;
@@ -59678,7 +59917,8 @@ async function readVtexBlockTree(page) {
59678
59917
  treePath: p.treePath,
59679
59918
  blockName: blockNameFromTreePath(p.treePath),
59680
59919
  component: p.component,
59681
- parent: parentTreePath(p.treePath)
59920
+ parent: parentTreePath(p.treePath),
59921
+ props: p.props
59682
59922
  })).filter((b) => b.blockName.length > 0 && !b.blockName.startsWith("$"));
59683
59923
  }
59684
59924
 
@@ -59886,6 +60126,18 @@ async function migrateCommand(opts) {
59886
60126
  await page.waitForLoadState("networkidle", { timeout: 8000 }).catch(() => {
59887
60127
  return;
59888
60128
  });
60129
+ await Promise.race([stabilizeCarousels(page).catch(() => {
60130
+ return;
60131
+ }), sleep2(3000)]);
60132
+ await Promise.race([scrollFullPage(page, 30000).catch(() => {
60133
+ return;
60134
+ }), sleep2(32000)]);
60135
+ await Promise.race([
60136
+ waitForSkeletonsToResolve(page, 5000).catch(() => {
60137
+ return;
60138
+ }),
60139
+ sleep2(5000)
60140
+ ]);
59889
60141
  samples.push(await scrapeThemeSamples(page));
59890
60142
  const shot = resolve3(runDir, "screenshots", `${vp}.png`);
59891
60143
  await page.screenshot({ path: shot, fullPage: true, animations: "disabled", timeout: 15000 }).then(() => screenshots.push({ viewport: vp, path: `screenshots/${vp}.png` })).catch(() => {
@@ -59896,6 +60148,14 @@ async function migrateCommand(opts) {
59896
60148
  const rawAssets = await collectSiteAssets(page);
59897
60149
  const fetchBytes = async (url) => await browserFetchBytes(page, url) ?? await nodeFetchBytes(url);
59898
60150
  assetsResolved = await downloadSiteAssets(rawAssets, runDir, fetchBytes);
60151
+ if (rawAssets.logo) {
60152
+ const logoPng = resolve3(runDir, "assets", "logo.png");
60153
+ const ok = await page.locator("[data-parity-logo]").first().screenshot({ path: logoPng, timeout: 8000 }).then(() => true).catch(() => false);
60154
+ if (ok) {
60155
+ assetsResolved.logo = "assets/logo.png";
60156
+ assetsResolved.logoSource = assetsResolved.logoSource ?? "screenshot";
60157
+ }
60158
+ }
59899
60159
  vtexBlocks = await readVtexBlockTree(page);
59900
60160
  }
59901
60161
  } finally {
@@ -59910,12 +60170,12 @@ async function migrateCommand(opts) {
59910
60170
  theme = aggregateTheme(mergeRawThemeSamples(samples));
59911
60171
  platform = platformSeen ?? "custom";
59912
60172
  assets = assetsResolved;
59913
- writeFileSync19(themePath, `${JSON.stringify(theme, null, 2)}
60173
+ writeFileSync20(themePath, `${JSON.stringify(theme, null, 2)}
59914
60174
  `, "utf8");
59915
- writeFileSync19(assetsPath, `${JSON.stringify({ platform, assets, screenshots }, null, 2)}
60175
+ writeFileSync20(assetsPath, `${JSON.stringify({ platform, assets, screenshots }, null, 2)}
59916
60176
  `, "utf8");
59917
60177
  if (vtexBlocks) {
59918
- writeFileSync19(blocksPath, `${JSON.stringify(vtexBlocks, null, 2)}
60178
+ writeFileSync20(blocksPath, `${JSON.stringify(vtexBlocks, null, 2)}
59919
60179
  `, "utf8");
59920
60180
  console.log(chalk16.dim(` vtex io: ${vtexBlocks.length} blocks read from runtime`));
59921
60181
  }
@@ -59947,7 +60207,7 @@ async function migrateCommand(opts) {
59947
60207
  });
59948
60208
  }
59949
60209
  const classified = sitemapUrls.slice(0, 500).map((u) => ({ url: u, kind: kindOf(u) }));
59950
- writeFileSync19(sitemapPath, `${JSON.stringify({ pages: resolvedPages, sitemapUrls: classified }, null, 2)}
60210
+ writeFileSync20(sitemapPath, `${JSON.stringify({ pages: resolvedPages, sitemapUrls: classified }, null, 2)}
59951
60211
  `, "utf8");
59952
60212
  }
59953
60213
  if (resolvedPages.length === 0) {
@@ -59969,7 +60229,7 @@ async function migrateCommand(opts) {
59969
60229
  llm: !opts.noLlm,
59970
60230
  runDir
59971
60231
  }));
59972
- writeFileSync19(capturePath, `${JSON.stringify({ pages, components }, null, 2)}
60232
+ writeFileSync20(capturePath, `${JSON.stringify({ pages, components }, null, 2)}
59973
60233
  `, "utf8");
59974
60234
  }
59975
60235
  const bundle = {
@@ -59990,13 +60250,14 @@ async function migrateCommand(opts) {
59990
60250
  await jsonExporter2.export(bundle, runDir);
59991
60251
  if (format === "md" || format === "both") {
59992
60252
  await markdownExporter2.export(bundle, runDir);
59993
- writeFileSync19(resolve3(runDir, "MIGRATION_PROMPT.md"), buildMigrationPrompt(bundle, playbook), "utf8");
60253
+ await htmlExporter.export(bundle, runDir);
60254
+ writeFileSync20(resolve3(runDir, "MIGRATION_PROMPT.md"), buildMigrationPrompt(bundle, playbook), "utf8");
59994
60255
  }
59995
60256
  if (opts.target === "faststore") {
59996
- writeFileSync19(resolve3(runDir, "custom-theme.scss"), buildFastStoreTheme(theme), "utf8");
60257
+ writeFileSync20(resolve3(runDir, "custom-theme.scss"), buildFastStoreTheme(theme), "utf8");
59997
60258
  }
59998
60259
  if (bundle.vtex) {
59999
- writeFileSync19(resolve3(runDir, "component-map.json"), `${JSON.stringify(bundle.vtex.map, null, 2)}
60260
+ writeFileSync20(resolve3(runDir, "component-map.json"), `${JSON.stringify(bundle.vtex.map, null, 2)}
60000
60261
  `, "utf8");
60001
60262
  }
60002
60263
  if (opts.json) {
@@ -60004,6 +60265,11 @@ async function migrateCommand(opts) {
60004
60265
  return 0;
60005
60266
  }
60006
60267
  printResults4(runDir, bundle);
60268
+ if (opts.open && format !== "json") {
60269
+ await open(resolve3(runDir, "report.html")).catch(() => {
60270
+ return;
60271
+ });
60272
+ }
60007
60273
  return 0;
60008
60274
  } finally {
60009
60275
  await browser.close().catch(() => {
@@ -60173,10 +60439,11 @@ function printResults4(runDir, bundle) {
60173
60439
  console.log(chalk16.dim(` platform: ${bundle.platform}${bundle.target ? ` → ${bundle.target}` : ""}`));
60174
60440
  console.log(chalk16.dim(` viewports:${(bundle.viewports ?? [bundle.viewport]).join(", ")}`));
60175
60441
  console.log(chalk16.dim(` theme: primary=${bundle.theme.colors.primary ?? "—"} text=${bundle.theme.colors.text ?? "—"}`));
60176
- console.log(chalk16.dim(` assets: logo=${bundle.assets.logo ? "✓" : "✗"} favicon=${bundle.assets.favicon ? "✓" : "✗"} icons=${bundle.assets.icons.length}`));
60442
+ console.log(chalk16.dim(` assets: logo=${bundle.assets.logo ? "✓" : "✗"} favicon=${bundle.assets.favicon ? "✓" : "✗"} icons=${bundle.assets.icons.length} fonts=${bundle.assets.fontFiles.length}`));
60177
60443
  if (bundle.vtex) {
60178
60444
  const mapped = bundle.vtex.map.filter((m) => m.strategy === "mapped").length;
60179
- console.log(chalk16.dim(` vtex io: ${bundle.vtex.blocks.length} blocks · ${mapped}/${bundle.vtex.map.length} block types mapped to FastStore`));
60445
+ const withContent = bundle.vtex.blocks.filter((x) => x.props).length;
60446
+ console.log(chalk16.dim(` vtex io: ${bundle.vtex.blocks.length} blocks (${withContent} with CMS content) · ${mapped}/${bundle.vtex.map.length} block types mapped to FastStore`));
60180
60447
  }
60181
60448
  console.log(chalk16.dim(` pages: ${bundle.pages.map((p) => p.kind).join(", ") || "—"}`));
60182
60449
  console.log(chalk16.dim(` out: ${runDir}`));
@@ -60189,7 +60456,7 @@ function printResults4(runDir, bundle) {
60189
60456
  }
60190
60457
  function readJson(path) {
60191
60458
  try {
60192
- return JSON.parse(readFileSync13(path, "utf8"));
60459
+ return JSON.parse(readFileSync14(path, "utf8"));
60193
60460
  } catch {
60194
60461
  return null;
60195
60462
  }
@@ -60235,13 +60502,13 @@ function sleep2(ms) {
60235
60502
  }
60236
60503
 
60237
60504
  // src/commands/pr.ts
60238
- import { existsSync as existsSync15, readFileSync as readFileSync16, writeFileSync as writeFileSync20 } from "node:fs";
60239
- import { join as join22 } from "node:path";
60505
+ import { existsSync as existsSync15, readFileSync as readFileSync17, writeFileSync as writeFileSync21 } from "node:fs";
60506
+ import { join as join23 } from "node:path";
60240
60507
  import chalk19 from "chalk";
60241
60508
 
60242
60509
  // src/commands/run.ts
60243
- import { existsSync as existsSync14, readFileSync as readFileSync15, unlinkSync as unlinkSync3 } from "node:fs";
60244
- import { join as join21 } from "node:path";
60510
+ import { existsSync as existsSync14, readFileSync as readFileSync16, unlinkSync as unlinkSync3 } from "node:fs";
60511
+ import { join as join22 } from "node:path";
60245
60512
  import chalk18 from "chalk";
60246
60513
  import ora6 from "ora";
60247
60514
 
@@ -60721,10 +60988,10 @@ import { existsSync as existsSync13 } from "node:fs";
60721
60988
  import chalk17 from "chalk";
60722
60989
 
60723
60990
  // src/server/proxy-server.ts
60724
- import { existsSync as existsSync12, readFileSync as readFileSync14, statSync } from "node:fs";
60991
+ import { existsSync as existsSync12, readFileSync as readFileSync15, statSync } from "node:fs";
60725
60992
  import { createServer } from "node:http";
60726
- import { extname, join as join20, normalize as normalize3, resolve as resolve4, sep } from "node:path";
60727
- var MIME = {
60993
+ import { extname, join as join21, normalize as normalize3, resolve as resolve4, sep } from "node:path";
60994
+ var MIME2 = {
60728
60995
  ".html": "text/html; charset=utf-8",
60729
60996
  ".css": "text/css; charset=utf-8",
60730
60997
  ".js": "application/javascript; charset=utf-8",
@@ -60817,13 +61084,13 @@ async function handleRequest(req, res, runDir) {
60817
61084
  return serveStatic(res, runDir, path);
60818
61085
  }
60819
61086
  function serveReportHtml(res, runDir) {
60820
- const filePath = join20(runDir, "report.html");
61087
+ const filePath = join21(runDir, "report.html");
60821
61088
  if (!existsSync12(filePath)) {
60822
61089
  res.statusCode = 404;
60823
61090
  res.end("report.html not found");
60824
61091
  return;
60825
61092
  }
60826
- const html3 = readFileSync14(filePath, "utf8");
61093
+ const html3 = readFileSync15(filePath, "utf8");
60827
61094
  const inject = `<script>window.__parity_proxy = "/proxy?url=";</script>`;
60828
61095
  const out = html3.includes("</head>") ? html3.replace("</head>", `${inject}</head>`) : `${inject}${html3}`;
60829
61096
  res.statusCode = 200;
@@ -60852,9 +61119,9 @@ function serveStatic(res, runDir, path) {
60852
61119
  }
60853
61120
  const ext = extname(filePath).toLowerCase();
60854
61121
  res.statusCode = 200;
60855
- res.setHeader("content-type", MIME[ext] ?? "application/octet-stream");
61122
+ res.setHeader("content-type", MIME2[ext] ?? "application/octet-stream");
60856
61123
  res.setHeader("cache-control", "no-store");
60857
- res.end(readFileSync14(filePath));
61124
+ res.end(readFileSync15(filePath));
60858
61125
  }
60859
61126
  async function proxyRequest(req, res, targetUrl, opts = {}) {
60860
61127
  let target;
@@ -60964,8 +61231,8 @@ async function serveRunAndBlock(runDir, opts = {}) {
60964
61231
  console.log(chalk17.dim(` Ctrl+C pra parar (2x pra forçar saída).
60965
61232
  `));
60966
61233
  if (opts.open !== false) {
60967
- const { default: open } = await import("open");
60968
- await open(handle.url).catch(() => {
61234
+ const { default: open2 } = await import("open");
61235
+ await open2(handle.url).catch(() => {
60969
61236
  return;
60970
61237
  });
60971
61238
  }
@@ -61214,7 +61481,7 @@ async function runCommand(rawOpts) {
61214
61481
  }
61215
61482
  const ignore = loadParityIgnore();
61216
61483
  if (opts.clearCache) {
61217
- const cacheFile = join21(opts.output, "cache", "verdicts.json");
61484
+ const cacheFile = join22(opts.output, "cache", "verdicts.json");
61218
61485
  if (existsSync14(cacheFile)) {
61219
61486
  try {
61220
61487
  unlinkSync3(cacheFile);
@@ -61411,8 +61678,8 @@ ${formatTimingsSummary(partialTimings, buildFlowBreakdown(allFlowCaptures))}
61411
61678
  const traceEnabled = process.env.PARITY_TRACE === "1";
61412
61679
  const runOneSide = async (viewport, side) => {
61413
61680
  const baseUrl = side === "prod" ? opts.prod : opts.cand;
61414
- const harPath = join21(paths.harDir, `${viewport}-${side}.har`);
61415
- const tracePath = traceEnabled ? join21(paths.tracesDir, `${viewport}-${side}.zip`) : null;
61681
+ const harPath = join22(paths.harDir, `${viewport}-${side}.har`);
61682
+ const tracePath = traceEnabled ? join22(paths.tracesDir, `${viewport}-${side}.zip`) : null;
61416
61683
  const ctx = await newContext(browser, {
61417
61684
  viewport,
61418
61685
  harPath,
@@ -61728,7 +61995,7 @@ ${formatTimingsSummary(partialTimings, buildFlowBreakdown(allFlowCaptures))}
61728
61995
  setSpinnerLabel("Rodando checks…");
61729
61996
  spinner.start();
61730
61997
  const checksHb = attachSpinnerHeartbeat(spinner, { baseText: "Rodando checks…" });
61731
- const cacheDir = join21(opts.output, "cache");
61998
+ const cacheDir = join22(opts.output, "cache");
61732
61999
  const checkCtx = {
61733
62000
  prodPages: allPageCaptures.filter((p) => p.side === "prod"),
61734
62001
  candPages: allPageCaptures.filter((p) => p.side === "cand"),
@@ -61913,7 +62180,7 @@ function resolveExplicitPages(pagesFile, pagesList) {
61913
62180
  if (!existsSync14(pagesFile)) {
61914
62181
  throw new Error(`--pages-file não encontrado: ${pagesFile}`);
61915
62182
  }
61916
- const raw = readFileSync15(pagesFile, "utf-8");
62183
+ const raw = readFileSync16(pagesFile, "utf-8");
61917
62184
  const lines = raw.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0 && !l.startsWith("#"));
61918
62185
  return lines.map(normalizePath);
61919
62186
  }
@@ -62135,15 +62402,15 @@ async function prCommand(opts) {
62135
62402
  return runCode || 1;
62136
62403
  }
62137
62404
  const latest = runs[0];
62138
- const reportJsonPath = join22(opts.output, "runs", latest.id, "report.json");
62405
+ const reportJsonPath = join23(opts.output, "runs", latest.id, "report.json");
62139
62406
  if (!existsSync15(reportJsonPath)) {
62140
62407
  console.error(chalk19.red(`report.json not found at ${reportJsonPath}`));
62141
62408
  return runCode || 1;
62142
62409
  }
62143
- const run = JSON.parse(readFileSync16(reportJsonPath, "utf8"));
62410
+ const run = JSON.parse(readFileSync17(reportJsonPath, "utf8"));
62144
62411
  const markdown = buildPrComment(run, opts);
62145
62412
  if (opts.out) {
62146
- writeFileSync20(opts.out, markdown, "utf8");
62413
+ writeFileSync21(opts.out, markdown, "utf8");
62147
62414
  console.log(chalk19.dim(` wrote PR comment: ${opts.out}`));
62148
62415
  } else {
62149
62416
  process.stdout.write(`
@@ -62152,7 +62419,7 @@ ${markdown}
62152
62419
  }
62153
62420
  if (opts.github && process.env.GITHUB_STEP_SUMMARY) {
62154
62421
  try {
62155
- writeFileSync20(process.env.GITHUB_STEP_SUMMARY, markdown, { flag: "a" });
62422
+ writeFileSync21(process.env.GITHUB_STEP_SUMMARY, markdown, { flag: "a" });
62156
62423
  } catch (err) {
62157
62424
  console.error(chalk19.yellow(`failed to write GITHUB_STEP_SUMMARY: ${err.message}`));
62158
62425
  }
@@ -62213,7 +62480,7 @@ function buildPrComment(run, opts) {
62213
62480
  }
62214
62481
 
62215
62482
  // src/commands/prompt.ts
62216
- import { existsSync as existsSync16, writeFileSync as writeFileSync21 } from "node:fs";
62483
+ import { existsSync as existsSync16, writeFileSync as writeFileSync22 } from "node:fs";
62217
62484
  import chalk20 from "chalk";
62218
62485
  function promptCommand(runId, opts) {
62219
62486
  let run;
@@ -62228,7 +62495,7 @@ function promptCommand(runId, opts) {
62228
62495
  limit: opts.limit
62229
62496
  });
62230
62497
  if (opts.out) {
62231
- writeFileSync21(opts.out, md, "utf8");
62498
+ writeFileSync22(opts.out, md, "utf8");
62232
62499
  console.log(chalk20.green(`✔ prompt salvo em ${opts.out}`));
62233
62500
  if (existsSync16(opts.out)) {
62234
62501
  const sizeKb = (md.length / 1024).toFixed(1);
@@ -62241,9 +62508,9 @@ function promptCommand(runId, opts) {
62241
62508
  }
62242
62509
 
62243
62510
  // src/commands/report.ts
62244
- import { existsSync as existsSync17, readFileSync as readFileSync17 } from "node:fs";
62511
+ import { existsSync as existsSync17, readFileSync as readFileSync18 } from "node:fs";
62245
62512
  import chalk21 from "chalk";
62246
- import open from "open";
62513
+ import open2 from "open";
62247
62514
 
62248
62515
  // src/report/extract-section.ts
62249
62516
  function extractReportSection(input) {
@@ -62406,7 +62673,7 @@ async function reportCommand(runId, opts) {
62406
62673
  console.error(chalk21.red(`report.html not found at ${paths.reportHtml}`));
62407
62674
  return 1;
62408
62675
  }
62409
- const html3 = readFileSync17(paths.reportHtml, "utf8");
62676
+ const html3 = readFileSync18(paths.reportHtml, "utf8");
62410
62677
  const slice2 = extractReportSection({ kind: "html", section: opts.section, html: html3 });
62411
62678
  if (slice2 === null) {
62412
62679
  console.error(chalk21.red(`section "${opts.section}" not present in this report`));
@@ -62416,15 +62683,15 @@ async function reportCommand(runId, opts) {
62416
62683
  return 0;
62417
62684
  }
62418
62685
  console.log(chalk21.dim(`opening ${paths.reportHtml}`));
62419
- await open(paths.reportHtml).catch((err) => {
62686
+ await open2(paths.reportHtml).catch((err) => {
62420
62687
  console.error(chalk21.red(`failed to open: ${err.message}`));
62421
62688
  });
62422
62689
  return 0;
62423
62690
  }
62424
62691
 
62425
62692
  // src/commands/vitals.ts
62426
- import { existsSync as existsSync18, readFileSync as readFileSync18, writeFileSync as writeFileSync22 } from "node:fs";
62427
- import { join as join23 } from "node:path";
62693
+ import { existsSync as existsSync18, readFileSync as readFileSync19, writeFileSync as writeFileSync23 } from "node:fs";
62694
+ import { join as join24 } from "node:path";
62428
62695
  import chalk22 from "chalk";
62429
62696
  import ora7 from "ora";
62430
62697
  async function vitalsCommand(opts) {
@@ -62532,7 +62799,7 @@ async function vitalsCommand(opts) {
62532
62799
  writeRunReportJson(paths.runDir, run);
62533
62800
  const html3 = renderHtmlReport(run, paths.runDir);
62534
62801
  writeRunReportHtml(paths.runDir, html3);
62535
- writeFileSync22(join23(paths.runDir, "vitals.json"), `${JSON.stringify({
62802
+ writeFileSync23(join24(paths.runDir, "vitals.json"), `${JSON.stringify({
62536
62803
  schemaVersion: "0.1",
62537
62804
  prodUrl: opts.prod,
62538
62805
  candUrl: opts.cand,
@@ -62547,8 +62814,8 @@ async function vitalsCommand(opts) {
62547
62814
  console.log(chalk22.dim(` \uD83D\uDCA1 use 'parity serve ${runId}' pra preview iframe`));
62548
62815
  console.log("");
62549
62816
  if (opts.open) {
62550
- const { default: open2 } = await import("open");
62551
- await open2(paths.reportHtml).catch(() => {
62817
+ const { default: open3 } = await import("open");
62818
+ await open3(paths.reportHtml).catch(() => {
62552
62819
  return;
62553
62820
  });
62554
62821
  }
@@ -62632,7 +62899,7 @@ function parseUrlList(input) {
62632
62899
  if (input.startsWith("file:") || input.endsWith(".txt") || input.endsWith(".list")) {
62633
62900
  const path = input.replace(/^file:\/\//, "");
62634
62901
  if (existsSync18(path)) {
62635
- return readFileSync18(path, "utf8").split(/\r?\n/).map((s) => s.trim()).filter((s) => s && !s.startsWith("#")).map((s) => s.startsWith("/") ? s : `/${s}`);
62902
+ return readFileSync19(path, "utf8").split(/\r?\n/).map((s) => s.trim()).filter((s) => s && !s.startsWith("#")).map((s) => s.startsWith("/") ? s : `/${s}`);
62636
62903
  }
62637
62904
  }
62638
62905
  return input.split(",").map((s) => s.trim()).filter(Boolean).map((s) => s.startsWith("/") || s.startsWith("http") ? s : `/${s}`);
@@ -62656,7 +62923,7 @@ function printSummary6(vitals, cache) {
62656
62923
  }
62657
62924
 
62658
62925
  // src/util/version.ts
62659
- import { readFileSync as readFileSync19 } from "node:fs";
62926
+ import { readFileSync as readFileSync20 } from "node:fs";
62660
62927
  import { dirname as dirname5, resolve as resolve5 } from "node:path";
62661
62928
  import { fileURLToPath } from "node:url";
62662
62929
  function getPackageVersion() {
@@ -62665,7 +62932,7 @@ function getPackageVersion() {
62665
62932
  for (const up of ["..", "../..", "../../.."]) {
62666
62933
  try {
62667
62934
  const pkgPath = resolve5(here, up, "package.json");
62668
- const raw = readFileSync19(pkgPath, "utf8");
62935
+ const raw = readFileSync20(pkgPath, "utf8");
62669
62936
  const parsed = JSON.parse(raw);
62670
62937
  if (parsed.name === "@decocms/parity" && typeof parsed.version === "string") {
62671
62938
  return parsed.version;
@@ -62850,7 +63117,7 @@ program.command("extract").description("Single-site AI-ready component extractio
62850
63117
  json: opts.json
62851
63118
  }));
62852
63119
  });
62853
- program.command("migrate").description("Single-site, phased migration capture (theme → sitemap → components). No prod×cand comparison — produces a target-agnostic, token-lean bundle + prompt for a migration agent: site theme (colors/typography/spacing as Tailwind tokens), classified pages, and per-component detail (suggested Tailwind classes, interaction hints, e2e selectors). Works whether or not the source code exists. Pass --target faststore to append a target playbook. Resumable: re-runs skip a completed phase unless --refresh.").requiredOption("--url <url>", "Site to migrate from").option("--pages <list>", 'Comma-separated pages: literal paths/URLs, and/or "category-auto"/"pdp-auto". Default: "/,category-auto,pdp-auto" (home + a PLP + a PDP).').option("--components <list>", "Comma-separated role allowlist, e.g. header,footer,nav,shelf,minicart. Default: all detected.").option("--target <name>", "Target playbook to append to the prompt (e.g. faststore)").option("--viewport <viewport>", "Primary viewport for component capture: mobile | desktop | tablet", "mobile").option("--viewports <list>", "Comma-separated viewports for theme + site screenshots (e.g. mobile,desktop). Default: --viewport only.").option("--format <fmt>", "md | json | both", "both").option("--out <dir>", "Output directory (stable per host, for resume)", "./parity-migrate").option("--refresh", "Re-run all phases even if cached artifacts exist", false).option("--no-llm", "Skip the optional LLM component-relabeling pass (heuristic detection always runs regardless).").option("--json", "Emit one-line JSON instead of pretty text", false).action(async (opts) => {
63120
+ program.command("migrate").description("Single-site, phased migration capture (theme → sitemap → components). No prod×cand comparison — produces a target-agnostic, token-lean bundle + prompt for a migration agent: site theme (colors/typography/spacing as Tailwind tokens), classified pages, and per-component detail (suggested Tailwind classes, interaction hints, e2e selectors). Works whether or not the source code exists. Pass --target faststore to append a target playbook. Resumable: re-runs skip a completed phase unless --refresh.").requiredOption("--url <url>", "Site to migrate from").option("--pages <list>", 'Comma-separated pages: literal paths/URLs, and/or "category-auto"/"pdp-auto". Default: "/,category-auto,pdp-auto" (home + a PLP + a PDP).').option("--components <list>", "Comma-separated role allowlist, e.g. header,footer,nav,shelf,minicart. Default: all detected.").option("--target <name>", "Target playbook to append to the prompt (e.g. faststore)").option("--viewport <viewport>", "Primary viewport for component capture: mobile | desktop | tablet", "mobile").option("--viewports <list>", "Comma-separated viewports for theme + site screenshots (e.g. mobile,desktop). Default: --viewport only.").option("--format <fmt>", "md | json | both", "both").option("--out <dir>", "Output directory (stable per host, for resume)", "./parity-migrate").option("--refresh", "Re-run all phases even if cached artifacts exist", false).option("--open", "Open the generated index.html visual report in the browser", false).option("--no-llm", "Skip the optional LLM component-relabeling pass (heuristic detection always runs regardless).").option("--json", "Emit one-line JSON instead of pretty text", false).action(async (opts) => {
62854
63121
  process.exit(await migrateCommand({
62855
63122
  url: opts.url,
62856
63123
  pages: opts.pages,
@@ -62861,6 +63128,7 @@ program.command("migrate").description("Single-site, phased migration capture (t
62861
63128
  format: opts.format,
62862
63129
  outDir: opts.out,
62863
63130
  refresh: opts.refresh,
63131
+ open: opts.open,
62864
63132
  noLlm: !opts.llm,
62865
63133
  json: opts.json
62866
63134
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/parity",
3
- "version": "0.18.0",
3
+ "version": "0.19.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",