tcmts.cli.shot

ShotBrowser interface
What `tcm shot` uses of Playwright's browser.
ShotPage interface
What `tcm shot` uses of Playwright's page.
launchChromium () => Promise<ShotBrowser>
Headless Chromium, through the Playwright tcm ships: the Chrome installed, as tcm's browser tests use; else Playwright's own Chromium, which its installer downloads the first time there's neither.
shot (o: { cwd: string; url: string; widths: number[]; out: string | undefined; wait: number; }) => Prom…
`tcm shot`: open a page in headless Chromium at each width, wait for it to settle (loaded, the network quiet, its fonts in, then `wait` ms more), and save a full-page PNG of it per width into `out` (default `.tcm/shots/` in a codebase, else the temp directory's `tcm-shots/`). Prints the page's title, each file's path, and what went wrong on the page: console errors, uncaught errors, and requests that failed or answered 400 or more.
shotTarget (given: string, root: string | undefined) => { url: string; slug: string; }
The page `tcm shot` is given, as a URL: one as it is; `host:port` or a port alone, over http on this machine; otherwise an app's name, at the address the `tcm dev` or `tcm start` running it on this codebase listens on (the newest). A file name for it, too.