Lab 03: Monorepo Architecture
Overview
Step 1: Monorepo Structure
monorepo/
├── package.json # Root: workspaces config
├── tsconfig.base.json # Shared compiler options
├── turbo.json # Build pipeline
├── packages/
│ ├── utils/ # @company/utils
│ │ ├── package.json
│ │ ├── tsconfig.json # composite: true, extends base
│ │ └── src/index.ts
│ ├── api-client/ # @company/api-client
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ └── src/index.ts
│ └── ui/ # @company/ui
│ ├── package.json
│ ├── tsconfig.json
│ └── src/index.ts
└── apps/
├── web/ # Next.js app
│ ├── package.json
│ └── tsconfig.json # references: utils, api-client, ui
└── api/ # Express app
├── package.json
└── tsconfig.json # references: utils, api-clientStep 2: Root Configuration
Step 3: Package tsconfig — Composite + Incremental
Step 4: App tsconfig with Project References
Step 5: Build with tsc --build
Step 6: Shared ESLint Config
Step 7: Changesets for Versioning
Step 8: Turborepo Build Pipeline
Summary
Feature
Config
Benefit
Last updated
