stateofpixel 0.0.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/README.md +44 -0
- package/dist/index.mjs +1104 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# stateofpixel
|
|
2
|
+
|
|
3
|
+
Visual regression testing that runs in your CI. Upload a folder of screenshots, review the changes on [stateofpixel.com](https://stateofpixel.com), and a GitHub check blocks the merge until every change is approved.
|
|
4
|
+
|
|
5
|
+
## GitHub Actions
|
|
6
|
+
|
|
7
|
+
Install the GitHub App from [stateofpixel.com](https://stateofpixel.com), then add a step after the one that writes your screenshots:
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
- run: npx playwright test
|
|
19
|
+
- run: npx stateofpixel upload screenshots
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
On other CI, set `STATEOFPIXEL_TOKEN` to a project token. Creating tokens in the web app comes with the project settings page.
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
| Command | Purpose |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `stateofpixel upload <dir>` | Upload a folder of PNGs and compare it with the baseline. |
|
|
29
|
+
| `stateofpixel finalize` | Finish a build whose shards ran with `--shard auto`. |
|
|
30
|
+
| `stateofpixel compare <dir> <baseline-dir>` | Compare two folders locally and write `stateofpixel-report/index.html`. |
|
|
31
|
+
|
|
32
|
+
Run `stateofpixel <command> --help` for every flag.
|
|
33
|
+
|
|
34
|
+
## Sharding
|
|
35
|
+
|
|
36
|
+
With a known shard count, each job runs `stateofpixel upload screenshots --shard 1/4` through `4/4`, and the build finishes when the last shard is done.
|
|
37
|
+
|
|
38
|
+
When the count is not known, each job runs `stateofpixel upload screenshots --shard auto`, and one last job runs `stateofpixel finalize`. Add `--skip-if-empty` so the check still reports when no shard ran.
|
|
39
|
+
|
|
40
|
+
## Service errors
|
|
41
|
+
|
|
42
|
+
When the service is down, `upload` and `finalize` print a warning and exit 0, so our outage does not break your CI. Pass `--strict` to fail instead.
|
|
43
|
+
|
|
44
|
+
Requires Node 20 or newer.
|