Thank you for considering contributing to TAP-RS! This document outlines the process for contributing to the project and provides guidelines for documentation, code style, and testing.
Please read and follow our Code of Conduct.
- Ensure the bug was not already reported by searching on GitHub under Issues.
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
- First, read the documentation to see if the enhancement is already supported.
- Look at the PRD to see if the enhancement is already planned.
- Open a new issue with a clear title and description of the suggested enhancement.
- Fork the repository.
- Create a new branch for your feature or bugfix:
git checkout -b feature/my-new-featureorgit checkout -b fix/issue-123. - Make your changes, following the coding guidelines.
- Write or update tests for your changes.
- Run the test suite to ensure all tests pass:
cargo test. - Commit your changes:
git commit -am 'Add some feature'. - Push to the branch:
git push origin feature/my-new-feature. - Submit a pull request.
- Follow the Rust API Guidelines.
- Use
cargo fmtto format your code according to the standard style. - Use
cargo clippyto catch common mistakes and non-idiomatic code. - Write clear and concise code with appropriate comments.
- Write unit tests for all new features and bug fixes.
- Ensure that all tests pass before submitting a pull request.
- Consider adding integration tests for complex features.
- For WASM code, include browser-based tests when appropriate.
Documentation is a critical part of the TAP-RS project. All contributions should include appropriate documentation updates.
- Document all public API items using Rust doc comments.
- Include examples in doc comments to demonstrate usage.
- Use
cargo docto build and review documentation locally.
- Update relevant markdown documentation in the
docsdirectory. - Follow a consistent style in markdown files:
- Use ATX-style headers (
# Header 1,## Header 2, etc.). - Use fenced code blocks with appropriate language identifiers.
- Use relative links to other documents in the repository.
- Include a table of contents for longer documents.
- Use ATX-style headers (
When writing or updating tutorials in the docs/tutorials directory:
- Clear Structure: Start with an introduction, followed by prerequisites, then step-by-step instructions.
- Code Examples: Include complete, working code examples.
- Explanations: Explain why certain approaches are used, not just how to use them.
- Progressive Complexity: Start simple and gradually introduce more complex concepts.
- Common Pitfalls: Highlight common mistakes and how to avoid them.
When writing or updating API reference documentation in the docs/api directory:
- Complete Coverage: Document all public types, functions, and methods.
- Parameter Descriptions: Clearly describe all parameters and return values.
- Examples: Include practical examples showing common usage patterns.
- Cross-References: Link to related API items when appropriate.
- Error Handling: Document possible errors and how to handle them.
- Install Rust (at least version 1.71.0) and Cargo.
- Clone the repository:
git clone https://github.com/notabene/tap-rs.git. - Change into the project directory:
cd tap-rs. - Build the project:
cargo build.
For WASM development:
- Install
wasm-pack:cargo install wasm-pack. - Build the WASM package:
cd tap-wasm && wasm-pack build --target web. - For testing in Node.js:
cd tap-wasm && wasm-pack build --target nodejs.
- Run benchmarks to measure performance:
cargo bench. - Compare benchmark results before and after your changes.
- Update version numbers in
Cargo.tomlfiles according to Semantic Versioning. - Update the CHANGELOG.md file with changes since the last release.
- Create a new GitHub release with a tag matching the version number.
By contributing to TAP-RS, you agree that your contributions will be licensed under the same MIT License that covers the project.