Contributing
Contributions are welcome — rut.ts is hardened for production identity use, so quality and test coverage matter more than speed. This guide gets you set up.
Reporting issues#
Found a bug or have a feature request?
- Search existing issues first.
- Open a new issue with a clear description, reproduction steps, expected vs. actual behavior, and a minimal code example.
For security vulnerabilities, do not open a public issue — follow the repository's private security policy. See Security.
Development setup#
Prerequisites#
- Node.js 16+ or Bun
- npm, pnpm, or bun
Get started#
git clone https://github.com/arrowsw/rut.ts.git
cd rut.ts
npm install
npm test # run the suite
npm test -- --watch
npm run build # build the librarySubmitting a pull request#
Branch
git checkout -b feature/my-featureImplement with tests
Add tests for new behavior — happy paths, error cases, edge cases, and safe mode. Coverage should not regress.
Verify locally
npm test
npm run lint
npm run prettierCommit and open the PR
Use a clear, conventional commit message and describe the change and any breaking impact.
Code guidelines#
- Written in TypeScript; follow the existing style and run the linter.
- Add JSDoc to public functions.
- Keep functions small and single-purpose — this library's value is being tiny and focused.
- Preserve the security invariants: bound input length, keep error messages generic, never echo the offending value.
Test guidelines#
The suite is the contract. Mirror the existing structure:
describe('myFunction', () => {
describe('basic functionality', () => {
test('handles valid input', () => { /* … */ })
})
describe('error cases', () => {
test('throws on invalid input', () => { /* … */ })
})
describe('safe mode', () => {
test('returns null instead of throwing', () => { /* … */ })
})
describe('edge cases', () => {
test('handles boundary input', () => { /* … */ })
})
})See Testing for how the suite is organized.
Project structure#
rut.ts/
├── src/ # Library source (single entry: index.ts)
├── tests/ # Jest suites, one per public function
├── www/ # This documentation site (Next.js App Router)
│ └── content/docs/ # The MDX pages you are reading
├── dist/ # Build output
└── package.json
Updating the docs#
The documentation site is a Next.js App Router app under www/. Pages are MDX in www/content/docs/. To change a page, edit its .mdx file directly — every page also has an “Edit this page on GitHub” link at the bottom that points at the right file.
When adding or changing a feature, please:
- Update the relevant
www/content/docs/**page(s). - Update the root
README.mdandCHANGELOG.md. - Include runnable code examples.
- Document any breaking change in Migration to v4 (or the current migration page).
Areas that always help#
- Tests: more edge cases, differential inputs, benchmarks.
- Docs: clearer explanations, more examples, translations.
- Tooling: CI/CD, developer experience, automated releases.
Maintainers#
- Hans Pina — @hansfpc
License#
MIT © 2026 rut.ts by Arrow Software.
Thank you for contributing — your help makes RUT handling safer for the entire Chilean developer community. 🙏