Skip to content

Adopt Turborepo and a single root .env - #9

Merged
RATCHAW merged 1 commit into
mainfrom
RATCHAW/turbo-monorepo-refactor
Jul 12, 2026
Merged

Adopt Turborepo and a single root .env#9
RATCHAW merged 1 commit into
mainfrom
RATCHAW/turbo-monorepo-refactor

Conversation

@RATCHAW

@RATCHAW RATCHAW commented Jul 12, 2026

Copy link
Copy Markdown
Owner

What

Adopt Turborepo for task orchestration/caching, move to a single root .env every package reads, and expose every common script from the root. A contributor can now clone → pnpm installcp .env.example .envpnpm dev with no per-package steps.

Changes

  • turbo.jsonbuild/typecheck/test/dev/run-eval/report all dependsOn: ["^build"], so packages/core builds before its dependents typecheck/run against its dist/ (this replaces the ordering CI enforced by step comments). dev + eval tasks are cache: false; globalDependencies covers .env and tsconfig.base.json.
  • Root package.jsonturbo devDependency + dev/build/test/typecheck and the eval scripts (run-eval/report/fetch-data/pin) all via turbo run.
  • Single root .env — new root .env.example (provider keys, PORT, eval settings); deletes apps/playground/.env.example. Tiny loaders resolve the repo-root .env from import.meta.url (cwd-independent, works under Turbo): apps/playground/src/server/env.ts (imported first in index.ts) and packages/evals/src/env.ts (imported in run/report/fetch/pin). vite.config.ts points loadEnv/envDir at the repo root. Ambient/exported vars still win — loadEnvFile never overrides.
  • Docs — root README gains a Development section; playground + evals READMEs point at the root .env and root scripts; CLAUDE.md notes "pnpm + Turborepo."

Verification

  • pnpm build cold → core first; re-run → >>> FULL TURBO cache hit.
  • pnpm typecheck + pnpm test from root: all 3 packages pass, core built automatically.
  • Env loading confirmed from both the repo root and the package dir; ambient vars override the file; playground server + Vite PORT proxy both read the root .env.
  • Fresh-checkout (dist/ absent): pnpm dev from root builds core via Turbo, then boots the server cleanly — no ERR_MODULE_NOT_FOUND.
  • CI (ci.yml) needs no change — same script names.

🤖 Generated with Claude Code

Task orchestration moves to Turborepo and every common script is exposed
from the root, so a contributor can clone → pnpm install → cp .env.example
.env → pnpm dev with no per-package steps.

- turbo.json: build/typecheck/test/dev/run-eval/report all dependsOn
  ["^build"] so packages/core builds before its dependents typecheck/run
  against its dist/. dev + eval tasks are cache:false; globalDependencies
  cover .env and tsconfig.base.json.
- Root package.json: turbo devDependency + dev/build/test/typecheck and the
  eval scripts (run-eval/report/fetch-data/pin) all via `turbo run`.
- Single root .env: new root .env.example (provider keys, PORT, eval
  settings); delete apps/playground/.env.example. Tiny loaders resolve the
  repo-root .env from import.meta.url (cwd-independent) — playground
  src/server/env.ts (imported first in index.ts) and packages/evals
  src/env.ts (imported in run/report/fetch/pin). vite.config.ts points
  loadEnv/envDir at the repo root. Ambient/exported vars still win.
- Docs: root README gains a Development section; playground + evals READMEs
  point at the root .env and root scripts; CLAUDE.md notes pnpm + Turborepo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RATCHAW
RATCHAW merged commit 1fc7ca5 into main Jul 12, 2026
1 check passed
@RATCHAW
RATCHAW deleted the RATCHAW/turbo-monorepo-refactor branch July 12, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant