- For each changed package/app (and packages/apps that depend on the changed code):
bun run format,bun run lint,bun run typecheck, andbun run testmust be green. - Add or extend tests and documentation when behavior or public APIs change.
- Only run root tests before committing.
- Bun + Vitest with helpers in
@osmix/test-utils; tests live as*.test.ts. - Fixtures: prefer
fixtures/monaco.pbfor synthetic data. - Cover parsing, serialization, spatial queries, merge workflows, and regressions.
- In-browser merge: Comlink workers host
@osmix/core,@osmix/change, and@osmix/rasterto keep the React UI responsive. @osmix/pbf+@osmix/jsonstream PBF blocks to entities;@osmix/coreindexes and ships transferables to dodge clone costs.- MapLibre uses a custom raster protocol and renders vector overlays for node/way previews.
- UI:
apps/merge(React 19 + Vite); worker wrapper atapps/merge/src/workers/osm.worker.ts. - Packages:
core,change,json,pbf,raster,test-utils; shared fixtures infixtures/.
bun installto bootstrap;bun run dev(filterable) for local dev;bun run buildfor production bundles.bun run checkruns format/lint/import organization in one pass.
Nodes.addDenseNodesonly accepts dense encodings; malformed blocks fail fast.- Call
Osmix.buildIndexesafter changes before spatial queries. - MapLibre raster URLs:
<osmId>/<tileSize>/<z>/<x>/<y>.png. - Use throttled logging when streaming worker progress.
- TypeScript + ES modules; named exports over default; kebab-case files; packages as
@osmix/<package>. - Tabs in code; keep TS/CSS/code blocks under ~100 characters; avoid manual wrapping of prose.
- Annotate public APIs; avoid
any/unsafe casts; prefer early returns. - React: keep components small, offload heavy work to workers, use keys/memoization pragmatically.
- PRs: formatted, linted, typed, and tested; imports organized; include UI note/screenshot for app changes; call out cross-package impacts.
- Commits: imperative subject; body explains why/what, behavior shifts, and verification commands; reference related issues.