Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.44 KB

File metadata and controls

42 lines (30 loc) · 1.44 KB

Architecture Overview

ForgeTS is designed as a modular monorepo, prioritizing separation of concerns and scalability.

High-Level structure

graph TD
    Root[Monorepo Root] --> Packages[Packages]
    Root --> Config[Configuration]
    
    Packages --> CLI[@forge-ts/cli]
    Packages --> Core[@forge-ts/core (Future)]
    Packages --> Templates[Templates]
    
    CLI --> Core
    CLI --> Templates
Loading

Core Components

1. @forge-ts/cli (packages/cli)

The primary entry point for users. It handles:

  • Command-line argument parsing (Commander).
  • Interactive prompts (Inquirer).
  • Orchestration of scaffolding tasks.
  • Template rendering/copying.

2. Templates

The scaffolding relies on templates (often stored within the CLI or a separate package) that serve as the blueprints for generated projects.

Monorepo Strategy

We use pnpm workspaces to manage dependencies efficiently.

  • Shared Dependencies: Common tools like TypeScript, ESLint, and Vitest are defined in the root package.json to ensure consistency.
  • Local Linking: Packages within the monorepo can depend on each other using the workspace protocol (e.g., "@forge-ts/core": "workspace:*").

Build Pipeline

The build system leverages TypeScript project references (tsv3).

  • tsc -b (build mode) is used to compile the entire graph of projects incrementally.
  • pnpm handles the execution order based on the dependency graph.