|
| 1 | +# Contributing to Klime Elixir SDK |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Klime Elixir SDK! |
| 4 | + |
| 5 | +## Important: Repository Structure |
| 6 | + |
| 7 | +This repository is a **read-only mirror** of our internal monorepo. We develop and maintain the SDK internally, then mirror releases to this public repository. |
| 8 | + |
| 9 | +### What This Means for Contributors |
| 10 | + |
| 11 | +- **Pull requests are welcome** and will be reviewed by our team |
| 12 | +- If accepted, we'll **manually port your changes** to our internal monorepo |
| 13 | +- Your changes will appear in this repository with the **next release** |
| 14 | +- You'll be credited as a co-author in the commit |
| 15 | + |
| 16 | +## How to Contribute |
| 17 | + |
| 18 | +### Reporting Bugs |
| 19 | + |
| 20 | +1. Check if the bug has already been reported in [Issues](../../issues) |
| 21 | +2. If not, create a new issue with: |
| 22 | + - A clear, descriptive title |
| 23 | + - Steps to reproduce the bug |
| 24 | + - Expected vs actual behavior |
| 25 | + - Your environment (Elixir version, OTP version, OS, etc.) |
| 26 | + - Any relevant code snippets or error messages |
| 27 | + |
| 28 | +### Suggesting Features |
| 29 | + |
| 30 | +1. Check if the feature has already been suggested in [Issues](../../issues) |
| 31 | +2. Create a new issue describing: |
| 32 | + - The problem you're trying to solve |
| 33 | + - Your proposed solution |
| 34 | + - Any alternatives you've considered |
| 35 | + |
| 36 | +### Submitting Code Changes |
| 37 | + |
| 38 | +1. Fork this repository |
| 39 | +2. Create a feature branch (`git checkout -b feat/amazing-feature`) |
| 40 | +3. Make your changes |
| 41 | +4. Write or update tests as needed |
| 42 | +5. Ensure all tests pass (`mix test`) |
| 43 | +6. Run the formatter (`mix format`) |
| 44 | +7. Commit using [Conventional Commits](https://www.conventionalcommits.org/): |
| 45 | + ``` |
| 46 | + feat: add new tracking method |
| 47 | + fix: handle edge case in batch processing |
| 48 | + docs: update README examples |
| 49 | + ``` |
| 50 | +8. Push to your fork and open a Pull Request |
| 51 | + |
| 52 | +### Pull Request Guidelines |
| 53 | + |
| 54 | +- Provide a clear description of what the PR does |
| 55 | +- Reference any related issues |
| 56 | +- Include tests for new functionality |
| 57 | +- Update documentation if needed |
| 58 | +- Keep PRs focused - one feature or fix per PR |
| 59 | + |
| 60 | +## Development Setup |
| 61 | + |
| 62 | +```bash |
| 63 | +# Clone your fork |
| 64 | +git clone https://github.com/YOUR_USERNAME/klime-elixir.git |
| 65 | +cd klime-elixir |
| 66 | + |
| 67 | +# Install dependencies |
| 68 | +mix deps.get |
| 69 | + |
| 70 | +# Run tests |
| 71 | +mix test |
| 72 | + |
| 73 | +# Run formatter |
| 74 | +mix format |
| 75 | + |
| 76 | +# Generate docs (optional) |
| 77 | +mix docs |
| 78 | +``` |
| 79 | + |
| 80 | +## Project Structure |
| 81 | + |
| 82 | +``` |
| 83 | +klime-elixir/ |
| 84 | +├── lib/ |
| 85 | +│ ├── klime.ex # Main entry point / public API |
| 86 | +│ └── klime/ |
| 87 | +│ ├── client.ex # GenServer client implementation |
| 88 | +│ ├── event.ex # Event struct and serialization |
| 89 | +│ ├── event_context.ex # Context and library info |
| 90 | +│ ├── batch_response.ex # Response parsing |
| 91 | +│ └── config.ex # Default configuration |
| 92 | +├── test/ |
| 93 | +│ ├── klime/ |
| 94 | +│ │ ├── client_test.exs # Integration tests |
| 95 | +│ │ └── event_test.exs # Unit tests |
| 96 | +│ └── test_helper.exs |
| 97 | +├── mix.exs # Project configuration |
| 98 | +└── README.md |
| 99 | +``` |
| 100 | + |
| 101 | +## Code Style |
| 102 | + |
| 103 | +- We follow standard Elixir conventions |
| 104 | +- Use `mix format` to format your code |
| 105 | +- Add `@moduledoc` and `@doc` documentation for public APIs |
| 106 | +- Use typespecs (`@type`, `@spec`) for public functions |
| 107 | +- Keep functions small and focused |
| 108 | + |
| 109 | +## Running Tests |
| 110 | + |
| 111 | +```bash |
| 112 | +# Run all tests |
| 113 | +mix test |
| 114 | + |
| 115 | +# Run specific test file |
| 116 | +mix test test/klime/client_test.exs |
| 117 | + |
| 118 | +# Run with coverage |
| 119 | +mix test --cover |
| 120 | +``` |
| 121 | + |
| 122 | +## Questions? |
| 123 | + |
| 124 | +If you have questions about contributing, feel free to open an issue and we'll be happy to help! |
| 125 | + |
| 126 | +## License |
| 127 | + |
| 128 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
0 commit comments