@kubb/plugin-vue-query 5.3.2 → 5.3.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/dist/index.cjs CHANGED
@@ -359,7 +359,7 @@ var compatibility = {
359
359
  };
360
360
  //#endregion
361
361
  //#region package.json
362
- var version = "5.3.2";
362
+ var version = "5.3.4";
363
363
  //#endregion
364
364
  //#region ../../internals/tanstack-query/src/utils.ts
365
365
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
- import { Exclude, Group, Include, Output, OutputOptions, Override, PluginFactoryOptions, Resolver, ResolverPatch, ast } from "kubb/kit";
2
+ import { Exclude, Group, Include, Output, OutputOptions, Override, PluginType, Resolver, ResolverPatch, ast } from "kubb/kit";
3
3
  import "@kubb/plugin-ts";
4
4
  import "kubb/jsx";
5
5
  import "@kubb/plugin-zod";
@@ -351,7 +351,7 @@ type ResolvedOptions = {
351
351
  hooks: boolean;
352
352
  resolver: ResolverVueQuery;
353
353
  };
354
- type PluginVueQuery = PluginFactoryOptions<'plugin-vue-query', Options, ResolvedOptions, ResolverVueQuery>;
354
+ type PluginVueQuery = PluginType<'plugin-vue-query', Options, ResolvedOptions, ResolverVueQuery>;
355
355
  declare global {
356
356
  namespace Kubb {
357
357
  interface PluginRegistry {
package/dist/index.js CHANGED
@@ -329,7 +329,7 @@ var compatibility = {
329
329
  };
330
330
  //#endregion
331
331
  //#region package.json
332
- var version = "5.3.2";
332
+ var version = "5.3.4";
333
333
  //#endregion
334
334
  //#region ../../internals/tanstack-query/src/utils.ts
335
335
  /**
package/docs/overview.md CHANGED
@@ -1,24 +1,28 @@
1
1
  # Vue Query
2
2
 
3
- Generates TanStack Query helpers for Vue from your OpenAPI spec. By default you get `queryOptions` factories with their query and mutation keys. Set `hooks: true` to also get `useQuery`, `useInfiniteQuery`, and `useMutation` composables with reactive parameters.
3
+ The Vue Query plugin generates TanStack Query helpers for Vue from your OpenAPI spec. By default you get `queryOptions` factories with their query keys, plus a key for each mutation. Set `hooks: true` to also get `useQuery` and `useMutation` composables with reactive parameters.
4
4
 
5
5
  The plugin ships no HTTP client. Each helper calls a function generated by a client plugin.
6
6
 
7
7
  ## Setup
8
8
 
9
- - Add `@kubb/plugin-ts` and a client plugin: `@kubb/plugin-fetch` or `@kubb/plugin-axios`.
10
- - Install `@tanstack/vue-query` v5 or higher in the app that uses the generated code.
9
+ - Add `@kubb/plugin-ts` and a client plugin: `@kubb/plugin-fetch` or `@kubb/plugin-axios`. Leave `sdk` unset on the client plugin.
10
+ - Install `@tanstack/vue-query` 5.41 or a later v5 release and `vue` 3.3 or a later v3 release in the app that uses the generated code.
11
11
  - Configure validation on the client plugin, not here.
12
12
 
13
13
  ## Options worth knowing
14
14
 
15
15
  - `client` picks `fetch` or `axios` when both client plugins are registered. A single client is detected automatically.
16
- - `hooks` adds the `use*` composables on top of the option factories.
17
- - `infinite` adds infinite queries for pagination. Set `infinite.queryParam` to the query parameter that holds the page cursor.
18
- - `query` and `mutation` set which HTTP methods become queries (`GET`) and mutations (`POST`, `PUT`, `PATCH`, `DELETE`), and where the TanStack Query runtime is imported from. Set either to `false` to skip it.
16
+ - `hooks` adds the `use*` composables on top of the query option factories.
17
+ - `infinite` adds `useInfiniteQuery` composables for pagination. It needs `hooks: true` and covers the operations that take the query parameter named in `infinite.queryParam`, which defaults to `'id'`.
18
+ - `query` and `mutation` set which HTTP methods become queries (`GET`) and mutations (`POST`, `PUT`, `PATCH`, `DELETE`). They also set where the TanStack Query runtime is imported from. Set either to `false` to skip those helpers.
19
+
20
+ See [Options](https://kubb.dev/extensions/kubb-labs/plugin-vue-query/options) for every option and its default.
19
21
 
20
22
  ## Example
21
23
 
24
+ The config below generates `useQuery` and `useMutation` composables that call the Fetch client.
25
+
22
26
  ```typescript [kubb.config.ts]
23
27
  import { defineConfig } from 'kubb/config'
24
28
  import { pluginTs } from '@kubb/plugin-ts'
@@ -35,7 +39,3 @@ export default defineConfig({
35
39
  ],
36
40
  })
37
41
  ```
38
-
39
- ## See also
40
-
41
- - [TanStack Query for Vue](https://tanstack.com/query/latest/docs/framework/vue/overview)
@@ -4,7 +4,7 @@
4
4
  "name": "plugin-vue-query",
5
5
  "export": "pluginVueQuery",
6
6
  "displayName": "Vue Query",
7
- "description": "Generates TanStack Query composables for Vue from your OpenAPI spec, so every read and write is a typed useQuery, useInfiniteQuery, or useMutation.",
7
+ "description": "Generates typed TanStack Query helpers for Vue from your OpenAPI spec: queryOptions factories with their query and mutation keys. Set hooks to also get useQuery and useMutation composables, plus useInfiniteQuery when infinite is set.",
8
8
  "category": "framework",
9
9
  "icon": {
10
10
  "light": "https://kubb.dev/feature/tanstack.svg"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-vue-query",
3
- "version": "5.3.2",
3
+ "version": "5.3.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",
@@ -78,7 +78,7 @@
78
78
  "registry": "https://registry.npmjs.org/"
79
79
  },
80
80
  "dependencies": {
81
- "@kubb/plugin-ts": "^5.0.9"
81
+ "@kubb/plugin-ts": "^5.0.11"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@internals/client": "0.0.0",
@@ -86,15 +86,20 @@
86
86
  "@internals/tanstack-query": "0.0.0",
87
87
  "@internals/utils": "0.0.0",
88
88
  "@tanstack/vue-query": "^5.104.1",
89
- "kubb": "^5.8.3"
89
+ "kubb": "^5.9.2",
90
+ "vue": "^3.5.43"
90
91
  },
91
92
  "peerDependencies": {
92
- "@tanstack/vue-query": "^5.0.0",
93
- "kubb": "^5.8.3"
93
+ "@tanstack/vue-query": "^5.41.0",
94
+ "kubb": "^5.9.2",
95
+ "vue": ">=3.3.0"
94
96
  },
95
97
  "peerDependenciesMeta": {
96
98
  "@tanstack/vue-query": {
97
99
  "optional": true
100
+ },
101
+ "vue": {
102
+ "optional": true
98
103
  }
99
104
  },
100
105
  "engines": {