|
1 | | -# Contributing |
| 1 | +# Contributing to packageurl-js |
2 | 2 |
|
3 | | -Contributions are welcome and appreciated! |
4 | | -Every little bit helps, and credit will always be given. |
| 3 | +Thanks for your interest in contributing! Every contribution helps make this project better. |
5 | 4 |
|
6 | | -When contributing to purl (such as code, bugs, documentation, etc.) you |
7 | | -agree to the Developer Certificate of Origin http://developercertificate.org/ |
8 | | -and its license (see the mit.LICENSE file). The same approach is used |
9 | | -by the Linux Kernel developers and several other projects. |
| 5 | +## Quick Start |
10 | 6 |
|
11 | | -For commits, it is best to simply add a line like this to your commit message, |
12 | | -with your name and email: |
| 7 | +```bash |
| 8 | +# 1. Fork and clone the repository |
| 9 | +git clone https://github.com/<your-username>/packageurl-js.git |
| 10 | +cd packageurl-js |
| 11 | + |
| 12 | +# 2. Install dependencies (requires pnpm) |
| 13 | +pnpm install |
| 14 | + |
| 15 | +# 3. Make your changes and run tests |
| 16 | +pnpm test |
| 17 | + |
| 18 | +# 4. Lint and format your code |
| 19 | +pnpm run fix |
13 | 20 | ``` |
14 | | - Signed-off-by: Jane Doe <developer@example.com> |
| 21 | + |
| 22 | +## Development Workflow |
| 23 | + |
| 24 | +### Before You Submit |
| 25 | + |
| 26 | +- ✅ Run `pnpm test` - all tests must pass |
| 27 | +- ✅ Run `pnpm run fix` - auto-format code |
| 28 | +- ✅ Run `pnpm run check:tsc` - type-check passes |
| 29 | +- ✅ Add tests for new features |
| 30 | +- ✅ Update docs if needed |
| 31 | + |
| 32 | +### Commit Messages |
| 33 | + |
| 34 | +Write clear, descriptive commit messages: |
| 35 | + |
| 36 | +```bash |
| 37 | +# Good examples |
| 38 | +git commit -m "fix: handle percent encoding in qualifiers" |
| 39 | +git commit -m "feat: add support for pub package type" |
| 40 | +git commit -m "docs: clarify namespace requirements" |
| 41 | + |
| 42 | +# Include sign-off |
| 43 | +Signed-off-by: Your Name <your.email@example.com> |
15 | 44 | ``` |
16 | 45 |
|
17 | | -Please try to write a good commit message. |
18 | | -See: https://chris.beams.io/posts/git-commit/ |
| 46 | +See [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/) for more tips. |
| 47 | + |
| 48 | +### Developer Certificate of Origin |
| 49 | + |
| 50 | +By contributing, you agree to the [Developer Certificate of Origin](http://developercertificate.org/) and the [MIT License](LICENSE). |
| 51 | + |
| 52 | +## Testing |
| 53 | + |
| 54 | +### Run Tests |
| 55 | + |
| 56 | +```bash |
| 57 | +pnpm test # Run all tests |
| 58 | +pnpm run check:tsc # Type checking |
| 59 | +``` |
| 60 | + |
| 61 | +### Test Structure |
| 62 | + |
| 63 | +- `test/package-url.spec.js` - Main test suite (includes purl-spec compliance tests) |
| 64 | +- `test/benchmark.spec.js` - Performance benchmarks |
| 65 | +- `test/data/` - Test fixtures |
| 66 | + |
| 67 | +## Code Style |
| 68 | + |
| 69 | +This project uses [Biome](https://biomejs.dev/) for formatting and linting: |
| 70 | + |
| 71 | +- **Format**: 2 spaces, 80 char line width |
| 72 | +- **Style**: Single quotes, trailing commas |
| 73 | +- **Auto-fix**: `pnpm run fix` |
| 74 | + |
| 75 | +## Need Help? |
| 76 | + |
| 77 | +- 💬 [Open an issue](https://github.com/package-url/packageurl-js/issues) for questions |
| 78 | +- 🐛 Report bugs with a minimal reproduction |
| 79 | +- 💡 Suggest features with use cases |
| 80 | + |
| 81 | +## License |
| 82 | + |
| 83 | +[MIT](LICENSE) © the purl authors |
0 commit comments