Skip to content

WI-002: Scaffold the monorepo

WI-002: Scaffold the monorepo

Problem

There is no build tooling. Everything downstream needs a workspace layout, a task runner, and shared TypeScript/lint/format configuration that packages extend rather than duplicate.

In scope

  • pnpm-workspace.yaml covering apps/*, packages/*, tools/*.
  • Turborepo with lint, typecheck, test, build pipelines and correct dependency ordering plus caching.
  • packages/config exporting base tsconfig, ESLint, and Prettier configs.
  • Root package.json with a gate script running the full gate (see ../standards/ci-and-gates.md).
  • .gitignore covering node_modules, build output, .dev.vars, .env.local.
  • Directory structure per ../standards/engineering-standards.md.

Out of scope

  • Any real package contents — packages/db is WI-006, apps/docs is WI-004.
  • CI workflow files — WI-003.
  • Runtime dependencies (Hono, Drizzle, Astro, Expo).

Definition of done

  • pnpm install succeeds from a clean clone with no warnings about missing workspace globs.
  • pnpm turbo lint typecheck test build exits zero across all workspaces (trivially, with no packages yet).
  • pnpm gate runs and exits zero.
  • A deliberately broken type in a throwaway package fails typecheck — proving the pipeline actually runs, not that it silently found nothing.
  • packages/config is consumed by at least one package via extends, not copy-paste.
  • Turborepo caching demonstrably works: a second identical pnpm turbo build reports cache hits.
  • tools/ is a workspace but nothing depends on it.

Verification

Terminal window
rm -rf node_modules && pnpm install
pnpm gate
pnpm turbo build # note timings
pnpm turbo build # must report FULL TURBO / cache hits

For the negative check, add a file with const x: string = 42; to a scratch package, confirm pnpm turbo typecheck fails, then remove it.

Notes

The negative check matters more than the positive one. A green pipeline that isn’t running anything is the exact false-confidence failure the standards are built to prevent.