Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ screenshots and text) out of git too. Details: [docs/scoping.md](https://github.

Flags cover a one-off run. A `renderdiff.config.{ts,mts,js,mjs}` in the working directory
covers a repo you diff repeatedly, and expresses what flags can't: **per-route masks** for content
that legitimately drifts, extra selectors to hide, extra URLs to block, `before` hooks.
that legitimately drifts, extra URLs to block, `before` and `beforeShot` hooks.

```ts
export default {
Expand All @@ -181,7 +181,8 @@ export default {
};
```

**Precedence: CLI flag > config file > built-in default.** Every field is annotated in
**Precedence: CLI flag > config file > built-in default; `--mask` and `--hide` add to the
config's instead.** Every field is annotated in
[`renderdiff.config.example.ts`](./renderdiff.config.example.ts). `export default { … }`
needs no import; `import type { RenderdiffConfig } from "renderdiff"` is for editor types
only.
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
description: The reference, e.g. https://example.com.
required: true
routes:
description: Routes separated by spaces or newlines, e.g. "/ /about /pricing::/plans". Optional when the config lists them.
description: Routes separated by spaces or newlines, e.g. "/ /about /pricing::/plans". Split on spaces, so a per-route selector ('/route @sel') doesn't work here; put it in the config. Optional when the config lists them.
default: ""
config:
description: Path to a renderdiff config file. Default renderdiff.config.{ts,mts,js,mjs} in the workspace.
Expand Down
14 changes: 11 additions & 3 deletions renderdiff.config.example.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copy to `renderdiff.config.ts` in the directory you run `renderdiff` from.
//
// Everything here is optional, and CLI flags always win over it. The type import and
// `satisfies` are for editor types only: Node erases both, so this loads without
// renderdiff installed in the project.
// Everything here is optional; a CLI flag for the same setting wins over it (`--mask`
// and `--hide` add to it instead). The type import and `satisfies` are for editor types
// only: Node erases both, so this loads without renderdiff installed in the project.
import type { RenderdiffConfig } from "renderdiff";

export default {
Expand Down Expand Up @@ -46,6 +46,14 @@ export default {
if (await accept.isVisible()) await accept.click();
},

// Like `before`, but after the settle, right before masks and the shot: for state the
// settle's scroll pass would undo. Nothing settles after it, so await what it changes.
// For every route without its own `beforeShot` (which can run this one with
// `await topLevel?.()`), CLI routes included.
// beforeShot: async (page) => {
// await page.click("[data-tab=intro]");
// },

// Playwright storage state (cookies, localStorage) each side starts with, e.g. signed
// in: `npx playwright codegen --save-storage=auth.json <url>`. One file, or
// `{ left, right }`. Relative to this file. It holds live session tokens: never commit
Expand Down
Loading