@kubb/plugin-swr 5.0.0-alpha.34 → 5.0.0-alpha.35
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/components-BJSzUg7M.cjs +955 -0
- package/dist/components-BJSzUg7M.cjs.map +1 -0
- package/dist/components-JQ2KRFCa.js +877 -0
- package/dist/components-JQ2KRFCa.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +77 -37
- package/dist/components.js +1 -1
- package/dist/generators-17ulS9mu.cjs +537 -0
- package/dist/generators-17ulS9mu.cjs.map +1 -0
- package/dist/generators-Cl7nr-FB.js +526 -0
- package/dist/generators-Cl7nr-FB.js.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +4 -4
- package/dist/generators.js +1 -1
- package/dist/index.cjs +132 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -2
- package/dist/index.js +132 -110
- package/dist/index.js.map +1 -1
- package/dist/{types-BVDtH9S7.d.ts → types-FA5mH9Ch.d.ts} +46 -90
- package/package.json +7 -11
- package/src/components/Mutation.tsx +165 -170
- package/src/components/MutationKey.tsx +50 -1
- package/src/components/Query.tsx +122 -126
- package/src/components/QueryKey.tsx +65 -1
- package/src/components/QueryOptions.tsx +38 -93
- package/src/generators/mutationGenerator.tsx +194 -117
- package/src/generators/queryGenerator.tsx +205 -139
- package/src/plugin.ts +117 -152
- package/src/resolvers/resolverSwr.ts +26 -0
- package/src/resolvers/resolverSwrLegacy.ts +17 -0
- package/src/types.ts +55 -18
- package/src/utils.ts +209 -0
- package/dist/components-DaCTPplv.js +0 -756
- package/dist/components-DaCTPplv.js.map +0 -1
- package/dist/components-Qs8_faOt.cjs +0 -834
- package/dist/components-Qs8_faOt.cjs.map +0 -1
- package/dist/generators-0YayIrse.js +0 -400
- package/dist/generators-0YayIrse.js.map +0 -1
- package/dist/generators-Bd4rCa3l.cjs +0 -411
- package/dist/generators-Bd4rCa3l.cjs.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["fetchClientSource","axiosClientSource","configSource"],"sources":["../
|
|
1
|
+
{"version":3,"file":"index.js","names":["fetchClientSource","axiosClientSource","configSource"],"sources":["../src/resolvers/resolverSwr.ts","../src/resolvers/resolverSwrLegacy.ts","../src/plugin.ts"],"sourcesContent":["import { camelCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginSwr } from '../types.ts'\n\n/**\n * Resolver for `@kubb/plugin-swr` that provides the default naming\n * and path-resolution helpers used by the plugin.\n *\n * @example\n * ```ts\n * import { resolverSwr } from '@kubb/plugin-swr'\n *\n * resolverSwr.default('list pets', 'function') // -> 'listPets'\n * resolverSwr.resolveName('show pet by id') // -> 'showPetById'\n * ```\n */\nexport const resolverSwr = defineResolver<PluginSwr>(() => ({\n name: 'default',\n pluginName: 'plugin-swr',\n default(name, type) {\n return camelCase(name, { isFile: type === 'file' })\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n}))\n","import { defineResolver } from '@kubb/core'\nimport type { PluginSwr } from '../types.ts'\nimport { resolverSwr } from './resolverSwr.ts'\n\n/**\n * Legacy resolver for `@kubb/plugin-swr` that reproduces the naming conventions\n * used in Kubb v4. Enable via `compatibilityPreset: 'kubbV4'`.\n *\n * The naming logic is identical to the default resolver — the only difference\n * is the `name` field (`'kubbV4'` vs `'default'`) so the driver can\n * distinguish presets.\n */\nexport const resolverSwrLegacy = defineResolver<PluginSwr>(() => ({\n ...resolverSwr,\n name: 'kubbV4',\n pluginName: 'plugin-swr',\n}))\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\n\nimport { ast, definePlugin, type Group } from '@kubb/core'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { source as axiosClientSource } from '@kubb/plugin-client/templates/clients/axios.source'\nimport { source as fetchClientSource } from '@kubb/plugin-client/templates/clients/fetch.source'\nimport { source as configSource } from '@kubb/plugin-client/templates/config.source'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { MutationKey, QueryKey } from './components'\nimport { mutationGenerator, queryGenerator } from './generators'\nimport { resolverSwr } from './resolvers/resolverSwr.ts'\nimport { resolverSwrLegacy } from './resolvers/resolverSwrLegacy.ts'\nimport type { PluginSwr } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-swr`, used to identify the plugin\n * in driver lookups and warnings.\n */\nexport const pluginSwrName = 'plugin-swr' satisfies PluginSwr['name']\n\n/**\n * The `@kubb/plugin-swr` plugin factory.\n *\n * Generates SWR hooks from an OpenAPI/AST `RootNode`.\n * Walks operations, delegates rendering to the active generators,\n * and writes barrel files based on `output.barrelType`.\n *\n * @example\n * ```ts\n * import { pluginSwr } from '@kubb/plugin-swr'\n *\n * export default defineConfig({\n * plugins: [pluginSwr({ output: { path: 'hooks' } })],\n * })\n * ```\n */\nexport const pluginSwr = definePlugin<PluginSwr>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n transformers = {},\n query,\n mutation,\n client,\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n mutationKey = MutationKey.getTransformer,\n queryKey = QueryKey.getTransformer,\n paramsCasing,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n compatibilityPreset = 'default',\n } = options\n\n const defaultResolver = compatibilityPreset === 'kubbV4' ? resolverSwrLegacy : resolverSwr\n\n const clientName = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientName}` : undefined)\n\n const selectedGenerators = options.generators ?? [queryGenerator, mutationGenerator].filter(Boolean)\n\n const groupConfig = group\n ? ({\n ...group,\n name: group.name\n ? group.name\n : (ctx: { group: string }) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n },\n } satisfies Group)\n : undefined\n\n return {\n name: pluginSwrName,\n options,\n dependencies: [pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n hooks: {\n 'kubb:plugin:setup'(ctx) {\n const resolver = userResolver ? { ...defaultResolver, ...userResolver } : defaultResolver\n\n ctx.setOptions({\n output,\n transformers,\n client: {\n bundle: client?.bundle,\n baseURL: client?.baseURL,\n client: clientName,\n clientType: client?.clientType ?? 'function',\n importPath: clientImportPath,\n dataReturnType: client?.dataReturnType ?? 'data',\n paramsCasing,\n },\n queryKey,\n query:\n query === false\n ? false\n : {\n importPath: 'swr',\n methods: ['get'],\n ...query,\n },\n mutationKey,\n mutation:\n mutation === false\n ? false\n : {\n importPath: 'swr/mutation',\n methods: ['post', 'put', 'delete', 'patch'],\n ...mutation,\n },\n parser,\n paramsType,\n pathParamsType,\n paramsCasing,\n group: groupConfig,\n exclude,\n include,\n override,\n resolver,\n })\n ctx.setResolver(resolver)\n if (userTransformer) {\n ctx.setTransformer(userTransformer)\n }\n for (const gen of selectedGenerators) {\n ctx.addGenerator(gen)\n }\n for (const gen of userGenerators) {\n ctx.addGenerator(gen)\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n\n const hasClientPlugin = !!ctx.config.plugins?.some((p) => (p as { name?: string }).name === pluginClientName)\n\n if (client?.bundle && !hasClientPlugin && !clientImportPath) {\n ctx.injectFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n ast.createSource({\n name: 'fetch',\n nodes: [ast.createText(clientName === 'fetch' ? fetchClientSource : axiosClientSource)],\n isExportable: true,\n isIndexable: true,\n }),\n ],\n })\n }\n\n if (!hasClientPlugin) {\n ctx.injectFile({\n baseName: 'config.ts',\n path: path.resolve(root, '.kubb/config.ts'),\n sources: [\n ast.createSource({\n name: 'config',\n nodes: [ast.createText(configSource)],\n isExportable: false,\n isIndexable: false,\n }),\n ],\n })\n }\n },\n },\n }\n})\n"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AS,CACP,IAAI,aAAa;KACf,MAAM;KACN,OAAO,CAAC,IAAI,WAAWC,SAAa,CAAC;KACrC,cAAc;KACd,aAAa;KACd,CAAC,CACH;IACF,CAAC;KAGP;EACF;EACD"}
|
|
@@ -1,83 +1,27 @@
|
|
|
1
1
|
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import {
|
|
2
|
+
import { CompatibilityPreset, Exclude, Generator, Group, Include, Output, Override, PluginFactoryOptions, ResolvePathOptions, Resolver, UserGroup, ast } from "@kubb/core";
|
|
3
3
|
import { ClientImportPath, PluginClient } from "@kubb/plugin-client";
|
|
4
|
-
import { Exclude, Include, OperationSchemas, Override, ResolvePathOptions } from "@kubb/plugin-oas";
|
|
5
|
-
import { HttpMethod, Oas, Operation, contentType } from "@kubb/oas";
|
|
6
|
-
import { Generator } from "@kubb/plugin-oas/generators";
|
|
7
|
-
import { KubbReactNode } from "@kubb/renderer-jsx/types";
|
|
8
4
|
|
|
9
|
-
//#region ../../internals/tanstack-query/src/types.d.ts
|
|
10
|
-
type ParamsCasing = 'camelcase' | undefined;
|
|
11
|
-
type PathParamsType = 'object' | 'inline';
|
|
12
|
-
type TransformerProps = {
|
|
13
|
-
operation: Operation;
|
|
14
|
-
schemas: OperationSchemas;
|
|
15
|
-
casing: ParamsCasing;
|
|
16
|
-
};
|
|
17
|
-
type Transformer = (props: TransformerProps) => unknown[];
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region ../../internals/tanstack-query/src/components/MutationKey.d.ts
|
|
20
|
-
type Props$1 = {
|
|
21
|
-
name: string;
|
|
22
|
-
typeName: string;
|
|
23
|
-
typeSchemas: OperationSchemas;
|
|
24
|
-
operation: Operation;
|
|
25
|
-
paramsCasing: ParamsCasing;
|
|
26
|
-
pathParamsType: PathParamsType;
|
|
27
|
-
transformer: Transformer | undefined;
|
|
28
|
-
};
|
|
29
|
-
type GetParamsProps$1 = {
|
|
30
|
-
pathParamsType: PathParamsType;
|
|
31
|
-
typeSchemas: OperationSchemas;
|
|
32
|
-
};
|
|
33
|
-
declare function MutationKey$1({
|
|
34
|
-
name,
|
|
35
|
-
typeSchemas,
|
|
36
|
-
pathParamsType,
|
|
37
|
-
paramsCasing,
|
|
38
|
-
operation,
|
|
39
|
-
typeName,
|
|
40
|
-
transformer
|
|
41
|
-
}: Props$1): KubbReactNode;
|
|
42
|
-
declare namespace MutationKey$1 {
|
|
43
|
-
var getParams: ({}: GetParamsProps$1) => FunctionParams;
|
|
44
|
-
var getTransformer: Transformer;
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region ../../internals/tanstack-query/src/components/QueryKey.d.ts
|
|
48
|
-
type Props = {
|
|
49
|
-
name: string;
|
|
50
|
-
typeName: string;
|
|
51
|
-
typeSchemas: OperationSchemas;
|
|
52
|
-
operation: Operation;
|
|
53
|
-
paramsCasing: ParamsCasing;
|
|
54
|
-
pathParamsType: PathParamsType;
|
|
55
|
-
transformer: Transformer | undefined;
|
|
56
|
-
};
|
|
57
|
-
type GetParamsProps = {
|
|
58
|
-
paramsCasing: ParamsCasing;
|
|
59
|
-
pathParamsType: PathParamsType;
|
|
60
|
-
typeSchemas: OperationSchemas;
|
|
61
|
-
};
|
|
62
|
-
declare function QueryKey$1({
|
|
63
|
-
name,
|
|
64
|
-
typeSchemas,
|
|
65
|
-
paramsCasing,
|
|
66
|
-
pathParamsType,
|
|
67
|
-
operation,
|
|
68
|
-
typeName,
|
|
69
|
-
transformer
|
|
70
|
-
}: Props): KubbReactNode;
|
|
71
|
-
declare namespace QueryKey$1 {
|
|
72
|
-
var getParams: ({
|
|
73
|
-
pathParamsType,
|
|
74
|
-
paramsCasing,
|
|
75
|
-
typeSchemas
|
|
76
|
-
}: GetParamsProps) => FunctionParams;
|
|
77
|
-
var getTransformer: Transformer;
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
5
|
//#region src/types.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Customizes how queryKey or mutationKey arrays are built.
|
|
8
|
+
*/
|
|
9
|
+
type Transformer = (props: {
|
|
10
|
+
node: ast.OperationNode;
|
|
11
|
+
casing: 'camelcase' | undefined;
|
|
12
|
+
}) => unknown[];
|
|
13
|
+
/**
|
|
14
|
+
* The concrete resolver type for `@kubb/plugin-swr`.
|
|
15
|
+
* Extends the base `Resolver` with a `resolveName` helper for hook function names.
|
|
16
|
+
*/
|
|
17
|
+
type ResolverSwr = Resolver & {
|
|
18
|
+
/**
|
|
19
|
+
* Resolves the hook function name for a given raw operation name.
|
|
20
|
+
* @example
|
|
21
|
+
* resolver.resolveName('show pet by id') // -> 'showPetById'
|
|
22
|
+
*/
|
|
23
|
+
resolveName(this: ResolverSwr, name: string): string;
|
|
24
|
+
};
|
|
81
25
|
/**
|
|
82
26
|
* Customize the queryKey
|
|
83
27
|
*/
|
|
@@ -91,7 +35,7 @@ type Query = {
|
|
|
91
35
|
* Define which HttpMethods can be used for queries
|
|
92
36
|
* @default ['get']
|
|
93
37
|
*/
|
|
94
|
-
methods?: Array<
|
|
38
|
+
methods?: Array<string>;
|
|
95
39
|
/**
|
|
96
40
|
* Path to the useQuery hook for useQuery functionality.
|
|
97
41
|
* Used as `import { useQuery } from '${importPath}'`.
|
|
@@ -106,7 +50,7 @@ type Mutation = {
|
|
|
106
50
|
* Define which HttpMethods can be used for queries
|
|
107
51
|
* @default ['post', 'put', 'delete', 'patch']
|
|
108
52
|
*/
|
|
109
|
-
methods?: Array<
|
|
53
|
+
methods?: Array<string>;
|
|
110
54
|
/**
|
|
111
55
|
* Path to the useQuery hook for useQuery functionality.
|
|
112
56
|
* Used as `import { useQuery } from '${importPath}'`.
|
|
@@ -128,12 +72,7 @@ type Options = {
|
|
|
128
72
|
* Specify the export location for the files and define the behavior of the output
|
|
129
73
|
* @default { path: 'hooks', barrelType: 'named' }
|
|
130
74
|
*/
|
|
131
|
-
output?: Output
|
|
132
|
-
/**
|
|
133
|
-
* Define which contentType should be used.
|
|
134
|
-
* By default, the first JSON valid mediaType is used
|
|
135
|
-
*/
|
|
136
|
-
contentType?: contentType;
|
|
75
|
+
output?: Output;
|
|
137
76
|
/**
|
|
138
77
|
* Group the SWR hooks based on the provided name.
|
|
139
78
|
*/
|
|
@@ -183,15 +122,30 @@ type Options = {
|
|
|
183
122
|
/**
|
|
184
123
|
* Customize the names based on the type that is provided by the plugin.
|
|
185
124
|
*/
|
|
186
|
-
name?: (name:
|
|
125
|
+
name?: (name: string, type?: string) => string;
|
|
187
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Apply a compatibility naming preset.
|
|
129
|
+
* @default 'default'
|
|
130
|
+
*/
|
|
131
|
+
compatibilityPreset?: CompatibilityPreset;
|
|
132
|
+
/**
|
|
133
|
+
* Override individual resolver methods. Any method you omit falls back to the
|
|
134
|
+
* preset resolver's implementation. Use `this.default(...)` to call it.
|
|
135
|
+
*/
|
|
136
|
+
resolver?: Partial<ResolverSwr> & ThisType<ResolverSwr>;
|
|
137
|
+
/**
|
|
138
|
+
* Single AST visitor applied to each node before printing.
|
|
139
|
+
* Return `null` or `undefined` from a method to leave the node unchanged.
|
|
140
|
+
*/
|
|
141
|
+
transformer?: ast.Visitor;
|
|
188
142
|
/**
|
|
189
143
|
* Define some generators next to the swr generators
|
|
190
144
|
*/
|
|
191
145
|
generators?: Array<Generator<PluginSwr>>;
|
|
192
146
|
};
|
|
193
147
|
type ResolvedOptions = {
|
|
194
|
-
output: Output
|
|
148
|
+
output: Output;
|
|
195
149
|
client: Pick<PluginClient['options'], 'client' | 'clientType' | 'dataReturnType' | 'importPath' | 'baseURL' | 'bundle' | 'paramsCasing'>;
|
|
196
150
|
parser: Required<NonNullable<Options['parser']>>;
|
|
197
151
|
queryKey: QueryKey | undefined;
|
|
@@ -201,12 +155,14 @@ type ResolvedOptions = {
|
|
|
201
155
|
paramsCasing: Options['paramsCasing'];
|
|
202
156
|
paramsType: NonNullable<Options['paramsType']>;
|
|
203
157
|
pathParamsType: NonNullable<Options['pathParamsType']>;
|
|
204
|
-
|
|
158
|
+
transformers: NonNullable<Options['transformers']>;
|
|
159
|
+
group: Group | undefined;
|
|
205
160
|
exclude: NonNullable<Options['exclude']>;
|
|
206
161
|
include: Options['include'];
|
|
207
162
|
override: NonNullable<Options['override']>;
|
|
163
|
+
resolver: ResolverSwr;
|
|
208
164
|
};
|
|
209
|
-
type PluginSwr = PluginFactoryOptions<'plugin-swr', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
165
|
+
type PluginSwr = PluginFactoryOptions<'plugin-swr', Options, ResolvedOptions, never, ResolvePathOptions, ResolverSwr>;
|
|
210
166
|
declare global {
|
|
211
167
|
namespace Kubb {
|
|
212
168
|
interface PluginRegistry {
|
|
@@ -215,5 +171,5 @@ declare global {
|
|
|
215
171
|
}
|
|
216
172
|
}
|
|
217
173
|
//#endregion
|
|
218
|
-
export {
|
|
219
|
-
//# sourceMappingURL=types-
|
|
174
|
+
export { PluginSwr as n, Transformer as r, Options as t };
|
|
175
|
+
//# sourceMappingURL=types-FA5mH9Ch.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-swr",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.35",
|
|
4
4
|
"description": "SWR hooks generator plugin for Kubb, creating type-safe data fetching hooks from OpenAPI specifications for React and Next.js applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"swr",
|
|
@@ -75,17 +75,14 @@
|
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"remeda": "^2.33.7",
|
|
78
|
-
"@kubb/
|
|
79
|
-
"@kubb/
|
|
80
|
-
"@kubb/
|
|
81
|
-
"@kubb/plugin-
|
|
82
|
-
"@kubb/
|
|
83
|
-
"@kubb/plugin-ts": "5.0.0-alpha.34",
|
|
84
|
-
"@kubb/plugin-zod": "5.0.0-alpha.34",
|
|
85
|
-
"@kubb/renderer-jsx": "5.0.0-alpha.34"
|
|
78
|
+
"@kubb/core": "5.0.0-alpha.35",
|
|
79
|
+
"@kubb/plugin-client": "5.0.0-alpha.35",
|
|
80
|
+
"@kubb/plugin-ts": "5.0.0-alpha.35",
|
|
81
|
+
"@kubb/plugin-zod": "5.0.0-alpha.35",
|
|
82
|
+
"@kubb/renderer-jsx": "5.0.0-alpha.35"
|
|
86
83
|
},
|
|
87
84
|
"peerDependencies": {
|
|
88
|
-
"@kubb/renderer-jsx": "5.0.0-alpha.
|
|
85
|
+
"@kubb/renderer-jsx": "5.0.0-alpha.35"
|
|
89
86
|
},
|
|
90
87
|
"engines": {
|
|
91
88
|
"node": ">=22"
|
|
@@ -97,7 +94,6 @@
|
|
|
97
94
|
"main": "./dist/index.cjs",
|
|
98
95
|
"module": "./dist/index.js",
|
|
99
96
|
"devDependencies": {
|
|
100
|
-
"@internals/tanstack-query": "0.0.0",
|
|
101
97
|
"@internals/utils": "0.0.0"
|
|
102
98
|
},
|
|
103
99
|
"scripts": {
|