Skip to content

Run, build & test locally

  • Node.js 24 (.node-version in the repository)
  • pnpm 10 (packageManager in package.json)
  • To run GPU tests or vj:preview, Nix (the dev shell in flake.nix provides Chromium and the required libraries)

The tech stack is Vite + React 19 + TypeScript. Rendering and audio analysis are plain TypeScript classes that do not depend on React (src/render/, src/audio/, src/scenes/, src/synth/), and React handles only the UI and settings. The only runtime dependencies are React and valibot; no rendering library such as three.js is used.

ターミナルウィンドウ
pnpm install
pnpm dev
  • The dev server starts over HTTPS with a self-signed certificate (@vitejs/plugin-basic-ssl). The URL is usually https://localhost:5173/. The browser shows a warning the first time, so proceed via “Advanced” → “Proceed to …”.
  • It is also exposed to the LAN (server.host: true). The microphone (getUserMedia) only works in a secure context (HTTPS or localhost), so it is HTTPS to let you try it from other LAN devices.
  • To control it from the CLI, start pnpm bridge in another terminal and open with ?bridge=1 (Remote control).
ターミナルウィンドウ
pnpm build # tsc -b && vite build (includes type checking)
pnpm preview # preview the build locally

Static files are output to dist/. To serve from a subpath, specify it like BASE_PATH=/<path>/ pnpm build.

ターミナルウィンドウ
pnpm test # vitest (the full unit test suite)
nix develop -c pnpm test:gpu # tests that use the GPU (WebGL2)
pnpm test:watch # watch mode
ターミナルウィンドウ
pnpm lint # oxlint --type-aware
pnpm lint:fix
pnpm format # oxfmt
pnpm format:check

CI (.github/workflows/ci.yml) runs the format check, lint, the build (including type checking), unit tests, and GPU tests.

Script Details
pnpm vj:preview Renders a Patch to a PNG (vj:preview / vj:validate)
pnpm vj:validate Validates a Patch locally (same as above)
pnpm measure:coverage Measures each Generator’s screen coverage on a real GPU and rewrites src/synth/coverage.generated.ts (nix develop recommended)
pnpm knowledge:check Validates the format of the knowledge bundle in knowledge/

The hosted version is served on Cloudflare Workers (wrangler.jsonc, worker/). A single Worker handles serving the built app (dist/) and the WebSocket relay at /room/<id> (the Durable Object RelayRoom). Deployment is done through the Git integration of Cloudflare Workers Builds, which runs pnpm run build at build time.