mirror of
https://github.com/tiennm99/vngeoguessr.git
synced 2026-10-13 02:14:54 +00:00
- panoramas + pano_provinces tables replace 28MB bundled JSON; pano-index.js now draws via cached COUNT + ORDER BY id OFFSET with rejection sampling, composite (province,id)/(district,id) indexes support the skip - scripts/seed-pano-db.mjs validates pipeline artifacts (the old real-data vitest invariants, extracted to scripts/lib/pano-artifacts.mjs), stages into panoramas_next, verifies, renames into place in one transaction, keeps panoramas_old as backup; --province reseeds in place; --check validates only - pipeline writes gitignored data-build/panos/; pano barrel removed - tests run against PGlite mocked in at the @neondatabase/serverless boundary, mirroring the fake-upstash pattern; fixtures replace real data - infrastructure errors rethrow instead of reading as missing coverage; session ids via crypto.randomUUID (uuid package dropped)
16 lines
858 B
JavaScript
16 lines
858 B
JavaScript
// Absolute paths to the generated data directories, shared by every script
|
|
// that reads or writes them.
|
|
//
|
|
// Resolved from this file's own location rather than the process's cwd. npm
|
|
// always runs scripts from the project root anyway, but `node
|
|
// scripts/whatever.mjs` from an unexpected directory would otherwise silently
|
|
// read or write the wrong tree instead of failing loudly.
|
|
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
export const BOUNDARY_DIR = fileURLToPath(new URL('../../src/data/boundaries', import.meta.url));
|
|
// Local pipeline artifacts, not committed and not bundled: the app reads
|
|
// panoramas from Postgres, seeded from these files by seed-pano-db.mjs.
|
|
export const PANO_DIR = fileURLToPath(new URL('../../data-build/panos', import.meta.url));
|
|
export const TREE_DIR = fileURLToPath(new URL('../../src/data/regions', import.meta.url));
|