Files
Maximo Guk 1c64925777 Transcribe scanned PDFs in readPdf() on Google Drive bindings (#1079)
This PR makes it so readPdf(fileId) now works on images in a PDF! A scanned PDF with an image and no text used to come back with hasText: false and nothing else (#843). Now its pages are drawn by a renderer Worker and read by the Workers AI vision model @cf/google/gemma-4-26b-a4b-it, and returned as text with transcribed: true

A deployment that wants no model calls/image processing sets PDF_OCR=false
2026-11-17 23:57:31 -06:00

35 lines
1.7 KiB
JSON

// Type-checks `scripts/` — the repo's build/release/dev tooling, which no package tsconfig
// includes. Nothing here is compiled: every module runs directly under `node`, which strips the
// types. `erasableSyntaxOnly` is what keeps that a guarantee. That is also why the `@gadgets/scripts`
// `exports` map points straight at the `.ts` sources: there is no build output to point at, and
// consumers (vite, and `node` for the task graph) both handle TS.
//
// Checked by `pnpm types:scripts` in CI's lint job, deliberately NOT by `pnpm build` (hot-path and no need)
{
"extends": "../tsconfig.json",
"compilerOptions": {
// Node resolves these specifiers for real, unlike the packages' bundled "bundler" mode, so
// imports name the file on disk (`./staging-config.ts`) and need the extension allowed.
"module": "nodenext",
"moduleResolution": "nodenext",
"allowImportingTsExtensions": true,
"types": ["node"],
"erasableSyntaxOnly": true,
"verbatimModuleSyntax": true
},
// The packages' Node-only build/import tools are excluded from their Worker tsconfigs and need the
// same Node runtime and erasable-syntax checks as the repo-level scripts. So do the Worker configs,
// which scripts/generate-worker-configs.ts imports under `node`.
"include": [
"**/*.ts",
"../packages/workshop-backend/scripts/*.ts",
"../packages/gatekeeper-*/build-app.ts",
"../packages/gatekeeper-*/scripts/*.ts",
"../packages/pdf-renderer/scripts/*.ts",
"../packages/configurator-ui/build/*.ts",
"../cloudflare.config.ts",
"../packages/*/cloudflare.config.ts",
"../packages/integration-tests/fixtures/*/cloudflare.config.ts"
]
}