@kubb/plugin-ts 5.0.0-beta.3 → 5.0.0-beta.31
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 +26 -5
- package/dist/index.cjs +416 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +81 -58
- package/dist/index.js +415 -120
- package/dist/index.js.map +1 -1
- package/extension.yaml +1078 -0
- package/package.json +11 -13
- package/src/components/Enum.tsx +3 -3
- package/src/factory.ts +23 -20
- package/src/generators/typeGenerator.tsx +100 -39
- package/src/plugin.ts +20 -21
- package/src/printers/printerTs.ts +31 -30
- package/src/resolvers/resolverTs.ts +28 -25
- package/src/types.ts +44 -37
- package/src/utils.ts +23 -13
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<h1
|
|
2
|
+
<h1>@kubb/plugin-ts</h1>
|
|
3
3
|
<a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
|
|
4
4
|
<img width="180" src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/logo.png" alt="Kubb logo">
|
|
5
5
|
</a>
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
[![Sponsors][sponsors-src]][sponsors-href]
|
|
12
12
|
|
|
13
13
|
<h4>
|
|
14
|
-
<a href="https://codesandbox.io/s/github/kubb-labs/
|
|
14
|
+
<a href="https://codesandbox.io/s/github/kubb-labs/plugins/tree/main/examples/typescript" target="_blank">View Demo</a>
|
|
15
15
|
<span> · </span>
|
|
16
|
-
<a href="https://kubb.dev/" target="_blank">Documentation</a>
|
|
16
|
+
<a href="https://kubb.dev/plugins/ts" target="_blank">Documentation</a>
|
|
17
17
|
<span> · </span>
|
|
18
18
|
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
|
|
19
19
|
<span> · </span>
|
|
@@ -21,11 +21,32 @@
|
|
|
21
21
|
</h4>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
`@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.
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Generates interfaces, enums, union types, and string literals from OpenAPI schemas
|
|
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
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
bun add @kubb/plugin-ts
|
|
37
|
+
# or
|
|
38
|
+
pnpm add @kubb/plugin-ts
|
|
39
|
+
# or
|
|
40
|
+
npm install @kubb/plugin-ts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
See the [full documentation](https://kubb.dev/plugins/ts) for configuration options and examples.
|
|
25
46
|
|
|
26
47
|
## Supporting Kubb
|
|
27
48
|
|
|
28
|
-
Kubb
|
|
49
|
+
Kubb is an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
|
|
29
50
|
|
|
30
51
|
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
31
52
|
|