mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-10 15:09:00 +02:00
asideClient.ts replaces the direct $B client with one render() call per PDF (the exact option mapping the browse pdf command had: paper, margins, header/footer/page numbers, tagged, outline, printBackground, preferCSSPageSize, Paged.js wait); the diagram pre-pass, oversized-image downscale and DOCX rasters each run as one render script with per-fence try/catch; exit 4 now means no browser is available and names both remedies; $P setup reports which engine it found. The e2e gates run on whichever engine is present, so the Linux lane exercises the fallback. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
16 lines
710 B
TypeScript
16 lines
710 B
TypeScript
/**
|
|
* Gate prerequisite shared by the make-pdf e2e gates: SOME browser the
|
|
* compiled binary can print through — the Aside app (macOS dev machines) or
|
|
* gstack's own browse binary (what the Linux free-tests lane builds via
|
|
* build:gates). Mirrors lib/aside-render's pickEngine() order.
|
|
*/
|
|
import { resolveBrowseBin } from "../../../lib/aside-render";
|
|
import { asideAvailable } from "../../../test/helpers/aside-available";
|
|
|
|
export const NO_BROWSER_REASON =
|
|
"no browser available (open the Aside app, or build gstack's own browser with `bun run build:gates`; GSTACK_SKIP_ASIDE=1 skips Aside).";
|
|
|
|
export function browserAvailable(): boolean {
|
|
return asideAvailable() || resolveBrowseBin() !== null;
|
|
}
|