ForgeTS is designed as a modular monorepo, prioritizing separation of concerns and scalability.
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
The primary entry point for users. It handles:
- Command-line argument parsing (Commander).
- Interactive prompts (Inquirer).
- Orchestration of scaffolding tasks.
- Template rendering/copying.
The scaffolding relies on templates (often stored within the CLI or a separate package) that serve as the blueprints for generated projects.
We use pnpm workspaces to manage dependencies efficiently.
- Shared Dependencies: Common tools like TypeScript, ESLint, and Vitest are defined in the root
package.jsonto ensure consistency. - Local Linking: Packages within the monorepo can depend on each other using the workspace protocol (e.g.,
"@forge-ts/core": "workspace:*").
The build system leverages TypeScript project references (tsv3).
tsc -b(build mode) is used to compile the entire graph of projects incrementally.pnpmhandles the execution order based on the dependency graph.