Roslyn source generator that auto-discovers modules, endpoints, and DTOs at compile time.
dotnet add package SimpleModule.GeneratorThe generator runs automatically at build time. Reference it in your host project and call the generated extension methods:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddModules(); // Generated method
var app = builder.Build();
app.MapModuleEndpoints(); // Generated method- AddModules() -- registers all discovered module services
- MapModuleEndpoints() -- maps all IEndpoint implementations
- CollectModuleMenuItems() -- gathers menu registrations from all modules
- JSON serializer contexts for all [Dto] types
- TypeScript interface definitions embedded as resources
- View page registry mapping view endpoints to React components
- Compile-time module discovery with zero runtime reflection
- Incremental generation via Roslyn IIncrementalGenerator
- Targets netstandard2.0 for broad analyzer compatibility