@kubb/plugin-swr 5.2.2 → 5.2.3

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/OVERVIEW.md ADDED
@@ -0,0 +1,16 @@
1
+ # SWR
2
+
3
+ Generates typed SWR hooks from your OpenAPI spec: `useSWR` for reads and `useSWRMutation` for writes.
4
+
5
+ The plugin ships no HTTP client. Each hook calls a function generated by a client plugin.
6
+
7
+ ## Setup
8
+
9
+ - Add `@kubb/plugin-ts` and a client plugin: `@kubb/plugin-fetch` or `@kubb/plugin-axios`.
10
+ - Install SWR v2 or higher in the app that uses the generated code.
11
+ - Configure validation on the client plugin, not here.
12
+
13
+ ## Options worth knowing
14
+
15
+ - `client` picks `fetch` or `axios` when both client plugins are registered. A single client is detected automatically.
16
+ - `query` and `mutation` set which HTTP methods become queries (`GET`) and mutations (`POST`, `PUT`, `PATCH`, `DELETE`), and where SWR is imported from (`swr` and `swr/mutation`). Set either to `false` to skip it.
package/dist/index.cjs CHANGED
@@ -335,8 +335,14 @@ function createGroupConfig(group) {
335
335
  };
336
336
  }
337
337
  //#endregion
338
+ //#region kubb-extension.json
339
+ var compatibility = {
340
+ "kubb": ">=5.8.0",
341
+ "node": ">=22"
342
+ };
343
+ //#endregion
338
344
  //#region package.json
339
- var version = "5.2.2";
345
+ var version = "5.2.3";
340
346
  //#endregion
341
347
  //#region ../../internals/client/src/resolveClient.ts
342
348
  /**
@@ -1304,7 +1310,7 @@ const pluginSwr = (0, kubb_kit.definePlugin)({
1304
1310
  meta: {
1305
1311
  name: pluginSwrName,
1306
1312
  version,
1307
- compatibility: { kubb: ">=5.8.0" }
1313
+ compatibility
1308
1314
  },
1309
1315
  dependencies: { [_kubb_plugin_ts.pluginTsName]: {} },
1310
1316
  setup(options) {