@kubb/plugin-ts 5.0.7 → 5.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OVERVIEW.md +17 -0
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/kubb-extension.json +277 -0
- package/package.json +8 -5
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://kubb.dev/schemas/kubb-extension.json",
|
|
3
|
+
"kind": "plugin",
|
|
4
|
+
"name": "plugin-ts",
|
|
5
|
+
"export": "pluginTs",
|
|
6
|
+
"displayName": "TypeScript",
|
|
7
|
+
"description": "Generates TypeScript types and interfaces from your OpenAPI spec, the typed foundation the other Kubb plugins build on.",
|
|
8
|
+
"category": "types",
|
|
9
|
+
"icon": {
|
|
10
|
+
"light": "https://kubb.dev/feature/typescript.svg"
|
|
11
|
+
},
|
|
12
|
+
"tags": ["typescript", "types", "interfaces", "codegen", "openapi"],
|
|
13
|
+
"docs": "https://kubb.dev/plugins/plugin-ts",
|
|
14
|
+
"compatibility": {
|
|
15
|
+
"kubb": ">=5.8.0",
|
|
16
|
+
"node": ">=22"
|
|
17
|
+
},
|
|
18
|
+
"options": [
|
|
19
|
+
{
|
|
20
|
+
"key": "outputPath",
|
|
21
|
+
"path": ["output", "path"],
|
|
22
|
+
"label": "Output Path",
|
|
23
|
+
"description": "Output folder for generated files",
|
|
24
|
+
"type": "text",
|
|
25
|
+
"default": "types"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"key": "barrel",
|
|
29
|
+
"path": ["output", "barrel"],
|
|
30
|
+
"label": "Barrel",
|
|
31
|
+
"description": "How index.ts barrel files are generated",
|
|
32
|
+
"type": "select",
|
|
33
|
+
"default": {
|
|
34
|
+
"type": "named"
|
|
35
|
+
},
|
|
36
|
+
"choices": [
|
|
37
|
+
{
|
|
38
|
+
"label": "named",
|
|
39
|
+
"value": {
|
|
40
|
+
"type": "named"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"label": "named (nested)",
|
|
45
|
+
"value": {
|
|
46
|
+
"type": "named",
|
|
47
|
+
"nested": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"label": "all",
|
|
52
|
+
"value": {
|
|
53
|
+
"type": "all"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"label": "all (nested)",
|
|
58
|
+
"value": {
|
|
59
|
+
"type": "all",
|
|
60
|
+
"nested": true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"label": "false (disabled)",
|
|
65
|
+
"value": false
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"key": "outputMode",
|
|
71
|
+
"path": ["output", "mode"],
|
|
72
|
+
"label": "Output Mode",
|
|
73
|
+
"description": "How the plugin consolidates its code into files. File mode writes everything into a single file, so the output path must include a file extension and cannot be grouped.",
|
|
74
|
+
"type": "select",
|
|
75
|
+
"default": "directory",
|
|
76
|
+
"choices": [
|
|
77
|
+
{
|
|
78
|
+
"label": "directory (one file per schema)",
|
|
79
|
+
"value": "directory"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"label": "file (single file)",
|
|
83
|
+
"value": "file"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"key": "group",
|
|
89
|
+
"path": ["group"],
|
|
90
|
+
"label": "Group",
|
|
91
|
+
"description": "Group generated operations by OpenAPI tag or path",
|
|
92
|
+
"type": "select",
|
|
93
|
+
"default": null,
|
|
94
|
+
"choices": [
|
|
95
|
+
{
|
|
96
|
+
"label": "none",
|
|
97
|
+
"value": null
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"label": "by tag",
|
|
101
|
+
"value": {
|
|
102
|
+
"type": "tag"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"label": "by path",
|
|
107
|
+
"value": {
|
|
108
|
+
"type": "path"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"key": "excludeTags",
|
|
115
|
+
"path": ["exclude"],
|
|
116
|
+
"label": "Exclude Tags",
|
|
117
|
+
"description": "Comma-separated OpenAPI tags to exclude from generation",
|
|
118
|
+
"type": "list",
|
|
119
|
+
"item": {
|
|
120
|
+
"type": "tag",
|
|
121
|
+
"pattern": "$item"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"key": "includeTags",
|
|
126
|
+
"path": ["include"],
|
|
127
|
+
"label": "Include Tags",
|
|
128
|
+
"description": "Comma-separated OpenAPI tags to include. Only operations with these tags are generated",
|
|
129
|
+
"type": "list",
|
|
130
|
+
"item": {
|
|
131
|
+
"type": "tag",
|
|
132
|
+
"pattern": "$item"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"key": "enumType",
|
|
137
|
+
"path": ["enum", "type"],
|
|
138
|
+
"label": "Enum Type",
|
|
139
|
+
"description": "How OpenAPI enums are represented in the generated TypeScript",
|
|
140
|
+
"type": "select",
|
|
141
|
+
"default": "asConst",
|
|
142
|
+
"choices": [
|
|
143
|
+
{
|
|
144
|
+
"label": "asConst",
|
|
145
|
+
"value": "asConst"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"label": "enum",
|
|
149
|
+
"value": "enum"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"label": "constEnum",
|
|
153
|
+
"value": "constEnum"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"label": "literal",
|
|
157
|
+
"value": "literal"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"label": "inlineLiteral",
|
|
161
|
+
"value": "inlineLiteral"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"key": "enumConstCasing",
|
|
167
|
+
"path": ["enum", "constCasing"],
|
|
168
|
+
"label": "Enum Const Casing",
|
|
169
|
+
"description": "Casing of the generated const variable (asConst only)",
|
|
170
|
+
"type": "select",
|
|
171
|
+
"default": "camelCase",
|
|
172
|
+
"choices": [
|
|
173
|
+
{
|
|
174
|
+
"label": "camelCase",
|
|
175
|
+
"value": "camelCase"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"label": "pascalCase",
|
|
179
|
+
"value": "pascalCase"
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"key": "enumTypeSuffix",
|
|
185
|
+
"path": ["enum", "typeSuffix"],
|
|
186
|
+
"label": "Enum Type Suffix",
|
|
187
|
+
"description": "Suffix appended to the generated enum type alias (asConst only)",
|
|
188
|
+
"type": "text",
|
|
189
|
+
"default": "Key"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"key": "enumKeyCasing",
|
|
193
|
+
"path": ["enum", "keyCasing"],
|
|
194
|
+
"label": "Enum Key Casing",
|
|
195
|
+
"description": "Casing for enum key names",
|
|
196
|
+
"type": "select",
|
|
197
|
+
"default": "none",
|
|
198
|
+
"choices": [
|
|
199
|
+
{
|
|
200
|
+
"label": "none",
|
|
201
|
+
"value": "none"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"label": "pascalCase",
|
|
205
|
+
"value": "pascalCase"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"label": "camelCase",
|
|
209
|
+
"value": "camelCase"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": "snakeCase",
|
|
213
|
+
"value": "snakeCase"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"label": "SCREAMING_SNAKE_CASE",
|
|
217
|
+
"value": "screamingSnakeCase"
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"key": "syntaxType",
|
|
223
|
+
"path": ["syntaxType"],
|
|
224
|
+
"label": "Syntax Type",
|
|
225
|
+
"type": "select",
|
|
226
|
+
"default": "type",
|
|
227
|
+
"choices": [
|
|
228
|
+
{
|
|
229
|
+
"label": "type",
|
|
230
|
+
"value": "type"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"label": "interface",
|
|
234
|
+
"value": "interface"
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"key": "optionalType",
|
|
240
|
+
"path": ["optionalType"],
|
|
241
|
+
"label": "Optional Type",
|
|
242
|
+
"type": "select",
|
|
243
|
+
"default": "questionToken",
|
|
244
|
+
"choices": [
|
|
245
|
+
{
|
|
246
|
+
"label": "questionToken",
|
|
247
|
+
"value": "questionToken"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"label": "undefined",
|
|
251
|
+
"value": "undefined"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"label": "questionTokenAndUndefined",
|
|
255
|
+
"value": "questionTokenAndUndefined"
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"key": "arrayType",
|
|
261
|
+
"path": ["arrayType"],
|
|
262
|
+
"label": "Array Type",
|
|
263
|
+
"type": "select",
|
|
264
|
+
"default": "array",
|
|
265
|
+
"choices": [
|
|
266
|
+
{
|
|
267
|
+
"label": "array (T[])",
|
|
268
|
+
"value": "array"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"label": "generic (Array<T>)",
|
|
272
|
+
"value": "generic"
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-ts",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.8",
|
|
4
4
|
"description": "Generate TypeScript types, interfaces, and enums with Kubb. The base plugin other Kubb plugins build on for type safety.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-generation",
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
],
|
|
38
38
|
"files": [
|
|
39
39
|
"dist",
|
|
40
|
+
"kubb-extension.json",
|
|
41
|
+
"OVERVIEW.md",
|
|
40
42
|
"!/**/**.test.**",
|
|
41
43
|
"!/**/__tests__/**",
|
|
42
44
|
"!/**/__snapshots__/**"
|
|
@@ -52,23 +54,24 @@
|
|
|
52
54
|
"import": "./dist/index.js",
|
|
53
55
|
"require": "./dist/index.cjs"
|
|
54
56
|
},
|
|
55
|
-
"./package.json": "./package.json"
|
|
57
|
+
"./package.json": "./package.json",
|
|
58
|
+
"./kubb-extension.json": "./kubb-extension.json"
|
|
56
59
|
},
|
|
57
60
|
"publishConfig": {
|
|
58
61
|
"access": "public",
|
|
59
62
|
"registry": "https://registry.npmjs.org/"
|
|
60
63
|
},
|
|
61
64
|
"dependencies": {
|
|
62
|
-
"@kubb/parser-ts": "^5.8.
|
|
65
|
+
"@kubb/parser-ts": "^5.8.1",
|
|
63
66
|
"typescript": "^6.0.3"
|
|
64
67
|
},
|
|
65
68
|
"devDependencies": {
|
|
66
69
|
"@internals/shared": "0.0.0",
|
|
67
70
|
"@internals/utils": "0.0.0",
|
|
68
|
-
"kubb": "^5.8.
|
|
71
|
+
"kubb": "^5.8.1"
|
|
69
72
|
},
|
|
70
73
|
"peerDependencies": {
|
|
71
|
-
"kubb": "^5.8.
|
|
74
|
+
"kubb": "^5.8.1"
|
|
72
75
|
},
|
|
73
76
|
"engines": {
|
|
74
77
|
"node": ">=22"
|