Skip to content

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?

  1. Search existing issues first.
  2. 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#

Shell
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 library

Submitting a pull request#

1

Branch

Shell
git checkout -b feature/my-feature
2

Implement with tests

Add tests for new behavior — happy paths, error cases, edge cases, and safe mode. Coverage should not regress.

3

Verify locally

Shell
npm test
npm run lint
npm run prettier
4

Commit 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:

TypeScript
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#

Code
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:

  1. Update the relevant www/content/docs/** page(s).
  2. Update the root README.md and CHANGELOG.md.
  3. Include runnable code examples.
  4. 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#

License#

MIT © 2026 rut.ts by Arrow Software.

Thank you for contributing — your help makes RUT handling safer for the entire Chilean developer community. 🙏