|
| 1 | +# Contributing to @vetaverse/logger |
| 2 | + |
| 3 | +Thank you for your interest in contributing to @vetaverse/logger! This document provides guidelines and instructions for contributing. |
| 4 | + |
| 5 | +## Code of Conduct |
| 6 | + |
| 7 | +We are committed to providing a welcoming and inclusive environment. Please be respectful and constructive in all interactions. |
| 8 | + |
| 9 | +## How to Contribute |
| 10 | + |
| 11 | +### Reporting Bugs |
| 12 | + |
| 13 | +If you find a bug, please create an issue on GitHub with: |
| 14 | + |
| 15 | +- Clear description of the issue |
| 16 | +- Steps to reproduce |
| 17 | +- Expected behavior |
| 18 | +- Actual behavior |
| 19 | +- Environment details (Node.js version, React Native version, etc.) |
| 20 | +- Code samples or screenshots if applicable |
| 21 | + |
| 22 | +### Suggesting Features |
| 23 | + |
| 24 | +Feature suggestions are welcome! Please create an issue with: |
| 25 | + |
| 26 | +- Clear description of the feature |
| 27 | +- Use cases and benefits |
| 28 | +- Examples of how it would work |
| 29 | +- Alternative solutions considered |
| 30 | + |
| 31 | +### Pull Requests |
| 32 | + |
| 33 | +1. **Fork the repository** and create a new branch from `main` |
| 34 | +2. **Install dependencies**: `npm install` |
| 35 | +3. **Make your changes** following our coding standards |
| 36 | +4. **Add tests** for new functionality |
| 37 | +5. **Run tests**: `npm test` |
| 38 | +6. **Run linting**: `npm run lint` |
| 39 | +7. **Run type checking**: `npm run typecheck` |
| 40 | +8. **Update documentation** if needed |
| 41 | +9. **Commit your changes** with a clear commit message |
| 42 | +10. **Push to your fork** and create a pull request |
| 43 | + |
| 44 | +## Development Setup |
| 45 | + |
| 46 | +```bash |
| 47 | +# Clone the repository |
| 48 | +git clone https://github.com/vetaverse/logger.git |
| 49 | +cd logger |
| 50 | + |
| 51 | +# Install dependencies |
| 52 | +npm install |
| 53 | + |
| 54 | +# Run tests |
| 55 | +npm test |
| 56 | + |
| 57 | +# Run tests in watch mode |
| 58 | +npm run test:watch |
| 59 | + |
| 60 | +# Run linting |
| 61 | +npm run lint |
| 62 | + |
| 63 | +# Run type checking |
| 64 | +npm run typecheck |
| 65 | + |
| 66 | +# Build the package |
| 67 | +npm run build |
| 68 | +``` |
| 69 | + |
| 70 | +## Coding Standards |
| 71 | + |
| 72 | +- **TypeScript**: Use strict mode, no `any` types |
| 73 | +- **Testing**: Maintain >80% code coverage |
| 74 | +- **Formatting**: Use Prettier (runs automatically on commit) |
| 75 | +- **Linting**: Follow ESLint rules (runs automatically on commit) |
| 76 | +- **Commits**: Use conventional commit messages |
| 77 | + |
| 78 | +### Commit Message Format |
| 79 | + |
| 80 | +``` |
| 81 | +type(scope): description |
| 82 | +
|
| 83 | +[optional body] |
| 84 | +
|
| 85 | +[optional footer] |
| 86 | +``` |
| 87 | + |
| 88 | +Types: |
| 89 | +- `feat`: New feature |
| 90 | +- `fix`: Bug fix |
| 91 | +- `docs`: Documentation changes |
| 92 | +- `style`: Code style changes (formatting, etc.) |
| 93 | +- `refactor`: Code refactoring |
| 94 | +- `test`: Adding or updating tests |
| 95 | +- `chore`: Build process or auxiliary tool changes |
| 96 | + |
| 97 | +Examples: |
| 98 | +``` |
| 99 | +feat(transport): add HTTP transport for remote logging |
| 100 | +fix(file): resolve file rotation issue on Windows |
| 101 | +docs(readme): add examples for custom transports |
| 102 | +``` |
| 103 | + |
| 104 | +## Testing |
| 105 | + |
| 106 | +All contributions must include tests. We use Jest for testing. |
| 107 | + |
| 108 | +- Write unit tests for new functionality |
| 109 | +- Update existing tests if behavior changes |
| 110 | +- Ensure all tests pass before submitting PR |
| 111 | +- Aim for 100% code coverage on new code |
| 112 | + |
| 113 | +## Documentation |
| 114 | + |
| 115 | +- Update README.md for new features |
| 116 | +- Add JSDoc comments for public APIs |
| 117 | +- Update CHANGELOG.md following Keep a Changelog format |
| 118 | +- Add examples for new functionality |
| 119 | + |
| 120 | +## Release Process |
| 121 | + |
| 122 | +Releases are managed by maintainers: |
| 123 | + |
| 124 | +1. Update version in package.json |
| 125 | +2. Update CHANGELOG.md |
| 126 | +3. Create git tag |
| 127 | +4. Push to GitHub |
| 128 | +5. GitHub Actions auto-publishes to npm |
| 129 | + |
| 130 | +## Questions? |
| 131 | + |
| 132 | +Feel free to: |
| 133 | +- Open an issue for questions |
| 134 | +- Join discussions on GitHub |
| 135 | +- Email us at info@vetaversevet.com |
| 136 | + |
| 137 | +## License |
| 138 | + |
| 139 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
| 140 | + |
| 141 | +--- |
| 142 | + |
| 143 | +Thank you for contributing to @vetaverse/logger! 🎉 |
0 commit comments