#!/usr/bin/env node /** * API snapshot (G10): every publishable package's public entry points, rolled * up to one text file per entry under `api/`, committed and diffed in CI. * * node tooling/build/src/api-snapshot.mjs # write snapshots * node tooling/build/src/api-snapshot.mjs --check # fail on drift * * Works on SOURCE entries (the `exports` map points at `src/*.ts`), so no * build is needed; a line per exported symbol with its declaration text, so * a diff reads as an API change. Signatures stay authored in TypeScript — * this is a mirror, never a second source of truth. * * Source-first all the way down: re-exports are followed with the * `development` condition (what Vite's dev server resolves), so a boundary * package's `import` → dist types never enter the picture, and a package * whose types only exist as `tsc --emitDeclarationOnly` mirrors (the viewer's * doors) is read through the src/ file its dist/ declaration mirrors; an * ng-packagr package through the entry files its `ng-package.json`s name. A * snapshot therefore never depends on what happens to be built — it is the * same text on a bare checkout (CI's contract job) and a developer's machine. * Vue and Svelte components, which the checker cannot read, get their props, * events and slots from their `