Thank you for your interest in contributing to chapa-nodejs! We welcome contributions from the community.
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
- Check if the bug has already been reported in Issues
- If not, create a new issue using the Bug Report template
- Provide as much detail as possible including:
- Package version
- Node.js version
- Steps to reproduce
- Expected vs actual behavior
- Code samples
- Check if the feature has already been requested
- Create a new issue using the Feature Request template
- Clearly describe the problem and proposed solution
- Provide example usage if possible
- Fork the repository and create your branch from
main - Install dependencies:
pnpm install - Make your changes following our coding standards
- Add tests for any new functionality
- Run tests:
pnpm test - Run linter:
pnpm run lint - Build the project:
pnpm run build - Commit your changes with clear commit messages
- Push to your fork and submit a pull request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/chapa-nodejs.git
cd chapa-nodejs
# Install dependencies
pnpm install
# Run tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run linter
pnpm run lint
# Build the project
pnpm run build- Use TypeScript for all code
- Enable strict mode
- Provide proper type definitions
- Avoid using
anytype
- Follow existing code style
- Use ESLint configuration
- Use Prettier for formatting
- Write clear, self-documenting code
- Add comments for complex logic
- Write tests for all new features
- Maintain or improve code coverage
- Use descriptive test names
- Follow AAA pattern (Arrange, Act, Assert)
- Use clear, descriptive commit messages
- Follow conventional commits format:
feat:for new featuresfix:for bug fixesdocs:for documentationtest:for testsrefactor:for refactoringchore:for maintenance
Example:
feat: add webhook signature verification
fix: handle timeout errors correctly
docs: update README with new examples
chapa-nodejs/
├── src/
│ ├── chapa.ts # Main SDK class
│ ├── interfaces/ # TypeScript interfaces
│ ├── validations/ # Zod validation schemas
│ ├── enums/ # Enumerations
│ └── types/ # Type definitions
├── test/ # Test files
├── dist/ # Build output
└── docs/ # Documentation
- Write unit tests for all functions
- Mock external dependencies (axios)
- Test both success and error scenarios
- Aim for >80% code coverage
- Run
pnpm test:coverageto check coverage
- Update README.md for new features
- Add JSDoc comments for public APIs
- Update CHANGELOG.md following Keep a Changelog format
- Include code examples where helpful
Releases are managed by maintainers using changesets:
- Create changeset:
pnpm changeset - Version bump:
pnpm version - Publish:
pnpm release
- Open a Question issue
- Check existing documentation
- Review Chapa API docs
By contributing, you agree that your contributions will be licensed under the MIT License.
Contributors will be recognized in the project's README and release notes.
Thank you for contributing! 🎉