renderdiff 0.1.0 → 0.3.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 +166 -275
- package/dist/accept.d.ts +42 -0
- package/dist/accept.js +105 -0
- package/dist/accept.js.map +1 -0
- package/dist/capture.d.ts +10 -2
- package/dist/capture.js +67 -26
- package/dist/capture.js.map +1 -1
- package/dist/cli.js +55 -9
- package/dist/cli.js.map +1 -1
- package/dist/compare.d.ts +15 -0
- package/dist/compare.js +99 -28
- package/dist/compare.js.map +1 -1
- package/dist/config.d.ts +41 -9
- package/dist/config.js +81 -24
- package/dist/config.js.map +1 -1
- package/dist/format.d.ts +3 -0
- package/dist/format.js +17 -0
- package/dist/format.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/locate.d.ts +24 -0
- package/dist/locate.js +316 -0
- package/dist/locate.js.map +1 -0
- package/dist/report.d.ts +28 -4
- package/dist/report.js +37 -21
- package/dist/report.js.map +1 -1
- package/dist/run.d.ts +6 -1
- package/dist/run.js +247 -58
- package/dist/run.js.map +1 -1
- package/package.json +24 -6
- package/renderdiff.config.example.ts +30 -2
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
import type { RenderdiffConfig } from "renderdiff";
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
-
//
|
|
9
|
+
// left: the build you changed (usually localhost). right: the reference you must match
|
|
10
|
+
// (usually production). The +/- signs in the output and text.added/removed in
|
|
11
|
+
// results.json are written from left's point of view.
|
|
10
12
|
left: "http://localhost:3000",
|
|
11
13
|
right: "https://example.com",
|
|
12
14
|
|
|
@@ -21,8 +23,33 @@ export default {
|
|
|
21
23
|
"/pricing::/plans",
|
|
22
24
|
{ left: "/blog", right: "/posts" },
|
|
23
25
|
{ left: "/pricing", selector: { left: ".plans-v2", right: ".plans" } },
|
|
26
|
+
// `before` runs on each side after the page loads, before it settles and is shot, so
|
|
27
|
+
// the open menu is what gets measured. Replaces the top-level `before` for this route.
|
|
28
|
+
{
|
|
29
|
+
left: "/docs",
|
|
30
|
+
before: async (page) => {
|
|
31
|
+
await page.click("[aria-label=Menu]");
|
|
32
|
+
},
|
|
33
|
+
},
|
|
24
34
|
],
|
|
25
35
|
|
|
36
|
+
// For every route without its own `before`, CLI routes included. Gets
|
|
37
|
+
// `{ side, route, width }`; use `side` only for markup that legitimately differs per
|
|
38
|
+
// side, never to make the two sides look alike. A throw is a route error, not retried.
|
|
39
|
+
// Actions use Playwright's 30s default timeout, so check first for what may not be
|
|
40
|
+
// there. hideSelectors and extraCss apply after the hook.
|
|
41
|
+
before: async (page) => {
|
|
42
|
+
const accept = page.getByRole("button", { name: "Accept" });
|
|
43
|
+
if (await accept.isVisible()) await accept.click();
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
// Playwright storage state (cookies, localStorage) each side starts with, e.g. signed
|
|
47
|
+
// in: `npx playwright codegen --save-storage=auth.json <url>`. One file, or
|
|
48
|
+
// `{ left, right }`. Relative to this file. It holds live session tokens: never commit
|
|
49
|
+
// it, and add it to .gitignore. The out dir then holds signed-in screenshots and text,
|
|
50
|
+
// so keep it out of git and don't publish it either. `--storage-state` replaces it.
|
|
51
|
+
storageState: "auth.json",
|
|
52
|
+
|
|
26
53
|
// Replaces the default set (1440, 1152, 896, 704, 375).
|
|
27
54
|
widths: [1440, 896, 375],
|
|
28
55
|
|
|
@@ -32,7 +59,8 @@ export default {
|
|
|
32
59
|
// Relative to the directory you run in. Wiped at the start of each run.
|
|
33
60
|
outDir: "renderdiff-out",
|
|
34
61
|
|
|
35
|
-
// Captures run in parallel.
|
|
62
|
+
// Captures run in parallel. Default half the CPU cores, between 2 and 8. Keep it low if
|
|
63
|
+
// the right origin is someone's live site.
|
|
36
64
|
concurrency: 2,
|
|
37
65
|
|
|
38
66
|
// Appended to the built-in analytics/consent/A-B blocklist. Aborted at the network
|