Skip to content

Commit 39fff3e

Browse files
thingnoyclaude
andcommitted
docs: update readme with badges, version header, development section
Add npm / CI / license badges at the top. Mention the version badge in the feature list and highlight playwright.config auto-detection. Add a Development section with Makefile commands, architecture overview, and how integration tests are wired into CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7656b97 commit 39fff3e

1 file changed

Lines changed: 49 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# flowshot
22

3+
[![npm version](https://img.shields.io/npm/v/flowshot.svg)](https://www.npmjs.com/package/flowshot)
4+
[![CI](https://github.com/thingnoy/flowshot/actions/workflows/ci.yml/badge.svg)](https://github.com/thingnoy/flowshot/actions/workflows/ci.yml)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6+
37
Flow-based visual regression dashboard for Playwright.
48
One command, one HTML file — screenshots connected as user flows with diff slider.
59

@@ -9,10 +13,11 @@ One command, one HTML file — screenshots connected as user flows with diff sli
913

1014
Existing visual regression tools show screenshots as flat galleries. Flowshot shows them as **user flows** — screens connected with arrows, so you see the journey, not just the pages.
1115

12-
- No server, no account — generates a single HTML file
13-
- Works with your existing Playwright snapshots
14-
- Diff mode with drag slider to compare expected vs actual
16+
- No server, no account — generates a single HTML file (~63 KB, fully self-contained)
17+
- Works with your existing Playwright snapshots — auto-detects the file naming from `playwright.config.*`
18+
- Diff mode with drag slider + fullscreen `Compare / Expected / Actual / Diff` tabs
1519
- Dark/light theme, sidebar navigation, lightbox zoom
20+
- Version badge in the report header — know which flowshot generated any report at a glance
1621

1722
## Quick Start
1823

@@ -331,6 +336,47 @@ Upload `.flowshot/report.html` as a CI artifact.
331336
path: .flowshot/report.html
332337
```
333338
339+
## Development
340+
341+
```bash
342+
git clone https://github.com/thingnoy/flowshot
343+
cd flowshot
344+
npm install
345+
```
346+
347+
Common tasks (via `make` or `npm`):
348+
349+
| Command | What it does |
350+
|---|---|
351+
| `make build` | Full build: `tsup` for CLI/lib + `vite` for the Svelte report template |
352+
| `make dev-ui` | Vite dev server with HMR on the report template (mock data auto-loaded) |
353+
| `make test` | Build + run integration tests (`node --test`) |
354+
| `make typecheck` | `tsc --noEmit` |
355+
| `make publish-check` | Build + test + `npm pack --dry-run` preview |
356+
357+
### Architecture
358+
359+
- `src/cli.ts` — Commander-based CLI entry
360+
- `src/report.ts` — image map builder + template renderer
361+
- `src/detect-*.ts` — snapshot pattern detection (filePattern / playwright.config / disk scan)
362+
- `src/report-ui/` — Svelte 5 app for the report UI, compiled by Vite to a single self-contained HTML file (`dist/report-template.html`). At runtime `generateReport()` reads this template and substitutes a `/*FLOWSHOT_DATA*/` marker with the JSON payload
363+
364+
### Testing
365+
366+
Integration tests use Node's built-in test runner (no vitest/jest — zero test deps):
367+
368+
```bash
369+
make test
370+
# or
371+
node --test test/*.test.mjs
372+
```
373+
374+
Coverage:
375+
- **Pattern detection** — explicit `filePattern`, `playwright.config.*` parsing, disk-scan fallback, defaults
376+
- **Report resolver** — component naming across 4 styles (project-based, legacy `{screen}-{platform}`, bare `{screen}`, missing file), single-file HTML output, `filePattern` round-trip
377+
378+
CI runs tests on every push + PR to `main`; releases block on a failing build or test run.
379+
334380
## License
335381

336382
MIT

0 commit comments

Comments
 (0)