Skip to content

Commit 783a58d

Browse files
committed
Add TypeSpecGeneratorPlugin snippets. Closes #239
Closes #239
1 parent 7c86eb9 commit 783a58d

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- Command: `dev-proxy-toolkit.config-new` - Create new configuration file
1515
- Command: `dev-proxy-toolkit.restart` - Restart Dev Proxy
16+
- Snippets: `devproxy-plugin-typespec-generator` - TypeSpecGeneratorPlugin instance
17+
- Snippets: `devproxy-plugin-typespec-generator-config` - TypeSpecGeneratorPlugin config section
1618

1719
### Changed:
1820

@@ -39,7 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3941

4042
### Added:
4143

42-
- Snippets: `devproxy-rewrite` - Dev Proxy rewrite
44+
- Snippets: `devproxy-plugin-rewrite` - Dev Proxy rewrite
4345
- Snippets: `devproxy-plugin-rewrite-file` - RewritePlugin rewrites file
4446
- Snippets: `devproxy-plugin-rewrite-file-schema` - RewritePlugin rewrites file schema
4547
- Diagnostics: Show warning if config contains a summary plugin without a reporter

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ Shown when the active document is a Dev Proxy configuration file
149149
| `devproxy-plugin-rewrite-file` | RewritePlugin rewrites file |
150150
| `devproxy-plugin-rewrite-file-schema` | RewritePlugin rewrites file schema |
151151
| `devproxy-plugin-rewrite-config` | RewritePlugin config section |
152+
| `devproxy-plugin-typespec-generator` | TypeSpecGeneratorPlugin instance |
153+
| `devproxy-plugin-typespec-generator-config` | TypeSpecGeneratorPlugin config section |
152154
| `devproxy-plugin-url-discovery` | UrlDiscoveryPlugin instance |
153155
| `devproxy-reporter-json` | JsonReporter instance |
154156
| `devproxy-reporter-markdown` | MarkdownReporter instance |

src/constants.ts

+11
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ export const pluginSnippets: PluginSnippets = {
189189
required: true,
190190
}
191191
},
192+
TypeSpecGeneratorPlugin: {
193+
instance: 'devproxy-plugin-typespec-generator',
194+
config: {
195+
name: 'devproxy-plugin-typespec-generator-config',
196+
required: false,
197+
}
198+
},
192199
UrlDiscoveryPlugin: {
193200
instance: 'devproxy-plugin-url-discovery',
194201
},
@@ -332,6 +339,10 @@ export const pluginDocs: PluginDocs = {
332339
name: 'Rewrite Plugin',
333340
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/rewriteplugin',
334341
},
342+
TypeSpecGeneratorPlugin: {
343+
name: 'TypeSpec Generator Plugin',
344+
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/typespecgeneratorplugin',
345+
},
335346
UrlDiscoveryPlugin: {
336347
name: 'UrlDiscovery Plugin',
337348
url: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/technical-reference/urldiscoveryplugin',

src/snippets.json

+28-7
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
],
111111
"description": "Dev Proxy response header"
112112
},
113-
"Rewrite":{
113+
"Rewrite": {
114114
"prefix": "devproxy-rewrite",
115115
"body": [
116116
"{",
@@ -462,7 +462,7 @@
462462
"\t\t\"https://graph.microsoft.us/beta/*\",",
463463
"\t\t\"https://dod-graph.microsoft.us/beta/*\",",
464464
"\t\t\"https://microsoftgraph.chinacloudapi.cn/beta/*\"",
465-
"\t]",
465+
"\t]",
466466
"}"
467467
],
468468
"description": "GraphBetaSupportGuidancePlugin instance"
@@ -947,7 +947,7 @@
947947
],
948948
"description": "RewritePlugin instance"
949949
},
950-
"RewritePluginFile":{
950+
"RewritePluginFile": {
951951
"prefix": "devproxy-plugin-rewrite-file",
952952
"body": [
953953
"{",
@@ -959,14 +959,14 @@
959959
],
960960
"description": "RewritePlugin rewrites file"
961961
},
962-
"RewritePluginFileSchema":{
962+
"RewritePluginFileSchema": {
963963
"prefix": "devproxy-plugin-rewrite-file-schema",
964964
"body": [
965965
"\"\\$schema\": \"https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/rewriteplugin.rewritesfile.schema.json\","
966966
],
967967
"description": "RewritePlugin rewrites file schema"
968968
},
969-
"RewritePluginConfig":{
969+
"RewritePluginConfig": {
970970
"prefix": "devproxy-plugin-rewrite-config",
971971
"body": [
972972
"\"rewritePlugin\": {",
@@ -975,8 +975,29 @@
975975
"}"
976976
],
977977
"description": "RewritePlugin config section"
978-
},
979-
"UrlDiscoveryPlugin": {
978+
},
979+
"TypeSpecGeneratorPlugin": {
980+
"prefix": "devproxy-plugin-typespec-generator",
981+
"body": [
982+
"{",
983+
"\t\"name\": \"TypeSpecGeneratorPlugin\",",
984+
"\t\"enabled\": true,",
985+
"\t\"pluginPath\": \"~appFolder/plugins/dev-proxy-plugins.dll\"",
986+
"}"
987+
],
988+
"description": "TypeSpecGeneratorPlugin instance"
989+
},
990+
"TypeSpecGeneratorPluginConfig": {
991+
"prefix": "devproxy-plugin-typespec-generator-config",
992+
"body": [
993+
"\"typeSpecGeneratorPlugin\": {",
994+
"\t\"\\$schema\": \"https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/typespecgeneratorplugin.schema.json\",",
995+
"\t\"ignoreResponseTypes\": false",
996+
"}"
997+
],
998+
"description": "TypeSpecGeneratorPlugin config section"
999+
},
1000+
"UrlDiscoveryPlugin": {
9801001
"prefix": "devproxy-plugin-url-discovery",
9811002
"body": [
9821003
"{",

0 commit comments

Comments
 (0)