Skip to content

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

ScriptWhat it does
build

Production build of the app, after regenerating the translation usage index

Commandpnpm run i18n:usage && react-router build
Scriptsi18n:usage
deploy

Render's build command: installs the locked dependencies and builds

Commandpnpm install --frozen-lockfile && pnpm run build
Scriptsbuild
deploy:prod

Deploys to Render with maintenance mode on until the new instance is healthy, see docs/site/src/content/docs/dev/scripts.mdx

Commandnode scripts/deploy-prod.ts
start

Production server: migrates the database then serves the build

Commandpnpm run migrate up && NODE_ENV=production react-router-serve ./build/server/index.js
Scriptsmigrate

Develop

ScriptWhat it does
dev

Dev server against db.sqlite3, migrating and setting up the dev database first

Commandcross-env DB_PATH=db.sqlite3 pnpm run migrate up && pnpm run setup && pnpm run i18n:usage && react-router dev --host
dev:docs

The docs site (living docs included) at http://localhost:4321, see docs/site/src/content/docs/dev/living-docs.mdx

Commandastro dev --root docs/site
dev:fast

Dev server without the migrate and setup steps of dev

Commandreact-router dev --host
dev:sandbox

Dev server against db-sandbox.sqlite3, the local copy of production data

Commandcross-env DB_PATH=db-sandbox.sqlite3 VITE_PROD_MODE=true react-router dev --host
seed

Rebuilds the dev dataset of db.sqlite3

Commandcross-env DB_PATH=db.sqlite3 vite-node ./scripts/seed.ts
setup

Seeds the dev database and its images when they are missing, run by dev

Commandcross-env DB_PATH=db.sqlite3 vite-node ./scripts/setup.ts

Database

ScriptWhat it does
bench:db

Benchmarks the repository read functions against db-sandbox.sqlite3

Commandcross-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

Commandnode scripts/download-prod-db.ts
migrate

Runs the Kysely migrations of /migrations, e.g. pnpm run migrate up

Commandnode scripts/migrate.ts
migrate:new

Scaffolds a new migration file, e.g. pnpm run migrate:new "add user bio"

Commandnode scripts/create-migration.ts
migrate:sandbox

Migrates db-sandbox.sqlite3

Commandcross-env DB_PATH=db-sandbox.sqlite3 pnpm run migrate up
Scriptsmigrate
sandbox:reset

Restores db-sandbox.sqlite3 from db-snapshot.sqlite3 and migrates it

Commandnode scripts/reset-sandbox-db.ts && pnpm run migrate:sandbox

Translations

ScriptWhat it does
check-plural-collapse

Fails when a translation json has suffixed plural keys i18n:sync would collapse

Commandnode 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

Commandnode scripts/check-translation-jsons.ts
check-translation-jsons:no-write

check-translation-jsons without writing fixes, for CI

Commandnode scripts/check-translation-jsons.ts --no-write
check-translation-sync

Fails when the translation jsons are out of sync with English

Commandnode scripts/sync-translation-jsons.ts --check
i18n:sync

Syncs the translation jsons with English, run after removing or renaming keys

Commandnode scripts/collapse-single-plural-keys.ts && node scripts/sync-translation-jsons.ts && pnpm run biome:fix
Scriptsbiome: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

Commandnode scripts/generate-translation-usage.ts

Checks

ScriptWhat it does
biome:check

Biome lint and format check

Commandbiome check --error-on-warnings .
biome:fix

Biome lint and format, applying the safe fixes

Commandbiome check --error-on-warnings --write .
biome:fix:unsafe

Biome lint and format, applying the unsafe fixes too

Commandbiome 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

Commandpnpm 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

checks plus the scanner tests

Commandpnpm checks && pnpm test:scanner
knip

Finds unused files, exports and dependencies

Commandknip
typecheck

Type checks the app after generating the route types

Commandreact-router typegen && tsc --noEmit
typecheck:docs

Type checks the docs site

Commandastro sync --root docs/site && tsc --noEmit -p docs/site
typecheck:scripts

Type checks scripts/

Commandtsc --noEmit -p scripts

Tests

ScriptWhat it does
test:browser:ui

Browser tests in Vitest's UI

Commandcross-env VITE_SITE_DOMAIN=http://localhost:5173 vitest --silent=passed-only --project browser
test:e2e

Runs the Playwright e2e tests

Commandplaywright test
test:e2e:flaky-detect

Runs every e2e test 10 times, stopping at the first failure

Commandplaywright test --repeat-each=10 --max-failures=1
test:scanner

Runs the scanner's fixture tests

Commandvitest run --project scanner
test:unit:browser

Runs the unit and browser (Vitest browser mode) tests

Commandcross-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

Commandcross-env VITE_SITE_DOMAIN=http://localhost:5173 vitest --silent=passed-only

Scanner

ScriptWhat it does
scanner:bootstrap-atlas

Bootstraps glyph atlases from labeled reference fixtures

Commandvite-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

Commandvite-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

Commandvite-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

Commandvite-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

Commandvite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/run-fixtures.ts
scanner:gpu-parity

GPU parity over every fixture frame

Commandvite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/gpu-parity.ts
scanner:gpu-replay

Replay benchmark for the GPU matcher

Commandvite-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

Commandvite-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

Commandvite-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

Commandvite-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

Commandvite-node -c scripts/scanner/vite-node.config.ts scripts/scanner/status-audit.ts
scanner:unpack-zip

Validates a scanner Game data zip sent in by a user and unpacks it into a fresh directory

Commandnode scripts/scanner/unpack-game-data-zip.ts

Docs

ScriptWhat it does
docs:build

Builds the docs site into docs/site/dist and checks its internal links

Commandastro 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

Commandnode scripts/living-docs/capture.ts
docs:preview

Builds the docs site and serves the build, search included

Commandastro 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

Commandnode scripts/living-docs/published-screenshots.ts download
docs:screenshots:publish

Uploads the screenshots of a docs:capture run to the docs' Space, run by CI on pushes to main

Commandnode scripts/living-docs/published-screenshots.ts publish

Other

ScriptWhat 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

Commandnode scripts/generate-changelog-image.ts
check-articles

Validates all articles files in the project are following the correct .md + grey matter format

Commandvite-node scripts/check-articles.ts
compute-luti-divs

Runs the ComputeLutiDivs routine once

Commandvite-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

Commandnode scripts/create-ink-detail-images.ts
notification:test

Sends a test notification (and web push) to a user of the dev database

Commandcross-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

Commandnode scripts/generate-og-images.ts
vods:download

Downloads the match VoDs of a tournament with yt-dlp, trimmed to each match

Commandcross-env DB_PATH=db-sandbox.sqlite3 VITE_PROD_MODE=true vite-node scripts/download-tournament-vods.ts