This is a Bun workspaces monorepo with the following structure:
packages/cli/- ThetangramsCLI package (published to npm)apps/docs/- Documentation site (TanStack Start + Fumadocs)examples/- Example applications to showcase the generated artifacts from the CLI
- Install:
bun install - Build CLI:
bun run build - Lint:
bun run lint(fix:bun run lint:fix) - Format:
bun run format - Typecheck all:
bun run typecheck - Test CLI:
bun run test - Dev CLI:
bun run dev:cli - Dev Docs:
bun run dev:docs
- Test single:
bun run test <file>(e.g.,bun run test src/core/generator.test.ts) - Update snapshots:
bun run test -u
- 2 spaces for indentation, double quotes, no semicolons (except when required)
- Imports are auto-organized; use
@/*alias for./src/*(CLI package) - Use
typeimports for type-only imports (import type { X } from "y")
- Files:
kebab-case.ts - Types/Interfaces:
PascalCase - Functions/Variables:
camelCase - Constants:
camelCase(not SCREAMING_CASE)
-
Add a changeset for any user-facing CLI changes (new features, breaking changes, bug fixes)
-
Run
bunx changesetor create a markdown file in.changeset/with the format:--- "tangrams": patch | minor --- Description of the change.
-
Use
patchfor bug fixes,minorfor new features or breaking changes -
Never use
major- major version bumps are always done manually -
The docs app is ignored by changesets (private package)
- Always verify and update documentation (README.md, docs site) after making breaking changes or changes that affect user-facing APIs, config structure, or CLI behavior
- Docs content lives in
apps/docs/content/docs/
- Never use
as any- If there is a complex type mismatch issue, analyze the root cause and bring it to the user's attention for discussion rather than masking it with type assertions - Prefer proper type mappings, generics, or schema adjustments over unsafe casts
- If type issues arise in generated code, the generator logic should be fixed to produce correctly typed output