{"id":13706018,"url":"https://github.com/skbkontur/TypeScript.ContractGenerator","last_synced_at":"2025-05-05T19:34:07.571Z","repository":{"id":47415385,"uuid":"167527332","full_name":"skbkontur/TypeScript.ContractGenerator","owner":"skbkontur","description":"A tool that can generate TypeScript types from C# classes","archived":false,"fork":false,"pushed_at":"2024-05-16T12:16:38.000Z","size":673,"stargazers_count":59,"open_issues_count":3,"forks_count":24,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-06T09:07:53.310Z","etag":null,"topics":["code-generation","code-generator","csharp","roslyn","typescript"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skbkontur.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-25T10:09:16.000Z","updated_at":"2024-11-25T16:52:26.000Z","dependencies_parsed_at":"2024-06-21T16:35:18.753Z","dependency_job_id":"14f13b9b-518b-4974-a5b6-c344fda2d790","html_url":"https://github.com/skbkontur/TypeScript.ContractGenerator","commit_stats":null,"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2FTypeScript.ContractGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2FTypeScript.ContractGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2FTypeScript.ContractGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2FTypeScript.ContractGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skbkontur","download_url":"https://codeload.github.com/skbkontur/TypeScript.ContractGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252563150,"owners_count":21768411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","code-generator","csharp","roslyn","typescript"],"created_at":"2024-08-02T22:00:51.388Z","updated_at":"2025-05-05T19:34:02.559Z","avatar_url":"https://github.com/skbkontur.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"# TypeScript.ContractGenerator\n\nA tool that can generate TypeScript types from C# classes\n\n|                                     | Build Status |\n|-------------------------------------|:--------------: |\n| TypeScript.ContractGenerator        | [![NuGet Status](https://img.shields.io/nuget/v/SkbKontur.TypeScript.ContractGenerator.svg)](https://www.nuget.org/packages/SkbKontur.TypeScript.ContractGenerator/) |\n| TypeScript.ContractGenerator.Roslyn | [![NuGet Status](https://img.shields.io/nuget/v/SkbKontur.TypeScript.ContractGenerator.Roslyn.svg)](https://www.nuget.org/packages/SkbKontur.TypeScript.ContractGenerator.Roslyn/) |\n| TypeScript.ContractGenerator.Cli    | [![NuGet Status](https://img.shields.io/nuget/v/SkbKontur.TypeScript.ContractGenerator.Cli.svg)](https://www.nuget.org/packages/SkbKontur.TypeScript.ContractGenerator.Cli/) |\n| Build                               | [![Build status](https://github.com/skbkontur/TypeScript.ContractGenerator/actions/workflows/actions.yml/badge.svg)](https://github.com/skbkontur/TypeScript.ContractGenerator/actions) |\n\n\n## Release Notes\n\nSee [CHANGELOG](CHANGELOG.md).\n\n## How to Use\n\nSee https://github.com/skbkontur/TypeScript.ContractGenerator/wiki#how-to-use\n\nSee [Quick Start](https://github.com/skbkontur/TypeScript.ContractGenerator/wiki/Quick-Start) for more detailed guide\n\n## Generation options\n\nSee https://github.com/skbkontur/TypeScript.ContractGenerator/wiki/Generation-Options\n\n## Attributes\n\nThere is `ContractGeneratorIgnore` attribute that can be applied to properties and makes generator skip current property.\n\n## Roslyn usage\n\nTo use Roslyn you should get a `Compilation` object of your project. It can be done with helper method `AdhocProject.GetCompilation(string[] directories, string[] assemblies)`.\nYou can then get customization info from this compilation by calling extension method `compilation.GetCustomization()` and call `TypeScriptGenerator` with this customization:\n```csharp\nvar (customTypeGenerator, typesProvider) = AdhocProject.GetCompilation(directories, assemblies).GetCustomization();\nvar typeGenerator = new TypeScriptGenerator(options, customTypeGenerator, typesProvider);\ntypeGenerator.GenerateFiles(outputDirectory);\n```\n\n## dotnet tool usage\n\nInstall tool with command:\n\n`dotnet tool install -g SkbKontur.TypeScript.ContractGenerator.Cli`\n\nUse tool with command:\n\n`dotnet ts-gen --assembly ./Api/bin/Api.dll --outputDir ./src/Api`\n\ndotnet tool also supports Roslyn:\n\n`dotnet ts-gen --directory ./Api;./Core --assembly ./External/Dependency.dll --outputDir ./src/Api`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskbkontur%2FTypeScript.ContractGenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskbkontur%2FTypeScript.ContractGenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskbkontur%2FTypeScript.ContractGenerator/lists"}