Contributing to TriCache
Thank you for your interest in contributing to TriCache! We welcome contributions of all kinds: bug fixes, performance optimizations, new framework adapters, documentation improvements, and architectural ideas.
Code of Conduct
This project and everyone participating in it is governed by the TriCache Code of Conduct. By participating, you are expected to uphold this code.
Getting Started
Prerequisites
- Node.js:
\ge 20.10.0(LTS or current) - pnpm:
\ge 9.0.0(pinned viapackageManager: pnpm@11.22.0) - Git
- Optional: Redis / Valkey running locally or in Docker on port
6379(unit tests run standalone mock/memory cache; live integration tests automatically connect if available).
Fork & Clone
- Fork the repository on GitHub: https://github.com/Kareem411/TriCache
- Clone your fork locally:bash
git clone https://github.com/<your-username>/TriCache.git cd TriCache - Set the upstream remote:bash
git remote add upstream https://github.com/Kareem411/TriCache.git - Install dependencies:bash
pnpm install
Development Workflow
Useful Commands
| Command | Description |
|---|---|
pnpm test | Run the full Vitest test suite once |
pnpm test:watch | Run Vitest in interactive watch mode |
pnpm lint | Run Oxlint fast static analysis |
pnpm typecheck | TypeScript type-check source files |
pnpm typecheck:all | TypeScript type-check source AND test files |
pnpm build | Build ESM, CJS, and type declarations with tsup |
pnpm bench | Run microbenchmarks (L1/L2/SWR throughput & latency) |
pnpm bench:roi | Run deterministic cloud ROI Zipfian simulation |
pnpm docs:dev | Start local documentation preview server |
pnpm docs:build | Build production documentation bundle |
Running Tests
All tests must pass before opening a pull request:
bash
pnpm testType Checking & Linting
Ensure type safety and code cleanliness:
bash
pnpm typecheck:all
pnpm lintPull Request Guidelines
- Create a feature branch from
main:bashgit checkout -b feat/my-feature - Keep PRs focused on a single change or feature.
- Add unit tests for any new functionality or bug fixes.
- If you touch a hot path in L1 memory or serialization, run
pnpm benchand include before/after throughput numbers in your PR description. - Ensure documentation is updated accordingly.

