jburzynski / TypeGen

Single-class-per-file C# to TypeScript generator
MIT License
195 stars 55 forks source link

Interface dependencies no longer generated across multiple 'outputDir' directories #184

Open cs-NET opened 9 months ago

cs-NET commented 9 months ago

If you break your generated output up across multiple directories via .AddClass(type, directory) the pre 4.5.0 behavior would export any interfaces used by the classes across all the directories. As of 4.5.0 it appears that an interface will now only be exported to one of the output directories. This results in imports failing in classes located in the other directories as the interface dependencies no longer exist across all the output directories.

I took a quick look at the commit and am wondering if a change in Generator.GenerateTypeDependencies() might be the root cause.

src/TypeGen/TypeGen.Core/Generator/Generator.cs

https://github.com/jburzynski/TypeGen/compare/4.4.1...4.5.0#diff-4875a30df1553ac5e3428a3b75c52c59d650490dc8b896f993e21930c162e3e7L729

jburzynski commented 9 months ago

I created a test for it. It passes, but I might have misunderstood the details of the issue - you can check if this actually tests the issue.

cs-NET commented 9 months ago

I will try to get that test reproducing the issue I am seeing as next step.