Add assembly-to-package mappings for ProxyGenerator#2189
Conversation
Agent-Logs-Url: https://github.com/Cratis/Arc/sessions/ae058189-02e3-477c-a131-5c0cd4a543da Co-authored-by: einari <134365+einari@users.noreply.github.com>
|
@copilot Great. I had an error in the spec; AssemblyToPageMapping should be AssemblyToPackageMapping. Let's create a better sample than the Cratis sample in the documentation, something others can relate to - like a reusable .NET Project that gets used by multiple other projects. |
| catch | ||
| { | ||
| _typeScriptIsValid = false; | ||
| } |
…ping to AssemblyToPackageMapping Agent-Logs-Url: https://github.com/Cratis/Arc/sessions/ae058189-02e3-477c-a131-5c0cd4a543da Co-authored-by: einari <134365+einari@users.noreply.github.com>
…le multi-project example Agent-Logs-Url: https://github.com/Cratis/Arc/sessions/fd53fd75-bc6a-4d3e-ab26-8c3680af0e37 Co-authored-by: einari <134365+einari@users.noreply.github.com>
The |
…ect' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
|
@copilot fix the markdown lint errors - run the verification script in the Documentation folder |
|
NuGet packages for this PR, e.g. Cratis.Arc: |
…in configuration.md Agent-Logs-Url: https://github.com/Cratis/Arc/sessions/560ada5c-342f-4fbc-acc8-1f0bed712c4b Co-authored-by: einari <134365+einari@users.noreply.github.com>
Combines flags enum template support with assembly-to-package mappings. Both regular and flags enum descriptors now respect IsFromMappedAssembly() so types from mapped assemblies are imported from their package rather than generated locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Superseded by #2187 which now includes both the assembly-to-package mapping feature and the flags enum template support. |
Types from referenced assemblies that have a corresponding npm package should be imported from that package rather than generated as local TypeScript files. This adds a configurable mapping from C# assembly name to npm package name.
Added
AssemblyToPackageMappingMSBuild ItemGroup support — maps C# assembly types to an npm package instead of generating local TypeScript files--assembly-to-package=Assembly=PackageCLI flag (repeatable) for direct proxy generator invocationTypeExtensions.SetAssemblyPackageMappings()/IsFromMappedAssembly()for configuring and querying the mapping at runtimeGetTargetType,IsFromMappedAssembly,CollectTypesInvolvedexclusion, and an end-to-end command generation scenarioconfiguration.mdwith a relatable multi-project shared library exampleChanged
Generator.Generate()accepts an optionalassemblyPackageMappingsdictionary and filters mapped types from generatedtypeDescriptors/enumDescriptorsGetTargetType()returns a package-basedTargetType(FromPackage=true,Module=<packageName>) for types whose assembly is mappedCollectTypesInvolvedoverloads skip types from mapped assemblies to prevent recursive local type generation