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.
- Root manages workspaces; primary package lives in
packages/meta. - Library source is in
packages/meta/srcwith focused folders such asgenerate,normalize, andtypes; unit tests sit next to implementations as.test.ts. - Built artifacts are written to
packages/meta/distviatsdownand are the only exported files. playground/is a TanStack Start app wired to the workspace build for manual validation; keep it in sync when changing public APIs.
bun install # install all workspace deps
bun meta build # bundle to dist/ with tsdown
bun test # run bun:test suite in src/**
bun meta lint # biome lint + format check
bun meta typecheck # tsc via tsgo --noEmit
bun meta publint # sanity-check published surface
bun playground dev # optional: preview changes in the demo app- Biome enforces tabs for indentation and double quotes; run
bun run lintbefore pushing. - Code is TypeScript-first; prefer typed helpers over
any, keep exports small and pure, and mirror the existinggenerate*andnormalize*naming patterns. - Tests follow
bun:test’sdescribe/test/expectstyle and reside beside the code they cover.
- Add or update
*.test.tsalongside new logic; extend existing fixtures insrc/generate/src/normalizeto cover edge cases. - Favor deterministic inputs and explicit expectations; ensure new behavior is exercised in both metadata generation and normalization paths when relevant.
- Run
bun testlocally; for public API changes, also sanity-check the playground to catch integration regressions.
- Use short, imperative commits (e.g., “add more tests for normalize” as seen in the log); group unrelated changes separately.
- PRs should include a clear summary, rationale, and scope of impact; link issues when applicable.
- Demonstrate safety: include test results, note playground updates or screenshots for UI-facing tweaks, and update docs when the API or behavior changes.