2.7 KiB
2.7 KiB
Basango — AGENTS.md
Scope
- Applies to the entire repository.
- Use these conventions when adding/modifying code, scripts, or docs.
Environment
- Node: >= 22
- Package manager: Bun
1.3.x - Task runner: Turborepo
- Lint/format: Biome
Workspace Layout
workspaces:apps/*andpackages/*.- Internal packages use the
@basango/scope andworkspace:*versions. - Avoid nested packages like
apps/**orpackages/**.
Packages
@basango/logger: Pino wrapper. Prefer named importimport { logger } from "@basango/logger".@basango/db: Drizzle ORM for Postgres. Import via defined subpaths (./client,./queries,./schema,./utils).@basango/ui: Shared UI.@basango/tsconfig: Shared TS configs. Extend this in apps/packages.
Conventions
- ESM-only: set
"type": "module"for packages that ship code. - TypeScript everywhere. Use
extends: "@basango/tsconfig/base.json"when possible. - Prefer named exports in libraries. Avoid barrel files unless necessary.
- Use
workspace:*for internal dependencies; do not hardcode versions. - Keep changes minimal and localized; avoid cross-cutting refactors without discussion.
Tasks & Commands
- Install:
bun install(run at repo root only). - Dev:
bun run dev. - Build:
bun run build. - Typecheck:
bun run typecheck. - Lint/format:
bun run lintorbun run format. - Turbo filtering examples:
bunx turbo dev --filter=@basango/crawlerbunx turbo build --filter=@basango/dashboard
Adding a New Package
- Place apps in
apps/<name>; libraries inpackages/<name>. - Use scoped name:
@basango/<name>and set"private": trueunless publishing. - If a lib exposes multiple entrypoints, prefer
exportsmap overmain. - Add dependencies with
bun add <pkg>in the package directory; internal deps asworkspace:*.
Logging
- Import logger as
import { logger } from "@basango/logger"for consistency. - Production logs are structured JSON; non-production uses
pino-prettytransport.
Testing
- Use
vitestwhere present. Add tests locally to the package being changed. - Keep tests fast and focused. Do not introduce global test state.
Quality Gates
biomeformatting/linting is enforced. Run before committing.manypkg checkruns as part ofbun run lintto validate workspace correctness.
Commits & Hooks
- Conventional commits via Commitizen:
bunx cz. - Commitlint enforces message format. Husky hooks run on commit.
Gotchas
- Ensure
apps/*andpackages/*are the only workspace globs. - Prefer named import for logger to avoid mixing default/named across files.
Contact Points
- Architecture overview:
docs/architecture.md. - Forms handling patterns:
docs/forms-handling.md.