@kubb/plugin-ts 5.1.0-canary.20261024T075028 → 5.1.0
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/dist/index.cjs +371 -248
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +240 -17
- package/dist/index.d.ts +240 -17
- package/dist/index.js +371 -248
- package/dist/index.js.map +1 -1
- package/docs/guides/customization.md +5 -4
- package/kubb-extension.json +1 -1
- package/package.json +18 -9
|
@@ -24,26 +24,27 @@ A generated `Pet` becomes `ApiPet`. File names stay unchanged unless you also cu
|
|
|
24
24
|
|
|
25
25
|
## Map schema types
|
|
26
26
|
|
|
27
|
-
Replace [printer handlers](https://kubb.dev/extensions/kubb-labs/plugin-ts/options#printer) with
|
|
27
|
+
Replace [printer handlers](https://kubb.dev/extensions/kubb-labs/plugin-ts/options#printer) with your own. Each handler returns the TypeScript type as a string.
|
|
28
28
|
|
|
29
29
|
```typescript [kubb.config.ts]
|
|
30
|
-
import ts from '@typescript/typescript6'
|
|
31
30
|
import { pluginTs } from '@kubb/plugin-ts'
|
|
32
31
|
|
|
33
32
|
pluginTs({
|
|
34
33
|
printer: {
|
|
35
34
|
nodes: {
|
|
36
35
|
date() {
|
|
37
|
-
return
|
|
36
|
+
return 'Date'
|
|
38
37
|
},
|
|
39
38
|
integer() {
|
|
40
|
-
return
|
|
39
|
+
return 'bigint'
|
|
41
40
|
},
|
|
42
41
|
},
|
|
43
42
|
},
|
|
44
43
|
})
|
|
45
44
|
```
|
|
46
45
|
|
|
46
|
+
Handlers that return TypeScript compiler nodes still work when your project installs `typescript` 5 or 6, or `@typescript/typescript6` next to TypeScript 7. Both are optional peer dependencies. That form is deprecated and is removed in the next major.
|
|
47
|
+
|
|
47
48
|
This maps `date` fields to `Date` and `int32` integers to `bigint`. The separate `bigint` handler controls `int64` fields, which already use `bigint` by default. A `date-time` field uses the `datetime` handler.
|
|
48
49
|
|
|
49
50
|
## Remove descriptions
|
package/kubb-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-ts",
|
|
3
|
-
"version": "5.1.0
|
|
3
|
+
"version": "5.1.0",
|
|
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",
|
|
@@ -67,21 +67,30 @@
|
|
|
67
67
|
"registry": "https://registry.npmjs.org/"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@kubb/parser-ts": "^5.
|
|
71
|
-
"
|
|
70
|
+
"@kubb/parser-ts": "^5.13.0",
|
|
71
|
+
"yuku-codegen": "^0.19.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@internals/shared": "0.
|
|
75
|
-
"@internals/utils": "0.
|
|
76
|
-
"kubb": "^5.
|
|
74
|
+
"@internals/shared": "0.0.0",
|
|
75
|
+
"@internals/utils": "0.0.0",
|
|
76
|
+
"kubb": "^5.13.0",
|
|
77
77
|
"typescript": "^7.0.2"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"
|
|
81
|
-
"
|
|
80
|
+
"@typescript/typescript6": "^6.0.2",
|
|
81
|
+
"kubb": "^5.13.0",
|
|
82
|
+
"typescript": ">=5.0.0"
|
|
83
|
+
},
|
|
84
|
+
"peerDependenciesMeta": {
|
|
85
|
+
"@typescript/typescript6": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"typescript": {
|
|
89
|
+
"optional": true
|
|
90
|
+
}
|
|
82
91
|
},
|
|
83
92
|
"engines": {
|
|
84
|
-
"node": ">=22.
|
|
93
|
+
"node": ">=22.22"
|
|
85
94
|
},
|
|
86
95
|
"scripts": {
|
|
87
96
|
"build": "tsdown",
|