#!/usr/bin/env node /** * ClinicPro admin page driver — screenshots and audits a page of the React admin * SPA from its URL, with no npm dependencies (Node 22's global WebSocket speaks * CDP directly, so there is no playwright/puppeteer install to babysit). * * driver.mjs shot [--out f.png] [--w 1440] [--h 900] [--full] * [--theme dark] [--density compact] [--context clinic] * driver.mjs variants [--dir /tmp/review] ← the four shots a review needs * driver.mjs inspect * driver.mjs audit * driver.mjs ds [components|tokens] * * `shot` logs in over the API, seeds localStorage['clinicpro-auth'], then * navigates and captures. Needed because the admin is a client-side * SPA: Chrome's plain `--screenshot` flag lands on the login form. * `variants` runs `shot` four times — light desktop, dark, compact, 390px mobile. * A redesign judged on one screenshot ships a page that breaks in the * other three; dark mode and compact density are real user settings * here, not hypotheticals. * `inspect` maps a URL to the route entry in App.tsx, the page source file, and * the design-system components it already imports. * `audit` greps one source file for the anti-patterns this project keeps * regrowing (native