Package scripts
Every script of package.json, run with pnpm run <name>. A script running a repo script is described by the comment at the top of that file, one running a tool by DESCRIPTIONS of scripts/living-docs/package-scripts.ts. The one-off admin scripts run with pnpm exec vite-node are in Scripts.
Build & deploy
| Script | What it does |
|---|---|
build | Production build of the app, after regenerating the translation usage index Command pnpm run i18n:usage && react-router buildScripts i18n:usage |
deploy | Render's build command: installs the locked dependencies and builds Command pnpm install --frozen-lockfile && pnpm run buildScripts build |
deploy:prod | Deploys to Render with maintenance mode on until the new instance is healthy, see docs/site/src/content/docs/dev/scripts.mdx Command node scripts/deploy-prod.ts |
start | Production server: migrates the database then serves the build Command pnpm run migrate up && NODE_ENV=production react-router-serve ./build/server/index.jsScripts migrate |
Develop
| Script | What it does |
|---|---|
dev | Dev server against db.sqlite3, migrating and setting up the dev database first Command cross-env DB_PATH=db.sqlite3 pnpm run migrate up && pnpm run setup && pnpm run i18n:usage && react-router dev --hostScripts migratesetupi18n:usage |
dev:docs | The docs site (living docs included) at http://localhost:4321, see docs/site/src/content/docs/dev/living-docs.mdx Command astro dev --root docs/site |
dev:fast | Dev server without the migrate and setup steps of Command react-router dev --host |
dev:sandbox | Dev server against db-sandbox.sqlite3, the local copy of production data Command cross-env DB_PATH=db-sandbox.sqlite3 VITE_PROD_MODE=true react-router dev --host |
seed | Rebuilds the dev dataset of db.sqlite3 Command cross-env DB_PATH=db.sqlite3 vite-node ./scripts/seed.tsRunsscripts/seed.ts |
setup | Seeds the dev database and its images when they are missing, run by Command cross-env DB_PATH=db.sqlite3 vite-node ./scripts/setup.tsRunsscripts/setup.ts |
Database
| Script | What it does |
|---|---|
bench:db | Benchmarks the repository read functions against db-sandbox.sqlite3 Command cross-env DB_PATH=db-sandbox.sqlite3 VITE_PROD_MODE=true vite-node scripts/benchmark-db.ts |
download-prod-db | Snapshots the production database over SSH into db-snapshot.sqlite3 and rebuilds the sandbox, see docs/site/src/content/docs/dev/scripts.mdx Command node scripts/download-prod-db.ts |
migrate | Runs the Kysely migrations of /migrations, e.g. Command node scripts/migrate.ts |
migrate:new | Scaffolds a new migration file, e.g. Command node scripts/create-migration.ts |
migrate:sandbox | Migrates db-sandbox.sqlite3 Command cross-env DB_PATH=db-sandbox.sqlite3 pnpm run migrate upScripts migrate |
sandbox:reset | Restores db-sandbox.sqlite3 from db-snapshot.sqlite3 and migrates it Command node scripts/reset-sandbox-db.ts && pnpm run migrate:sandboxScripts migrate:sandbox |
Translations
| Script | What it does |
|---|---|
check-plural-collapse | Fails when a translation json has suffixed plural keys Command node scripts/collapse-single-plural-keys.ts --check |
check-translation-jsons | Checks the translation jsons for missing keys and plural suffix clashes, fixing what it can Command node scripts/check-translation-jsons.ts |
check-translation-jsons:no-write |
Command node scripts/check-translation-jsons.ts --no-write |
check-translation-sync | Fails when the translation jsons are out of sync with English Command node scripts/sync-translation-jsons.ts --check |
i18n:sync | Syncs the translation jsons with English, run after removing or renaming keys Command node scripts/collapse-single-plural-keys.ts && node scripts/sync-translation-jsons.ts && pnpm run biome:fixScripts biome:fix |
i18n:usage | Generates the index of where each translation key is used (source files and the routes rendering them) shown on the /translate page Command node scripts/generate-translation-usage.ts |
Checks
| Script | What it does |
|---|---|
biome:check | Biome lint and format check Command biome check --error-on-warnings . |
biome:fix | Biome lint and format, applying the safe fixes Command biome check --error-on-warnings --write . |
biome:fix:unsafe | Biome lint and format, applying the unsafe fixes too Command biome check --error-on-warnings --write --unsafe . |
checks | Everything CI checks: lint, unit and browser tests, translations, type checks and knip. A task isn't done until it passes Command pnpm run biome:fix && pnpm run test:unit:browser && pnpm run check-translation-jsons && pnpm run check-plural-collapse && pnpm run check-translation-sync && pnpm run typecheck && pnpm run typecheck:scripts && pnpm run typecheck:docs && pnpm run knip |
checks:scanner |
Command pnpm checks && pnpm test:scannerScripts checkstest:scanner |
knip | Finds unused files, exports and dependencies Command knip |
typecheck | Type checks the app after generating the route types Command react-router typegen && tsc --noEmit |
typecheck:docs | Type checks the docs site Command astro sync --root docs/site && tsc --noEmit -p docs/site |
typecheck:scripts | Type checks scripts/ Command tsc --noEmit -p scripts |
Tests
| Script | What it does |
|---|---|
test:browser:ui | Browser tests in Vitest's UI Command cross-env VITE_SITE_DOMAIN=http://localhost:5173 vitest --silent=passed-only --project browser |
test:e2e | Runs the Playwright e2e tests Command playwright test |
test:e2e:flaky-detect | Runs every e2e test 10 times, stopping at the first failure Command playwright test --repeat-each=10 --max-failures=1 |
test:scanner | Runs the scanner's fixture tests Command vitest run --project scanner |
test:unit:browser | Runs the unit and browser (Vitest browser mode) tests Command cross-env VITE_SITE_DOMAIN=http://localhost:5173 BROWSER_HEADLESS=true vitest --silent=passed-only run --project unit --project browser |
test:unit:browser:ui | Unit and browser tests in Vitest's UI Command cross-env VITE_SITE_DOMAIN=http://localhost:5173 vitest --silent=passed-only |
Scanner
| Script | What it does |
|---|---|
scanner:bootstrap-atlas | Bootstraps glyph atlases from labeled reference fixtures Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/bootstrap-atlas-from-fixture.ts |
scanner:build-glyph-atlas | Builds glyph atlases by rendering the Splatoon fonts at the exact scoreboard render sizes, calibrated against the reference fixture Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/build-glyph-atlas.ts |
scanner:build-localized-entries | Generates the localized closed sets from the splat3 repo's language dumps (https://github.com/Leanny/splat3, data/language/<Lang>_full.json) so ingestion works in any game language Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/build-localized-entries.ts |
scanner:build-planner-signatures | Builds the planner signature atlas from the assets repo's planner renders Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/build-planner-signatures.ts |
scanner:fixtures | CLI harness: run the ScoreboardDetector over fixtures and print everything it saw — gate result, parsed fields, per-field scores, top weapon candidates Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/run-fixtures.ts |
scanner:gpu-parity | GPU parity over every fixture frame Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/gpu-parity.ts |
scanner:gpu-replay | Replay benchmark for the GPU matcher Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/gpu-replay.ts |
scanner:replay | CLI harness: replays a directory of extracted VoD frames through the full detector registry driven by a DetectorScheduler, mirroring the worker's chunk scan Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/replay-frames.ts |
scanner:report | Accuracy report across all fixtures, separate from pass/fail testing Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/report.ts |
scanner:scan-vod | CLI equivalent of the VoD tab: scans a video with the full detector registry and writes the same events CSV the tab's Export menu downloads Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/scan-vod.ts |
scanner:status-audit | Audits death/special detection against scoreboard truth, from an events CSV downloaded from the scanner UI Command vite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/status-audit.ts |
scanner:unpack-zip | Validates a scanner Command node scripts/scanner/unpack-game-data-zip.ts |
Docs
| Script | What it does |
|---|---|
docs:build | Builds the docs site into docs/site/dist and checks its internal links Command astro build --root docs/site && node scripts/check-docs-links.ts |
docs:capture | Runs e2e specs with tracing on and keeps what the living docs show from the run Command node scripts/living-docs/capture.ts |
docs:preview | Builds the docs site and serves the build, search included Command astro build --root docs/site && astro preview --root docs/site |
docs:screenshots:download | Downloads the published screenshots whose spec is unchanged since their capture, run by the docs site's Render build Command node scripts/living-docs/published-screenshots.ts download |
docs:screenshots:publish | Uploads the screenshots of a Command node scripts/living-docs/published-screenshots.ts publish |
Other
| Script | What it does |
|---|---|
changelog:image | Screenshots the canvas of the /admin/changelog-image page into a shareable PNG and writes the same update as text, both as Bluesky alt text and as a Discord post, see docs/site/src/content/docs/dev/how-to.mdx Command node scripts/generate-changelog-image.ts |
check-articles | Validates all articles files in the project are following the correct .md + grey matter format Command vite-node scripts/check-articles.ts |
compute-luti-divs | Runs the ComputeLutiDivs routine once Command vite-node scripts/compute-luti-divs.ts |
ink-detail:generate | Splits sub & special weapon icons into the layers that let them take the user's accent color as their ink color, writing them into the assets repo, see docs/site/src/content/docs/dev/how-to.mdx Command node scripts/create-ink-detail-images.ts |
notification:test | Sends a test notification (and web push) to a user of the dev database Command cross-env DB_PATH=db.sqlite3 vite-node ./scripts/send-test-notification.ts |
og:generate | Screenshots the canvases of the /admin/og-images page into the assets repo, see docs/site/src/content/docs/dev/how-to.mdx Command node scripts/generate-og-images.ts |
vods:download | Downloads the match VoDs of a tournament with yt-dlp, trimmed to each match Command cross-env DB_PATH=db-sandbox.sqlite3 VITE_PROD_MODE=true vite-node scripts/download-tournament-vods.ts |