Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 1.49 KB

structure.md

File metadata and controls

19 lines (15 loc) · 1.49 KB

Project Structure

Modular core under src/:

Path Role
src/index.ts Plugin entrypoint; exports languages, options, parsers, and printers
src/config/ Plugin constants, language registration, and user option definitions
src/parser/ Parser orchestration (parsers.ts) and regex AST builder (parse-go-template.ts)
src/printer/ Printer orchestration (printers.ts) and printer helper utilities
src/types/ AST and option types (src/types/ast/ast.ts, guards, parser-option interfaces)
src/utils/ Shared utility helpers such as ULID ID generation and collection helpers
src/tests/ Auto-discovered fixture tests for formatting behavior

Formatting Flow

Parser in src/parser/parse-go-template.ts builds aliased AST. Printer embed() in src/printer/printers.ts maps IDs back to formatted children through Prettier HTML. The final document output is emitted from that formatted tree.