How typelate/muxt works
Project type and purpose
• Muxt is a standalone, open-source code-generation CLI tool written in Go.
• Its purpose is to scan Go HTML templates, extract HTTP route definitions from their names, analyze matching Go receiver methods, and emit strongly-typed HTTP handlers without runtime reflection.
File structure
• Top-level “cmd/muxt” directory: CLI entry point and its tests.
• “internal/cli”: flag parsing, command registration, help text.
• “internal/muxt”: core orchestration of scanning, validation, code generation.
• “internal/asteval”: template evaluation and validation logic.
• “internal/astgen”: AST-based Go code generator.
• “internal/asterr”: error-wrapping utilities.
• “docs”, “examples” and “tests” are documentation and usage samples—supporting but not part of runtime.
• Configuration files (go.mod, Go workflows) and license/legal files.
README for additional insights
• The README describes a single CLI command (muxt generate) that drives the pipeline.
• Emphasizes a compile-time type-checking approach using go/types, html/template, and no runtime reflection.
• Illustrates how templates define request patterns, status codes, and calls into user-provided methods.
Detail without overthinking
• Every major module—even small ones (e.g., internal/asterr)—to show full architecture.
• Keep components coarse enough to avoid clutter but fine-grained enough to reflect the separate responsibilities.
• How the user’s templates and methods plug into the pipeline and how generated handlers feed back into the user application.