mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-19 11:22:21 +02:00
refactor(make-pdf): print through Aside first, the bundled browser otherwise
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>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
Reference in New Issue
Block a user