build/docs/architecture.md
Lilith 04c11f9980 feat: initial commit of @lilith/build-core and @lilith/lixb
Build tooling packages for the Lilith ecosystem:
- @lilith/build-core: Package detection, builders, and Vite presets
- @lilith/lixb: CLI for unified build commands

Key features:
- Auto-detect package type (library, NestJS, frontend)
- platformVite() plugin for consistent Vite configuration
- REEXPORT_EXCLUDE list for packages with star re-exports (ui-motion)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 23:13:15 -08:00

2.4 KiB

Architecture

Overview

┌─────────────────────────────────────────────────────────┐
│                    lilith-build CLI                      │
│                  (@lilith/build)                         │
└────────────────────────┬────────────────────────────────┘
                         │
                         ▼
┌─────────────────────────────────────────────────────────┐
│                   @lilith/build-core                     │
│  ┌──────────────┐  ┌────────────────────────────────┐   │
│  │   detect.ts  │  │          builders/             │   │
│  │              │  │  ┌─────────┐ ┌─────────┐       │   │
│  │  Analyzes:   │  │  │ library │ │ nestjs  │ ...   │   │
│  │  - files     │──▶│  │ (tsup)  │ │ (nest)  │       │   │
│  │  - pkg.json  │  │  └─────────┘ └─────────┘       │   │
│  └──────────────┘  └────────────────────────────────┘   │
└─────────────────────────────────────────────────────────┘
                         │
                         ▼
         ┌───────────────┴───────────────┐
         │      Actual Build Tools       │
         │   tsup  │  nest  │  vite      │
         └───────────────────────────────┘

Design Principles

  1. Auto-detection over configuration - The CLI figures out what to do
  2. Escape hatches exist - Force type with CLI flag if detection fails
  3. Thin wrapper - We invoke real tools, not reimplementations
  4. Fail fast - Unknown package type = error, not guess