Library Mode
By default, the proxy generator only produces TypeScript for types that are directly used by commands and queries — types referenced as properties or return values flow in transitively. Any other public types in your assembly are ignored.
Library mode generates TypeScript for every public type in the assembly, regardless of whether it appears in any command or query. This is useful for shared libraries or packages where the TypeScript consumer needs the full type surface.
Enabling Library Mode
Section titled “Enabling Library Mode”<PropertyGroup> <CratisProxiesLibraryMode>true</CratisProxiesLibraryMode></PropertyGroup>proxygenerator assembly.dll output-path --library-modeBehavior
Section titled “Behavior”When library mode is on:
- All public, non-abstract classes and records in every project assembly are collected and generated as TypeScript interfaces.
- All public interfaces are included.
- All public enums are included.
- Abstract classes are skipped (they cannot be instantiated).
- Types excluded via
ExcludeTypeorExcludeNamespaceare still skipped. - Types from assemblies mapped via
AssemblyToPackageMappingare still imported from their package rather than regenerated.
Combining with Other Options
Section titled “Combining with Other Options”Library mode pairs naturally with type exclusions and namespace roots:
<PropertyGroup> <CratisProxiesLibraryMode>true</CratisProxiesLibraryMode></PropertyGroup>
<ItemGroup> <!-- Exclude internal implementation types --> <ExcludeNamespace Namespace="MyApp.Internal*" />
<!-- Root the output at the feature namespace --> <NamespaceRoot Namespace="MyApp.Features" /></ItemGroup>