|
| 1 | +# Contributing to finprim |
| 2 | + |
| 3 | +Thanks for your interest in contributing to finprim! This guide will help you get started. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. Fork the repository |
| 8 | +2. Clone your fork: |
| 9 | + ```bash |
| 10 | + git clone https://github.com/YOUR_USERNAME/finprim.git |
| 11 | + cd finprim |
| 12 | + ``` |
| 13 | +3. Install dependencies: |
| 14 | + ```bash |
| 15 | + npm install |
| 16 | + ``` |
| 17 | +4. Run the tests to make sure everything works: |
| 18 | + ```bash |
| 19 | + npm test |
| 20 | + ``` |
| 21 | + |
| 22 | +## Development Workflow |
| 23 | + |
| 24 | +```bash |
| 25 | +npm run dev # Watch mode (rebuilds on changes) |
| 26 | +npm test # Run tests once |
| 27 | +npm run test:watch # Run tests in watch mode |
| 28 | +npm run lint # Type-check with tsc |
| 29 | +npm run build # Production build |
| 30 | +``` |
| 31 | + |
| 32 | +## Making Changes |
| 33 | + |
| 34 | +1. Create a branch from `main`: |
| 35 | + ```bash |
| 36 | + git checkout -b feat/my-feature |
| 37 | + ``` |
| 38 | +2. Make your changes |
| 39 | +3. Add tests for any new functionality |
| 40 | +4. Ensure all tests pass: `npm test` |
| 41 | +5. Ensure types are correct: `npm run lint` |
| 42 | + |
| 43 | +## Pull Requests |
| 44 | + |
| 45 | +- **Open an issue first** before submitting a PR for significant changes so we can discuss the approach |
| 46 | +- Keep PRs focused - one feature or fix per PR |
| 47 | +- Include tests for new validators, formatters, or calculations |
| 48 | +- Update the README if you add a new public API |
| 49 | + |
| 50 | +## What We're Looking For |
| 51 | + |
| 52 | +Here are some areas where contributions are especially welcome: |
| 53 | + |
| 54 | +- **New validators** - Additional financial data validators (e.g., SEPA, ACH) |
| 55 | +- **Locale coverage** - More currency locales and formatting options |
| 56 | +- **Bug reports** - Found an edge case? Open an issue with the input that failed |
| 57 | +- **Documentation** - Improvements to docs, examples, or guides |
| 58 | +- **Framework integrations** - Additional framework support beyond React/NestJS/Zod |
| 59 | + |
| 60 | +## Code Style |
| 61 | + |
| 62 | +- Write TypeScript (no `any` types) |
| 63 | +- Follow the existing patterns in the codebase |
| 64 | +- All validators return a discriminated union (`{ valid: true, ... } | { valid: false, error: string }`) |
| 65 | +- Keep the core zero-dependency - framework integrations go in their own subpath |
| 66 | + |
| 67 | +## Reporting Issues |
| 68 | + |
| 69 | +When reporting a bug, please include: |
| 70 | +- The input value that caused the issue |
| 71 | +- Expected behavior |
| 72 | +- Actual behavior |
| 73 | +- Your Node.js and TypeScript versions |
| 74 | + |
| 75 | +## License |
| 76 | + |
| 77 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
0 commit comments