CSharpToTypescript2 1.1.6
See the version list below for details.
dotnet add package CSharpToTypescript2 --version 1.1.6
NuGet\Install-Package CSharpToTypescript2 -Version 1.1.6
<PackageReference Include="CSharpToTypescript2" Version="1.1.6" />
paket add CSharpToTypescript2 --version 1.1.6
#r "nuget: CSharpToTypescript2, 1.1.6"
// Install CSharpToTypescript2 as a Cake Addin #addin nuget:?package=CSharpToTypescript2&version=1.1.6 // Install CSharpToTypescript2 as a Cake Tool #tool nuget:?package=CSharpToTypescript2&version=1.1.6
Transpiles dto.cs files into dto.ts files. Including simple calcualtions.
It is based on Roslyn. So, potentially can transpile code of any complexity but currently intended (and tested) only for simple data transfer classes and simple calculations.
It is compatible with dotnet cli and dotnet watch in particular.
As input takes:
1. List of input folders with cs files (your dtos)
2. Output folder
and some other things. See example configuration file.
While the tool is the best of C# to Typescript generators I have seen (TypeLite, Typewriter, etc) it does not produce self sufficient set of dto files. The initial setup is more complex than of mentioned tools in exchange of much greater flexebility.
I will try to provide enough information for it to use but it may be not sufficient. In such a case please consult the working example with the transpiler integrated here: https://github.com/alehro/AspNetCoreSpa
Since the transpiler by itself doesn't have public repo please feel free to post its issues to the demo SPA project: https://github.com/alehro/AspNetCoreSpa/issues
The setup documentation is currently attached to version 1.1.2 here: CSharpToTypescript2/1.1.2
Or the same: https://github.com/alehro/AspNetCoreSpa/blob/master/README_Cs2Ts.md
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.2
- Microsoft.CodeAnalysis.CSharp (>= 3.3.1)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 3.3.1)
- YamlDotNet (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.9 | 19,582 | 11/27/2022 |
1.1.8 | 1,056 | 12/21/2021 |
1.1.7 | 4,219 | 8/14/2020 |
1.1.6 | 1,254 | 8/13/2020 |
1.1.5 | 1,224 | 7/15/2020 |
1.1.4 | 1,312 | 3/18/2020 |
1.1.3 | 2,002 | 11/10/2019 |
1.1.2 | 1,268 | 11/10/2019 |
1.1.0 | 1,221 | 11/10/2019 |
0.7.2 | 1,296 | 10/27/2019 |
0.7.1 | 1,282 | 10/26/2019 |
0.7.0 | 1,262 | 10/26/2019 |
Clean up of line endings. Previously there was a mess of "\r\n"s and "\n"s. Replaced it with Environment.NewLine