@kubb/plugin-swr 5.0.0-alpha.9 → 5.0.0-beta.36

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.
Files changed (45) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +36 -21
  3. package/dist/components-BuLagnaM.js +933 -0
  4. package/dist/components-BuLagnaM.js.map +1 -0
  5. package/dist/components-CD7ZoS3B.cjs +1029 -0
  6. package/dist/components-CD7ZoS3B.cjs.map +1 -0
  7. package/dist/components.cjs +1 -1
  8. package/dist/components.d.ts +46 -52
  9. package/dist/components.js +1 -1
  10. package/dist/generators-DM18y_Qk.cjs +445 -0
  11. package/dist/generators-DM18y_Qk.cjs.map +1 -0
  12. package/dist/generators-bnwHiUqJ.js +434 -0
  13. package/dist/generators-bnwHiUqJ.js.map +1 -0
  14. package/dist/generators.cjs +1 -1
  15. package/dist/generators.d.ts +4 -501
  16. package/dist/generators.js +1 -1
  17. package/dist/index.cjs +134 -113
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.ts +4 -5
  20. package/dist/index.js +131 -114
  21. package/dist/index.js.map +1 -1
  22. package/dist/types-BoANASs2.d.ts +220 -0
  23. package/extension.yaml +199 -0
  24. package/package.json +58 -67
  25. package/src/components/Mutation.tsx +106 -227
  26. package/src/components/MutationKey.tsx +25 -1
  27. package/src/components/Query.tsx +75 -140
  28. package/src/components/QueryOptions.tsx +46 -95
  29. package/src/generators/mutationGenerator.tsx +113 -128
  30. package/src/generators/queryGenerator.tsx +125 -137
  31. package/src/index.ts +2 -2
  32. package/src/plugin.ts +117 -170
  33. package/src/resolvers/resolverSwr.ts +56 -0
  34. package/src/types.ts +115 -59
  35. package/src/utils.ts +10 -0
  36. package/dist/components-DRDGvgXG.js +0 -702
  37. package/dist/components-DRDGvgXG.js.map +0 -1
  38. package/dist/components-jd0l9XKn.cjs +0 -780
  39. package/dist/components-jd0l9XKn.cjs.map +0 -1
  40. package/dist/generators-CRSl6u2M.js +0 -399
  41. package/dist/generators-CRSl6u2M.js.map +0 -1
  42. package/dist/generators-D062obA7.cjs +0 -410
  43. package/dist/generators-D062obA7.cjs.map +0 -1
  44. package/dist/types-BIaGRPjD.d.ts +0 -210
  45. /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
package/LICENSE CHANGED
@@ -1,14 +1,21 @@
1
- Copyright (c) 2026 Stijn Van Hulle
1
+ MIT License
2
2
 
3
- This repository contains software under two licenses:
3
+ Copyright (c) 2026 Kubb Labs
4
4
 
5
- 1. Most of the code in this repository is licensed under the
6
- MIT License see licenses/LICENSE-MIT for the full license text.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
7
11
 
8
- 2. The following components are licensed under the
9
- GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)
10
- — see licenses/LICENSE-AGPL-3.0 for the full license text:
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
11
14
 
12
- - packages/agent (published as @kubb/agent)
13
-
14
- Each package's own LICENSE file or package.json specifies its applicable license.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,32 +1,48 @@
1
1
  <div align="center">
2
- <h1>Plugin SWR</h1>
3
2
  <a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
4
- <img width="180" src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/logo.png" alt="Kubb logo">
3
+ <img src="https://kubb.dev/og.png" alt="Kubb banner">
5
4
  </a>
6
5
 
7
-
8
6
  [![npm version][npm-version-src]][npm-version-href]
9
7
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
10
8
  [![Coverage][coverage-src]][coverage-href]
11
9
  [![License][license-src]][license-href]
12
10
  [![Sponsors][sponsors-src]][sponsors-href]
11
+
13
12
  <h4>
14
- <a href="https://codesandbox.io/s/github/kubb-labs/kubb/tree/main//examples/typescript" target="_blank">View Demo</a>
15
- <span> · </span>
16
- <a href="https://kubb.dev/" target="_blank">Documentation</a>
13
+ <a href="https://kubb.dev/plugins/swr" target="_blank">Documentation</a>
17
14
  <span> · </span>
18
- <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
15
+ <a href="https://github.com/kubb-labs/plugins/issues/" target="_blank">Report Bug</a>
19
16
  <span> · </span>
20
- <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
17
+ <a href="https://github.com/kubb-labs/plugins/issues/" target="_blank">Request Feature</a>
21
18
  </h4>
22
19
  </div>
23
20
 
24
- Swagger integration for SWR to generate all the different SWR hooks based on an OpenAPI specification.
21
+ <br />
22
+
23
+ # @kubb/plugin-swr
24
+
25
+ ### Generate SWR hooks from OpenAPI
25
26
 
27
+ `@kubb/plugin-swr` generates SWR hooks from your OpenAPI specification. Each operation becomes a typed `useSWR` or `useSWRMutation` hook.
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ bun add @kubb/plugin-swr
33
+ # or
34
+ pnpm add @kubb/plugin-swr
35
+ # or
36
+ npm install @kubb/plugin-swr
37
+ ```
38
+
39
+ ## Documentation
40
+
41
+ See the [full documentation](https://kubb.dev/plugins/swr) for configuration options and examples.
26
42
 
27
43
  ## Supporting Kubb
28
44
 
29
- Kubb uses an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
45
+ Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
30
46
 
31
47
  - [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
32
48
 
@@ -36,20 +52,19 @@ Kubb uses an MIT-licensed open source project with its ongoing development made
36
52
  </a>
37
53
  </p>
38
54
 
55
+ ## License
56
+
57
+ [MIT](https://github.com/kubb-labs/plugins/blob/main/LICENSE)
39
58
 
40
59
  <!-- Badges -->
41
60
 
42
- [npm-version-src]: https://img.shields.io/npm/v/@kubb/plugin-swr?flat&colorA=18181B&colorB=f58517
61
+ [npm-version-src]: https://img.shields.io/npm/v/@kubb/plugin-swr?style=flat&colorA=18181B&colorB=f58517
43
62
  [npm-version-href]: https://npmjs.com/package/@kubb/plugin-swr
44
- [npm-downloads-src]: https://img.shields.io/npm/dm/@kubb/plugin-swr?flat&colorA=18181B&colorB=f58517
63
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@kubb/plugin-swr?style=flat&colorA=18181B&colorB=f58517
45
64
  [npm-downloads-href]: https://npmjs.com/package/@kubb/plugin-swr
46
- [license-src]: https://img.shields.io/github/license/kubb-labs/kubb.svg?flat&colorA=18181B&colorB=f58517
47
- [license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
48
- [build-src]: https://img.shields.io/github/actions/workflow/status/kubb-labs/kubb/ci.yaml?style=flat&colorA=18181B&colorB=f58517
49
- [build-href]: https://www.npmjs.com/package/@kubb/plugin-swr
50
- [minified-src]: https://img.shields.io/bundlephobia/min/@kubb/plugin-swr?style=flat&colorA=18181B&colorB=f58517
51
- [minified-href]: https://www.npmjs.com/package/@kubb/plugin-swr
52
- [coverage-src]: https://img.shields.io/codecov/c/github/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517
53
- [coverage-href]: https://www.npmjs.com/package/@kubb/plugin-swr
65
+ [coverage-src]: https://qlty.sh/badges/8959bd5b-d8a3-4811-8762-3a8be3bd2c34/test_coverage.svg
66
+ [coverage-href]: https://qlty.sh/gh/kubb-labs/projects/plugins
67
+ [license-src]: https://img.shields.io/github/license/kubb-labs/plugins.svg?style=flat&colorA=18181B&colorB=f58517
68
+ [license-href]: https://github.com/kubb-labs/plugins/blob/main/LICENSE
54
69
  [sponsors-src]: https://img.shields.io/github/sponsors/stijnvanhulle?style=flat&colorA=18181B&colorB=f58517
55
- [sponsors-href]: https://github.com/sponsors/stijnvanhulle/
70
+ [sponsors-href]: https://github.com/sponsors/stijnvanhulle