@decocms/parity 0.25.1 → 0.26.1
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 +47 -0
- package/dist/cli.js +115 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,53 @@ 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.26.0] — 2026-08-21
|
|
9
|
+
|
|
10
|
+
Fixes the failure mode found running the plugin on a mature FastStore target
|
|
11
|
+
(electrolux-poc): the run filed 13 issues and opened 5 stacked PRs — i18n,
|
|
12
|
+
`:global()`, `rgba()` tokens, GA4 analytics, JSON-LD — and **zero** about the
|
|
13
|
+
work actually in progress (missing components, pages without content). Root
|
|
14
|
+
cause: `.parity/migration-plan.json` was never persisted, so the triager had
|
|
15
|
+
nothing to compare against, reported no missing components, and the orchestrator
|
|
16
|
+
degenerated into a CSS/perf linter over whatever the repo contained — while
|
|
17
|
+
reconcile imported the target's whole polish backlog as issues.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
* **`parity plan status`** — the migration inventory. Prints components settled
|
|
22
|
+
(no work needed) vs remaining, and pages done vs **awaiting CMS content**,
|
|
23
|
+
with `--json` for the orchestrator. This is the "what's actually left?" view
|
|
24
|
+
that was missing.
|
|
25
|
+
* **Page readiness tracking.** `pages[]` rows now carry a `status`
|
|
26
|
+
(`pending` \| `code` \| `done` \| `skipped`) flipped by **`parity plan
|
|
27
|
+
set-page-status <path> <status>`**. `code` means the route/sections exist but
|
|
28
|
+
the CMS has no published content — on FastStore the most common real state,
|
|
29
|
+
and previously not modeled at all (code-complete was indistinguishable from
|
|
30
|
+
page-complete). Plans written before this read as `pending`.
|
|
31
|
+
* **`partial` component status.** A half-wired section (CMS schema with no
|
|
32
|
+
`index.tsx` registration, or the reverse) is neither pending nor done;
|
|
33
|
+
reporting it as `pending` sent a porter to redo finished work.
|
|
34
|
+
* **Stage scoping (`state.stage`: `components` \| `pages` \| `polish`).** Scopes
|
|
35
|
+
what `triage` reports and what gets imported from the target's backlog, so a
|
|
36
|
+
run works on the current goal. In `components`/`pages`, CSS tokens, i18n, CLS,
|
|
37
|
+
perf/bundle, analytics/GTM, SEO and a11y contrast are **deferred, not filed**
|
|
38
|
+
(listed as deferred so nothing is silently dropped). (`migration-orchestrator`,
|
|
39
|
+
`triager`)
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
* **Reconcile hard-gates on the plan.** The orchestrator must verify
|
|
44
|
+
`<target.dir>/.parity/migration-plan.json` exists before `porting`/`triage`,
|
|
45
|
+
classify every page's readiness, and report `parity plan status` to the user
|
|
46
|
+
before doing any work. Backlog import is now stage-filtered instead of
|
|
47
|
+
wholesale. (`migration-orchestrator`)
|
|
48
|
+
* **`triager` is stage- and platform-scoped.** Runs only the checks the stage
|
|
49
|
+
allows, returns a `deferred` list for the rest, refuses to survey when the plan
|
|
50
|
+
is absent (returns one critical issue instead of lint findings), and skips the
|
|
51
|
+
deco-fresh-only checks (`.deco/blocks/`, `.deco/sections.gen.ts`) on
|
|
52
|
+
`faststore-v4` where those paths do not exist. Missing-section detection now
|
|
53
|
+
matches by concept and distinguishes `partial` from missing. (`triager`)
|
|
54
|
+
|
|
8
55
|
## [0.25.1] — 2026-08-20
|
|
9
56
|
|
|
10
57
|
### Fixed
|
package/dist/cli.js
CHANGED
|
@@ -62827,7 +62827,7 @@ function buildMigrationPlan(input) {
|
|
|
62827
62827
|
timestamp: bundle.timestamp,
|
|
62828
62828
|
source: { kind: source.kind, label: source.label, dir: source.dir, notes: inventory.notes },
|
|
62829
62829
|
target: { name: bundle.target ?? null },
|
|
62830
|
-
pages: bundle.pages.map((p) => ({ path: p.path, kind: p.kind })),
|
|
62830
|
+
pages: bundle.pages.map((p) => ({ path: p.path, kind: p.kind, status: "pending" })),
|
|
62831
62831
|
components
|
|
62832
62832
|
};
|
|
62833
62833
|
}
|
|
@@ -62850,6 +62850,58 @@ function setComponentStatus(plan, name, status) {
|
|
|
62850
62850
|
component.status = status;
|
|
62851
62851
|
return component;
|
|
62852
62852
|
}
|
|
62853
|
+
function setPageStatus(plan, path, status) {
|
|
62854
|
+
const norm = (p) => `/${p.trim().replace(/^\/+|\/+$/g, "")}` || "/";
|
|
62855
|
+
const target = norm(path);
|
|
62856
|
+
const page = plan.pages.find((p) => p.path === path) ?? plan.pages.find((p) => norm(p.path) === target);
|
|
62857
|
+
if (!page)
|
|
62858
|
+
return null;
|
|
62859
|
+
page.status = status;
|
|
62860
|
+
return page;
|
|
62861
|
+
}
|
|
62862
|
+
function planProgress(plan) {
|
|
62863
|
+
const compByStatus = {
|
|
62864
|
+
pending: 0,
|
|
62865
|
+
partial: 0,
|
|
62866
|
+
done: 0,
|
|
62867
|
+
skipped: 0
|
|
62868
|
+
};
|
|
62869
|
+
const settled = [];
|
|
62870
|
+
const remaining = [];
|
|
62871
|
+
for (const c of plan.components) {
|
|
62872
|
+
compByStatus[c.status] = (compByStatus[c.status] ?? 0) + 1;
|
|
62873
|
+
if (c.status === "done" || c.status === "skipped")
|
|
62874
|
+
settled.push(c.name);
|
|
62875
|
+
else
|
|
62876
|
+
remaining.push({
|
|
62877
|
+
name: c.name,
|
|
62878
|
+
status: c.status,
|
|
62879
|
+
scope: c.scope ?? "page",
|
|
62880
|
+
origin: c.origin
|
|
62881
|
+
});
|
|
62882
|
+
}
|
|
62883
|
+
const pageByStatus = { pending: 0, code: 0, done: 0, skipped: 0 };
|
|
62884
|
+
const awaitingContent = [];
|
|
62885
|
+
const pagesRemaining = [];
|
|
62886
|
+
for (const p of plan.pages) {
|
|
62887
|
+
const status = p.status ?? "pending";
|
|
62888
|
+
pageByStatus[status] = (pageByStatus[status] ?? 0) + 1;
|
|
62889
|
+
if (status === "code")
|
|
62890
|
+
awaitingContent.push(p.path);
|
|
62891
|
+
if (status !== "done" && status !== "skipped") {
|
|
62892
|
+
pagesRemaining.push({ path: p.path, kind: p.kind, status });
|
|
62893
|
+
}
|
|
62894
|
+
}
|
|
62895
|
+
return {
|
|
62896
|
+
components: { total: plan.components.length, byStatus: compByStatus, settled, remaining },
|
|
62897
|
+
pages: {
|
|
62898
|
+
total: plan.pages.length,
|
|
62899
|
+
byStatus: pageByStatus,
|
|
62900
|
+
awaitingContent,
|
|
62901
|
+
remaining: pagesRemaining
|
|
62902
|
+
}
|
|
62903
|
+
};
|
|
62904
|
+
}
|
|
62853
62905
|
function syntheticSourceComponents(plan) {
|
|
62854
62906
|
return plan.components.filter((c) => c.origin === "source-only").map((c) => ({
|
|
62855
62907
|
role: c.name,
|
|
@@ -64297,7 +64349,8 @@ function sleep2(ms) {
|
|
|
64297
64349
|
|
|
64298
64350
|
// src/commands/plan.ts
|
|
64299
64351
|
import chalk18 from "chalk";
|
|
64300
|
-
var STATUSES = ["pending", "done", "skipped"];
|
|
64352
|
+
var STATUSES = ["pending", "partial", "done", "skipped"];
|
|
64353
|
+
var PAGE_STATUSES = ["pending", "code", "done", "skipped"];
|
|
64301
64354
|
function planSetStatusCommand(dir, name, status) {
|
|
64302
64355
|
if (!STATUSES.includes(status)) {
|
|
64303
64356
|
console.error(chalk18.red(`Invalid status "${status}". Use one of: ${STATUSES.join(", ")}`));
|
|
@@ -64317,6 +64370,61 @@ function planSetStatusCommand(dir, name, status) {
|
|
|
64317
64370
|
console.log(`${chalk18.green("✓")} ${component.name} → ${status}`);
|
|
64318
64371
|
return 0;
|
|
64319
64372
|
}
|
|
64373
|
+
function planSetPageStatusCommand(dir, path, status) {
|
|
64374
|
+
if (!PAGE_STATUSES.includes(status)) {
|
|
64375
|
+
console.error(chalk18.red(`Invalid status "${status}". Use one of: ${PAGE_STATUSES.join(", ")}`));
|
|
64376
|
+
return 1;
|
|
64377
|
+
}
|
|
64378
|
+
const plan = loadPlan(dir);
|
|
64379
|
+
if (!plan) {
|
|
64380
|
+
console.error(chalk18.red(`No migration-plan.json found in ${dir}`));
|
|
64381
|
+
return 1;
|
|
64382
|
+
}
|
|
64383
|
+
const page = setPageStatus(plan, path, status);
|
|
64384
|
+
if (!page) {
|
|
64385
|
+
console.error(chalk18.red(`No page matching "${path}" in the plan`));
|
|
64386
|
+
return 1;
|
|
64387
|
+
}
|
|
64388
|
+
savePlan(dir, plan);
|
|
64389
|
+
console.log(`${chalk18.green("✓")} ${page.path} → ${status}`);
|
|
64390
|
+
return 0;
|
|
64391
|
+
}
|
|
64392
|
+
function planStatusCommand(dir, asJson) {
|
|
64393
|
+
const plan = loadPlan(dir);
|
|
64394
|
+
if (!plan) {
|
|
64395
|
+
console.error(chalk18.red(`No migration-plan.json found in ${dir}`));
|
|
64396
|
+
console.error(chalk18.yellow("Run `parity migrate --url <prod>` first — without a plan there is no inventory."));
|
|
64397
|
+
return 1;
|
|
64398
|
+
}
|
|
64399
|
+
const p = planProgress(plan);
|
|
64400
|
+
if (asJson) {
|
|
64401
|
+
console.log(JSON.stringify({ url: plan.url, target: plan.target.name, ...p }, null, 2));
|
|
64402
|
+
return 0;
|
|
64403
|
+
}
|
|
64404
|
+
const c = p.components;
|
|
64405
|
+
console.log(chalk18.bold(`
|
|
64406
|
+
Migration plan — ${plan.url}${plan.target.name ? ` → ${plan.target.name}` : ""}`));
|
|
64407
|
+
console.log(`
|
|
64408
|
+
${chalk18.bold("Components")} (${c.total}): ` + `${chalk18.green(`${c.byStatus.done} done`)}, ` + `${chalk18.yellow(`${c.byStatus.partial} partial`)}, ` + `${chalk18.red(`${c.byStatus.pending} pending`)}, ` + `${chalk18.gray(`${c.byStatus.skipped} skipped`)}`);
|
|
64409
|
+
if (c.settled.length) {
|
|
64410
|
+
console.log(chalk18.gray(` no work needed: ${c.settled.join(", ")}`));
|
|
64411
|
+
}
|
|
64412
|
+
for (const r of c.remaining) {
|
|
64413
|
+
const tag = r.status === "partial" ? chalk18.yellow("partial") : chalk18.red("pending");
|
|
64414
|
+
console.log(` ${tag} ${r.name} ${chalk18.gray(`(${r.scope}, ${r.origin})`)}`);
|
|
64415
|
+
}
|
|
64416
|
+
const pg = p.pages;
|
|
64417
|
+
console.log(`
|
|
64418
|
+
${chalk18.bold("Pages")} (${pg.total}): ` + `${chalk18.green(`${pg.byStatus.done} done`)}, ` + `${chalk18.yellow(`${pg.byStatus.code} code-only`)}, ` + `${chalk18.red(`${pg.byStatus.pending} pending`)}, ` + `${chalk18.gray(`${pg.byStatus.skipped} skipped`)}`);
|
|
64419
|
+
if (pg.awaitingContent.length) {
|
|
64420
|
+
console.log(chalk18.yellow(` awaiting CMS content: ${pg.awaitingContent.join(", ")}`));
|
|
64421
|
+
}
|
|
64422
|
+
for (const r of pg.remaining.filter((r2) => r2.status === "pending")) {
|
|
64423
|
+
console.log(` ${chalk18.red("pending")} ${r.path} ${chalk18.gray(`(${r.kind})`)}`);
|
|
64424
|
+
}
|
|
64425
|
+
console.log("");
|
|
64426
|
+
return 0;
|
|
64427
|
+
}
|
|
64320
64428
|
|
|
64321
64429
|
// src/commands/pr.ts
|
|
64322
64430
|
import { existsSync as existsSync18, readFileSync as readFileSync22, writeFileSync as writeFileSync24 } from "node:fs";
|
|
@@ -67088,8 +67196,12 @@ program.command("list").description("List saved runs").option("--output <dir>",
|
|
|
67088
67196
|
}).addCommand(new Command("modules").description("List the 8 selectable check modules (M3 module selection) with their descriptions, checks, and flows — see --only/--skip on `parity run`.").option("--json", "Emit structured JSON instead of human-readable text", false).action((opts) => {
|
|
67089
67197
|
process.exit(listModulesCommand(Boolean(opts.json)));
|
|
67090
67198
|
}));
|
|
67091
|
-
program.command("plan").description("Inspect/update the migration-plan.json component contract").addCommand(new Command("set-status").description("Mark a component pending|done|skipped as the orchestrator ports it").argument("<name>", "Component name (case- and separator-insensitive)").argument("<status>", "pending | done | skipped").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").action((name, status, opts) => {
|
|
67199
|
+
program.command("plan").description("Inspect/update the migration-plan.json component contract").addCommand(new Command("set-status").description("Mark a component pending|partial|done|skipped as the orchestrator ports it").argument("<name>", "Component name (case- and separator-insensitive)").argument("<status>", "pending | partial | done | skipped").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").action((name, status, opts) => {
|
|
67092
67200
|
process.exit(planSetStatusCommand(opts.dir, name, status));
|
|
67201
|
+
})).addCommand(new Command("set-page-status").description("Mark a page pending|code|done|skipped (code = route built, content missing)").argument("<path>", "Page path, e.g. / or /refrigeracion").argument("<status>", "pending | code | done | skipped").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").action((path, status, opts) => {
|
|
67202
|
+
process.exit(planSetPageStatusCommand(opts.dir, path, status));
|
|
67203
|
+
})).addCommand(new Command("status").description("Migration inventory: components settled vs remaining, pages done vs awaiting CMS content").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").option("--json", "Emit structured JSON instead of human-readable text", false).action((opts) => {
|
|
67204
|
+
process.exit(planStatusCommand(opts.dir, Boolean(opts.json)));
|
|
67093
67205
|
}));
|
|
67094
67206
|
program.command("serve").argument("<runId>", "Run ID to serve").description("Spawns a local HTTP server that serves the report and proxies external iframes (strips X-Frame-Options/CSP), making the Side-by-side tab functional for any site.").option("--output <dir>", "Output directory where runs live", "./parity-output").option("--port <n>", "Fixed port (default: auto-pick free port)", (v) => Number(v)).option("--no-open", "Don't open the browser automatically").action(async (runId, opts) => {
|
|
67095
67207
|
process.exit(await serveCommand(runId, opts));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/parity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
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",
|