snapdrift 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +5 -4
- package/action.yml +2 -2
- package/docs/contracts.md +46 -7
- package/docs/integration-guide.md +31 -16
- package/docs/local-cli.md +8 -7
- package/docs/workflow-templates/refresh-baseline-on-merge.yml +1 -1
- package/lib/provider.mjs +2 -7
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.0 - 2026-09-14
|
|
4
|
+
|
|
5
|
+
### Behavior changes
|
|
6
|
+
|
|
7
|
+
- **Local comparisons now always use comparison policy v1.** `generateDriftReport`
|
|
8
|
+
synthesizes `{ "version": 1, "threshold": diff.threshold }` when neither the
|
|
9
|
+
caller nor `diff.comparisonPolicy` supplies a policy, matching the CLI and both
|
|
10
|
+
providers. Dimension mismatches are now `changed[]` signals with union-canvas
|
|
11
|
+
metadata instead of `dimensionChanges[]` (which stays in the summary contract
|
|
12
|
+
but is empty for local comparisons). The strict same-dimension comparator
|
|
13
|
+
remains available to direct `@snapdrift/compare-core` / `comparePngs` callers
|
|
14
|
+
that pass no policy.
|
|
15
|
+
|
|
16
|
+
### Performance
|
|
17
|
+
|
|
18
|
+
- `compareImages` short-circuits byte-identical buffers and can skip rendering
|
|
19
|
+
the diff PNG via `renderDiffImage: false`; drift reports only render diff
|
|
20
|
+
images for changed routes and resolve/read route PNGs concurrently.
|
|
21
|
+
- Union-canvas size limits are now checked against the PNG IHDR header before
|
|
22
|
+
decoding, so oversized images are rejected before allocating decoded buffers.
|
|
23
|
+
|
|
24
|
+
### Fixes
|
|
25
|
+
|
|
26
|
+
- `compareImages`, `generateDiffImage`, and `compareWithIgnoreRegions` now reject
|
|
27
|
+
malformed ignore regions and highlight colors instead of silently masking
|
|
28
|
+
nothing or coercing `undefined` channels.
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
- **Workspace packages** — publish `@snapdrift/compare-core` 1.2.0 and
|
|
33
|
+
`@snapdrift/adapter-fs` 1.3.0 with the new comparison options, validation, and
|
|
34
|
+
performance behavior. The new `renderDiffImage: false` option is surfaced
|
|
35
|
+
through a separate overload, so existing `compareImages` / `comparePngs`
|
|
36
|
+
callers keep a non-optional `diffImageBuffer` with no type or runtime change.
|
|
37
|
+
|
|
38
|
+
### Documentation
|
|
39
|
+
|
|
40
|
+
- Document the full-page screenshot pixel budget, viewport/device-scale
|
|
41
|
+
estimates, custom-viewport semantics, and remediation for
|
|
42
|
+
`comparison_too_large` failures.
|
|
43
|
+
|
|
3
44
|
## 0.10.0 - 2026-09-10
|
|
4
45
|
|
|
5
46
|
### Fixes
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ You keep ownership of checkout, build, startup, readiness, and teardown. SnapDri
|
|
|
48
48
|
|
|
49
49
|
```yaml
|
|
50
50
|
- name: SnapDrift Baseline
|
|
51
|
-
uses: ranacseruet/snapdrift@v0.
|
|
51
|
+
uses: ranacseruet/snapdrift@v0.11.0
|
|
52
52
|
with:
|
|
53
53
|
mode: baseline
|
|
54
54
|
repo-config-path: .github/snapdrift.json
|
|
@@ -60,7 +60,7 @@ With `provider: "snap"`, baseline publication is a complete, fail-closed snapsho
|
|
|
60
60
|
|
|
61
61
|
```yaml
|
|
62
62
|
- name: SnapDrift Report
|
|
63
|
-
uses: ranacseruet/snapdrift@v0.
|
|
63
|
+
uses: ranacseruet/snapdrift@v0.11.0
|
|
64
64
|
with:
|
|
65
65
|
mode: pr-diff
|
|
66
66
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -107,7 +107,7 @@ Start with `report-only` while baselines settle. Move to `fail-on-changes` or st
|
|
|
107
107
|
|------|--------------------|
|
|
108
108
|
| `report-only` | Never |
|
|
109
109
|
| `fail-on-changes` | Any capture exceeds threshold |
|
|
110
|
-
| `fail-on-incomplete` | Captures are missing
|
|
110
|
+
| `fail-on-incomplete` | Captures are missing or comparison errors occur |
|
|
111
111
|
| `strict` | Any drift signal or incomplete comparison appears |
|
|
112
112
|
|
|
113
113
|
## Current constraints
|
|
@@ -115,8 +115,9 @@ Start with `report-only` while baselines settle. Move to `fail-on-changes` or st
|
|
|
115
115
|
- Ubuntu runners only (local CLI works on any OS Node 22+ supports)
|
|
116
116
|
- Full-page capture only
|
|
117
117
|
- Viewport presets: `desktop` (1440×900) and `mobile` (390×844), or custom `{ "width": number, "height": number }`
|
|
118
|
+
- Full-page comparisons are bounded to a 32 Mi-pixel union canvas; see the [screenshot size budget](docs/contracts.md#screenshot-size-budget) for viewport, device-scale, and remediation guidance
|
|
118
119
|
- One global `diff.threshold`
|
|
119
|
-
- Unequal dimensions
|
|
120
|
+
- Unequal dimensions compare on a top-left-aligned union canvas via comparison policy v1, which is always applied (synthesized from `diff.threshold` when `diff.comparisonPolicy` is absent)
|
|
120
121
|
- Local provider writes artifacts to the runner filesystem; for a hosted backend with a dashboard and a shared baseline store, configure `provider: "snap"` (see the [Integration Guide](docs/integration-guide.md#hosted-snap-provider))
|
|
121
122
|
- Hosted Snap baselines publish only from the default branch and always include the complete configured route set
|
|
122
123
|
|
package/action.yml
CHANGED
|
@@ -155,7 +155,7 @@ runs:
|
|
|
155
155
|
- name: SnapDrift baseline
|
|
156
156
|
id: baseline
|
|
157
157
|
if: inputs.mode == 'baseline'
|
|
158
|
-
uses: ranacseruet/snapdrift/actions/baseline@
|
|
158
|
+
uses: ranacseruet/snapdrift/actions/baseline@799cfb16ff9d51e57d515cdddd4b329950574ef2 # v0.11.0
|
|
159
159
|
with:
|
|
160
160
|
repo-config-path: ${{ inputs.repo-config-path }}
|
|
161
161
|
route-ids: ${{ inputs.route-ids }}
|
|
@@ -165,7 +165,7 @@ runs:
|
|
|
165
165
|
- name: SnapDrift pull request diff
|
|
166
166
|
id: pr-diff
|
|
167
167
|
if: inputs.mode == 'pr-diff'
|
|
168
|
-
uses: ranacseruet/snapdrift/actions/pr-diff@
|
|
168
|
+
uses: ranacseruet/snapdrift/actions/pr-diff@799cfb16ff9d51e57d515cdddd4b329950574ef2 # v0.11.0
|
|
169
169
|
with:
|
|
170
170
|
github-token: ${{ inputs.github-token }}
|
|
171
171
|
repo-config-path: ${{ inputs.repo-config-path }}
|
package/docs/contracts.md
CHANGED
|
@@ -40,7 +40,7 @@ SnapDrift reads runtime behavior from `.github/snapdrift.json` by default.
|
|
|
40
40
|
| `snap.apiKey` | `string` | Inline API key with `${VAR}` interpolation (mutually exclusive with `snap.apiKeyEnv`) |
|
|
41
41
|
| `snap.projectId` | `string` | Snap project ID or `"auto"` (default: `"auto"`, derives from `GITHUB_REPOSITORY`) |
|
|
42
42
|
| `snap.onUnavailable` | `string` | Behavior when Snap is unreachable: `"fail"` (default), `"warn-and-skip"`, or `"fallback-local"` |
|
|
43
|
-
| `diff.comparisonPolicy` | `{ "version": 1, "threshold": number }` |
|
|
43
|
+
| `diff.comparisonPolicy` | `{ "version": 1, "threshold": number }` | Accepted for compatibility; comparison policy v1 is always applied when absent. `threshold` must match `diff.threshold` |
|
|
44
44
|
|
|
45
45
|
When `provider: "snap"` is set, the `snap` block is required. Exactly one of `snap.apiKeyEnv` or `snap.apiKey` must be present. `snap.apiKey` accepts `${VAR}` interpolation (for example `"${SNAP_API_KEY}"`); the referenced environment variable must be set at runtime or the config loader throws.
|
|
46
46
|
|
|
@@ -210,9 +210,9 @@ The pull request drift bundle contains:
|
|
|
210
210
|
| Field | Type | Description |
|
|
211
211
|
|:------|:-----|:------------|
|
|
212
212
|
| `dashboardUrl` | `string?` | Snap dashboard URL for the run (set by `SnapProvider`; omitted by `LocalProvider`) |
|
|
213
|
-
| `comparisonPolicy` | `{ "version": 1, "threshold": number }?` |
|
|
213
|
+
| `comparisonPolicy` | `{ "version": 1, "threshold": number }?` | Effective v1 comparison policy used by the local adapter (synthesized from `diff.threshold` when not configured) |
|
|
214
214
|
|
|
215
|
-
When v1 comparison is
|
|
215
|
+
When v1 comparison is applied, each affected `changed[]` item may also contain
|
|
216
216
|
`comparison` with `baseline`, `current`, and `canvas` `{ width, height }`
|
|
217
217
|
objects, `dimensionsChanged`, and the effective `totalPixels` denominator. A
|
|
218
218
|
local changed item with a generated image contains `diffImagePath`, relative to
|
|
@@ -229,7 +229,7 @@ path as a GitHub-hosted image URL.
|
|
|
229
229
|
|:-------|:--------|
|
|
230
230
|
| `clean` | All captures matched within threshold |
|
|
231
231
|
| `changes-detected` | One or more captures exceeded threshold |
|
|
232
|
-
| `incomplete` | Missing captures
|
|
232
|
+
| `incomplete` | Missing captures or comparison errors occurred |
|
|
233
233
|
| `skipped` | The report was intentionally skipped |
|
|
234
234
|
|
|
235
235
|
### Skipped summary
|
|
@@ -251,9 +251,9 @@ Additional missing-baseline fields: `baselineAvailable`, `currentResultsPath`.
|
|
|
251
251
|
- Mismatch ratio is `different_pixels / total_pixels`
|
|
252
252
|
- `diff.threshold` applies per screenshot
|
|
253
253
|
- Missing captures are counted separately from drift signals
|
|
254
|
-
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
254
|
+
- Comparison policy v1 `{ "version": 1, "threshold": number }` is always applied. When `diff.comparisonPolicy` is absent, SnapDrift synthesizes it from `diff.threshold`. Images are top-left aligned on a max-dimension union canvas with no scaling. Overlap pixels are compared, one-sided pixels count as changed (including transparent pixels), and empty union corners do not enter the denominator. Dimension changes land in `changed[]` with comparison metadata and a generated local diff image.
|
|
255
|
+
- `dimensionChanges[]` remains part of the summary contract but is empty for local comparisons in v1. Strict same-dimension comparison (`compareBuffers`) remains available to direct `@snapdrift/compare-core`/`comparePngs` callers that pass no policy.
|
|
256
|
+
- Threshold is applied after pixel aggregation. A mismatch exactly equal to the threshold is matched; a dimension change is still a changed signal independent of ratio.
|
|
257
257
|
- `diff.mode` controls enforcement, not summary generation
|
|
258
258
|
|
|
259
259
|
## Drift modes
|
|
@@ -278,6 +278,45 @@ directly, not just for the guarded enforcement step inside `actions/pr-diff`.
|
|
|
278
278
|
| `desktop` | 1440 | 900 | 1 | No | No |
|
|
279
279
|
| `mobile` | 390 | 844 | 3 | Yes | Yes |
|
|
280
280
|
|
|
281
|
+
## Screenshot size budget
|
|
282
|
+
|
|
283
|
+
SnapDrift compares full-page screenshots using their rendered raster dimensions.
|
|
284
|
+
The unequal-dimension comparator bounds the union canvas at `32 × 1024 × 1024`
|
|
285
|
+
pixels (`33,554,432` pixels). A comparison is oversized when:
|
|
286
|
+
|
|
287
|
+
```text
|
|
288
|
+
max(baselineWidth, currentWidth) × max(baselineHeight, currentHeight) > 33,554,432
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
This is a raster-pixel limit, not a direct CSS viewport limit. Full-page capture
|
|
292
|
+
height is the document height, and `deviceScaleFactor` increases both raster
|
|
293
|
+
width and raster height. The baseline/current union also means that a dimension
|
|
294
|
+
change can make an otherwise valid image exceed the budget. Leave headroom for
|
|
295
|
+
horizontal overflow or other layout changes that increase the rendered image
|
|
296
|
+
dimensions.
|
|
297
|
+
|
|
298
|
+
The comparator reports this condition with the stable error code
|
|
299
|
+
`comparison_too_large` and includes the baseline, current, and union-canvas
|
|
300
|
+
dimensions in the error message. Approximate maximum full-page CSS heights below
|
|
301
|
+
assume that the raster width remains equal to the configured CSS width and that
|
|
302
|
+
the document height scales by the same device scale factor:
|
|
303
|
+
|
|
304
|
+
| Configuration | CSS viewport | Scale factor | Approx. maximum full-page CSS height |
|
|
305
|
+
|:--------------|:-------------|-------------:|-------------------------------------:|
|
|
306
|
+
| `desktop` preset | 1440 × 900 | 1 | 23,301 px |
|
|
307
|
+
| `mobile` preset | 390 × 844 | 3 | 9,559 px |
|
|
308
|
+
| Custom 390 × 844 viewport | 390 × 844 | 1 | 86,037 px |
|
|
309
|
+
|
|
310
|
+
These are planning estimates, not guarantees. Check the actual `width` and
|
|
311
|
+
`height` recorded in the capture results or screenshot manifest, then apply the
|
|
312
|
+
union-canvas formula above. A custom viewport object currently uses scale factor
|
|
313
|
+
1 with `isMobile: false` and `hasTouch: false`; it is therefore not equivalent
|
|
314
|
+
to the named `mobile` preset. Use it to avoid unnecessary raster inflation only
|
|
315
|
+
when the route does not require mobile device emulation. Otherwise, reduce the
|
|
316
|
+
captured document or fixture height, or split the coverage across routes when
|
|
317
|
+
that matches the product behavior. Do not resize or crop screenshots, or lower
|
|
318
|
+
`diff.threshold`, to work around this limit.
|
|
319
|
+
|
|
281
320
|
## Capture defaults
|
|
282
321
|
|
|
283
322
|
| Setting | Value |
|
|
@@ -46,7 +46,7 @@ SnapDrift owns route selection, capture, comparison, skipped-report generation,
|
|
|
46
46
|
|
|
47
47
|
```yaml
|
|
48
48
|
- name: SnapDrift Baseline
|
|
49
|
-
uses: ranacseruet/snapdrift@v0.
|
|
49
|
+
uses: ranacseruet/snapdrift@v0.11.0
|
|
50
50
|
with:
|
|
51
51
|
mode: baseline
|
|
52
52
|
repo-config-path: .github/snapdrift.json
|
|
@@ -71,7 +71,7 @@ Then add SnapDrift after the app is running:
|
|
|
71
71
|
|
|
72
72
|
```yaml
|
|
73
73
|
- name: SnapDrift Report
|
|
74
|
-
uses: ranacseruet/snapdrift@v0.
|
|
74
|
+
uses: ranacseruet/snapdrift@v0.11.0
|
|
75
75
|
with:
|
|
76
76
|
mode: pr-diff
|
|
77
77
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -86,8 +86,8 @@ The wrappers remain published in their own right, and are equivalent to the disp
|
|
|
86
86
|
|
|
87
87
|
| Entry point | Equivalent to |
|
|
88
88
|
|-------------|---------------|
|
|
89
|
-
| `ranacseruet/snapdrift@v0.
|
|
90
|
-
| `ranacseruet/snapdrift@v0.
|
|
89
|
+
| `ranacseruet/snapdrift@v0.11.0` with `mode: baseline` | `ranacseruet/snapdrift/actions/baseline@v0.11.0` |
|
|
90
|
+
| `ranacseruet/snapdrift@v0.11.0` with `mode: pr-diff` | `ranacseruet/snapdrift/actions/pr-diff@v0.11.0` |
|
|
91
91
|
|
|
92
92
|
Use the wrappers directly when you want to skip the dispatcher's input indirection, and the lower-level `capture`, `compare`, `scope`, `resolve-baseline`, `stage`, `comment`, and `enforce` actions when you need to orchestrate the stages yourself.
|
|
93
93
|
|
|
@@ -130,7 +130,7 @@ jobs:
|
|
|
130
130
|
done
|
|
131
131
|
|
|
132
132
|
- name: SnapDrift Report
|
|
133
|
-
uses: ranacseruet/snapdrift@v0.
|
|
133
|
+
uses: ranacseruet/snapdrift@v0.11.0
|
|
134
134
|
with:
|
|
135
135
|
mode: pr-diff
|
|
136
136
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -170,7 +170,7 @@ jobs:
|
|
|
170
170
|
done
|
|
171
171
|
|
|
172
172
|
- name: SnapDrift Report
|
|
173
|
-
uses: ranacseruet/snapdrift@v0.
|
|
173
|
+
uses: ranacseruet/snapdrift@v0.11.0
|
|
174
174
|
with:
|
|
175
175
|
mode: pr-diff
|
|
176
176
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -311,11 +311,10 @@ See the [Local CLI guide](local-cli.md) for full command reference, flags, direc
|
|
|
311
311
|
## Refresh the baseline automatically
|
|
312
312
|
|
|
313
313
|
After an intentional layout change merges, the baseline can be republished as
|
|
314
|
-
usual.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
report.
|
|
314
|
+
usual. Local comparisons always apply comparison policy v1
|
|
315
|
+
(`{ "version": 1, "threshold": number }`) — synthesized from `diff.threshold`
|
|
316
|
+
when not configured — so unequal frames are compared on a union canvas and
|
|
317
|
+
dimension metadata stays in the report.
|
|
319
318
|
|
|
320
319
|
Use the provided workflow template to refresh the baseline automatically on every push to your default branch (i.e. every merge):
|
|
321
320
|
|
|
@@ -343,15 +342,31 @@ Grant `issues: write` and `pull-requests: write` to the job.
|
|
|
343
342
|
The Snap client never retries 4xx and never falls back, even when `onUnavailable` is set. Inspect the response body — the most common cause is a project-id mismatch between `GITHUB_REPOSITORY` (auto-derived) and the project's id on Snap.
|
|
344
343
|
|
|
345
344
|
**Screenshots have different dimensions**
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
future runs to return to equal-size comparisons.
|
|
345
|
+
SnapDrift compares the top-left-aligned union canvas, records the route in
|
|
346
|
+
`changed[]`, and writes a local diff PNG. Refresh the baseline after an
|
|
347
|
+
intentional change when you want future runs to return to equal-size
|
|
348
|
+
comparisons.
|
|
351
349
|
|
|
352
350
|
**A route appears in `errors[]`**
|
|
353
351
|
Capture failed before comparison. Confirm the app is fully ready and reachable before SnapDrift runs.
|
|
354
352
|
|
|
353
|
+
**`comparison_too_large` or `union canvas ... exceeds the maximum`**
|
|
354
|
+
|
|
355
|
+
The baseline/current screenshot union is larger than the 33,554,432-pixel
|
|
356
|
+
comparison budget. Because captures are full-page, a short configured viewport
|
|
357
|
+
can still produce an oversized image when the document is tall; the named
|
|
358
|
+
`mobile` preset also renders at device scale factor 3. Inspect the actual image
|
|
359
|
+
dimensions in the capture results or manifest and calculate
|
|
360
|
+
`max(baselineWidth, currentWidth) × max(baselineHeight, currentHeight)`.
|
|
361
|
+
|
|
362
|
+
If the route does not need mobile device emulation, a custom viewport object uses
|
|
363
|
+
scale factor 1 and can avoid unnecessary raster inflation. Otherwise reduce the
|
|
364
|
+
captured content or fixture height, or split the coverage across routes when
|
|
365
|
+
appropriate. Do not resize/crop images or lower `diff.threshold`; neither changes
|
|
366
|
+
the capture budget and either can hide a layout regression. See the [screenshot
|
|
367
|
+
size budget](contracts.md#screenshot-size-budget) for the preset estimates and
|
|
368
|
+
custom-viewport semantics.
|
|
369
|
+
|
|
355
370
|
**Playwright install runs even though `provider: "snap"`**
|
|
356
371
|
That's expected for the Snap local-capture hybrid. Playwright runs locally to render the page, then the resulting screenshot is uploaded to Snap. The hybrid kicks in only when `baseUrl` points to a local address; for remote `baseUrl` Snap's render worker captures directly.
|
|
357
372
|
|
package/docs/local-cli.md
CHANGED
|
@@ -225,7 +225,7 @@ After running `capture` and `diff` with default paths:
|
|
|
225
225
|
summary.json # structured drift summary
|
|
226
226
|
summary.md # human-readable markdown report
|
|
227
227
|
report.html # self-contained HTML report with side-by-side images
|
|
228
|
-
diffs/ #
|
|
228
|
+
diffs/ # generated diff PNGs for changed routes
|
|
229
229
|
```
|
|
230
230
|
|
|
231
231
|
Add `.snapdrift/` to your `.gitignore` to keep local run output out of version control.
|
|
@@ -272,7 +272,7 @@ Comparing against baseline ...
|
|
|
272
272
|
Report: .snapdrift/diff/report.html
|
|
273
273
|
```
|
|
274
274
|
|
|
275
|
-
**Incomplete run** (errors
|
|
275
|
+
**Incomplete run** (errors or missing captures):
|
|
276
276
|
|
|
277
277
|
```
|
|
278
278
|
❌ SnapDrift — incomplete
|
|
@@ -281,7 +281,7 @@ Report: .snapdrift/diff/report.html
|
|
|
281
281
|
Changed: 0
|
|
282
282
|
Missing: 1
|
|
283
283
|
Errors: 1
|
|
284
|
-
Dim diff:
|
|
284
|
+
Dim diff: 0
|
|
285
285
|
|
|
286
286
|
Report: .snapdrift/diff/report.html
|
|
287
287
|
```
|
|
@@ -290,14 +290,15 @@ The `Missing`, `Errors`, and `Dim diff` lines only print when their count is gre
|
|
|
290
290
|
|
|
291
291
|
The `report.html` path is printed whenever the status is anything other than `clean`; pass `--open` to also launch it in your default browser.
|
|
292
292
|
|
|
293
|
-
|
|
294
|
-
`diff
|
|
293
|
+
SnapDrift always applies comparison policy v1. It synthesizes the policy from
|
|
294
|
+
`diff.threshold` when `diff` does not declare one, so the explicit opt-in is only
|
|
295
|
+
needed to pin a non-default threshold:
|
|
295
296
|
|
|
296
297
|
```json
|
|
297
298
|
"comparisonPolicy": { "version": 1, "threshold": 0.01 }
|
|
298
299
|
```
|
|
299
300
|
|
|
300
|
-
The
|
|
301
|
+
The report includes the baseline, current, and union-canvas dimensions in
|
|
301
302
|
`summary.md` and `report.html`, and stores changed-route diff PNGs under
|
|
302
303
|
`.snapdrift/diff/diffs/`. A completed dimension comparison is a normal changed
|
|
303
304
|
signal, so `fail-on-incomplete` does not fail solely because its dimensions
|
|
@@ -309,7 +310,7 @@ differ; `fail-on-changes` and `strict` still enforce it.
|
|
|
309
310
|
|
|
310
311
|
| Variable | Applies to | Description |
|
|
311
312
|
|:---------|:-----------|:------------|
|
|
312
|
-
| `SNAPDRIFT_CAPTURE_CONCURRENCY` | `capture`, `diff` | Max concurrent route
|
|
313
|
+
| `SNAPDRIFT_CAPTURE_CONCURRENCY` | `capture`, `diff` | Max concurrent route operations (positive integer, default `5`): route captures per viewport context, and per-route resolve/compare during `diff`. Set to `1` to restore serial behavior for apps with shared session or auth state. |
|
|
313
314
|
| `SNAPDRIFT_CONFIG_PATH` | `capture`, `diff`, `migrate-baselines` | Override the config file path. Equivalent to `--config`. |
|
|
314
315
|
| `SNAPDRIFT_ROUTE_IDS` | `capture`, `baseline`, `diff` | Comma-separated route ids to scope to. Equivalent to `--routes`; it may not reduce a hosted baseline's complete route set. |
|
|
315
316
|
|
package/lib/provider.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { runBaselineCapture, generateDriftReport, stageArtifacts } from '@snapdrift/adapter-fs';
|
|
4
4
|
import { buildReportCommentBody } from '@snapdrift/adapter-report-md';
|
|
5
5
|
import {
|
|
6
6
|
SnapProvider,
|
|
@@ -43,12 +43,7 @@ export class LocalProvider {
|
|
|
43
43
|
* @returns {Promise<DiffResult>}
|
|
44
44
|
*/
|
|
45
45
|
async diff(options) {
|
|
46
|
-
|
|
47
|
-
const comparisonPolicy = config.diff.comparisonPolicy ?? {
|
|
48
|
-
version: 1,
|
|
49
|
-
threshold: config.diff.threshold
|
|
50
|
-
};
|
|
51
|
-
return generateDriftReport({ ...options, comparisonPolicy });
|
|
46
|
+
return generateDriftReport(options);
|
|
52
47
|
}
|
|
53
48
|
|
|
54
49
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snapdrift",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "SnapDrift captures, compares, and reports UI drift for Playwright-based app checks.",
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
"registry": "https://registry.npmjs.org"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@snapdrift/adapter-fs": "^1.
|
|
105
|
+
"@snapdrift/adapter-fs": "^1.3.0",
|
|
106
106
|
"@snapdrift/adapter-report-md": "^1.2.0",
|
|
107
|
-
"@snapdrift/compare-core": "^1.
|
|
107
|
+
"@snapdrift/compare-core": "^1.2.0",
|
|
108
108
|
"@snapdrift/manifest": "^1.4.0",
|
|
109
109
|
"js-yaml": "^5.4.0",
|
|
110
110
|
"playwright": "^1.59.1",
|