Thanks for your interest in contributing! This document covers how to get set up, the conventions the codebase follows, and what to expect from the review process.
-
Fork the repository and clone your fork.
-
Install dependencies and start the dev server:
npm install npm run dev
Requires Node.js 20+. The dev server proxies API calls to
https://node.gitlawb.com— no backend setup needed. -
Create a branch off
mainfor your change:git checkout -b feat/short-description
Run the full check suite locally — CI runs the same three commands:
npm run lint
npm test
npm run buildAll three must pass. npm run build includes the TypeScript project build
(tsc -b), so type errors fail there.
- Keep it focused. One logical change per PR. Refactors, formatting sweeps, and behavior changes belong in separate PRs.
- Add tests for logic. New pure functions in
src/lib/should ship with a colocated*.test.tsfile. Bug fixes should include a test that fails without the fix. - Match the surrounding style. The codebase favors small framework-free modules
in
src/lib/, hooks insrc/hooks/, and presentational components that receive data via props. Comments explain why, not what. - Mind the bundle.
markedandshikiare lazy-loaded on purpose — don't import them (directly or transitively) from modules used by the page entry.src/lib/lang.tsexists specifically to keep detection separate from rendering. - Screenshots for UI changes. The PR template asks for before/after screenshots of any visual change, in both dark and light themes if the change touches themed surfaces.
- Tests run on Vitest; the default environment is
node. - If a test needs the DOM, add
// @vitest-environment jsdomas the first line of the file rather than switching the global environment. - Stub the network with
vi.stubGlobal('fetch', …)— tests must not hit a real node. - Time-dependent code (e.g.
timeAgo) should be tested withvi.useFakeTimers()+vi.setSystemTime(…).
Use concise, imperative subject lines (Add line-range permalinks to file viewer).
Conventional-commit prefixes (feat:, fix:, docs:, test:, chore:) are
welcome but not required.
Open a GitHub issue with:
- what you expected vs. what happened,
- steps to reproduce (including the node you were pointed at, if not the default),
- browser and OS for rendering issues.
For larger features, please open an issue to discuss the approach before investing in an implementation — it saves everyone time if the direction is agreed on first.
Be kind and constructive. By participating you agree to uphold the Contributor Covenant.
By contributing, you agree that your contributions will be licensed under the MIT License.