#!/usr/bin/env -S bun run // scripts/emit-version-modules.ts // // Codegen for the per-version TypeScript wrappers that sit alongside // each `generated//*.json` defs. // // For every version we track, we emit one file: // // generated//index.ts one module, all exports — // createParser / createTokenizer // pre-bound to this version's // dumps, plus a `parse(sql)` / // `tokenize(sql)` convenience // API, re-exported types, and the // raw defs objects. // // The reason this file exists at all (vs. hand-authored per-version // modules) is that every version's wrapper is boilerplate save one // version string. Codegen keeps the set consistent and makes "what // does the version wrapper look like?" a one-place question. // // There's also one cross-version file: // // generated/current.ts re-exports the version named // by vendor/manifest.json's // `current` field. This is what // a bare `import ''` // resolves to by default (where // is taken from // package.json — see PACKAGE_JSON). // // Usage: // bun scripts/emit-version-modules.ts version