Ok, my previous attempt was not really thought through.
Using this package as a CLI Plugin makes the plugin not know where it exists during runtime, causing it to not to be able to find the .cs files in its own dist folder. Should have thought about it.
Second best solution is keeping C# code in memory and writing it to a temporary folder. We already do this heavily in the tests, so it is a trivial thing to change.
Not super satisfied with the outcome, but I did not see a better way. There are some Github projects to execute .NET code from Typescript, but it's a hassle.
In short:
Refactored the fixture test helpers to be used by actual non-test code
Removed the raw C# code
Re-used the test fixture helper to write the C# code to a temporary file store
Added a simple memory cache to avoid tons of dotnet restore and spamming of /tmp when running tests and in the future when scanning multiple <TargetFramework>s.
Ok, my previous attempt was not really thought through.
Using this package as a CLI Plugin makes the plugin not know where it exists during runtime, causing it to not to be able to find the .cs files in its own dist folder. Should have thought about it.
Second best solution is keeping C# code in memory and writing it to a temporary folder. We already do this heavily in the tests, so it is a trivial thing to change.
Not super satisfied with the outcome, but I did not see a better way. There are some Github projects to execute .NET code from Typescript, but it's a hassle.
In short:
dotnet restore
and spamming of/tmp
when running tests and in the future when scanning multiple<TargetFramework>s
.