Contributing
- Make a branch from
main:feat/,fix/,docs/,chore/,refactor/,test/orperf/, then a short name. - Make one change on the branch.
- Open a pull request. Never push to
main. - Merge with squash.
Before you merge, build and run what you changed. A merge to main deploys.
Database migrations
Section titled “Database migrations”Several branches are built in parallel, so two branches can claim the same migration number. This workflow fixes that before it blocks a merge:
- On your branch, change
apps/api/src/db/schema.tsand runpnpm db:generate. Commit the migration. Its number is temporary. - Before you open a pull request, and again if
mainmoves before you merge, runpnpm db:sync. It rebases the branch ontoorigin/main, rebuildsapps/api/drizzle/asmainhas it, and regenerates your migration with the next free number. - The pre-push hook runs
pnpm db:check. It refuses a push that edits a merged migration, adds a migration on a branch that is behindmain, has a snapshot collision, or changesschema.tswithout a migration.
For a branch stacked on an unmerged branch, set DB_BASE=<that branch>. Never edit a migration that is on main. Each worktree uses its own database (budi_<worktree> for dev, budi_test_<worktree> for tests).
Every domain term has one meaning, in GLOSSARY.md. Add a new term there before you use it in code or copy. The Glossary page on this site is built from that file.