Files
sendou.ink/scripts/cv/vite-node.config.ts
Kalle abc36e3978 Move CV tools to scripts/cv, run via vite-node
- dedicated scripts/cv/vite-node.config.ts: the root config's opencv-js
  optimizeDeps entry would hand vite-node the browser prebundle (crashes
  on __dirname); this config externalizes it to the patched CJS bundle
- atlas builders read/write the local assets checkout (CV_ASSETS_DIR);
  fonts from the repo-root assets/fonts (gitignored)
- build-planner-signatures reads the assets repo's planner-maps with a
  filename adapter (<stageId>-<MODE>-<TYPE>.png); the MINI variant
  reproduces the committed signature atlas byte-identically
- build-localized-entries emits the id-keyed snap tables (StageId/
  ModeShort/CvLobby) — regenerated output is structurally identical to
  the converted localized-entries.ts, and localized-messages.ts survives
  unchanged; canonical-English validation now anchors on the en locale
- report.ts compares weaponIds; the accuracy table matches emberz's last
  run exactly, and the golden suite passes against a from-scratch atlas
  regen (bootstrap + font builder)
- pnpm scripts: cv:report, cv:fixtures, cv:bootstrap-atlas,
  cv:build-glyph-atlas, cv:build-localized-entries,
  cv:build-planner-signatures
2026-07-19 14:13:44 +03:00

19 lines
555 B
TypeScript

/**
* Config for running the CV scripts with vite-node. Deliberately minimal:
* the root vite.config.ts pre-bundles @techstark/opencv-js for the browser
* worker, and vite-node would resolve that browser prebundle (which
* crashes on __dirname in Node). Without the include, vite-node
* externalizes the dep to a plain require of the (patched) CJS bundle.
*/
import { defineConfig } from "vite";
export default defineConfig({
resolve: {
tsconfigPaths: true,
},
optimizeDeps: {
noDiscovery: true,
exclude: ["@techstark/opencv-js"],
},
});