MarcosLopezC / LightJson

A simple JSON library for C#.
MIT License
60 stars 21 forks source link

Include source files in nuget package (Internal types) #51

Closed vsilvar closed 1 year ago

vsilvar commented 1 year ago

This builds on top of #50 to also make the included types, when using source embedded internal. This is a nice to have, to ensure consuming packages aren't exposing the types, but does pollute the code a little with the extra compiler directives.

As such, and because this isn't entirely necessary for source generators, I wasn't sure we wanted to include it.

For context, when a consuming project references the source generator, it should really only include the analyzers, which means that the actual dll won't have any reference to the source generator/analyzer itself. This means that even if the included types are public, they won't be exposed, so not a problem

vsilvar commented 1 year ago

@sharwell With this functionality it would be possible to not have a copy of the LightJson source code in the StyleCopAnalyzers repository. Would there be interest in using this? And if so, would the internal types be a hard requirement?

sharwell commented 1 year ago

@vsilvar I think we made a number of other small changes to the functionality to match the behavior we were getting with Newtonsoft.Json for our specific inputs. It's been a while since I looked so I'm not 100% sure which changes were necessary.