@kubb/plugin-swr 5.2.1 → 5.2.2
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 +35 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +36 -35
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { Resolver, Url, ast, createResolver, defineGenerator, definePlugin } from "kubb/kit";
|
|
2
|
+
import { Resolver, Url, addGenerator, ast, createResolver, defineGenerator, definePlugin, setMacros, setResolver, useConfig } from "kubb/kit";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createFunctionParameter, createFunctionParameters, createObjectBindingPattern, createTypeLiteral, functionPrinter, pluginTsName } from "@kubb/plugin-ts";
|
|
5
5
|
import { File, Function, Type, jsxRenderer } from "kubb/jsx";
|
|
@@ -305,6 +305,9 @@ function createGroupConfig(group) {
|
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
//#endregion
|
|
308
|
+
//#region package.json
|
|
309
|
+
var version = "5.2.2";
|
|
310
|
+
//#endregion
|
|
308
311
|
//#region ../../internals/client/src/resolveClient.ts
|
|
309
312
|
/**
|
|
310
313
|
* Resolves which client plugin a consumer (react-query, vue-query, swr, mcp) should call for an
|
|
@@ -1267,41 +1270,39 @@ const pluginSwrName = "plugin-swr";
|
|
|
1267
1270
|
* })
|
|
1268
1271
|
* ```
|
|
1269
1272
|
*/
|
|
1270
|
-
const pluginSwr = definePlugin(
|
|
1271
|
-
|
|
1272
|
-
path: "hooks",
|
|
1273
|
-
barrel: { type: "named" }
|
|
1274
|
-
}, group, exclude = [], include, override = [], mutation = {}, query = {}, mutationKey = mutationKeyTransformer, queryKey = queryKeyTransformer, client, resolver: userResolver, macros: userMacros } = options;
|
|
1275
|
-
const selectedGenerators = [queryGenerator, mutationGenerator];
|
|
1276
|
-
const groupConfig = createGroupConfig(group) ?? void 0;
|
|
1277
|
-
return {
|
|
1273
|
+
const pluginSwr = definePlugin({
|
|
1274
|
+
meta: {
|
|
1278
1275
|
name: pluginSwrName,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
})
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1276
|
+
version,
|
|
1277
|
+
compatibility: { kubb: ">=5.8.0" }
|
|
1278
|
+
},
|
|
1279
|
+
dependencies: { [pluginTsName]: {} },
|
|
1280
|
+
setup(options) {
|
|
1281
|
+
const { output = {
|
|
1282
|
+
path: "hooks",
|
|
1283
|
+
barrel: { type: "named" }
|
|
1284
|
+
}, group, exclude = [], include, override = [], mutation = {}, query = {}, mutationKey = mutationKeyTransformer, queryKey = queryKeyTransformer, client, resolver: userResolver, macros: userMacros } = options;
|
|
1285
|
+
const resolver = userResolver ? Resolver.merge(resolverSwr, userResolver) : resolverSwr;
|
|
1286
|
+
setResolver(resolver);
|
|
1287
|
+
if (userMacros?.length) setMacros(userMacros);
|
|
1288
|
+
addGenerator(queryGenerator, mutationGenerator);
|
|
1289
|
+
return {
|
|
1290
|
+
output,
|
|
1291
|
+
client: resolveContractClient({
|
|
1292
|
+
client,
|
|
1293
|
+
plugins: useConfig().plugins
|
|
1294
|
+
}),
|
|
1295
|
+
queryKey,
|
|
1296
|
+
query: resolveQueryConfig(query, { importPath: "swr" }),
|
|
1297
|
+
mutationKey,
|
|
1298
|
+
mutation: resolveMutationConfig(mutation, { importPath: "swr/mutation" }),
|
|
1299
|
+
group: createGroupConfig(group) ?? void 0,
|
|
1300
|
+
exclude,
|
|
1301
|
+
include,
|
|
1302
|
+
override,
|
|
1303
|
+
resolver
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1305
1306
|
});
|
|
1306
1307
|
//#endregion
|
|
1307
1308
|
export { pluginSwr as default, pluginSwr, pluginSwrName, resolverSwr };
|