Files
civitai__civitai/turbo.json
T
Briant Diehl f63154e2f9 chore(monorepo): Turborepo + package dependency boundary enforcement
Add Turborepo for task caching/orchestration, and lock in the package
boundary discipline that keeps its cache invalidation trustworthy.

Turborepo:
- turbo.json with build/typecheck/lint/test/dev tasks
- "cacheDir": ".turbo/cache" pins each git worktree's cache to itself (an
  explicit relative cacheDir resolves to the worktree root, not the shared
  git common-dir) -- no per-worktree TURBO_CACHE_DIR setup needed
- .turbo gitignored

Package deps + lint:
- declare every @civitai/* package's real external dependencies; redis,
  clickhouse, axiom, and telemetry were relying on root hoisting -- a
  phantom-dep trap any second app would hit (as the moderator did with
  @civitai/db)
- packages/.eslintrc.cjs (root:true) enforces import/no-extraneous-dependencies
  (every import must be a declared dep, so Turborepo's graph-based cache
  invalidation stays correct) and bans ~/... app imports; run via
  `pnpm lint:packages`
- @civitai/db-schema keeps a documented inline exception for @prisma/client
  (declaring it breaks `prisma generate`; proper fix is a custom output)

CI:
- pr-check.yml runs lint:packages on every PR/push to main

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 17:08:28 -06:00

24 lines
436 B
JSON

{
"$schema": "https://turbo.build/schema.json",
"cacheDir": ".turbo/cache",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**", "dist/**"]
},
"typecheck": {
"dependsOn": ["^build"]
},
"lint": {
"dependsOn": ["^build"]
},
"test": {
"dependsOn": ["^build"]
},
"dev": {
"cache": false,
"persistent": true
}
}
}