Contributing
Conventions for contributors and agents.
The repository is public. Never commit secrets, internal hostnames, customer data or details of any other company’s private systems.
Conventions
- Use bun for everything:
bun install,bun run <script>,bun test. Do not use node or npm. - TypeScript only, strict mode, with explicit types at module boundaries.
- Format with
bun fmt(bun run format, check withbun fmt --check). There is no lint step; the compiler flagsnoUnusedLocals,noUnusedParametersandnoFallthroughCasesInSwitchare on. - Typecheck with
bun checkper package (bun run typecheckruns them one at a time). - File names are kebab-case, for example
run-queue.ts. - Commits use conventional commits:
type(scope): message, with a required scope. - Tests live in
packages/<name>/tests/and run withbun test <file>. - Prose uses sentence-case headings and no em-dashes.
Database schema
The schema lives in packages/core/src/db/schema.ts. After changing it, run:
bun run --cwd packages/core db:generateThis runs drizzle-kit and re-embeds the migrations into migrations.generated.ts. Commit both. CI fails if the embedded module is stale.
Embedded assets
The compiled binary must work from an empty directory, so never read runtime assets from disk. Embed them. See Bun notes.
Web UI in the dev loop
Run from source (bun run packages/core/src/main.ts serve), the server serves the built bundle in packages/ui/dist when it has an index.html: build it with bun run --cwd packages/ui build and reload the page (files are read per request, so a rebuild shows without a restart). To serve a bundle from elsewhere set TURNTABLE_UI_DIR. Without a build the server shows a placeholder that says how to build one. This is dev mode only: the compiled binary serves its embedded UI and never reads UI files from disk, and ignores TURNTABLE_UI_DIR. Only regular files inside the directory are served; a path that leaves it, or a symlink that does, is a 404.
Docs
Docs ship with each feature. This site lives in docs/ and is built with Tangly. Run bun run dev in docs/ to preview, and bun run check before you push. bun fmt skips .mdx files (see .prettierignore).
Branches and PRs
Work on a branch and open a PR for anything beyond a trivial fix. Keep main green.
Branches from before the Turntable rename
Update them by hand. LONGSHORE_* env, ls_ and lsi_ tokens, longshore.db and __longshore_migrations are still accepted (see Formerly Longshore). Never rename a string in key-derivation, signing, approval or webhook code.