@decocms/parity 0.7.0 → 0.8.1
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 +23 -0
- package/dist/cli.js +2294 -1625
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -74,6 +74,7 @@ Individual flags always override the preset.
|
|
|
74
74
|
| `parity console` | Sub-10s capture of console errors/warnings + network failures for one URL |
|
|
75
75
|
| `parity html` | Dump page/selector HTML or unified diff prod×cand (prettier + jsdiff) |
|
|
76
76
|
| `parity section` | Focused prod×cand diff of a section: HTML + screenshot + computed styles |
|
|
77
|
+
| `parity fix` | Pixel-perfect bundle: heatmap + CSS source + LLM-ready Markdown prompt |
|
|
77
78
|
| `parity prompt` | Export issues as a Markdown prompt for any LLM |
|
|
78
79
|
| `parity explain` | LLM deep-dive on a specific issue (needs `ANTHROPIC_API_KEY`) |
|
|
79
80
|
| `parity learned` | Inspect the learned-selectors library |
|
|
@@ -105,6 +106,28 @@ When `--visual-pages > 0` and an LLM key is set, the report's **Visual Diff** ta
|
|
|
105
106
|
|
|
106
107
|
The visual prompt focuses *only* on visual diffs, references the screenshot paths, and includes migration-specific guidance (register section in `setup.ts`, loader shape drift, useDevice hydration, etc).
|
|
107
108
|
|
|
109
|
+
## Pixel-perfect fix loop
|
|
110
|
+
|
|
111
|
+
When `parity run` flags a section but you want the LLM to actually patch it, `parity fix` bundles every signal into one Markdown prompt:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
parity fix \
|
|
115
|
+
--prod https://www.example.com \
|
|
116
|
+
--cand https://example.deco-cx.workers.dev \
|
|
117
|
+
--selector 'header'
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Writes (under `./parity-output/sections/`):
|
|
121
|
+
|
|
122
|
+
- `section-<hash>-{prod,cand}.png` — locator screenshots, carousels stabilized
|
|
123
|
+
- `section-<hash>-heatmap.png` — pixelmatch with bounding-box analysis
|
|
124
|
+
- `section-<hash>-bundle.json` — machine-readable bundle (deltas + sources + bboxes)
|
|
125
|
+
- `section-<hash>-prompt.md` — **paste-ready** Markdown with embedded images, computed-style deltas, CSS source per property, HTML diff, and an opinionated "summarize what you understand first, no code yet" instruction
|
|
126
|
+
|
|
127
|
+
If `ANTHROPIC_API_KEY` is set, the LLM is invoked automatically and prints a one-paragraph diagnosis to stdout (uses Claude Vision on the screenshots). Pass `--no-llm` to stay offline.
|
|
128
|
+
|
|
129
|
+
The same flags are available individually on `parity section`: `--heatmap`, `--css-source`, `--prompt`, `--llm-summary`. Use those when you only need one signal; `parity fix` is the "do everything" shortcut.
|
|
130
|
+
|
|
108
131
|
## Configuration (optional)
|
|
109
132
|
|
|
110
133
|
`.parityrc.json` at the project root — selector overrides and run defaults:
|