|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +This repo is a Bun workspace for `tanstack-meta`, a TypeScript utility that turns structured metadata into TanStack Router/Start-compatible head tags. Use the notes below to stay consistent and ship safe changes. |
| 4 | + |
| 5 | +## Project Structure & Module Organization |
| 6 | +- Root manages workspaces; primary package lives in `packages/meta`. |
| 7 | +- Library source is in `packages/meta/src` with focused folders such as `generate`, `normalize`, and `types`; unit tests sit next to implementations as `.test.ts`. |
| 8 | +- Built artifacts are written to `packages/meta/dist` via `tsdown` and are the only exported files. |
| 9 | +- `playground/` is a TanStack Start app wired to the workspace build for manual validation; keep it in sync when changing public APIs. |
| 10 | + |
| 11 | +## Build, Test, and Development Commands |
| 12 | +```bash |
| 13 | +bun install # install all workspace deps |
| 14 | +bun meta build # bundle to dist/ with tsdown |
| 15 | +bun test # run bun:test suite in src/** |
| 16 | +bun meta lint # biome lint + format check |
| 17 | +bun meta typecheck # tsc via tsgo --noEmit |
| 18 | +bun meta publint # sanity-check published surface |
| 19 | + |
| 20 | +bun playground dev # optional: preview changes in the demo app |
| 21 | +``` |
| 22 | + |
| 23 | +## Coding Style & Naming Conventions |
| 24 | +- Biome enforces tabs for indentation and double quotes; run `bun run lint` before pushing. |
| 25 | +- Code is TypeScript-first; prefer typed helpers over `any`, keep exports small and pure, and mirror the existing `generate*` and `normalize*` naming patterns. |
| 26 | +- Tests follow `bun:test`’s `describe/test/expect` style and reside beside the code they cover. |
| 27 | + |
| 28 | +## Testing Guidelines |
| 29 | +- Add or update `*.test.ts` alongside new logic; extend existing fixtures in `src/generate`/`src/normalize` to cover edge cases. |
| 30 | +- Favor deterministic inputs and explicit expectations; ensure new behavior is exercised in both metadata generation and normalization paths when relevant. |
| 31 | +- Run `bun test` locally; for public API changes, also sanity-check the playground to catch integration regressions. |
| 32 | + |
| 33 | +## Commit & Pull Request Guidelines |
| 34 | +- Use short, imperative commits (e.g., “add more tests for normalize” as seen in the log); group unrelated changes separately. |
| 35 | +- PRs should include a clear summary, rationale, and scope of impact; link issues when applicable. |
| 36 | +- Demonstrate safety: include test results, note playground updates or screenshots for UI-facing tweaks, and update docs when the API or behavior changes. |
0 commit comments