Mugi.Generators
0.1.3
dotnet add package Mugi.Generators --version 0.1.3
NuGet\Install-Package Mugi.Generators -Version 0.1.3
<PackageReference Include="Mugi.Generators" Version="0.1.3" />
<PackageVersion Include="Mugi.Generators" Version="0.1.3" />
<PackageReference Include="Mugi.Generators" />
paket add Mugi.Generators --version 0.1.3
#r "nuget: Mugi.Generators, 0.1.3"
#:package Mugi.Generators@0.1.3
#addin nuget:?package=Mugi.Generators&version=0.1.3
#tool nuget:?package=Mugi.Generators&version=0.1.3
Mugi.Generators
Mugi.Generators is the compile-time source generator for the Mugi web framework. It is the piece that makes Mugi work under NativeAOT: everything that other frameworks discover at runtime is generated during the build instead.
The package installs as a Roslyn analyzer and needs no code of its own. During the build it:
- Reads each
c.Json(...)andc.Req.Json<T>()call, collects the types you serialize, and generates a JSON codec for every one of them. - Validates route patterns at compile time and embeds the parsed templates.
- Generates the binders for
Mugi.Schematyped input, reading field selectors and rule declarations without runtime expression trees. - Optionally imports an OpenAPI document marked as
AdditionalFilesand generates DTOs, route constants, input schemas, and a typedHttpClientwrapper. - Replaces recognized
c.Jsonand route calls with direct calls into the generated code, using C# interceptors. AbuildTransitiveprops file addsMugi.GeneratedtoInterceptorsNamespacesautomatically.
Unsupported types and invalid patterns are reported as compile-time diagnostics (MUGI001 and up) that name the type or call site.
Install
Reference it next to Mugi; building needs the .NET 9 SDK or newer:
<ItemGroup>
<PackageReference Include="Mugi" Version="0.1.3" />
<PackageReference Include="Mugi.Generators" Version="0.1.3" />
</ItemGroup>
For build setups that cannot run compiler-integrated source generators, the Mugi.Gen dotnet tool produces the same code as ordinary .cs files, and the Mugi.Reflection package offers a runtime fallback for JIT deployments.
Full documentation is at github.com/hckaye/Mugi.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.