Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 2.69 KB

File metadata and controls

73 lines (53 loc) · 2.69 KB

AGENTS

This guide helps automated agents submit high-quality PRs for this repo.

Repo map

  • 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 under docs/docs/ (API, setup, guides, troubleshooting, etc.). Run bun run docs:start or bun run docs:build from root.
  • Root package.json defines the Bun workspace.

Local setup

bun install

A single bun install at the root installs every workspace (package, example, docs).

Common workflows

  • 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:ios or bunx expo run:android
  • Docs (dev): bun run docs:start. Docs (build): bun run docs:build

Nitro Modules notes

  • Specs and types are generated by Nitrogen.
  • If you change any *.nitro.ts specs or Hybrid Object types, run cd 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.

Change guidelines

  • Keep PRs small and scoped to one objective.
  • If you change public APIs, update README.md and 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 under docs/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.

Agentic PR checklist

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
- ...