@design-parity/report-html 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -43,6 +43,36 @@ Reference and candidate PNGs are read from disk via `repoRoot + Image.uri`
43
43
  (the same resolution the diff engine uses) and inlined. A side with no images
44
44
  (a semantic/token-only verdict) degrades cleanly — the findings still render.
45
45
 
46
+ ## Branch landing page
47
+
48
+ `report.html` is per-component; `renderIndex` stitches a whole run together so
49
+ the published artifact branch has an entry point instead of a wall of
50
+ machine-named directories. Given the run's components it returns
51
+ `{ readme, html }`:
52
+
53
+ - `README.md` — what GitHub renders when you open the branch: a "generated, do
54
+ not edit" banner, the source commit, an "open the board" link, and a table
55
+ linking each component to its report.
56
+ - `index.html` — a self-contained landing page for GitHub Pages / local view,
57
+ with a small **preview thumbnail of the real candidate render** (reality, not
58
+ the mock) next to each component, inlined as a `data:` URI.
59
+
60
+ Because GitHub serves a linked `.html` blob as source (the slider JS won't run),
61
+ pass the published `repoSlug` + `branch` to wrap every report link — and the
62
+ "open the board" link to `index.html` — through `htmlpreview.github.io` so they
63
+ render on click without GitHub Pages; without them the links are relative (right
64
+ for Pages / local view). Per-entry thumbnails come from the caller as `data:`
65
+ URIs (`orchestrate` inlines the candidate's first render), keeping this package a
66
+ leaf with no disk reads. Deterministic, same as `renderHtmlReport`.
67
+
68
+ When `repoSlug` + `branch` are set, each entry also gets a **History** link to
69
+ GitHub's commit history for that screen's `report.html`. Since `report.html` is
70
+ regenerated whenever a screen's code or mock changes, its commit log is that
71
+ screen's change timeline. design-parity's `publishBaseline` re-parents each run
72
+ on the branch tip (a linear commit chain, no force), so this works out of the
73
+ box; a force-pushing publisher would flatten the branch to one commit and the
74
+ link would show only the latest run.
75
+
46
76
  ## CLI
47
77
 
48
78
  A small demo CLI ships as `design-parity-report`:
@@ -0,0 +1,65 @@
1
+ /**
2
+ * `renderIndex` — the **branch landing page**.
3
+ *
4
+ * The orchestrator writes one self-contained `report.html` per component into
5
+ * its own subdir. That's great once you know which file to open, but a human
6
+ * landing on the published branch (`design-parity/main`) sees only a list of
7
+ * machine-named directories with no entry point. This stitches them together:
8
+ *
9
+ * - `README.md` — what GitHub renders when you open the branch: a "generated,
10
+ * do not edit" banner, the source commit, and a table linking each component
11
+ * to its report.
12
+ * - `index.html` — a self-contained landing page for GitHub Pages / local view.
13
+ *
14
+ * GitHub serves a linked `.html` blob as source (it won't render the slider
15
+ * JS), so when the published `repoSlug` + `branch` are known the README links
16
+ * are wrapped through htmlpreview.github.io so they render on click; otherwise
17
+ * they fall back to relative links (which still navigate to the file).
18
+ *
19
+ * Output is deterministic: same input → byte-identical strings. No timestamps,
20
+ * random ids, or `Date.now()` — entries render in the order given.
21
+ */
22
+ import type { VerdictStatus } from "@design-parity/core";
23
+ /** A component status as shown on the landing page (verdict or non-verdict). */
24
+ export type IndexStatus = VerdictStatus | "skipped" | "error";
25
+ export interface IndexEntry {
26
+ /** Component id, e.g. `ui/DeviceBody.kt#DeviceBodyPreview`. */
27
+ code: string;
28
+ /** Verdict status, or why the component produced no verdict. */
29
+ status: IndexStatus;
30
+ /** Path to the component's `report.html`, relative to the branch root. */
31
+ reportPath?: string;
32
+ /**
33
+ * The real candidate render (reality, not the mock) as a `data:` URI, shown as
34
+ * a small preview on the landing page. Inlined so `index.html` stays
35
+ * self-contained. Omitted when there's no candidate (e.g. a skipped component).
36
+ */
37
+ thumbnail?: string;
38
+ }
39
+ export interface IndexInput {
40
+ /** Page title (default `Design parity`). */
41
+ title?: string;
42
+ /** Candidate commit the reports were rendered from, shown if provided. */
43
+ sourceCommit?: string;
44
+ /**
45
+ * `owner/repo` the index is published to. With {@link branch}, README report
46
+ * links are wrapped through htmlpreview.github.io so they render on click.
47
+ */
48
+ repoSlug?: string;
49
+ /** Branch the index is published to (e.g. `design-parity/main`). */
50
+ branch?: string;
51
+ /** Optional overview image at the branch root, e.g. `candidates.bundle.png`. */
52
+ bundleImage?: string;
53
+ /** One row per component, in display order. */
54
+ entries: IndexEntry[];
55
+ }
56
+ /** Render the branch's `README.md`. */
57
+ export declare function renderReadme(input: IndexInput): string;
58
+ /** Render the branch's self-contained `index.html` landing page. */
59
+ export declare function renderIndexHtml(input: IndexInput): string;
60
+ /** Render both branch landing artifacts from one input. */
61
+ export declare function renderIndex(input: IndexInput): {
62
+ readme: string;
63
+ html: string;
64
+ };
65
+ //# sourceMappingURL=index-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-page.d.ts","sourceRoot":"","sources":["../src/index-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,gFAAgF;AAChF,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,MAAM,EAAE,WAAW,CAAC;IACpB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAsDD,uCAAuC;AACvC,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAmDtD;AAwCD,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAoCzD;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAE/E"}
@@ -0,0 +1,159 @@
1
+ import { escapeHtml } from "./html.js";
2
+ const STATUS_TEXT = {
3
+ pass: "Pass",
4
+ warn: "Warn",
5
+ fail: "Fail",
6
+ skipped: "Skipped",
7
+ error: "Error",
8
+ };
9
+ const STATUS_EMOJI = {
10
+ pass: "✅",
11
+ warn: "⚠️",
12
+ fail: "❌",
13
+ skipped: "⏭️",
14
+ error: "🚫",
15
+ };
16
+ function short(sha) {
17
+ return /^[0-9a-f]{7,40}$/i.test(sha) ? sha.slice(0, 7) : sha;
18
+ }
19
+ /** Escape a cell for a GitHub-flavored markdown table. */
20
+ function mdCell(value) {
21
+ return value.replace(/\\/g, "\\\\").replace(/\|/g, "\\|");
22
+ }
23
+ /**
24
+ * Link target for a branch-relative `.html` path. GitHub serves a linked `.html`
25
+ * blob as source, so when the published repo + branch are known the link is
26
+ * wrapped through htmlpreview.github.io to render on click (works without Pages);
27
+ * otherwise it stays relative (right for Pages / local view).
28
+ */
29
+ function previewHref(path, input) {
30
+ if (input.repoSlug && input.branch) {
31
+ const blob = `https://github.com/${input.repoSlug}/blob/${input.branch}/${path}`;
32
+ return `https://htmlpreview.github.io/?${blob}`;
33
+ }
34
+ return `./${path}`;
35
+ }
36
+ /**
37
+ * GitHub commit-history URL for a branch-relative path, or `undefined` when the
38
+ * repo isn't known. Since `report.html` is regenerated whenever a screen's code
39
+ * or mock changes, its history is that screen's change timeline — provided the
40
+ * publish step commits each run rather than force-updating the branch.
41
+ */
42
+ function historyHref(path, input) {
43
+ if (input.repoSlug && input.branch) {
44
+ return `https://github.com/${input.repoSlug}/commits/${input.branch}/${path}`;
45
+ }
46
+ return undefined;
47
+ }
48
+ /** Render the branch's `README.md`. */
49
+ export function renderReadme(input) {
50
+ const title = input.title ?? "Design parity";
51
+ const lines = [`# ${title}`, ""];
52
+ const commit = input.sourceCommit
53
+ ? ` Rendered from \`${short(input.sourceCommit)}\` — see [\`SOURCE_COMMIT\`](./SOURCE_COMMIT).`
54
+ : " Rendered from the commit in [`SOURCE_COMMIT`](./SOURCE_COMMIT).";
55
+ lines.push(`> **Generated by [design-parity](https://github.com/yschimke/design-parity) — do not edit by hand.**`, `> This branch is rebuilt on every run.${commit}`, "");
56
+ // A one-click previewable entry to the whole board (renders the rendered
57
+ // `index.html` with thumbnails), only useful once it resolves to htmlpreview.
58
+ if (input.repoSlug && input.branch) {
59
+ lines.push(`[**Open the board →**](${previewHref("index.html", input)}) — rendered previews of every screen.`, "");
60
+ }
61
+ if (input.bundleImage) {
62
+ lines.push(`![Candidate overview](./${input.bundleImage})`, "");
63
+ }
64
+ const hasHistory = !!(input.repoSlug && input.branch);
65
+ lines.push(hasHistory ? "| Component | Status | Report | History |" : "| Component | Status | Report |", hasHistory ? "| --- | --- | --- | --- |" : "| --- | --- | --- |");
66
+ for (const e of input.entries) {
67
+ const status = `${STATUS_EMOJI[e.status]} ${STATUS_TEXT[e.status]}`;
68
+ const report = e.reportPath
69
+ ? `[report](${previewHref(e.reportPath, input)})`
70
+ : "—";
71
+ const history = e.reportPath && historyHref(e.reportPath, input)
72
+ ? `[history](${historyHref(e.reportPath, input)})`
73
+ : "—";
74
+ lines.push(hasHistory
75
+ ? `| ${mdCell(e.code)} | ${status} | ${report} | ${history} |`
76
+ : `| ${mdCell(e.code)} | ${status} | ${report} |`);
77
+ }
78
+ lines.push("");
79
+ lines.push("Each report is a self-contained HTML page — open one in a browser to view the", "reference / candidate / diff comparison. GitHub shows a linked `.html` as", "source; use the rendered links above, GitHub Pages, or download and open it.", "");
80
+ return lines.join("\n");
81
+ }
82
+ const STYLE = `:root{color-scheme:light dark}
83
+ *{box-sizing:border-box}
84
+ body{margin:0;font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:#0f0f14;color:#e7e7ef}
85
+ a{color:#9db8ff}
86
+ header.page{padding:24px 28px;border-bottom:1px solid #26262f}
87
+ header.page h1{margin:0 0 6px;font-size:18px}
88
+ .subtitle{color:#9a9ab0;font-size:13px}
89
+ .subtitle code{background:#222230;padding:1px 6px;border-radius:5px}
90
+ main{padding:20px 28px;max-width:900px}
91
+ .overview{max-width:100%;border:1px solid #26262f;border-radius:10px;margin-bottom:20px}
92
+ table{border-collapse:collapse;width:100%}
93
+ th,td{text-align:left;padding:8px 12px;border-bottom:1px solid #26262f;font-size:13px;vertical-align:top}
94
+ th{color:#9a9ab0;font-weight:600;text-transform:uppercase;letter-spacing:.04em;font-size:11px}
95
+ td.code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
96
+ .thumb{display:block;max-height:140px;max-width:200px;border:1px solid #26262f;border-radius:6px;background:#0c0c11;image-rendering:auto}
97
+ .status{display:inline-block;padding:2px 10px;border-radius:999px;font-weight:600;font-size:12px}
98
+ .status-pass{background:#16351f;color:#7ee29a}
99
+ .status-warn{background:#3a3115;color:#e8c66b}
100
+ .status-fail{background:#3a1820;color:#f08a9c}
101
+ .status-skipped{background:#222230;color:#b8b8cc}
102
+ .status-error{background:#3a1820;color:#f08a9c}
103
+ .muted{color:#666}`;
104
+ function rowMarkup(e, input, hasHistory) {
105
+ const status = `<span class="status status-${e.status}">${STATUS_TEXT[e.status]}</span>`;
106
+ const report = e.reportPath
107
+ ? `<a href="${escapeHtml(previewHref(e.reportPath, input))}">report</a>`
108
+ : `<span class="muted">—</span>`;
109
+ const preview = e.thumbnail
110
+ ? `<img class="thumb" src="${e.thumbnail}" alt="${escapeHtml(e.code)} candidate render" loading="lazy" />`
111
+ : `<span class="muted">—</span>`;
112
+ const href = e.reportPath ? historyHref(e.reportPath, input) : undefined;
113
+ const historyCell = hasHistory
114
+ ? `<td>${href ? `<a href="${escapeHtml(href)}">history</a>` : `<span class="muted">—</span>`}</td>`
115
+ : "";
116
+ return `<tr><td>${preview}</td><td class="code">${escapeHtml(e.code)}</td><td>${status}</td><td>${report}</td>${historyCell}</tr>`;
117
+ }
118
+ /** Render the branch's self-contained `index.html` landing page. */
119
+ export function renderIndexHtml(input) {
120
+ const title = input.title ?? "Design parity";
121
+ const commit = input.sourceCommit
122
+ ? `Rendered from <code>${escapeHtml(short(input.sourceCommit))}</code>`
123
+ : "Generated by design-parity";
124
+ const overview = input.bundleImage
125
+ ? `<img class="overview" src="./${escapeHtml(input.bundleImage)}" alt="Candidate overview" />`
126
+ : "";
127
+ const hasHistory = !!(input.repoSlug && input.branch);
128
+ const rows = input.entries.map((e) => rowMarkup(e, input, hasHistory)).join("\n");
129
+ return `<!doctype html>
130
+ <html lang="en">
131
+ <head>
132
+ <meta charset="utf-8" />
133
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
134
+ <title>${escapeHtml(title)}</title>
135
+ <style>${STYLE}</style>
136
+ </head>
137
+ <body>
138
+ <header class="page">
139
+ <h1>${escapeHtml(title)}</h1>
140
+ <div class="subtitle">${commit} — generated by design-parity, do not edit by hand.</div>
141
+ </header>
142
+ <main>
143
+ ${overview}
144
+ <table>
145
+ <thead><tr><th>Preview</th><th>Component</th><th>Status</th><th>Report</th>${hasHistory ? "<th>History</th>" : ""}</tr></thead>
146
+ <tbody>
147
+ ${rows}
148
+ </tbody>
149
+ </table>
150
+ </main>
151
+ </body>
152
+ </html>
153
+ `;
154
+ }
155
+ /** Render both branch landing artifacts from one input. */
156
+ export function renderIndex(input) {
157
+ return { readme: renderReadme(input), html: renderIndexHtml(input) };
158
+ }
159
+ //# sourceMappingURL=index-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-page.js","sourceRoot":"","sources":["../src/index-page.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAsCvC,MAAM,WAAW,GAAgC;IAC/C,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,E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CAAC,KAAK,CAAC;SACjB,KAAK;;;;QAIN,UAAU,CAAC,KAAK,CAAC;0BACC,MAAM;;;EAG9B,QAAQ;;6EAEmE,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE;;EAE/G,IAAI;;;;;;CAML,CAAC;AACF,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;AACvE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -14,4 +14,6 @@ export { pairVariants } from "./variants.js";
14
14
  export type { Variant } from "./variants.js";
15
15
  export { groupFindings, tokenDelta, SECTIONS } from "./findings.js";
16
16
  export type { FindingSection, GroupedSection, TokenDelta } from "./findings.js";
17
+ export { renderIndex, renderReadme, renderIndexHtml } from "./index-page.js";
18
+ export type { IndexEntry, IndexInput, IndexStatus } from "./index-page.js";
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7E,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -11,4 +11,5 @@
11
11
  export { renderHtmlReport } from "./render.js";
12
12
  export { pairVariants } from "./variants.js";
13
13
  export { groupFindings, tokenDelta, SECTIONS } from "./findings.js";
14
+ export { renderIndex, renderReadme, renderIndexHtml } from "./index-page.js";
14
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-parity/report-html",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Self-contained HTML comparison page per parity run: reference | candidate | diff side by side with the verdict findings, inlined to one offline .html file (data-URI PNGs + inline CSS/JS, no external assets).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "test": "vitest run"
21
21
  },
22
22
  "dependencies": {
23
- "@design-parity/core": "^0.1.1"
23
+ "@design-parity/core": "^0.1.3"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",