Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate TypeScript files upon build #249

Open
Thijmen opened this issue Nov 11, 2024 · 3 comments
Open

Generate TypeScript files upon build #249

Thijmen opened this issue Nov 11, 2024 · 3 comments
Labels
question Further information is requested

Comments

@Thijmen
Copy link

Thijmen commented Nov 11, 2024

Hi there,

First of all; this package looks very promising! Is it possible to add this to an existing csproj and have it generate the files during build time? Ideally that's what I want to do, and not manually with running the tool cli.

Please note I have not that much experience with the tool cli, perhaps it is already possible - perhaps it's a good idea to share that in the README 😄

@WhiteOlivierus
Copy link

WhiteOlivierus commented Nov 14, 2024

You can add this to your csproj. This will generate everytime you build.

<Target Name="SignalRClientGeneration" AfterTargets="PostBuildEvent" Condition=" '$(Configuration)' == 'Debug' ">
    <Exec EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="dotnet tsrts --project project.csproj --output generated" />
</Target>

I might create a PR later this week if I have time.

@mansellan
Copy link

It would be superb if there was a package that could just be installed into the project, like the C# source generator. That would make it trivial to get working on a CI server. Yes, I'm that lazy :-)

@nenoNaninu
Copy link
Owner

I recommend using the dotnet tsrts command to generate code in your CI, such as GitHub actions.

@nenoNaninu nenoNaninu added the question Further information is requested label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants