Anvil and Bellows
Pre-alphaCompile-time dependency injection for TypeScript and Express
A code-generation DI framework for TypeScript, modeled after Dagger 2 and written with Claude Code. This project explores how we can use AI to accelerate using existing concepts and patterns in new environments.
I have used Dagger with Kotlin and appreciated its transparency, and I have used NestJS extensively in TypeScript and feel the lack. Anvil brings the best of Dagger to TypeScript using modern JavaScript tooling. It is paired with Bellows, a code generation implementation of class-based Controllers similar to NestJS that utilizes Anvil to package complex apps into clean Express middleware.
- Zero runtime reflection — all wiring happens at codegen time
- Build-time graph validation with rich diagnostics (miette)
- Dagger 2 semantics: @Component, @Module, @Provides, scopes, subcomponents
- Rust CLI in the spirit of swc and esbuild for fast iteration
- Ships as @msulak/anvil (runtime stubs) + @msulak/anvil-cli (binary launcher)