Contributing
Report bugs, suggest features and send changes.
Contributions are welcome! Please read CONTRIBUTING.md first, and follow the Code of Conduct.
Ways to contribute
- Report bugs and unexpected behaviour.
- Suggest features or improvements.
- Improve the documentation.
- Add or improve tests.
- Fix bugs or implement approved features.
Reporting a bug
Open a GitHub Issue with a clear title, steps to reproduce, the expected and the actual behaviour, your environment (OS, Bun version and RiserBob version) and any relevant logs or a minimal code sample.
Suggesting a feature
Open an Issue describing the problem, your proposed solution and the alternatives you considered. For a large change, wait for maintainer feedback before you start.
Development setup
Terminal
# Install dependenciesbun install # Run the full test suitebun testRepository layout
Output
src/ application/ Application class (RiserBob) errors/ HttpError and ErrorHandler http/ Response helpers middleware/ Middleware pipeline and built-in middleware routing/ Router server/ HTTP server types/ Shared types validation/ Validatortest/ unit/ Unit tests, mirroring the src/ layout e2e/ End-to-end tests against a real serverCoding guidelines
- Write TypeScript with strict, explicit types, and avoid
any. - Follow the existing style: tabs for indentation, single quotes and no semicolons.
- Follow the existing naming conventions, for example the
Spongprefix for public API members. - Keep functions small and focused, and prefer clear code over clever code.
- Do not introduce new dependencies without discussing them in an Issue first.
- Keep user-facing error messages consistent with the existing project tone.
Testing requirements
- Every bug fix must include a test that fails without the fix.
- Every new feature must include unit tests, and end-to-end tests where it affects server behaviour.
- All tests must pass with
bun testbefore you open a Pull Request. - Tests that intentionally trigger errors should silence the expected
console.errorandconsole.warnoutput with a spy, and restore it afterwards.
Commit messages
Use short, descriptive messages in the imperative mood:
Output
Fix Allow header missing on 405 responsesAdd maxLength rule to ValidatorUpdate auth middleware to throw HttpErrorPull requests
- Make sure an Issue exists, or open one, and that the maintainers agreed on the approach.
- Create a branch from
mainwith a descriptive name, for examplefix/405-allow-header. - Keep each Pull Request focused on one concern.
- Describe what changed and why, and link the related Issue.
- Respond to review feedback respectfully. Maintainers may request changes or decline contributions that do not fit the project's goals.
License and contributions
RiserBob is licensed under the MIT License. Contributions are welcome and are subject to the terms of that license.
- By submitting a contribution, you confirm that you have the right to submit it.
- Contributions are licensed under the MIT License, allowing the community to use, modify, and distribute them under its terms.
- Submitting a contribution does not guarantee that it will be merged.