Deps
Dependency Management Rules
Section titled “Dependency Management Rules”Bun Catalog — Promotion Policy
Section titled “Bun Catalog — Promotion Policy”A package version belongs in the root package.json "catalog" section only if it is a runtime/peer dependency used in 2 or more workspaces (apps/* or packages/*).
Promote to catalog when:
- The same package appears as a
dependencyorpeerDependencyin ≥ 2apps/*orpackages/*package.jsonfiles. - Reference it as
"catalog:"in each workspace that uses it.
Do NOT put in catalog:
- A package used in only one app or package — keep the explicit version there.
- Dev tooling (
typescript,vitest,wrangler,drizzle-kit,auth,@biomejs/biome,@cloudflare/workers-types) — these live in rootdevDependenciesdirectly so all workspaces inherit them via Bun workspace resolution.
Current catalog entries (update this list when adding/removing):
better-auth—@packages/auth,@apps/web,@packages/db(seed script password hashing)drizzle-orm—@packages/db,@packages/auth,@packages/service,@apps/webzod—@packages/db,@packages/auth,@packages/service,@apps/web,@packages/contract@tigorhutasuhut/telemetry-js—@packages/service,@apps/web
Single-workspace packages (not in catalog — used by exactly one workspace):
@orpc/contract—@packages/contractonly@orpc/server,@orpc/openapi—@apps/webonly
Global Tooling — Root Only
Section titled “Global Tooling — Root Only”The following are installed only in root devDependencies. Never add them to individual workspace package.json files:
typescript—tscavailable everywhere via Bun workspace bin resolutionvitest— test runnerwrangler— CF Workers deploy/devdrizzle-kit— DB migrationsauth— Better Auth CLI (auth generate/migrate); installed locally because the isolatednpx/bunxform can’t resolve the workspace’sbetter-auth(see schema.md)@biomejs/biome— lint + format@cloudflare/workers-types— CF Workers type declarations
Adding a New Dependency
Section titled “Adding a New Dependency”- Identify which workspace(s) need it.
- If 1 workspace: add with explicit version to that workspace’s
package.json. - If 2+ workspaces: add to root
catalog, reference as"catalog:"in each workspace, update the catalog entries list above. - Run
bun installfrom repo root.