@kubb/plugin-ts 5.0.0-beta.33 → 5.0.0-beta.36
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/README.md +11 -11
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<h1>@kubb/plugin-ts</h1>
|
|
3
2
|
<a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
|
|
4
|
-
<img
|
|
3
|
+
<img src="https://kubb.dev/og.png" alt="Kubb banner">
|
|
5
4
|
</a>
|
|
6
5
|
|
|
7
6
|
[![npm version][npm-version-src]][npm-version-href]
|
|
@@ -11,8 +10,6 @@
|
|
|
11
10
|
[![Sponsors][sponsors-src]][sponsors-href]
|
|
12
11
|
|
|
13
12
|
<h4>
|
|
14
|
-
<a href="https://codesandbox.io/s/github/kubb-labs/plugins/tree/main/examples/typescript" target="_blank">View Demo</a>
|
|
15
|
-
<span> · </span>
|
|
16
13
|
<a href="https://kubb.dev/plugins/ts" target="_blank">Documentation</a>
|
|
17
14
|
<span> · </span>
|
|
18
15
|
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
|
|
@@ -21,14 +18,13 @@
|
|
|
21
18
|
</h4>
|
|
22
19
|
</div>
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
<br />
|
|
22
|
+
|
|
23
|
+
# @kubb/plugin-ts
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
### Generate TypeScript types from OpenAPI
|
|
27
26
|
|
|
28
|
-
-
|
|
29
|
-
- Other plugins — `@kubb/plugin-client`, `@kubb/plugin-zod`, and the query plugins — import from its output
|
|
30
|
-
- Supports strict typing mode for required vs optional fields
|
|
31
|
-
- Controls output organization by tag, operation, or a custom grouping
|
|
27
|
+
`@kubb/plugin-ts` generates TypeScript types from your OpenAPI specification. It produces interfaces, enums, union types, and string literals that other Kubb plugins import and build on.
|
|
32
28
|
|
|
33
29
|
## Installation
|
|
34
30
|
|
|
@@ -46,7 +42,7 @@ See the [full documentation](https://kubb.dev/plugins/ts) for configuration opti
|
|
|
46
42
|
|
|
47
43
|
## Supporting Kubb
|
|
48
44
|
|
|
49
|
-
Kubb is an
|
|
45
|
+
Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
|
|
50
46
|
|
|
51
47
|
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
52
48
|
|
|
@@ -56,6 +52,10 @@ Kubb is an MIT-licensed open source project with its ongoing development made po
|
|
|
56
52
|
</a>
|
|
57
53
|
</p>
|
|
58
54
|
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
[MIT](https://github.com/kubb-labs/plugins/blob/main/LICENSE)
|
|
58
|
+
|
|
59
59
|
<!-- Badges -->
|
|
60
60
|
|
|
61
61
|
[npm-version-src]: https://img.shields.io/npm/v/@kubb/plugin-ts?flat&colorA=18181B&colorB=f58517
|
package/dist/index.cjs
CHANGED
|
@@ -900,17 +900,17 @@ function getOperationParameters(node, options = {}) {
|
|
|
900
900
|
* - `path` groups use the second path segment (`/pet/findByStatus` → `pet`).
|
|
901
901
|
* - other groups use `${camelCase(group)}${suffix}` (e.g. `petController`).
|
|
902
902
|
*
|
|
903
|
-
*
|
|
903
|
+
* A user-provided `group.name` always wins over the default namer, so callers stay in
|
|
904
|
+
* control of their output folders. Returns `null` when grouping is disabled, matching the
|
|
905
|
+
* per-plugin convention.
|
|
904
906
|
*
|
|
905
907
|
* @param group - The user-supplied group option, or `undefined` to disable grouping.
|
|
906
908
|
* @param options.suffix - Appended to non-`path` group names, e.g. `'Controller'` or `'Requests'`.
|
|
907
|
-
* @param options.honorName - When `true`, a user-provided `group.name` overrides the default namer.
|
|
908
909
|
*
|
|
909
910
|
* @example
|
|
910
911
|
* ```ts
|
|
911
|
-
* createGroupConfig(group, { suffix: 'Controller' })
|
|
912
|
-
* createGroupConfig(group, { suffix: '
|
|
913
|
-
* createGroupConfig(group, { suffix: 'Requests', honorName: true }) // plugin-cypress, plugin-mcp
|
|
912
|
+
* createGroupConfig(group, { suffix: 'Controller' }) // plugin-ts, plugin-client, …
|
|
913
|
+
* createGroupConfig(group, { suffix: 'Requests' }) // plugin-cypress, plugin-mcp
|
|
914
914
|
* ```
|
|
915
915
|
*/
|
|
916
916
|
function createGroupConfig(group, options) {
|
|
@@ -921,7 +921,7 @@ function createGroupConfig(group, options) {
|
|
|
921
921
|
};
|
|
922
922
|
return {
|
|
923
923
|
...group,
|
|
924
|
-
name:
|
|
924
|
+
name: group.name ? group.name : defaultName
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
927
|
//#endregion
|