@kubb/plugin-ts 5.5.0-canary.20261111T122006 → 5.5.1

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.
@@ -43,9 +43,9 @@ pluginTs({
43
43
  })
44
44
  ```
45
45
 
46
- Handlers that return TypeScript compiler nodes still work when your project installs `@kubb/parser-ts`, plus `typescript` 5 or 6 or `@typescript/typescript6` next to TypeScript 7. All are optional peer dependencies. If `@kubb/parser-ts` is missing, the build stops with an error that tells you to install it. That form is deprecated and is removed in the next major.
46
+ The example 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.
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
+ Handlers that return TypeScript compiler nodes are deprecated and are removed in the next major. They still work when your project installs `@kubb/parser-ts`, plus `typescript` 5 or 6 or `@typescript/typescript6` next to TypeScript 7. All are optional peer dependencies. If `@kubb/parser-ts` is missing, the build stops with an error that tells you to install it.
49
49
 
50
50
  ## Remove descriptions
51
51
 
@@ -53,9 +53,9 @@ Clear schema descriptions with a [macro](https://kubb.dev/docs/5.x/reference/plu
53
53
 
54
54
  ```typescript [kubb.config.ts]
55
55
  import { pluginTs } from '@kubb/plugin-ts'
56
- import { ast } from 'kubb/kit'
56
+ import { defineMacro } from 'kubb/kit'
57
57
 
58
- const dropDescriptions = ast.defineMacro({
58
+ const dropDescriptions = defineMacro({
59
59
  name: 'drop-descriptions',
60
60
  schema(node) {
61
61
  return 'description' in node && node.description
@@ -67,4 +67,4 @@ const dropDescriptions = ast.defineMacro({
67
67
  pluginTs({ macros: [dropDescriptions] })
68
68
  ```
69
69
 
70
- The generated types omit description JSDoc. The OpenAPI document stays unchanged. The same macro works with `pluginZod`.
70
+ The generated types omit description JSDoc. The OpenAPI document stays unchanged. The same macro works with `pluginZod`, with [one exception](https://kubb.dev/extensions/kubb-labs/plugin-zod/guides/customization#remove-descriptions).
package/docs/options.md CHANGED
@@ -63,7 +63,7 @@ Emits a named union type with no runtime value.
63
63
  :::
64
64
 
65
65
  :::field{name="'inlineLiteral'"}
66
- Emits the same union as `'literal'` but inlines it at each usage site instead of naming it.
66
+ Emits the same union as `'literal'` and inlines it at each usage site for an enum declared on a property. A component enum that a `$ref` points to keeps its named type.
67
67
  :::
68
68
 
69
69
  ::
@@ -118,7 +118,7 @@ Names the const `PetStatus`, matching the schema name.
118
118
 
119
119
  #### enum.typeSuffix
120
120
 
121
- Suffix on the companion type alias when `type` is `'asConst'`. It never changes the const object name. Set it to `''` to drop the suffix, which with `constCasing: 'pascalCase'` merges the const and the type under one name, `PetStatus`.
121
+ Suffix on the companion type alias when `type` is `'asConst'`. The suffix never changes the const object name. Set it to `''` to drop the suffix, which with `constCasing: 'pascalCase'` merges the const and the type under one name, `PetStatus`.
122
122
 
123
123
  | | |
124
124
  | -------- | -------- |
@@ -236,7 +236,7 @@ Uses `tags: Array<string>`, which reads better for complex elements like `Array<
236
236
 
237
237
  ### operations
238
238
 
239
- Whether each operation gets its own types file (`AddPetOptions`, `AddPetResponses`, `AddPetStatus200`, `AddPetPath`).
239
+ Whether each operation gets its own types file (`AddPetOptions`, `AddPetResponses`, `AddPetStatus200`, `AddPetPath`). A response that declares `headers` also gets a type for them, such as `ListPetsStatus200Headers`. Cookie parameters get a type such as `ListPetsCookies`.
240
240
 
241
241
  | | |
242
242
  | -------- | ---------------------- |
@@ -251,7 +251,7 @@ Emits one file per operation with its aliases and aggregates, for example `expor
251
251
  :::
252
252
 
253
253
  :::field{name="'inline'"}
254
- Emits only the schema types. Clients, query hooks, MSW handlers, Faker mocks, Cypress requests, and MCP handlers reference those directly and print the rest inline, for example `Options<{ body: Order; path?: never; query?: never; headers?: never }>` and `mutationOptions<Order, ResponseErrorConfig<unknown>, …>`. An enum declared inside an operation becomes a literal union such as `'available' | 'pending' | 'sold'`. Kubb moves each operation type into the files that use it, so this needs a Kubb version with inline sources.
254
+ Emits only the schema types. Clients, query hooks, MSW handlers, Faker mocks, Cypress requests, and MCP handlers reference those directly and print the rest inline, for example `Options<{ body: Order; path?: never; query?: never; headers?: never }>` and `mutationOptions<Order, ResponseErrorConfig<unknown>, …>`. An enum declared inside an operation becomes a literal union such as `'available' | 'pending' | 'sold'`. Kubb moves each operation type into the files that use it, so `'inline'` needs a Kubb version with inline sources.
255
255
  :::
256
256
 
257
257
  ::
@@ -275,9 +275,11 @@ type ResolverTsPatch = {
275
275
  path?(node: OperationNode, param: ParameterNode): string // → 'GetPetByIdPath'
276
276
  query?(node: OperationNode, param: ParameterNode): string // → 'FindPetsByStatusQuery'
277
277
  headers?(node: OperationNode, param: ParameterNode): string // → 'DeletePetHeaders'
278
+ cookies?(node: OperationNode, param: ParameterNode): string // → 'GetCookiesCookies'
278
279
  }
279
280
  response?: {
280
281
  status?(node: OperationNode, statusCode: StatusCode): string // → 'ListPetsStatus200'
282
+ headers?(node: OperationNode, statusCode: StatusCode): string // → 'ListPetsStatus200Headers'
281
283
  options?(node: OperationNode): string // → 'ListPetsOptions'
282
284
  responses?(node: OperationNode): string // → 'ListPetsResponses'
283
285
  response?(node: OperationNode): string // → 'ListPetsResponse'
@@ -293,7 +295,7 @@ type ResolverTsPatch = {
293
295
 
294
296
  ### printer
295
297
 
296
- Replaces the node handler for a schema type such as `'integer'` or `'date'` with one that builds its TypeScript AST node. Use `this.transform` to recurse into nested nodes and `this.options` to read printer options. The [printer guide](https://kubb.dev/docs/5.x/how-to/printers) covers the handler context and how overrides compose with macros.
298
+ Replaces the handler for a schema type such as `'integer'` or `'date'`. Each handler returns the TypeScript type as a string. Inside a handler, `this.transform(node)` returns the printed type of a nested node and `this.options` holds the printer options. A handler that returns a TypeScript compiler node is deprecated. The [printer guide](https://kubb.dev/docs/5.x/how-to/printers) covers the handler context and how overrides compose with macros.
297
299
 
298
300
  | | |
299
301
  | -------- | ---------------------------- |
@@ -18,7 +18,7 @@
18
18
  }
19
19
  ],
20
20
  "compatibility": {
21
- "kubb": ">=5.16.0",
21
+ "kubb": ">=5.18.4",
22
22
  "node": ">=22.22"
23
23
  },
24
24
  "options": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-ts",
3
- "version": "5.5.0-canary.20261111T122006",
3
+ "version": "5.5.1",
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,18 +67,18 @@
67
67
  "registry": "https://registry.npmjs.org/"
68
68
  },
69
69
  "dependencies": {
70
- "@kubb/kit": "^5.18.2",
71
- "@kubb/renderer-jsx": "^5.18.2",
70
+ "@kubb/kit": "^5.18.8",
71
+ "@kubb/renderer-jsx": "^5.18.8",
72
72
  "yuku-codegen": "^0.19.0"
73
73
  },
74
74
  "devDependencies": {
75
- "@internals/shared": "0.1.0-canary.20261111T122006",
76
- "@internals/utils": "0.1.0-canary.20261111T122006",
77
- "@kubb/parser-ts": "^5.18.2",
75
+ "@internals/shared": "0.0.0",
76
+ "@internals/utils": "0.0.0",
77
+ "@kubb/parser-ts": "^5.18.8",
78
78
  "typescript": "^7.0.2"
79
79
  },
80
80
  "peerDependencies": {
81
- "@kubb/parser-ts": "^5.18.2",
81
+ "@kubb/parser-ts": "^5.18.8",
82
82
  "@typescript/typescript6": "^6.0.2",
83
83
  "typescript": ">=5.0.0"
84
84
  },