|
| 1 | +# Contributing to @rbac/rbac |
| 2 | + |
| 3 | +Thanks for your interest in contributing! This document outlines how to get started. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. Fork and clone the repository |
| 8 | +2. Install dependencies: |
| 9 | + ```bash |
| 10 | + npm install |
| 11 | + ``` |
| 12 | +3. Build the project: |
| 13 | + ```bash |
| 14 | + npm run build |
| 15 | + ``` |
| 16 | +4. Run tests to make sure everything works: |
| 17 | + ```bash |
| 18 | + npm test |
| 19 | + ``` |
| 20 | + |
| 21 | +## Development Workflow |
| 22 | + |
| 23 | +### Building |
| 24 | + |
| 25 | +```bash |
| 26 | +npm run build # Compile TypeScript and bundle with Vite |
| 27 | +npm run dev # Watch mode for development |
| 28 | +``` |
| 29 | + |
| 30 | +### Testing |
| 31 | + |
| 32 | +```bash |
| 33 | +npm test # Run tests with coverage |
| 34 | +npm run test:watch # Run tests in watch mode |
| 35 | +``` |
| 36 | + |
| 37 | +### Benchmarks |
| 38 | + |
| 39 | +```bash |
| 40 | +npm run bench # Run performance benchmarks |
| 41 | +``` |
| 42 | + |
| 43 | +## Project Structure |
| 44 | + |
| 45 | +``` |
| 46 | +├── src/ # TypeScript source files |
| 47 | +├── lib/ # Compiled output (generated) |
| 48 | +├── test/ # Test files |
| 49 | +├── examples/ # Usage examples (Node, web, React) |
| 50 | +├── benchmarks/ # Performance benchmarks |
| 51 | +└── docs/ # Documentation |
| 52 | +``` |
| 53 | + |
| 54 | +## Making Changes |
| 55 | + |
| 56 | +1. Create a branch for your feature or fix: |
| 57 | + ```bash |
| 58 | + git checkout -b feature/my-feature |
| 59 | + ``` |
| 60 | + |
| 61 | +2. Make your changes and ensure: |
| 62 | + - All tests pass (`npm test`) |
| 63 | + - Code follows existing style (check `.eslintrc`) |
| 64 | + - TypeScript compiles without errors (`npm run build`) |
| 65 | + |
| 66 | +3. Add tests for new functionality |
| 67 | + |
| 68 | +4. Update documentation if needed (README.md, docs/, examples/) |
| 69 | + |
| 70 | +## Pull Request Guidelines |
| 71 | + |
| 72 | +- Keep PRs focused on a single change |
| 73 | +- Write clear commit messages |
| 74 | +- Include tests for new features or bug fixes |
| 75 | +- Update the CHANGELOG.md if applicable |
| 76 | +- Make sure CI passes before requesting review |
| 77 | + |
| 78 | +## Code Style |
| 79 | + |
| 80 | +- Written in TypeScript |
| 81 | +- Follow existing patterns in the codebase |
| 82 | +- Use meaningful variable and function names |
| 83 | +- Add JSDoc comments for public APIs |
| 84 | + |
| 85 | +## Reporting Issues |
| 86 | + |
| 87 | +When reporting bugs, please include: |
| 88 | +- Node.js version |
| 89 | +- Steps to reproduce |
| 90 | +- Expected vs actual behavior |
| 91 | +- Minimal code example if possible |
| 92 | + |
| 93 | +## Questions? |
| 94 | + |
| 95 | +Open an issue or start a discussion on GitHub. |
| 96 | + |
| 97 | +## License |
| 98 | + |
| 99 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
0 commit comments