|
| 1 | +# Contributing to @avensio/graph |
| 2 | + |
| 3 | +Thanks for helping improve the graph data-structure! This document explains how to get started, what quality gates we expect, and how releases are coordinated. |
| 4 | + |
| 5 | +## Project layout |
| 6 | + |
| 7 | +- **Source** lives under `src/` (lists, queues, heaps, etc.) |
| 8 | +- **Tests** live under `test/` (Vitest) with micro-benchmarks under `test/benchmarks/` |
| 9 | +- **Docs** live under `docs/` and are rendered via VitePress |
| 10 | +- **Tooling** scripts live in `scripts/` (including git hooks) |
| 11 | + |
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +- Node.js 20+ and pnpm 10.20+ |
| 15 | +- Run `pnpm install` from the repo root (monorepo) so shared tooling is linked |
| 16 | + |
| 17 | +## Workflow |
| 18 | + |
| 19 | +1. **Create a branch** from `main`. |
| 20 | +2. **Develop with safety nets**: |
| 21 | + - `pnpm dev` for watch mode with coverage |
| 22 | + - `pnpm test` for the full Vitest suite |
| 23 | + - `pnpm bench` for micro-benchmarks when touching performance-sensitive paths |
| 24 | +3. **Update docs** alongside code: |
| 25 | + - Page content in `docs/*.md` |
| 26 | + - API reference via `pnpm docs:api` |
| 27 | +4. **Validate the docs site**: `pnpm docs:dev` and `pnpm docs:build && pnpm docs:preview` |
| 28 | +5. **Commit and create PR**; `scripts/hooks/commit-msg.mjs` enforces commitlint with tags given in `changelog.config.ts` |
| 29 | + |
| 30 | +Before pushing, run: |
| 31 | + |
| 32 | +```bash |
| 33 | +pnpm lint |
| 34 | +pnpm test |
| 35 | +``` |
| 36 | + |
| 37 | +## Pull requests |
| 38 | + |
| 39 | +- Keep changes focused; separate refactors from features/fixes. |
| 40 | +- Add tests for regressions or new behavior. |
| 41 | +- Update docs and changelog entries when user-facing changes occur. |
| 42 | +- Reference related issues (e.g., `Fixes #123`). |
| 43 | + |
| 44 | +## Release process |
| 45 | + |
| 46 | +Releases are handled via the `pnpm release` script, which runs tests, builds, generates docs, and updates the changelog. The [mono-repo](https://github.com/Avensio/avensio) contains CI workflows that publish documentation and packages once changes land on `main`. |
| 47 | + |
| 48 | +If you need to cut a release manually: |
| 49 | + |
| 50 | +```bash |
| 51 | +pnpm release |
| 52 | +# follow the prompts and push the resulting tag |
| 53 | +``` |
| 54 | + |
| 55 | +## Reporting bugs & requesting features |
| 56 | + |
| 57 | +Use the GitHub issue templates (`Bug report` / `Feature request`). Provide reproducible steps, environment details, and failing tests where possible. |
| 58 | + |
| 59 | +## Security |
| 60 | + |
| 61 | +Please follow the steps in [SECURITY.md](./SECURITY.md) for reporting vulnerabilities privately. |
| 62 | + |
| 63 | +## License |
| 64 | + |
| 65 | +By contributing, you agree that your contributions are licensed under the MIT License. |
0 commit comments