Architecture Overview
Pencel is a component transpiler: read .pen.tsx, output multiple frameworks (React, Angular, Vue) via a single IR (Intermediate Representation).
The 7-Phase Pipeline
Section titled “The 7-Phase Pipeline”- Discover – Glob
.pen.tsfiles, validatetsconfig.json - Load – Create TypeScript AST objects
- Build IR – Parse decorators → immutable IR
- Sync AST – Update AST nodes from IR state
- Generate – Create global files (ir.json, components.d.ts)
- Derive – Create framework adapters (React, Angular, Vue)
- Write – Preprocess imports, print AST, flush to disk
Key Concepts
Section titled “Key Concepts”- IR – Immutable graph: tags, props, events, metadata
- Generators – Plugins for global files (fully rebuild each pass)
- Derivatives – Plugins for framework adapters (incremental per-file)
See Compilation Flow for three-layer model, Core Components for system architecture.