You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Arguments:**`tsdefgen $FilePath$` (при установленном tool) или `run --project src/TypeScriptDefinitionGenerator.Cli -- $FilePath$` (при работе из исходников)
23
27
-**Working directory:**`$ContentRoot$`
24
28
- Включите **Synchronize files after execution**
25
29
@@ -30,11 +34,12 @@
30
34
## Способ 2: Запуск из терминала
31
35
32
36
```bash
33
-
# Один файл (укажите путь к вашему .cs файлу)
34
-
dotnet run --project src/TypeScriptDefinitionGenerator.Cli -- path/to/YourDto.cs
37
+
# Через dotnet tool (после: dotnet tool install -g TypeScriptDefinitionGenerator.Cli)
38
+
dotnet tsdefgen path/to/YourDto.cs
39
+
dotnet tsdefgen path/to/Dto1.cs path/to/Dto2.cs
35
40
36
-
#Несколько файлов
37
-
dotnet run --project src/TypeScriptDefinitionGenerator.Cli -- path/to/Dto1.cs path/to/Dto2.cs
41
+
#Или напрямую из исходников
42
+
dotnet run --project src/TypeScriptDefinitionGenerator.Cli -- path/to/YourDto.cs
38
43
```
39
44
40
45
## Конфигурация (tsdefgen.json)
@@ -57,7 +62,33 @@ dotnet run --project src/TypeScriptDefinitionGenerator.Cli -- path/to/Dto1.cs pa
57
62
58
63
## Автогенерация при сборке (MSBuild)
59
64
60
-
При изменении .cs файла можно автоматически перегенерировать .d.ts при сборке. Добавьте в .csproj:
65
+
При изменении .cs файла можно автоматически перегенерировать .d.ts при сборке.
См. [README-RIDER.md](README-RIDER.md) для полной конфигурации.
121
+
104
122
## JetBrains Rider
105
123
106
124
Для использования в Rider см. [README-RIDER.md](README-RIDER.md) — плагин с контекстным меню, External Tool или dotnet tool для генерации .d.ts файлов.
|`VS_MARKETPLACE_PAT`| Personal Access Token из Azure DevOps (Marketplace → Manage) для публикации VSIX в [Visual Studio Marketplace](https://marketplace.visualstudio.com/)|
8
+
|`JETBRAINS_MARKETPLACE_TOKEN`| Permanent Token из [JetBrains Marketplace → My Tokens](https://plugins.jetbrains.com/author/me/tokens) для публикации Rider-плагина |
9
+
|`NUGET_API_KEY`| API Key из [nuget.org → Account → API Keys](https://www.nuget.org/account/apikeys) для публикации пакетов TypeScriptDefinitionGenerator.Cli и TypeScriptDefinitionGenerator.MSBuild |
10
+
11
+
## VS Marketplace (PAT)
12
+
13
+
1.[Azure DevOps](https://dev.azure.com) → User settings → Personal access tokens
14
+
2. New Token, Scope: **Marketplace** → **Manage**
15
+
3. Добавить в GitHub как secret `VS_MARKETPLACE_PAT`
16
+
17
+
## JetBrains Marketplace (Token)
18
+
19
+
1.[plugins.jetbrains.com](https://plugins.jetbrains.com) → Author → My Tokens
20
+
2. Create new token
21
+
3. Добавить в GitHub как secret `JETBRAINS_MARKETPLACE_TOKEN`
22
+
23
+
## NuGet.org (API Key)
24
+
25
+
1.[nuget.org](https://www.nuget.org) → Account → API Keys
26
+
2. Create → Generate new key (Scope: Push new packages)
Creates and synchronizes TypeScript Definition files (`.d.ts`) from C# model classes (DTO) to build strongly typed web applications where the server and client-side models are in sync. Works on all .NET project types.
4
+
5
+
## Features
6
+
7
+
- Right-click any `.cs` file and select **Generate TypeScript Definition** to create a `.generated.d.ts` file
8
+
- Automatically updates `.d.ts` when the C# file is modified and saved
9
+
- Supports classes, interfaces, enums, inheritance, and XML documentation
10
+
- Configurable: camelCase, module format, EOL, indentation
11
+
12
+
## NuGet
13
+
14
+
For MSBuild integration and CI/CD: `dotnet add package TypeScriptDefinitionGenerator.MSBuild` — adds targets for build-time generation.
15
+
16
+
## JetBrains Rider
17
+
18
+
For Rider, see [README-RIDER.md](https://github.com/denis-peshkov/TypeScriptDefinitionGenerator/blob/master/README-RIDER.md) — plugin with context menu, External Tool, or dotnet tool.
0 commit comments