Contributing
Prerequisites
- Bun runtime
- TypeScript 5+
Setup
bash
git clone https://github.com/rafbcampos/rmbr.git
cd rmbr
bun installbun install automatically registers the rmbr command on your PATH via bun link.
Development Commands
| Command | Description |
|---|---|
bun run check | Full quality gate (typecheck + lint + format + test) |
bun run test | Run tests |
bun run typecheck | Type-check with tsc --noEmit |
bun run lint | Lint with oxlint |
bun run format | Check formatting with Prettier |
bun run format:fix | Auto-fix formatting with Prettier |
Always run bun run check before submitting a pull request. It runs the full quality gate in one command.
Testing
Tests use bun:test with describe/it blocks. Every test gets an in-memory SQLite database via openMemoryDatabase(), so tests are fast and isolated.
The test directory mirrors the source structure:
src/modules/todo/service.ts
tests/modules/todo/service.test.tsCode Style
Prettier is configured with:
- Single quotes
- Trailing commas
arrowParens: avoid- 100 character line width
TypeScript is set to strict mode with exactOptionalPropertyTypes enabled. Additional rules:
- No
enumkeyword — use const object enums instead. - No hardcoded string checks — use typed constants.
- No
unknown,as, orany— use proper types or type guards. - No placeholder code or TODOs.
Adding a Module
- Create a directory at
src/modules/<name>/. - Implement the
RmbrModuleinterface withname,migrations,tools, andregisterCommands. - Choose a migration version range (see Architecture for the range table).
- Add a
drizzle-schema.tsfor your table definitions. - Add a
service.tswith business logic. - Register your module in
src/registry.ts. - Add tests under
tests/modules/<name>/.