@decocms/parity 0.27.0 → 0.28.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 +48 -0
- package/dist/cli.js +169 -34
- package/package.json +1 -1
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.28.1] — 2026-08-24
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
* **`PARITY_STUDIO_URL` accepts a full MCP endpoint.** Studio deployments are
|
|
13
|
+
org-scoped (`https://studio.decocms.com/api/<org>/mcp/self`), and the client
|
|
14
|
+
appended `/mcp/self` to whatever was set — hitting the root path instead, which
|
|
15
|
+
404s on a real deployment. It now uses the value as-is when it already points at
|
|
16
|
+
an `/mcp/` endpoint and only appends for a bare host. Note that on an org-scoped
|
|
17
|
+
URL the **organization comes from the URL**, not only from the token.
|
|
18
|
+
|
|
19
|
+
## [0.28.0] — 2026-08-24
|
|
20
|
+
|
|
21
|
+
The Studio board stops being a one-way report: the client can now see the fixes
|
|
22
|
+
that landed and talk back on a card, and what they say enters the flow.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
* **`parity plan notes` — the client's input channel.** Reads the comments the
|
|
27
|
+
client leaves on a page's card (`TASK_BOARD_COMMENT_LIST`), so *"this product
|
|
28
|
+
card should match the Brazil site, not Ecuador"* becomes a proposed
|
|
29
|
+
`set-reference` + `set-status upgrade` — exactly what those exist for. `--post`
|
|
30
|
+
writes a confirmation back on the card so the client sees their note became a
|
|
31
|
+
decision; our comments are prefixed and skipped on the next read, so a
|
|
32
|
+
confirmation never returns as fresh input. Notes are **proposals**: `as-is` and
|
|
33
|
+
`upgrade` still need the user, since only they get to say "stop working on this".
|
|
34
|
+
* **Fix cards (`parity plan board --fixes <file>`).** Mirrors the fixes a client
|
|
35
|
+
would recognise as their own cards, with the PR URL in the description and
|
|
36
|
+
`closed` rendering as `done` — "we fixed X" without them reading GitHub. Scoped
|
|
37
|
+
on purpose: lint, bundle and infra findings bury the board that is supposed to
|
|
38
|
+
show progress.
|
|
39
|
+
* **`--repo <owner/name>`** stored on each card, so the board knows where the work
|
|
40
|
+
lives.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
* **Cards are anchored by id, not title.** The card id is stored on the page
|
|
45
|
+
(`PlanPage.boardItemId`) and carried across a re-capture by `mergePlanDecisions`.
|
|
46
|
+
Without it, renaming a card orphaned the client's comments and the next sync
|
|
47
|
+
built a second board. Titles are now the plain page path — the previous
|
|
48
|
+
`[host] /path` prefix existed only because the item was thought to have no repo
|
|
49
|
+
field; it does.
|
|
50
|
+
* **Orchestrator: a `client-notes` step** at the start of each page cycle when the
|
|
51
|
+
board goes to the Studio — read notes, propose the plan change, ask, apply,
|
|
52
|
+
confirm on the card. A note that cannot be acted on is answered, never left
|
|
53
|
+
silently unread: the client is watching that card to know they were heard.
|
|
54
|
+
(`migration-orchestrator`)
|
|
55
|
+
|
|
8
56
|
## [0.27.0] — 2026-08-21
|
|
9
57
|
|
|
10
58
|
### Added
|
package/dist/cli.js
CHANGED
|
@@ -63724,6 +63724,8 @@ function mergePlanDecisions(fresh, previous) {
|
|
|
63724
63724
|
const prev2 = prevPages.get(page.path);
|
|
63725
63725
|
if (prev2?.status && prev2.status !== "pending")
|
|
63726
63726
|
page.status = prev2.status;
|
|
63727
|
+
if (prev2?.boardItemId)
|
|
63728
|
+
page.boardItemId = prev2.boardItemId;
|
|
63727
63729
|
}
|
|
63728
63730
|
return { plan: fresh, carried, droppedWithDecisions };
|
|
63729
63731
|
}
|
|
@@ -63759,6 +63761,13 @@ function findPage(plan, path) {
|
|
|
63759
63761
|
const target = norm(path);
|
|
63760
63762
|
return plan.pages.find((p) => p.path === path) ?? plan.pages.find((p) => norm(p.path) === target) ?? null;
|
|
63761
63763
|
}
|
|
63764
|
+
function setPageBoardItemId(plan, path, boardItemId) {
|
|
63765
|
+
const page = findPage(plan, path);
|
|
63766
|
+
if (!page)
|
|
63767
|
+
return null;
|
|
63768
|
+
page.boardItemId = boardItemId;
|
|
63769
|
+
return page;
|
|
63770
|
+
}
|
|
63762
63771
|
function planProgress(plan) {
|
|
63763
63772
|
const compByStatus = {
|
|
63764
63773
|
pending: 0,
|
|
@@ -63912,7 +63921,8 @@ function planBoard(plan, candUrl) {
|
|
|
63912
63921
|
column,
|
|
63913
63922
|
blockers: (page.tasks ?? []).filter((t) => t.disposition === "build" && t.scope !== "global").map((t) => t.name),
|
|
63914
63923
|
counts: page.counts,
|
|
63915
|
-
ready: page.ready
|
|
63924
|
+
ready: page.ready,
|
|
63925
|
+
boardItemId: p.boardItemId
|
|
63916
63926
|
});
|
|
63917
63927
|
}
|
|
63918
63928
|
const onAnyPage = new Set(plan.pages.flatMap((p) => (p.components ?? []).map(key)));
|
|
@@ -65221,6 +65231,7 @@ function sleep2(ms) {
|
|
|
65221
65231
|
}
|
|
65222
65232
|
|
|
65223
65233
|
// src/commands/plan.ts
|
|
65234
|
+
import { readFileSync as readFileSync21 } from "node:fs";
|
|
65224
65235
|
import chalk18 from "chalk";
|
|
65225
65236
|
|
|
65226
65237
|
// src/board/studio.ts
|
|
@@ -65237,11 +65248,16 @@ function studioConfigFromEnv(env = process.env) {
|
|
|
65237
65248
|
const token = env.PARITY_STUDIO_TOKEN;
|
|
65238
65249
|
if (!url || !token)
|
|
65239
65250
|
return null;
|
|
65240
|
-
return { url: url
|
|
65251
|
+
return { url: mcpEndpoint(url), token };
|
|
65252
|
+
}
|
|
65253
|
+
function mcpEndpoint(url) {
|
|
65254
|
+
const trimmed = url.replace(/\/+$/, "");
|
|
65255
|
+
return /\/mcp(\/|$)/.test(trimmed) ? trimmed : `${trimmed}/mcp/self`;
|
|
65241
65256
|
}
|
|
65242
|
-
function cardTitle(
|
|
65243
|
-
return
|
|
65257
|
+
function cardTitle(path) {
|
|
65258
|
+
return path;
|
|
65244
65259
|
}
|
|
65260
|
+
var PARITY_COMMENT_PREFIX = "[parity]";
|
|
65245
65261
|
function cardDescription(card) {
|
|
65246
65262
|
const lines = [`kind: ${card.kind}`, `lane: ${card.column}`];
|
|
65247
65263
|
if (card.blockers.length)
|
|
@@ -65265,7 +65281,7 @@ function parseRpcBody(body) {
|
|
|
65265
65281
|
return JSON.parse(last2);
|
|
65266
65282
|
}
|
|
65267
65283
|
var callTool2 = async (cfg, name, args) => {
|
|
65268
|
-
const res = await fetch(
|
|
65284
|
+
const res = await fetch(cfg.url, {
|
|
65269
65285
|
method: "POST",
|
|
65270
65286
|
headers: {
|
|
65271
65287
|
"content-type": "application/json",
|
|
@@ -65292,11 +65308,27 @@ var callTool2 = async (cfg, name, args) => {
|
|
|
65292
65308
|
}
|
|
65293
65309
|
return result?.structuredContent ?? {};
|
|
65294
65310
|
};
|
|
65295
|
-
async function syncBoardToStudio(board, cfg, call = callTool2) {
|
|
65296
|
-
const host = new URL(board.url).host;
|
|
65311
|
+
async function syncBoardToStudio(board, cfg, opts = {}, call = callTool2) {
|
|
65297
65312
|
const existing = await call(cfg, "TASK_BOARD_ITEM_LIST", {});
|
|
65298
65313
|
const byTitle = new Map((existing.items ?? []).map((i) => [i.title, i]));
|
|
65299
|
-
const
|
|
65314
|
+
const byId = new Map((existing.items ?? []).map((i) => [i.id, i]));
|
|
65315
|
+
const result = { created: 0, updated: 0, skipped: 0, ids: {} };
|
|
65316
|
+
const upsert = async (title, description, status, knownId) => {
|
|
65317
|
+
const found = (knownId ? byId.get(knownId) : undefined) ?? byTitle.get(title);
|
|
65318
|
+
if (found) {
|
|
65319
|
+
await call(cfg, "TASK_BOARD_ITEM_UPDATE", { id: found.id, title, status, description });
|
|
65320
|
+
result.updated += 1;
|
|
65321
|
+
return found.id;
|
|
65322
|
+
}
|
|
65323
|
+
const created = await call(cfg, "TASK_BOARD_ITEM_CREATE", {
|
|
65324
|
+
title,
|
|
65325
|
+
description,
|
|
65326
|
+
status,
|
|
65327
|
+
...opts.repo ? { repo: opts.repo } : {}
|
|
65328
|
+
});
|
|
65329
|
+
result.created += 1;
|
|
65330
|
+
return created.item?.id;
|
|
65331
|
+
};
|
|
65300
65332
|
for (const cards of Object.values(board.columns)) {
|
|
65301
65333
|
for (const card of cards) {
|
|
65302
65334
|
const status = LANE_TO_STUDIO[card.column];
|
|
@@ -65304,20 +65336,58 @@ async function syncBoardToStudio(board, cfg, call = callTool2) {
|
|
|
65304
65336
|
result.skipped += 1;
|
|
65305
65337
|
continue;
|
|
65306
65338
|
}
|
|
65307
|
-
const
|
|
65308
|
-
|
|
65309
|
-
|
|
65310
|
-
if (found) {
|
|
65311
|
-
await call(cfg, "TASK_BOARD_ITEM_UPDATE", { id: found.id, status, description });
|
|
65312
|
-
result.updated += 1;
|
|
65313
|
-
} else {
|
|
65314
|
-
await call(cfg, "TASK_BOARD_ITEM_CREATE", { title, description, status });
|
|
65315
|
-
result.created += 1;
|
|
65316
|
-
}
|
|
65339
|
+
const id = await upsert(cardTitle(card.path), cardDescription(card), status, card.boardItemId);
|
|
65340
|
+
if (id)
|
|
65341
|
+
result.ids[card.path] = id;
|
|
65317
65342
|
}
|
|
65318
65343
|
}
|
|
65344
|
+
for (const fix of opts.fixes ?? []) {
|
|
65345
|
+
await upsert(fix.title, fixDescription(fix), FIX_STATE_TO_STUDIO[fix.state]);
|
|
65346
|
+
}
|
|
65319
65347
|
return result;
|
|
65320
65348
|
}
|
|
65349
|
+
async function fetchClientNotes(pages, cfg, call = callTool2) {
|
|
65350
|
+
const notes = [];
|
|
65351
|
+
for (const page of pages) {
|
|
65352
|
+
const res = await call(cfg, "TASK_BOARD_COMMENT_LIST", {
|
|
65353
|
+
taskBoardItemId: page.boardItemId
|
|
65354
|
+
});
|
|
65355
|
+
for (const c of res.comments ?? []) {
|
|
65356
|
+
if (c.body.trimStart().startsWith(PARITY_COMMENT_PREFIX))
|
|
65357
|
+
continue;
|
|
65358
|
+
if (c.resolved)
|
|
65359
|
+
continue;
|
|
65360
|
+
notes.push({
|
|
65361
|
+
path: page.path,
|
|
65362
|
+
boardItemId: page.boardItemId,
|
|
65363
|
+
commentId: c.id,
|
|
65364
|
+
body: c.body,
|
|
65365
|
+
createdAt: c.createdAt
|
|
65366
|
+
});
|
|
65367
|
+
}
|
|
65368
|
+
}
|
|
65369
|
+
return notes;
|
|
65370
|
+
}
|
|
65371
|
+
async function postParityComment(boardItemId, body, cfg, call = callTool2) {
|
|
65372
|
+
await call(cfg, "TASK_BOARD_COMMENT_CREATE", {
|
|
65373
|
+
taskBoardItemId: boardItemId,
|
|
65374
|
+
body: `${PARITY_COMMENT_PREFIX} ${body}`
|
|
65375
|
+
});
|
|
65376
|
+
}
|
|
65377
|
+
var FIX_STATE_TO_STUDIO = {
|
|
65378
|
+
open: "todo",
|
|
65379
|
+
in_review: "in_review",
|
|
65380
|
+
closed: "done"
|
|
65381
|
+
};
|
|
65382
|
+
function fixDescription(fix) {
|
|
65383
|
+
const lines = [];
|
|
65384
|
+
if (fix.body)
|
|
65385
|
+
lines.push(fix.body);
|
|
65386
|
+
if (fix.prUrl)
|
|
65387
|
+
lines.push(`PR: ${fix.prUrl}`);
|
|
65388
|
+
return lines.join(`
|
|
65389
|
+
`);
|
|
65390
|
+
}
|
|
65321
65391
|
|
|
65322
65392
|
// src/commands/plan.ts
|
|
65323
65393
|
var STATUSES = ["pending", "partial", "done", "as-is", "upgrade", "skipped"];
|
|
@@ -65582,7 +65652,15 @@ ${chalk18.bold("no page")} ${chalk18.gray("(in the code, not seen on any sampled
|
|
|
65582
65652
|
return 0;
|
|
65583
65653
|
}
|
|
65584
65654
|
try {
|
|
65585
|
-
const
|
|
65655
|
+
const fixes = opts.fixes ? JSON.parse(readFileSync21(opts.fixes, "utf8")) : undefined;
|
|
65656
|
+
const synced = await syncBoardToStudio(board, cfg, { repo: opts.repo, fixes });
|
|
65657
|
+
let stored = 0;
|
|
65658
|
+
for (const [path, id] of Object.entries(synced.ids)) {
|
|
65659
|
+
if (setPageBoardItemId(plan, path, id))
|
|
65660
|
+
stored += 1;
|
|
65661
|
+
}
|
|
65662
|
+
if (stored)
|
|
65663
|
+
savePlan(dir, plan);
|
|
65586
65664
|
console.log(chalk18.green(`Studio board synced — ${synced.created} created, ${synced.updated} updated, ${synced.skipped} skipped.
|
|
65587
65665
|
`));
|
|
65588
65666
|
} catch (err) {
|
|
@@ -65592,14 +65670,63 @@ ${chalk18.bold("no page")} ${chalk18.gray("(in the code, not seen on any sampled
|
|
|
65592
65670
|
}
|
|
65593
65671
|
return 0;
|
|
65594
65672
|
}
|
|
65673
|
+
async function planNotesCommand(dir, opts) {
|
|
65674
|
+
const plan = loadPlan(dir);
|
|
65675
|
+
if (!plan) {
|
|
65676
|
+
console.error(chalk18.red(`No migration-plan.json found in ${dir}`));
|
|
65677
|
+
return 1;
|
|
65678
|
+
}
|
|
65679
|
+
const cfg = studioConfigFromEnv();
|
|
65680
|
+
if (!cfg) {
|
|
65681
|
+
console.error(chalk18.yellow("Studio not configured — set PARITY_STUDIO_URL and PARITY_STUDIO_TOKEN."));
|
|
65682
|
+
return 1;
|
|
65683
|
+
}
|
|
65684
|
+
if (opts.post) {
|
|
65685
|
+
const page = plan.pages.find((p) => p.path === opts.page);
|
|
65686
|
+
if (!page?.boardItemId) {
|
|
65687
|
+
console.error(chalk18.red(`No synced card for page "${opts.page}" — run \`parity plan board --board studio\` first`));
|
|
65688
|
+
return 1;
|
|
65689
|
+
}
|
|
65690
|
+
await postParityComment(page.boardItemId, opts.post, cfg);
|
|
65691
|
+
console.log(`${chalk18.green("✓")} comment posted on ${page.path}`);
|
|
65692
|
+
return 0;
|
|
65693
|
+
}
|
|
65694
|
+
const pages = plan.pages.filter((p) => p.boardItemId).filter((p) => !opts.page || p.path === opts.page).map((p) => ({ path: p.path, boardItemId: p.boardItemId }));
|
|
65695
|
+
if (!pages.length) {
|
|
65696
|
+
console.error(chalk18.yellow("No page has a synced card yet — run `parity plan board --board studio` first."));
|
|
65697
|
+
return 1;
|
|
65698
|
+
}
|
|
65699
|
+
const notes = await fetchClientNotes(pages, cfg);
|
|
65700
|
+
if (opts.json) {
|
|
65701
|
+
console.log(JSON.stringify({ notes }, null, 2));
|
|
65702
|
+
return 0;
|
|
65703
|
+
}
|
|
65704
|
+
if (!notes.length) {
|
|
65705
|
+
console.log(chalk18.gray(`
|
|
65706
|
+
No open client notes.
|
|
65707
|
+
`));
|
|
65708
|
+
return 0;
|
|
65709
|
+
}
|
|
65710
|
+
console.log(chalk18.bold(`
|
|
65711
|
+
Client notes (${notes.length})`));
|
|
65712
|
+
for (const n of notes) {
|
|
65713
|
+
console.log(`
|
|
65714
|
+
${chalk18.cyan(n.path)} ${chalk18.gray(n.createdAt)}`);
|
|
65715
|
+
for (const line of n.body.split(`
|
|
65716
|
+
`))
|
|
65717
|
+
console.log(` ${line}`);
|
|
65718
|
+
}
|
|
65719
|
+
console.log(chalk18.gray('\nThese are PROPOSALS. Apply with `parity plan set-reference` / `set-status`, then confirm with `parity plan notes --page <path> --post "<what you did>"`.\n'));
|
|
65720
|
+
return 0;
|
|
65721
|
+
}
|
|
65595
65722
|
|
|
65596
65723
|
// src/commands/pr.ts
|
|
65597
|
-
import { existsSync as existsSync19, readFileSync as
|
|
65724
|
+
import { existsSync as existsSync19, readFileSync as readFileSync24, writeFileSync as writeFileSync25 } from "node:fs";
|
|
65598
65725
|
import { join as join30 } from "node:path";
|
|
65599
65726
|
import chalk21 from "chalk";
|
|
65600
65727
|
|
|
65601
65728
|
// src/commands/run.ts
|
|
65602
|
-
import { existsSync as existsSync18, readFileSync as
|
|
65729
|
+
import { existsSync as existsSync18, readFileSync as readFileSync23, unlinkSync as unlinkSync3 } from "node:fs";
|
|
65603
65730
|
import { join as join29 } from "node:path";
|
|
65604
65731
|
import chalk20 from "chalk";
|
|
65605
65732
|
import ora7 from "ora";
|
|
@@ -66142,7 +66269,7 @@ import { existsSync as existsSync17 } from "node:fs";
|
|
|
66142
66269
|
import chalk19 from "chalk";
|
|
66143
66270
|
|
|
66144
66271
|
// src/server/proxy-server.ts
|
|
66145
|
-
import { existsSync as existsSync16, readFileSync as
|
|
66272
|
+
import { existsSync as existsSync16, readFileSync as readFileSync22, statSync } from "node:fs";
|
|
66146
66273
|
import { createServer } from "node:http";
|
|
66147
66274
|
import { extname, join as join28, normalize as normalize3, resolve as resolve5, sep } from "node:path";
|
|
66148
66275
|
var MIME3 = {
|
|
@@ -66244,7 +66371,7 @@ function serveReportHtml(res, runDir) {
|
|
|
66244
66371
|
res.end("report.html not found");
|
|
66245
66372
|
return;
|
|
66246
66373
|
}
|
|
66247
|
-
const html3 =
|
|
66374
|
+
const html3 = readFileSync22(filePath, "utf8");
|
|
66248
66375
|
const inject = `<script>window.__parity_proxy = "/proxy?url=";</script>`;
|
|
66249
66376
|
const out = html3.includes("</head>") ? html3.replace("</head>", `${inject}</head>`) : `${inject}${html3}`;
|
|
66250
66377
|
res.statusCode = 200;
|
|
@@ -66275,7 +66402,7 @@ function serveStatic(res, runDir, path) {
|
|
|
66275
66402
|
res.statusCode = 200;
|
|
66276
66403
|
res.setHeader("content-type", MIME3[ext] ?? "application/octet-stream");
|
|
66277
66404
|
res.setHeader("cache-control", "no-store");
|
|
66278
|
-
res.end(
|
|
66405
|
+
res.end(readFileSync22(filePath));
|
|
66279
66406
|
}
|
|
66280
66407
|
async function proxyRequest(req, res, targetUrl, opts = {}) {
|
|
66281
66408
|
let target;
|
|
@@ -67388,7 +67515,7 @@ function resolveExplicitPages(pagesFile, pagesList) {
|
|
|
67388
67515
|
if (!existsSync18(pagesFile)) {
|
|
67389
67516
|
throw new Error(`--pages-file não encontrado: ${pagesFile}`);
|
|
67390
67517
|
}
|
|
67391
|
-
const raw =
|
|
67518
|
+
const raw = readFileSync23(pagesFile, "utf-8");
|
|
67392
67519
|
const lines = raw.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0 && !l.startsWith("#"));
|
|
67393
67520
|
return lines.map(parsePagePair);
|
|
67394
67521
|
}
|
|
@@ -67619,7 +67746,7 @@ async function prCommand(opts) {
|
|
|
67619
67746
|
console.error(chalk21.red(`report.json not found at ${reportJsonPath}`));
|
|
67620
67747
|
return runCode || 1;
|
|
67621
67748
|
}
|
|
67622
|
-
const run = JSON.parse(
|
|
67749
|
+
const run = JSON.parse(readFileSync24(reportJsonPath, "utf8"));
|
|
67623
67750
|
const markdown = buildPrComment(run, opts);
|
|
67624
67751
|
if (opts.out) {
|
|
67625
67752
|
writeFileSync25(opts.out, markdown, "utf8");
|
|
@@ -67720,7 +67847,7 @@ function promptCommand(runId, opts) {
|
|
|
67720
67847
|
}
|
|
67721
67848
|
|
|
67722
67849
|
// src/commands/report.ts
|
|
67723
|
-
import { existsSync as existsSync21, readFileSync as
|
|
67850
|
+
import { existsSync as existsSync21, readFileSync as readFileSync25, writeFileSync as writeFileSync27 } from "node:fs";
|
|
67724
67851
|
import { join as join31 } from "node:path";
|
|
67725
67852
|
import chalk23 from "chalk";
|
|
67726
67853
|
import open2 from "open";
|
|
@@ -68352,7 +68479,7 @@ async function reportCommand(runId, opts) {
|
|
|
68352
68479
|
console.error(chalk23.red(`report.html not found at ${paths.reportHtml}`));
|
|
68353
68480
|
return 1;
|
|
68354
68481
|
}
|
|
68355
|
-
const html3 =
|
|
68482
|
+
const html3 = readFileSync25(paths.reportHtml, "utf8");
|
|
68356
68483
|
const slice2 = extractReportSection({ kind: "html", section: opts.section, html: html3 });
|
|
68357
68484
|
if (slice2 === null) {
|
|
68358
68485
|
console.error(chalk23.red(`section "${opts.section}" not present in this report`));
|
|
@@ -68369,7 +68496,7 @@ async function reportCommand(runId, opts) {
|
|
|
68369
68496
|
}
|
|
68370
68497
|
|
|
68371
68498
|
// src/commands/vitals.ts
|
|
68372
|
-
import { existsSync as existsSync22, readFileSync as
|
|
68499
|
+
import { existsSync as existsSync22, readFileSync as readFileSync26, writeFileSync as writeFileSync28 } from "node:fs";
|
|
68373
68500
|
import { availableParallelism } from "node:os";
|
|
68374
68501
|
import { join as join32 } from "node:path";
|
|
68375
68502
|
import chalk24 from "chalk";
|
|
@@ -68906,7 +69033,7 @@ function parseUrlList(input) {
|
|
|
68906
69033
|
if (input.startsWith("file:") || input.endsWith(".txt") || input.endsWith(".list")) {
|
|
68907
69034
|
const path = input.replace(/^file:\/\//, "");
|
|
68908
69035
|
if (existsSync22(path)) {
|
|
68909
|
-
return
|
|
69036
|
+
return readFileSync26(path, "utf8").split(/\r?\n/).map((s) => s.trim()).filter((s) => s && !s.startsWith("#")).map((s) => s.startsWith("/") ? s : `/${s}`);
|
|
68910
69037
|
}
|
|
68911
69038
|
}
|
|
68912
69039
|
return input.split(",").map((s) => s.trim()).filter(Boolean).map((s) => s.startsWith("/") || s.startsWith("http") ? s : `/${s}`);
|
|
@@ -68936,7 +69063,7 @@ function printSummary7(vitals, cache, scores, opportunities, agentic) {
|
|
|
68936
69063
|
}
|
|
68937
69064
|
|
|
68938
69065
|
// src/util/version.ts
|
|
68939
|
-
import { readFileSync as
|
|
69066
|
+
import { readFileSync as readFileSync27 } from "node:fs";
|
|
68940
69067
|
import { dirname as dirname5, resolve as resolve6 } from "node:path";
|
|
68941
69068
|
import { fileURLToPath } from "node:url";
|
|
68942
69069
|
function getPackageVersion() {
|
|
@@ -68945,7 +69072,7 @@ function getPackageVersion() {
|
|
|
68945
69072
|
for (const up of ["..", "../..", "../../.."]) {
|
|
68946
69073
|
try {
|
|
68947
69074
|
const pkgPath = resolve6(here, up, "package.json");
|
|
68948
|
-
const raw =
|
|
69075
|
+
const raw = readFileSync27(pkgPath, "utf8");
|
|
68949
69076
|
const parsed = JSON.parse(raw);
|
|
68950
69077
|
if (parsed.name === "@decocms/parity" && typeof parsed.version === "string") {
|
|
68951
69078
|
return parsed.version;
|
|
@@ -69013,11 +69140,19 @@ program.command("plan").description("Inspect/update the migration-plan.json comp
|
|
|
69013
69140
|
process.exit(planStatusCommand(opts.dir, Boolean(opts.json)));
|
|
69014
69141
|
})).addCommand(new Command("page").description("Per-page worksheet: every component the capture saw on this page, what to do about it (build | validate | upgrade | as-is | settled), and a runnable `parity section` command for the checkable ones. The unit of work a migration closes is a page, not a global queue.").argument("<path>", "Page path, e.g. / or /refrigeracion").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").option("--cand <url>", "Candidate base URL — required for runnable validation commands").option("--json", "Emit structured JSON instead of human-readable text", false).action((path, opts) => {
|
|
69015
69142
|
process.exit(planPageCommand(opts.dir, path, { cand: opts.cand, json: Boolean(opts.json) }));
|
|
69016
|
-
})).addCommand(new Command("board").description("Per-page kanban: every sampled page in a derived lane (triage | backlog | building | review | done) with what blocks it. Lanes come from each page's components, so a page cannot read as done while a component it needs is missing.").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").option("--cand <url>", "Candidate base URL — enriches cards with validation state").option("--board <where>", "terminal (default) | studio — push one card per page to the deco Studio task board (needs PARITY_STUDIO_URL + PARITY_STUDIO_TOKEN; falls back to terminal when unset or unreachable)", "terminal").option("--json", "Emit structured JSON instead of human-readable text", false).action(async (opts) => {
|
|
69143
|
+
})).addCommand(new Command("board").description("Per-page kanban: every sampled page in a derived lane (triage | backlog | building | review | done) with what blocks it. Lanes come from each page's components, so a page cannot read as done while a component it needs is missing.").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").option("--cand <url>", "Candidate base URL — enriches cards with validation state").option("--board <where>", "terminal (default) | studio — push one card per page to the deco Studio task board (needs PARITY_STUDIO_URL + PARITY_STUDIO_TOKEN; falls back to terminal when unset or unreachable)", "terminal").option("--repo <owner/name>", "Repository stored on each card, so the board knows where the work lives").option("--fixes <path>", "JSON file of client-legible fixes to mirror as cards: [{title, body?, prUrl?, state: open|in_review|closed}]").option("--json", "Emit structured JSON instead of human-readable text", false).action(async (opts) => {
|
|
69017
69144
|
process.exit(await planBoardCommand(opts.dir, {
|
|
69018
69145
|
cand: opts.cand,
|
|
69019
69146
|
json: Boolean(opts.json),
|
|
69020
|
-
board: opts.board
|
|
69147
|
+
board: opts.board,
|
|
69148
|
+
repo: opts.repo,
|
|
69149
|
+
fixes: opts.fixes
|
|
69150
|
+
}));
|
|
69151
|
+
})).addCommand(new Command("notes").description("Read the client's comments off the Studio cards — the input channel for 'compare this component against site X instead'. They are proposals: apply with set-reference/set-status, then --post a confirmation back.").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").option("--page <path>", "Only this page").option("--post <body>", "Post a confirmation comment on --page instead of reading").option("--json", "Emit structured JSON instead of human-readable text", false).action(async (opts) => {
|
|
69152
|
+
process.exit(await planNotesCommand(opts.dir, {
|
|
69153
|
+
json: Boolean(opts.json),
|
|
69154
|
+
page: opts.page,
|
|
69155
|
+
post: opts.post
|
|
69021
69156
|
}));
|
|
69022
69157
|
})).addCommand(new Command("set-reference").description("Point a component's comparison at something other than prod (a site the better component came from), and record WHY it diverges. Without this, an intentional improvement is reported as a defect on every run.").argument("<name>", "Component name (case- and separator-insensitive)").requiredOption("--note <why>", "Why this component diverges — required, not decoration").option("--url <url>", "Reference site base URL (default: the plan's prod URL)").option("--selector <sel>", "Selector on the reference site, when it differs").option("--dir <path>", "Directory holding migration-plan.json (default: the target repo's .parity/)", ".parity").action((name, opts) => {
|
|
69023
69158
|
process.exit(planSetReferenceCommand(opts.dir, name, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/parity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.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",
|