Mugi.Generators 0.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Mugi.Generators --version 0.1.2
                    
NuGet\Install-Package Mugi.Generators -Version 0.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mugi.Generators" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mugi.Generators" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Mugi.Generators" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mugi.Generators --version 0.1.2
                    
#r "nuget: Mugi.Generators, 0.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mugi.Generators@0.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mugi.Generators&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Mugi.Generators&version=0.1.2
                    
Install as a Cake Tool

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(...) and c.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.Schema typed input, reading field selectors and rule declarations without runtime expression trees.
  • Optionally imports an OpenAPI document marked as AdditionalFiles and generates DTOs, route constants, input schemas, and a typed HttpClient wrapper.
  • Replaces recognized c.Json and route calls with direct calls into the generated code, using C# interceptors. A buildTransitive props file adds Mugi.Generated to InterceptorsNamespaces automatically.

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.2" />
  <PackageReference Include="Mugi.Generators" Version="0.1.2" />
</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.

There are no supported framework assets in this package.

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.

Version Downloads Last Updated
0.1.3 106 8/28/2026
0.1.2 93 8/28/2026