This guide helps automated agents submit high-quality PRs for this repo.
package/is the published library (react-native-better-clustering, TypeScript + native code via Nitro).example/is an Expo app used for manual verification.docs/is the technical documentation (Docusaurus, English). User-facing docs live underdocs/docs/(API, setup, guides, troubleshooting, etc.). Runbun run docs:startorbun run docs:buildfrom root.- Root
package.jsondefines the Bun workspace.
bun installA single bun install at the root installs every workspace (package, example, docs).
- Generate Nitro bindings:
cd package && bun run specs - Typecheck:
cd package && bun run typecheck - Lint:
cd package && bun run lint - Test (all):
cd package && bun run test - Test (single file):
cd package && bun run test -- src/utils/distance.test.ts - Run example:
cd example && bunx expo prebuild && bunx expo run:iosorbunx expo run:android - Docs (dev):
bun run docs:start. Docs (build):bun run docs:build
- Specs and types are generated by Nitrogen.
- If you change any
*.nitro.tsspecs or Hybrid Object types, runcd package && bun run specs. - Regenerating specs updates the native bindings and TypeScript outputs under
package/. - The C++ clustering core has a standalone test:
cd package/cpp && c++ -std=c++20 -I. ClusterEngineCore.test.cpp -o cluster_test && ./cluster_test.
- Keep PRs small and scoped to one objective.
- If you change public APIs, update
README.mdand any types. - Docs (
docs/): When you add, change, or remove public API, setup steps, or user-facing behavior, create, update, or delete the relevant pages underdocs/docs/so the Docusaurus docs stay in sync. All docs content is in English. - If you touch native code, validate both iOS and Android paths.
- Avoid drive-by refactors and formatting-only changes.
Include these sections in your PR description:
- Summary: 2-5 bullets describing the intent and impact.
- Test plan: checklist of commands run and outcomes. If untested, say why.
- Risk: note compatibility, migration, or platform risk.
- Notes: assumptions, edge cases, or follow-ups.
Example template:
## Summary
- ...
## Test plan
- [ ] `cd package && bun run typecheck` (not run)
- [ ] `cd package && bun run lint` (not run)
- [ ] `cd package && bun run test:ci` (not run)
- [ ] `cd example && bunx expo run:ios` (not run)
- [ ] `cd example && bunx expo run:android` (not run)
- [ ] `bun run docs:build` (if you changed `docs/` or public API/setup; not run)
## Risk
- ...
## Notes
- ...