found-pixel 0.7.0 → 0.8.0-alpha.144

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 (75) hide show
  1. package/README.md +37 -23
  2. package/dist/baselines.d.ts +21 -0
  3. package/dist/baselines.d.ts.map +1 -0
  4. package/dist/baselines.js +180 -0
  5. package/dist/baselines.js.map +1 -0
  6. package/dist/bin.d.ts +1 -7
  7. package/dist/bin.d.ts.map +1 -1
  8. package/dist/bin.js +3 -15
  9. package/dist/bin.js.map +1 -1
  10. package/dist/capture/browser.d.ts +5 -0
  11. package/dist/capture/browser.d.ts.map +1 -0
  12. package/dist/capture/browser.js +21 -0
  13. package/dist/capture/browser.js.map +1 -0
  14. package/dist/capture/compare.d.ts +8 -0
  15. package/dist/capture/compare.d.ts.map +1 -0
  16. package/dist/capture/compare.js +40 -0
  17. package/dist/capture/compare.js.map +1 -0
  18. package/dist/capture/engine.d.ts +35 -0
  19. package/dist/capture/engine.d.ts.map +1 -0
  20. package/dist/capture/engine.js +212 -0
  21. package/dist/capture/engine.js.map +1 -0
  22. package/dist/capture/externalRequests.d.ts +10 -0
  23. package/dist/capture/externalRequests.d.ts.map +1 -0
  24. package/dist/capture/externalRequests.js +31 -0
  25. package/dist/capture/externalRequests.js.map +1 -0
  26. package/dist/capture/inPage.d.ts +39 -0
  27. package/dist/capture/inPage.d.ts.map +1 -0
  28. package/dist/capture/inPage.js +106 -0
  29. package/dist/capture/inPage.js.map +1 -0
  30. package/dist/capture/server.d.ts +6 -0
  31. package/dist/capture/server.d.ts.map +1 -0
  32. package/dist/capture/server.js +67 -0
  33. package/dist/capture/server.js.map +1 -0
  34. package/dist/capture/shotPlan.d.ts +25 -0
  35. package/dist/capture/shotPlan.d.ts.map +1 -0
  36. package/dist/capture/shotPlan.js +89 -0
  37. package/dist/capture/shotPlan.js.map +1 -0
  38. package/dist/cli.d.ts.map +1 -1
  39. package/dist/cli.js +10 -2
  40. package/dist/cli.js.map +1 -1
  41. package/dist/comment.d.ts +2 -1
  42. package/dist/comment.d.ts.map +1 -1
  43. package/dist/comment.js +4 -1
  44. package/dist/comment.js.map +1 -1
  45. package/dist/config.d.ts +23 -93
  46. package/dist/config.d.ts.map +1 -1
  47. package/dist/config.js +2 -38
  48. package/dist/config.js.map +1 -1
  49. package/dist/diffViewerResults.d.ts +2 -0
  50. package/dist/diffViewerResults.d.ts.map +1 -1
  51. package/dist/diffViewerResults.js +2 -1
  52. package/dist/diffViewerResults.js.map +1 -1
  53. package/dist/review.d.ts.map +1 -1
  54. package/dist/review.js +26 -59
  55. package/dist/review.js.map +1 -1
  56. package/dist/shotIds.js +1 -1
  57. package/dist/shotIds.js.map +1 -1
  58. package/dist/storage.d.ts +5 -0
  59. package/dist/storage.d.ts.map +1 -1
  60. package/dist/storage.js +32 -0
  61. package/dist/storage.js.map +1 -1
  62. package/dist/storyIndex.d.ts +2 -0
  63. package/dist/storyIndex.d.ts.map +1 -1
  64. package/dist/storyIndex.js +15 -10
  65. package/dist/storyIndex.js.map +1 -1
  66. package/dist/storybook.d.ts +8 -0
  67. package/dist/storybook.d.ts.map +1 -0
  68. package/dist/storybook.js +42 -0
  69. package/dist/storybook.js.map +1 -0
  70. package/dist/visualRegression.d.ts +9 -32
  71. package/dist/visualRegression.d.ts.map +1 -1
  72. package/dist/visualRegression.js +177 -238
  73. package/dist/visualRegression.js.map +1 -1
  74. package/package.json +7 -8
  75. package/patches/lostPixelWindowApi.cjs +0 -215
package/README.md CHANGED
@@ -11,13 +11,13 @@ On every build:
11
11
  1. Runs the configured storybook build command
12
12
  2. Uploads the archive and static site to S3 under `<repoName>/storybook/<branch-slug>/`
13
13
  3. Annotates the Buildkite build with a link to the hosted storybook
14
- 4. If the branch is the default branch, also uploads under the commit SHA for future base resolution
14
+ 4. If the branch is the default branch, also uploads under the commit SHA for future base resolution, and updates the shared baseline screenshots for PRs (see [Baselines](#baselines))
15
15
 
16
16
  On pull requests (additional to the above):
17
17
 
18
18
  5. Resolves a base storybook from S3 — tries merge-base SHA first (for PRs into the default branch), then the base branch slug, then the default branch
19
19
  6. Runs [storybook-diff](https://www.npmjs.com/package/storybook-diff) between base and head, writing the JSON to `artifacts/`
20
- 7. Runs [lost-pixel](https://github.com/lost-pixel/lost-pixel) against the changed stories only, capturing pixel-level diffs; uploads screenshots to S3 and constructs PR comment image URLs via `screenshots.baseUrl` (if configured)
20
+ 7. Screenshots the changed stories with Playwright (see [Screenshots](#screenshots)), compares them against the base, and re-shoots every difference in isolation before reporting it; uploads screenshots to S3 and constructs PR comment image URLs via `screenshots.baseUrl` (if configured)
21
21
  8. Upserts a PR comment with added / deleted / modified sections, thumbnail previews for stories with visual changes, and a "Detected N story changes" summary
22
22
  9. Annotates the Buildkite build with a diff summary and a link to the PR comment
23
23
 
@@ -37,7 +37,7 @@ Runtime requirements on the Buildkite agent:
37
37
  - `git` (for merge-base resolution)
38
38
  - `buildkite-agent` (for annotations and artifact upload)
39
39
 
40
- Chromium is installed lazily on first `review` run via `playwright install --with-deps chromium`, using the `playwright-core` copy bundled with `lost-pixel` (so browser revisions match lost-pixel's expectations).
40
+ Chromium is installed on each `review` and `baseline` run via `playwright-core install --with-deps --only-shell chromium`. `playwright-core` is pinned, so every build uses the same Chromium; bumping it makes the next default-branch build re-shoot the whole baseline.
41
41
 
42
42
  ## Configuration
43
43
 
@@ -83,15 +83,7 @@ Example:
83
83
  "timeoutMinutes": 120,
84
84
  "threshold": 0,
85
85
  "shotConcurrency": 5,
86
- "compareConcurrency": 10,
87
- "waitBeforeScreenshot": 1000,
88
- "waitForFirstRequest": 1000,
89
- "waitForLastRequest": 1000,
90
- "timeouts": {
91
- "fetchStories": 30000,
92
- "loadState": 30000,
93
- "networkRequests": 30000
94
- }
86
+ "baselines": true
95
87
  },
96
88
  "comment": {
97
89
  "heading": "📘 UI Review",
@@ -111,13 +103,10 @@ Example:
111
103
  - `artifactsDir`: `"artifacts"`
112
104
  - `defaultBranch`: `"master"`
113
105
  - `visualRegression.enabled`: `true`
114
- - `visualRegression.timeoutMinutes`: `120` (per lost-pixel pass — baseline and compare are timed independently)
115
- - `visualRegression.shotConcurrency`: `5`
116
- - `visualRegression.compareConcurrency`: `10`
117
- - `visualRegression.waitBeforeScreenshot`: `1000`
118
- - `visualRegression.waitForFirstRequest`: `1000`
119
- - `visualRegression.waitForLastRequest`: `1000`
106
+ - `visualRegression.timeoutMinutes`: `120` — time budget for all screenshots in one run; stories still unshot when it runs out are reported as failed
107
+ - `visualRegression.shotConcurrency`: `5` — stories shot in parallel, each in its own browser context
120
108
  - `visualRegression.threshold`: `0` — Values `>=1` measure in absolute pixels, values from `0.00` to `1.00` are percentage
109
+ - `visualRegression.baselines`: `true` — keep shared baseline screenshots of the default branch and compare PRs against them (requires `screenshots`)
121
110
  - `skipLabels`: `[ "skip-ui-review" ]` — GitHub labels (from `BUILDKITE_PULL_REQUEST_LABELS`) that skip the `review` stage (storybook is still built and uploaded)
122
111
  - `fullReviewLabels`: `[ "full-ui-review" ]` — GitHub labels that force a full review: every story in the storybook is screenshotted and compared, bypassing the storybook-diff filter (including `autoIgnoreThreshold` exclusions)
123
112
  - `comment.heading`: `"📘 UI Review"`
@@ -142,6 +131,29 @@ All flags accepted by the [`storybook-diff`](https://www.npmjs.com/package/story
142
131
 
143
132
  See [src/config.ts](src/config.ts) for the full zod schema.
144
133
 
134
+ ### Screenshots
135
+
136
+ Stories are rendered in Chromium from the built storybook, served over a local HTTP server. Each stories file is loaded once and its stories are rendered in turn through Storybook's preview channel. A story is shot once Storybook reports it rendered and the page has settled: no network requests in flight, no pending timers of 3s or less, no DOM changes for 250ms, fonts loaded and images decoded. CSS animations are disabled and `prefers-reduced-motion` is set. Requests to other origins are fetched once per run and replayed to every page, so a CDN that varies its responses can't make the two sides differ.
137
+
138
+ The viewport is 1280×720, resized to the page's content before the shot. These story parameters are honoured:
139
+
140
+ | Parameter | Effect |
141
+ |---|---|
142
+ | `viewport` | `width`/`height`, a named viewport from `globals.viewport`, or `viewport.defaultViewport` |
143
+ | `lostpixel.breakpoints` | One full-page shot per width, named `<storyId>__[w<width>px]` |
144
+ | `lostpixel.mask` | `[{ selector }]` regions blanked out before comparing |
145
+ | `lostpixel.threshold` | Per-story `threshold` |
146
+ | `lostpixel.waitBeforeScreenshot` | Extra wait (ms) once the story has settled |
147
+ | `lostpixel.disable` | Skip the story |
148
+
149
+ Stories rendered one after another in the same page can leak state into each other (module-level caches, randomness seeded once per page). So every shot that differs from its baseline is re-shot on both sides in a fresh page per story, and only differences that reproduce are reported; a difference that can't be re-shot is still reported, and its story flagged as failed. A story whose breakpoints changed is always reported. Seed any randomness per story (e.g. `faker.seed()` in a decorator) to keep those re-shoots rare.
150
+
151
+ ### Baselines
152
+
153
+ The default branch keeps one shared set of screenshots in `screenshots.s3`: `<repoName>/baseline/<shotId>.png`, plus `<repoName>/baseline.json` recording the commit and Chromium they were shot from. Each default-branch build runs storybook-diff against that commit, re-shoots only the stories it reports as changed and overwrites their files; the first build, or one with a different Chromium, shoots every story. Baseline diffs ignore `storybookDiff.maxDepth` and `autoIgnoreThreshold`, so sweeping changes still reach the baseline. A story that fails to shoot is removed from the baseline and retried by the next build.
154
+
155
+ PRs into the default branch download the baseline shots for the stories they compare instead of screenshotting the base storybook. The baseline tracks the latest default-branch build rather than the PR's merge-base, so alongside its own storybook-diff the PR diffs the baseline's commit against its base, and shoots the base storybook for stories that changed in between or have no baseline shot. A story that still differs from its baseline is re-shot from the base storybook before it is treated as a change.
156
+
145
157
  ## Environment variables
146
158
 
147
159
  Read from the Buildkite environment automatically:
@@ -188,12 +200,13 @@ steps:
188
200
  ## CLI reference
189
201
 
190
202
  ```
191
- found-pixel build # build storybook, upload to S3, annotate
192
- found-pixel review # (PR only) download base, diff, regress, upsert comment
193
- found-pixel run # build then review
203
+ found-pixel build # build storybook, upload to S3, annotate
204
+ found-pixel baseline # (default branch only) update the shared baseline screenshots
205
+ found-pixel review # (PR only) download base, diff, regress, upsert comment
206
+ found-pixel run # build, then baseline or review
194
207
  ```
195
208
 
196
- `review` is a no-op when the build isn't a pull request.
209
+ `review` is a no-op when the build isn't a pull request, and `baseline` is a no-op off the default branch.
197
210
 
198
211
  ## Library usage
199
212
 
@@ -225,6 +238,7 @@ const body = renderComment({
225
238
 
226
239
  ```bash
227
240
  npm install
241
+ npx playwright-core install --only-shell chromium # once, for the screenshot engine tests
228
242
  npm test # runs vitest against all fixtures
229
243
  npm run build # tsc → dist/
230
244
  npm run typecheck # tsc --noEmit
@@ -249,7 +263,7 @@ npm install --save-dev found-pixel@alpha-<branch-slug>
249
263
 
250
264
  Two gates apply, and both bite silently when they fail:
251
265
 
252
- 1. **Path filter** — the PR must change at least one file matching the workflow's `paths:` list (`src/**`, `patches/**`, `package.json`, `package-lock.json`). A docs- or test-only PR never starts the workflow at all, so there is no skipped job to notice.
266
+ 1. **Path filter** — the PR must change at least one file matching the workflow's `paths:` list (`src/**`, `package.json`, `package-lock.json`). A docs- or test-only PR never starts the workflow at all, so there is no skipped job to notice.
253
267
  2. **Head commit only** — only `HEAD` is checked, not the whole PR. `[publish]` in an earlier commit does nothing; amend or add a new commit to re-publish. Each push increments `run_number`, so every alpha gets a distinct version.
254
268
 
255
269
  **Release, on merge to main.** Bump `version` in `package.json` as part of the PR. Once it lands on `main` the workflow compares the version against `HEAD~1` — if it changed, it publishes to the `latest` tag, pushes a `v<version>` tag, and creates a GitHub release with generated notes. If the version is untouched, the run succeeds and publishes nothing, which is what makes dependency-only and refactor-only merges safe.
@@ -0,0 +1,21 @@
1
+ import type { Config } from "./config.js";
2
+ export declare const WORK_DIR = ".found-pixel";
3
+ export interface BaselineState {
4
+ sha: string;
5
+ engine: string;
6
+ updatedAt: string;
7
+ failed?: string[];
8
+ }
9
+ export interface BaselineShots {
10
+ sha: string;
11
+ download: (shotId: string, localPath: string) => Promise<boolean>;
12
+ }
13
+ type BaseStorybook = {
14
+ slug: string;
15
+ dir: string;
16
+ };
17
+ export declare function parseState(raw: string): BaselineState | null;
18
+ export declare function baselineLoader(cfg: Config, base: BaseStorybook, cancelSignal?: AbortSignal): ((engine: string) => Promise<BaselineShots | null>) | undefined;
19
+ export declare function publishBaselines(cfg: Config): Promise<void>;
20
+ export {};
21
+ //# sourceMappingURL=baselines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baselines.d.ts","sourceRoot":"","sources":["../src/baselines.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAM1C,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACnE;AAID,KAAK,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAmCnD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAO5D;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,aAAa,EACnB,YAAY,CAAC,EAAE,WAAW,GACzB,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CA0BjE;AAoBD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2EjE"}
@@ -0,0 +1,180 @@
1
+ import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
+ import { join, resolve } from "node:path";
3
+ import { annotate, readContext } from "./buildkite.js";
4
+ import { engineFingerprint, installChromium, launchChromium } from "./capture/browser.js";
5
+ import { captureStories, logProblems } from "./capture/engine.js";
6
+ import { shotBaseId } from "./shotIds.js";
7
+ import { baselinePrefix, baselineStateKey, createS3 } from "./storage.js";
8
+ import { diffStorybooks, fetchStorybook } from "./storybook.js";
9
+ import { readCaptureStories } from "./storyIndex.js";
10
+ export const WORK_DIR = ".found-pixel";
11
+ function createBaselineStore(cfg, screenshots, workDir) {
12
+ const s3 = createS3(screenshots.s3);
13
+ const s3Key = (key) => (screenshots.uploadPrefix ? `${screenshots.uploadPrefix}/${key}` : key);
14
+ const s3Url = (key) => `s3://${screenshots.s3.bucket}/${s3Key(key)}`;
15
+ const fetchTo = async (key, localPath) => {
16
+ if (!screenshots.baseUrl)
17
+ return s3.download(s3Key(key), localPath);
18
+ const path = key.split("/").map(encodeURIComponent).join("/");
19
+ const res = await fetch(`${screenshots.baseUrl}/${path}`);
20
+ if (!res.ok)
21
+ return false;
22
+ writeFileSync(localPath, Buffer.from(await res.arrayBuffer()));
23
+ return true;
24
+ };
25
+ return {
26
+ async readState() {
27
+ mkdirSync(workDir, { recursive: true });
28
+ const localPath = join(workDir, "baseline.json");
29
+ if (!(await fetchTo(baselineStateKey(cfg), localPath)))
30
+ return null;
31
+ return parseState(readFileSync(localPath, "utf8"));
32
+ },
33
+ async writeState(state) {
34
+ const localPath = join(workDir, "baseline.json");
35
+ writeFileSync(localPath, JSON.stringify(state));
36
+ await s3.cp(localPath, s3Url(baselineStateKey(cfg)), { noCache: true });
37
+ },
38
+ download: (shotId, localPath) => fetchTo(`${baselinePrefix(cfg)}/${shotId}.png`, localPath),
39
+ upload: (dir) => s3.cp(dir, `${s3Url(baselinePrefix(cfg))}/`, { recursive: true, noCache: true }),
40
+ replace: (dir) => s3.mirror(dir, `${s3Url(baselinePrefix(cfg))}/`),
41
+ remove: (storyIds) => s3.removeStories(s3Key(baselinePrefix(cfg)), storyIds),
42
+ };
43
+ }
44
+ export function parseState(raw) {
45
+ try {
46
+ const state = JSON.parse(raw);
47
+ return typeof state.sha === "string" && typeof state.engine === "string" ? state : null;
48
+ }
49
+ catch {
50
+ return null;
51
+ }
52
+ }
53
+ export function baselineLoader(cfg, base, cancelSignal) {
54
+ const { screenshots } = cfg;
55
+ if (!screenshots || !cfg.visualRegression.enabled || !cfg.visualRegression.baselines)
56
+ return undefined;
57
+ const workDir = resolve(WORK_DIR, "cache");
58
+ const store = createBaselineStore(cfg, screenshots, workDir);
59
+ const comparison = compareWithBase(cfg, store, base, workDir, cancelSignal);
60
+ return async (engine) => {
61
+ const result = await comparison;
62
+ if ("skip" in result) {
63
+ console.log(`${result.skip}; shooting the base storybook instead`);
64
+ return null;
65
+ }
66
+ const { state, stale } = result;
67
+ if (state.engine !== engine) {
68
+ console.log(`Baselines were shot with ${state.engine}, not ${engine}; shooting the base storybook instead`);
69
+ return null;
70
+ }
71
+ if (stale.size > 0) {
72
+ console.log(`${stale.size} stories changed between the baselines (${state.sha.slice(0, 7)}) and the base storybook`);
73
+ }
74
+ return {
75
+ sha: state.sha,
76
+ download: async (shotId, localPath) => !stale.has(shotBaseId(shotId)) && (await store.download(shotId, localPath)),
77
+ };
78
+ };
79
+ }
80
+ async function compareWithBase(cfg, store, base, workDir, cancelSignal) {
81
+ try {
82
+ const state = await store.readState();
83
+ if (!state)
84
+ return { skip: "No baselines yet" };
85
+ if (state.sha === base.slug)
86
+ return { state, stale: new Set() };
87
+ const changes = await changedSince(cfg, state.sha, base.dir, workDir, cancelSignal);
88
+ return { state, stale: new Set(changes.shoot) };
89
+ }
90
+ catch (error) {
91
+ return { skip: `Could not compare the baselines with the base storybook (${String(error).split("\n")[0]})` };
92
+ }
93
+ }
94
+ export async function publishBaselines(cfg) {
95
+ const ctx = readContext();
96
+ const vr = cfg.visualRegression;
97
+ if (!vr.enabled || !vr.baselines || ctx.branch !== cfg.defaultBranch || !ctx.commitSha)
98
+ return;
99
+ if (!cfg.screenshots) {
100
+ console.log("Skipping baselines: `screenshots` is not configured");
101
+ return;
102
+ }
103
+ const workDir = resolve(WORK_DIR, "baseline");
104
+ rmSync(workDir, { recursive: true, force: true });
105
+ mkdirSync(workDir, { recursive: true });
106
+ const shotsDir = join(workDir, "shots");
107
+ const store = createBaselineStore(cfg, cfg.screenshots, workDir);
108
+ await installChromium();
109
+ const browser = await launchChromium();
110
+ try {
111
+ const engine = engineFingerprint(browser);
112
+ const state = await store.readState();
113
+ const changes = state?.engine === engine
114
+ ? await changedSince(cfg, state.sha, cfg.outputDir, workDir).catch((error) => {
115
+ console.warn(`Could not diff against ${state.sha}; shooting every story:`, error);
116
+ return null;
117
+ })
118
+ : null;
119
+ const retry = changes ? (state?.failed ?? []) : [];
120
+ const stories = readCaptureStories(cfg.outputDir, changes ? [...changes.shoot, ...retry] : undefined);
121
+ console.log(changes
122
+ ? `--- :camera_with_flash: Updating baselines: ${stories.length} stories changed since ${state?.sha.slice(0, 7)}` +
123
+ (retry.length > 0 ? " or failed last time" : "")
124
+ : `--- :camera_with_flash: Shooting baselines for all ${stories.length} stories`);
125
+ const result = await captureStories({
126
+ browser,
127
+ storybookDir: cfg.outputDir,
128
+ stories,
129
+ outDir: shotsDir,
130
+ concurrency: vr.shotConcurrency,
131
+ deadline: Date.now() + vr.timeoutMinutes * 60_000,
132
+ label: "baselines",
133
+ });
134
+ logProblems(result, "baselines");
135
+ const failed = new Set(result.failures.map((f) => f.storyId));
136
+ for (const shot of result.shots) {
137
+ if (failed.has(shot.storyId))
138
+ rmSync(shot.file, { force: true });
139
+ }
140
+ console.log("--- :s3: Uploading baselines");
141
+ mkdirSync(shotsDir, { recursive: true });
142
+ if (changes) {
143
+ const remove = [...changes.remove, ...failed];
144
+ if (remove.length > 0)
145
+ await store.remove(remove);
146
+ if (result.shots.length > 0)
147
+ await store.upload(shotsDir);
148
+ }
149
+ else {
150
+ await store.replace(shotsDir);
151
+ }
152
+ await store.writeState({
153
+ sha: ctx.commitSha,
154
+ engine,
155
+ updatedAt: new Date().toISOString(),
156
+ failed: [...failed].sort(),
157
+ });
158
+ const failedNote = failed.size > 0 ? `, ${failed.size} failed and will be retried next build` : "";
159
+ await annotate(`:camera_with_flash: Baselines: shot ${stories.length - failed.size} of ${stories.length} stories in ${Math.round(result.seconds)}s${failedNote}`, { context: "found-pixel-baselines", style: failed.size > 0 ? "warning" : "info" });
160
+ }
161
+ finally {
162
+ await browser.close();
163
+ }
164
+ }
165
+ async function changedSince(cfg, sha, storybookDir, workDir, cancelSignal) {
166
+ const dir = join(workDir, "previous");
167
+ if (!(await fetchStorybook(cfg, sha, dir, join(workDir, "previous.tar.gz")))) {
168
+ throw new Error(`No storybook archive for ${sha}`);
169
+ }
170
+ const diff = JSON.parse(await diffStorybooks(cfg, dir, storybookDir, { exhaustive: true, cancelSignal }));
171
+ const modified = diff.modified ?? [];
172
+ return {
173
+ shoot: [...modified.map((s) => s.id), ...(diff.created ?? []).map((s) => s.id)],
174
+ remove: [
175
+ ...(diff.deleted ?? []).map((s) => s.id),
176
+ ...modified.flatMap((s) => (s.previousRef && s.previousRef.id !== s.id ? [s.previousRef.id] : [])),
177
+ ],
178
+ };
179
+ }
180
+ //# sourceMappingURL=baselines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baselines.js","sourceRoot":"","sources":["../src/baselines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAA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AAC;IACrC,OAAO;QACL,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/E,MAAM,EAAE;YACN,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACnG;KACF,CAAC;AACJ,CAAC"}
package/dist/bin.d.ts CHANGED
@@ -1,10 +1,4 @@
1
+ export declare function packageRoot(pkg: string): string;
1
2
  /** Resolve an installed package's CLI entry, accounting for string or object `bin` fields. */
2
3
  export declare function resolveBin(pkg: string, binName?: string): string;
3
- /**
4
- * Lost-pixel bundles its own `playwright-core` with matching browser revisions.
5
- * We must use *that* copy's CLI to install browsers, otherwise we'd install
6
- * browsers for our top-level playwright-core version and lost-pixel would fail
7
- * at runtime looking for a different chromium build.
8
- */
9
- export declare function lostPixelPlaywrightCoreDir(): string;
10
4
  //# sourceMappingURL=bin.d.ts.map
package/dist/bin.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":"AA4BA,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAchE;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAGnD"}
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":"AAMA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAkB/C;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAchE"}
package/dist/bin.js CHANGED
@@ -2,11 +2,9 @@ import { readFileSync } from "node:fs";
2
2
  import { dirname, resolve } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  // Some deps are ESM-only with `exports` that block both `./package.json` and
5
- // the CJS resolution of `.`, so we walk `node_modules` directly instead. Pass
6
- // `from` to resolve a nested dep (e.g. the playwright-core copy bundled inside
7
- // lost-pixel) rather than the top-level install.
8
- function packageRoot(pkg, from) {
9
- let dir = from ?? dirname(fileURLToPath(import.meta.url));
5
+ // the CJS resolution of `.`, so we walk `node_modules` directly instead.
6
+ export function packageRoot(pkg) {
7
+ let dir = dirname(fileURLToPath(import.meta.url));
10
8
  while (true) {
11
9
  const candidate = resolve(dir, "node_modules", pkg, "package.json");
12
10
  try {
@@ -38,14 +36,4 @@ export function resolveBin(pkg, binName) {
38
36
  }
39
37
  return resolve(root, binRel);
40
38
  }
41
- /**
42
- * Lost-pixel bundles its own `playwright-core` with matching browser revisions.
43
- * We must use *that* copy's CLI to install browsers, otherwise we'd install
44
- * browsers for our top-level playwright-core version and lost-pixel would fail
45
- * at runtime looking for a different chromium build.
46
- */
47
- export function lostPixelPlaywrightCoreDir() {
48
- const lostPixelRoot = packageRoot("lost-pixel");
49
- return packageRoot("playwright-core", lostPixelRoot);
50
- }
51
39
  //# sourceMappingURL=bin.js.map
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.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right-core";
2
+ export declare function installChromium(): Promise<void>;
3
+ export declare function launchChromium(): Promise<Browser>;
4
+ export declare function engineFingerprint(browser: Browser): string;
5
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/capture/browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAMzD,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAOrD;AAED,wBAAgB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAEjD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,21 @@
1
+ import { execa } from "execa";
2
+ import { resolve } from "node:path";
3
+ import { chromium } from "playwright-core";
4
+ import { packageRoot } from "../bin.js";
5
+ const INSTALL_TIMEOUT_MS = 5 * 60_000;
6
+ const CAPTURE_VERSION = 1;
7
+ export async function installChromium() {
8
+ console.log("~~~ :chrome: Installing chromium");
9
+ const cli = resolve(packageRoot("playwright-core"), "cli.js");
10
+ await execa("node", [cli, "install", "--with-deps", "--only-shell", "chromium"], {
11
+ stdio: "inherit",
12
+ timeout: INSTALL_TIMEOUT_MS,
13
+ });
14
+ }
15
+ export function launchChromium() {
16
+ return chromium.launch({ args: ["--force-color-profile=srgb"] });
17
+ }
18
+ export function engineFingerprint(browser) {
19
+ return `capture/${CAPTURE_VERSION} chromium/${browser.version()} ${process.platform}-${process.arch}`;
20
+ }
21
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/capture/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAgB,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,kBAAkB,GAAG,CAAC,GAAG,MAAM,CAAC;AACtC,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC9D,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE;QAC/E,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,kBAAkB;KAC5B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,OAAO,WAAW,eAAe,aAAa,OAAO,CAAC,OAAO,EAAE,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;AACxG,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface ImageComparison {
2
+ pixelDifference: number;
3
+ ratio: number;
4
+ withinThreshold: boolean;
5
+ }
6
+ export declare function withinThreshold(threshold: number, pixelsTotal: number, pixelDifference: number): boolean;
7
+ export declare function compareImageFiles(baselinePath: string, currentPath: string, threshold: number, diffPath?: string): ImageComparison;
8
+ //# sourceMappingURL=compare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../src/capture/compare.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAExG;AAED,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,eAAe,CAwBjB"}
@@ -0,0 +1,40 @@
1
+ import { readFileSync, writeFileSync } from "node:fs";
2
+ import pixelmatch from "pixelmatch";
3
+ import { PNG } from "pngjs";
4
+ export function withinThreshold(threshold, pixelsTotal, pixelDifference) {
5
+ return threshold < 1 ? pixelDifference <= pixelsTotal * threshold : pixelDifference <= threshold;
6
+ }
7
+ export function compareImageFiles(baselinePath, currentPath, threshold, diffPath) {
8
+ const baselineBuffer = readFileSync(baselinePath);
9
+ const currentBuffer = readFileSync(currentPath);
10
+ if (baselineBuffer.equals(currentBuffer)) {
11
+ return { pixelDifference: 0, ratio: 0, withinThreshold: true };
12
+ }
13
+ let baseline = PNG.sync.read(baselineBuffer);
14
+ let current = PNG.sync.read(currentBuffer);
15
+ const width = Math.max(baseline.width, current.width);
16
+ const height = Math.max(baseline.height, current.height);
17
+ if (baseline.width !== width || baseline.height !== height)
18
+ baseline = padImage(baseline, width, height);
19
+ if (current.width !== width || current.height !== height)
20
+ current = padImage(current, width, height);
21
+ const diff = new PNG({ width, height });
22
+ const pixelDifference = pixelmatch(baseline.data, current.data, diff.data, width, height, { threshold: 0 });
23
+ const pixelsTotal = width * height;
24
+ const result = {
25
+ pixelDifference,
26
+ ratio: pixelDifference / pixelsTotal,
27
+ withinThreshold: withinThreshold(threshold, pixelsTotal, pixelDifference),
28
+ };
29
+ if (!result.withinThreshold && diffPath)
30
+ writeFileSync(diffPath, PNG.sync.write(diff));
31
+ return result;
32
+ }
33
+ function padImage(image, width, height) {
34
+ const padded = new PNG({ width, height, fill: true });
35
+ for (let i = 3; i < padded.data.length; i += 4)
36
+ padded.data[i] = 64;
37
+ PNG.bitblt(image, padded, 0, 0, image.width, image.height, 0, 0);
38
+ return padded;
39
+ }
40
+ //# sourceMappingURL=compare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/capture/compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQ5B,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,WAAmB,EAAE,eAAuB;IAC7F,OAAO,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,IAAI,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,eAAe,IAAI,SAAS,CAAC;AACnG,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,YAAoB,EACpB,WAAmB,EACnB,SAAiB,EACjB,QAAiB;IAEjB,MAAM,cAAc,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAChD,IAAI,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;IACjE,CAAC;IAED,IAAI,QAAQ,GAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAClD,IAAI,OAAO,GAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAA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C,MAAM,EAAE,CAAC,IAAI,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACpE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { Browser } from "playwright-core";
2
+ import { type ExternalCache } from "./externalRequests.js";
3
+ import { type ShotPlan } from "./shotPlan.js";
4
+ export interface CaptureStory {
5
+ id: string;
6
+ importPath?: string;
7
+ }
8
+ export interface CapturedShot extends ShotPlan {
9
+ file: string;
10
+ error?: string;
11
+ }
12
+ export interface CaptureFailure {
13
+ storyId: string;
14
+ error: string;
15
+ }
16
+ export interface CaptureResult {
17
+ shots: CapturedShot[];
18
+ failures: CaptureFailure[];
19
+ seconds: number;
20
+ }
21
+ export interface CaptureOptions {
22
+ browser: Browser;
23
+ storybookDir: string;
24
+ stories: CaptureStory[];
25
+ outDir: string;
26
+ concurrency: number;
27
+ isolate?: boolean;
28
+ deadline?: number;
29
+ label?: string;
30
+ externalCache?: ExternalCache;
31
+ }
32
+ export declare function captureStories(options: CaptureOptions): Promise<CaptureResult>;
33
+ export declare function logProblems(result: CaptureResult, label: string): void;
34
+ export declare function groupStories(stories: CaptureStory[], isolate: boolean): CaptureStory[][];
35
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/capture/engine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAwB,MAAM,iBAAiB,CAAC;AAWrE,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAmD,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE/F,MAA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