WckdRzr.Gaspar
0.5.4
See the version list below for details.
dotnet add package WckdRzr.Gaspar --version 0.5.4
NuGet\Install-Package WckdRzr.Gaspar -Version 0.5.4
<PackageReference Include="WckdRzr.Gaspar" Version="0.5.4" />
paket add WckdRzr.Gaspar --version 0.5.4
#r "nuget: WckdRzr.Gaspar, 0.5.4"
// Install WckdRzr.Gaspar as a Cake Addin #addin nuget:?package=WckdRzr.Gaspar&version=0.5.4 // Install WckdRzr.Gaspar as a Cake Tool #tool nuget:?package=WckdRzr.Gaspar&version=0.5.4
Gaspar
Gaspar is a tool that consumes your C# domain models, types and controllers and exports them for other services and languages to consume. Your C# models are available in TypeScript and your controller endpoints are available to TypeScript and other C# services, removing the need to hard code variable names and urls.
It's built from Jonathan Svenheden's C# models to TypeScript project which makes use of the Roslyn (the .NET compiler platform) to parse the source files, which removes the need to create and maintain our own parser.
Supported Conversions
C# Models and Types | C# Controllers | |
---|---|---|
Export to TypeScript | ✅ | |
Export to Angular | ✅ | ✅ |
Export to Ocelot Config | ✅ | |
Export to C# | ✅ |
Dependencies
Install
Install from NuGet: https://www.nuget.org/packages/WckdRzr.Gaspar/
How to use
- Add a config file to your project named
gaspar.config.json
that contains for example (See/Models/Configuration.cs
for the full config model)...
{
"Models": {
"Include": [
"./Models/**/*.cs",
"./Enums/**/*.cs"
],
"Exclude": [
"./Models/foo/bar.cs"
],
"Output": [{
"Type": "TypeScript",
"Location": "./api.d.ts"
},{
"Type": "CSharp",
"Location": "./ServiceComms/Api.cs"
}],
"CamelCaseEnums": false,
"NumericEnums": true,
"StringLiteralTypesInsteadOfEnums": false
},
"Controllers": {
"Include": [
"./Controllers/**/*.cs",
],
"Exclude": [],
"Output": [{
"Type": "Angular",
"Location": "./service.ts",
"ModelPath": "./api.d"
}],
"Gateway": "api",
"ServiceName": "all"
},
"OnlyWhenAttributed": "FrontEnd",
"CustomTypeTranslations": {
"ProductName": "string",
"ProductNumber": "string"
}
}
Add a NuGet script to your project.
Build. The output files will be created.
License
MIT © Wckd Rzr
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. |
-
net5.0
- Glob.cs (>= 5.1.766)
- Microsoft.Build.Framework (>= 17.2.0)
- Microsoft.Build.Utilities.Core (>= 17.2.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.2.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 | |
---|---|---|---|
3.4.0 | 102 | 10/2/2024 | |
3.3.1 | 81 | 9/2/2024 | |
3.3.0 | 117 | 8/19/2024 | |
3.2.2 | 116 | 8/9/2024 | |
3.2.1 | 69 | 7/31/2024 | |
3.2.0 | 63 | 7/30/2024 | |
3.1.2 | 78 | 7/30/2024 | |
3.1.1 | 76 | 7/30/2024 | |
3.1.0 | 89 | 7/12/2024 | |
3.0.0 | 84 | 7/10/2024 | |
2.9.14 | 102 | 7/1/2024 | |
2.9.13 | 85 | 7/1/2024 | |
2.9.12 | 99 | 6/21/2024 | |
2.9.11 | 108 | 6/17/2024 | |
2.9.10 | 119 | 6/16/2024 | |
2.9.9 | 109 | 6/16/2024 | |
2.9.8 | 91 | 6/14/2024 | |
2.9.7 | 110 | 6/14/2024 | |
2.9.6 | 105 | 6/14/2024 | |
2.9.5 | 97 | 6/14/2024 | |
2.9.4 | 112 | 6/14/2024 | |
2.9.3 | 94 | 6/14/2024 | |
2.9.2 | 101 | 6/13/2024 | |
2.9.1 | 103 | 6/12/2024 | |
2.9.0 | 103 | 6/12/2024 | |
2.8.4 | 197 | 2/8/2024 | |
2.8.3 | 107 | 2/6/2024 | |
2.8.2 | 119 | 2/6/2024 | |
2.8.1 | 110 | 2/6/2024 | |
2.8.0 | 778 | 1/23/2024 | |
2.7.0 | 300 | 10/6/2023 | |
2.6.3 | 169 | 9/24/2023 | |
2.6.2 | 165 | 9/7/2023 | |
2.6.1 | 156 | 9/7/2023 | |
2.6.0 | 143 | 9/7/2023 | |
2.5.6 | 7,928 | 4/26/2023 | |
2.5.5 | 163 | 4/26/2023 | |
2.5.4 | 183 | 4/26/2023 | |
2.5.3 | 165 | 4/26/2023 | |
2.5.2 | 173 | 4/26/2023 | |
2.5.1 | 385 | 4/25/2023 | |
2.5.0 | 175 | 4/25/2023 | |
2.4.1 | 4,702 | 2/15/2023 | |
2.4.0 | 258 | 2/15/2023 | |
2.3.2 | 2,979 | 1/16/2023 | |
2.3.1 | 301 | 1/16/2023 | |
2.3.0 | 311 | 1/16/2023 | |
2.2.4 | 556 | 1/11/2023 | |
2.2.3 | 298 | 1/10/2023 | |
2.2.2 | 438 | 12/20/2022 | |
2.2.1 | 312 | 12/20/2022 | |
2.2.0 | 322 | 12/20/2022 | |
2.1.0 | 1,300 | 12/8/2022 | |
2.0.1 | 390 | 12/6/2022 | |
2.0.0 | 326 | 12/6/2022 | |
1.5.2 | 2,837 | 11/14/2022 | |
1.5.1 | 3,611 | 10/4/2022 | |
1.5.0 | 434 | 10/4/2022 | |
1.4.5 | 423 | 10/3/2022 | |
1.4.4 | 910 | 9/27/2022 | |
1.4.3 | 3,353 | 9/6/2022 | |
1.4.2 | 540 | 9/1/2022 | |
1.4.1 | 444 | 9/1/2022 | |
1.4.0 | 470 | 9/1/2022 | |
1.3.4 | 735 | 8/17/2022 | |
1.3.3 | 818 | 8/17/2022 | |
1.3.2 | 626 | 8/11/2022 | |
1.3.1 | 541 | 7/25/2022 | |
1.3.0 | 538 | 7/19/2022 | |
1.2.3 | 1,696 | 6/28/2022 | |
1.2.2 | 514 | 6/28/2022 | |
1.2.1 | 816 | 6/21/2022 | |
1.2.0 | 500 | 6/21/2022 | |
1.1.4 | 630 | 6/16/2022 | |
1.1.3 | 551 | 6/16/2022 | |
1.1.2 | 527 | 6/16/2022 | |
1.1.0 | 548 | 6/16/2022 | |
1.0.0 | 558 | 6/15/2022 | |
0.6.2 | 551 | 6/15/2022 | |
0.6.1 | 567 | 6/15/2022 | |
0.6.0 | 585 | 6/15/2022 | |
0.5.4 | 803 | 6/14/2022 | |
0.5.3 | 517 | 6/14/2022 | |
0.5.2 | 542 | 6/14/2022 | |
0.5.1 | 536 | 6/14/2022 | |
0.5.0 | 518 | 6/14/2022 |