@kubb/plugin-vue-query 5.5.1 → 5.5.4

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/docs/options.md CHANGED
@@ -11,9 +11,9 @@ Pass these options to `pluginVueQuery()`. Shared options link to [Shared plugin
11
11
  | [`client`](#client) | Which registered client plugin the composables call. | Auto-detected |
12
12
  | [`infinite`](#infinite) | Add `useInfiniteQuery` composables for paginated reads. | `false` |
13
13
  | [`query`](#query) | Configure or disable query composables. | `{ methods: ['GET', 'QUERY'], importPath: '@tanstack/vue-query' }` |
14
- | [`queryKey`](#querykey) | Build the `queryKey` for each query composable. | Built-in `queryKeyTransformer` |
14
+ | [`queryKey`](#querykey) | Build the `queryKey` for each query composable. | Exported `queryKeyTransformer` |
15
15
  | [`mutation`](#mutation) | Configure or disable mutation composables. | `{ methods: ['POST', 'PUT', 'PATCH', 'DELETE'], importPath: '@tanstack/vue-query' }` |
16
- | [`mutationKey`](#mutationkey) | Build the `mutationKey` for each mutation composable. | Built-in `mutationKeyTransformer` |
16
+ | [`mutationKey`](#mutationkey) | Build the `mutationKey` for each mutation composable. | Exported `mutationKeyTransformer` |
17
17
  | [`hooks`](#hooks) | Emit `use*` composables on top of the factory helpers. | `false` |
18
18
  | [`include`](https://kubb.dev/docs/5.x/reference/plugin-options#include) | Keep only operations that match. | None |
19
19
  | [`exclude`](https://kubb.dev/docs/5.x/reference/plugin-options#exclude) | Skip operations that match. | `[]` |
@@ -180,7 +180,7 @@ Builds the `queryKey` for each query composable. The callback receives the opera
180
180
  | -------- | ------------------------------------------------------ |
181
181
  | Type | `(props: { node, casing, variant }) => Array<unknown>` |
182
182
  | Required | `false` |
183
- | Default | Built-in `queryKeyTransformer` |
183
+ | Default | Exported `queryKeyTransformer` |
184
184
 
185
185
  ::code-group
186
186
 
@@ -194,6 +194,14 @@ export const getUserByNameQueryKey = () => [{ variant: 'query', operationId: 'ge
194
194
 
195
195
  ::
196
196
 
197
+ To extend the default key instead of replacing it, import `queryKeyTransformer` and spread its result. The default segments can change between releases, so spread them instead of reading single entries.
198
+
199
+ ```typescript
200
+ import { queryKeyTransformer } from '@kubb/plugin-vue-query'
201
+
202
+ queryKey: (props) => [JSON.stringify(props.node.operationId), ...queryKeyTransformer(props)]
203
+ ```
204
+
197
205
  ### mutation
198
206
 
199
207
  Decides which operations are treated as mutations. The plugin generates a `mutationKey` helper for each match by default. Pass `false` to skip, or set [`hooks`](#hooks) to also emit `useMutation`.
@@ -232,7 +240,15 @@ Builds the `mutationKey` for each mutation composable, useful for batching inval
232
240
  | -------- | ------------------------------------------------------ |
233
241
  | Type | `(props: { node, casing, variant }) => Array<unknown>` |
234
242
  | Required | `false` |
235
- | Default | Built-in `mutationKeyTransformer` |
243
+ | Default | Exported `mutationKeyTransformer` |
244
+
245
+ Extend the default the same way with `mutationKeyTransformer`:
246
+
247
+ ```typescript
248
+ import { mutationKeyTransformer } from '@kubb/plugin-vue-query'
249
+
250
+ mutationKey: (props) => [JSON.stringify(props.node.operationId), ...mutationKeyTransformer(props)]
251
+ ```
236
252
 
237
253
  ### hooks
238
254
 
@@ -20,7 +20,7 @@
20
20
  "dependencies": ["plugin-ts"],
21
21
  "compatibility": {
22
22
  "kubb": ">=5.8.3",
23
- "node": ">=22"
23
+ "node": ">=22.12"
24
24
  },
25
25
  "role": "consumer",
26
26
  "options": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-vue-query",
3
- "version": "5.5.1",
3
+ "version": "5.5.4",
4
4
  "description": "Generate type-safe TanStack Query (Vue Query) composables with Kubb. Covers useQuery, useMutation, useInfiniteQuery, and queryOptions with Vue 3 Composition API support.",
5
5
  "keywords": [
6
6
  "code-generation",
@@ -66,9 +66,14 @@
66
66
  },
67
67
  "exports": {
68
68
  ".": {
69
- "types": "./dist/index.d.ts",
70
- "import": "./dist/index.js",
71
- "require": "./dist/index.cjs"
69
+ "import": {
70
+ "types": "./dist/index.d.ts",
71
+ "default": "./dist/index.js"
72
+ },
73
+ "require": {
74
+ "types": "./dist/index.d.cts",
75
+ "default": "./dist/index.cjs"
76
+ }
72
77
  },
73
78
  "./package.json": "./package.json",
74
79
  "./kubb-extension.json": "./kubb-extension.json"
@@ -78,20 +83,20 @@
78
83
  "registry": "https://registry.npmjs.org/"
79
84
  },
80
85
  "dependencies": {
81
- "@kubb/plugin-ts": "^5.0.12"
86
+ "@kubb/plugin-ts": "^5.0.14"
82
87
  },
83
88
  "devDependencies": {
84
89
  "@internals/client": "0.0.0",
85
90
  "@internals/shared": "0.0.0",
86
91
  "@internals/tanstack-query": "0.0.0",
87
92
  "@internals/utils": "0.0.0",
88
- "@tanstack/vue-query": "^5.104.2",
89
- "kubb": "^5.10.2",
90
- "vue": "^3.5.43"
93
+ "@tanstack/vue-query": "^5.104.3",
94
+ "kubb": "^5.11.1",
95
+ "vue": "^3.5.44"
91
96
  },
92
97
  "peerDependencies": {
93
98
  "@tanstack/vue-query": "^5.41.0",
94
- "kubb": "^5.10.2",
99
+ "kubb": "^5.11.1",
95
100
  "vue": ">=3.3.0"
96
101
  },
97
102
  "peerDependenciesMeta": {
@@ -103,7 +108,7 @@
103
108
  }
104
109
  },
105
110
  "engines": {
106
- "node": ">=22"
111
+ "node": ">=22.12"
107
112
  },
108
113
  "scripts": {
109
114
  "build": "tsdown",
@@ -1,8 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __name = (target, value) => __defProp(target, "name", {
4
- value,
5
- configurable: true
6
- });
7
- //#endregion
8
- export { __name as t };