@crvy/rprtr 0.2.4 → 0.3.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +41 -0
  3. package/dist/{chunk-473CWZ4V.js → chunk-4CVHIHAJ.js} +746 -281
  4. package/dist/{chunk-HAFWYUNO.js → chunk-4YJL655E.js} +16 -4
  5. package/dist/cli.d.ts +5 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +24 -4
  8. package/dist/index.css +35 -0
  9. package/dist/index.js +152 -105
  10. package/dist/reporter-artifact-ops.d.ts +0 -2
  11. package/dist/reporter-artifact-ops.d.ts.map +1 -1
  12. package/dist/reporter.cjs +32 -38
  13. package/dist/reporter.d.ts +2 -1
  14. package/dist/reporter.d.ts.map +1 -1
  15. package/dist/reporter.js +27 -43
  16. package/dist/schemas/http.d.ts +2 -0
  17. package/dist/schemas/http.d.ts.map +1 -1
  18. package/dist/schemas.d.ts +14 -0
  19. package/dist/schemas.d.ts.map +1 -1
  20. package/dist/server/app.d.ts +6 -0
  21. package/dist/server/app.d.ts.map +1 -1
  22. package/dist/server/artifact-routes.d.ts.map +1 -1
  23. package/dist/server/docker-launcher.d.ts +27 -0
  24. package/dist/server/docker-launcher.d.ts.map +1 -0
  25. package/dist/server/docker-support.d.ts +88 -0
  26. package/dist/server/docker-support.d.ts.map +1 -0
  27. package/dist/server/handlers.d.ts +1 -1
  28. package/dist/server/handlers.d.ts.map +1 -1
  29. package/dist/server/launcher-resolver.d.ts +23 -0
  30. package/dist/server/launcher-resolver.d.ts.map +1 -0
  31. package/dist/server/playwright-config.d.ts +6 -0
  32. package/dist/server/playwright-config.d.ts.map +1 -1
  33. package/dist/server/routes-context.d.ts +6 -1
  34. package/dist/server/routes-context.d.ts.map +1 -1
  35. package/dist/server/routes.d.ts +7 -0
  36. package/dist/server/routes.d.ts.map +1 -1
  37. package/dist/server/run-controller.d.ts +19 -19
  38. package/dist/server/run-controller.d.ts.map +1 -1
  39. package/dist/server/run-launcher.d.ts +45 -0
  40. package/dist/server/run-launcher.d.ts.map +1 -0
  41. package/dist/server/run-mode.d.ts +15 -0
  42. package/dist/server/run-mode.d.ts.map +1 -0
  43. package/dist/server/server-factories.d.ts +21 -0
  44. package/dist/server/server-factories.d.ts.map +1 -0
  45. package/dist/server.cjs +921 -446
  46. package/dist/server.js +2 -2
  47. package/dist/types.d.ts +2 -0
  48. package/dist/types.d.ts.map +1 -1
  49. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,61 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.1] - 2026-08-24
9
+
10
+ ### Added
11
+
12
+ - **server:** Warn once that native Windows docker mode is experimental
13
+
14
+ ### Documentation
15
+
16
+ - Windows OS support design spec (WSL2 recommended, native win32 experimental)
17
+ - Windows OS support implementation plan
18
+ - Recommend WSL2 on Windows, mark native win32 docker mode experimental
19
+ - **server:** Refresh stale comments after docker-support extraction
20
+
21
+ ### Fixed
22
+
23
+ - **server:** Separator-agnostic rewriteContainerPath for Windows hosts
24
+ - **server:** Posix --test-list entries in docker mode
25
+ - **server:** Mount --test-list tmpfile at a fixed container path
26
+ - **server:** Keep host PATH and Windows env noise out of docker containers
27
+ ## [0.3.0] - 2026-08-24
28
+
29
+ ### Added
30
+
31
+ - **reporter:** Portable artifacts mode via CRVY_RPRTR_PORTABLE_ARTIFACTS
32
+ - **server:** --update-snapshots run flag and docker-unavailable run reason
33
+ - **server:** Carry run mode and phase in run-status broadcasts
34
+ - **server:** Docker CLI helpers and container command resolution
35
+ - **server:** DockerLauncher spawning playwright runs in containers
36
+ - **server:** Run-mode resolution, docker launcher wiring, and docker CLI flags
37
+ - **ui:** Run mode badge, update-baselines action, and image-pull state
38
+
39
+ ### Changed
40
+
41
+ - **run-controller:** Extract RunLauncher strategy with LocalLauncher
42
+
43
+ ### Documentation
44
+
45
+ - **spec:** Docker browser execution design
46
+ - **plan:** Docker browser execution implementation plan
47
+ - Docker mode usage and options
48
+ - Docker rendering determinism findings; correct baseline arch guidance
49
+
50
+ ### Fixed
51
+
52
+ - **run-controller:** Make UI re-run work on Playwright 1.59+
53
+ - **server:** Surface auto-mode docker fallback warning
54
+ - **server:** Rewrite container paths in reporter register payloads
55
+ - **server:** Rewrite host paths in docker container command args
56
+ - **server:** Warn when --config path is unreachable inside container
57
+ - **reporter:** Content-addressed artifact names for static-host portability
58
+ - **server:** Route docker runs via rootDir-keyed --test-list with host paths
59
+
60
+ ### Testing
61
+
62
+ - CI-gated docker smoke test for containerized runs
8
63
  ## [0.2.4] - 2026-07-06
9
64
 
10
65
  ### Added
package/README.md CHANGED
@@ -122,6 +122,47 @@ If you generate a report on one operating system and then open it on another (fo
122
122
 
123
123
  For fully portable artifact loading across operating systems, run the reporter in CI mode (`ci: true`) and ship the `screenshots/` directory alongside the report JSON.
124
124
 
125
+ ## Docker Mode
126
+
127
+ Run Playwright browsers inside a pinned Docker container so screenshot baselines are reproducible across machines — no local browser or system-dependency installation required.
128
+
129
+ ```bash
130
+ npx crvy-rprtr --run-mode docker
131
+ ```
132
+
133
+ The server still runs on your host; only `playwright test` executes in the container, against the official `mcr.microsoft.com/playwright:v<your @playwright/test version>-noble` image with your project bind-mounted. Reporters stream results back live, and approve/update flows work unchanged.
134
+
135
+ | Mode | Behavior |
136
+ | ---------------- | ------------------------------------------------------------------------------- |
137
+ | `auto` (default) | Docker when a daemon is reachable, local on CI, warned local fallback otherwise |
138
+ | `docker` | Always Docker; runs fail fast with `docker-unavailable` when the daemon is down |
139
+ | `local` | Never Docker |
140
+
141
+ | Option | Description |
142
+ | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
143
+ | `--run-mode <mode>` | `local`, `docker`, or `auto` (default: `auto`) |
144
+ | `--docker-image <image>` | Custom image. With a custom image, the container-side package manager is auto-detected from your lockfile (`npx` / `pnpm exec` / `yarn` / `bunx`); the image must contain it |
145
+ | `--docker-platform <platform>` | `linux/amd64` or `linux/arm64` (default: host architecture) |
146
+
147
+ Programmatic equivalents: `startServer({ runMode: 'docker', docker: { image, platform, command, extraArgs } })`. `docker.command` overrides the container-side invocation verbatim (e.g. `['pnpm', 'exec', 'playwright']`); `docker.extraArgs` appends raw `docker run` flags.
148
+
149
+ ### Windows
150
+
151
+ The recommended Windows setup is **WSL2**: enable Docker Desktop's WSL2 integration (Settings → Resources → WSL integration), keep the project inside the WSL filesystem (e.g. `~/proj` in your distro, not `/mnt/c/...` — bind-mounts from `/mnt/c` are slow and lack inotify events), and run `npx crvy-rprtr` from the WSL shell. Paths and rendering then behave exactly as on Linux, so baselines match CI.
152
+
153
+ Running natively on a Windows host (PowerShell/cmd) works but is **experimental**: Docker Desktop translates the `C:\proj:/work` mount, and crvy-rprtr rewrites Windows paths in container arguments, but this path has no CI coverage — expect a one-time experimental warning on the first run. Local (`--run-mode local`) Windows runs can never match Linux CI baselines (DirectWrite vs fontconfig text rendering) — which is exactly the problem Docker mode solves, so prefer WSL2.
154
+
155
+ Known limitations on native Windows: UNC project roots (`\\server\share\...`) are unsupported; drive-letter casing is normalized (`C:` ≡ `c:`), but path body case is not; Windows-specific host env vars (`PATH`, `TEMP`, `APPDATA`, `ProgramFiles`, ...) are filtered out so the container keeps its own environment (user env vars like API keys are still forwarded); single-file bind mounts (used for `--test-list`) can be flaky on some Docker Desktop versions — if the container sees an empty or missing test list, that is why.
156
+
157
+ Notes:
158
+
159
+ > **Important — baselines are image-specific, not architecture-specific.** Text rendering follows the image's fontconfig: Ubuntu-based images (including the default `mcr.microsoft.com/playwright:*-noble`) render text with subpixel (LCD) antialiasing and slight hinting, while Debian-based images (e.g. `node:24` + `playwright install --with-deps`) render grayscale with full hinting — different pixels _and_ slightly different text widths. Generate and verify baselines in the **same image** everywhere (CI and local), and regenerate baselines once after switching image flavor. See [docs/docker-screenshot-determinism.md](docs/docker-screenshot-determinism.md) for the full investigation.
160
+
161
+ - Baselines are **not** architecture-specific for typical DOM/text pages: amd64 and arm64 variants of the same image render bit-identically in practice (verified: 100/103 tests byte-identical between an amd64 CI runner and Apple Silicon). Use the native architecture on every host — do **not** pin `--docker-platform` to force amd64 emulation on Apple Silicon (Rosetta/QEMU is slower and less stable, and buys nothing). Residual risk: canvas 2D / complex SVG / WebGL content can show tiny cross-arch anti-aliasing diffs; handle per-test with `maxDiffPixels`.
162
+ - If your `playwright.config.ts` uses `webServer`, that server now starts inside the container: it must bind `0.0.0.0`, and hosts it references must resolve inside the container.
163
+ - Timezone and locale are pinned (`TZ=UTC`, `LANG=C.UTF-8`, `LC_ALL=C.UTF-8`) so date/number rendering in screenshots is stable; override via `docker.extraArgs` if you need a different locale under test.
164
+ - The "Run & update baselines" button (▶↻) regenerates baselines inside the container, keeping generation and verification in the same image.
165
+
125
166
  ## Programmatic API
126
167
 
127
168
  ```ts