@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.cjs
CHANGED
|
@@ -335,6 +335,9 @@ function createGroupConfig(group) {
|
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
337
|
//#endregion
|
|
338
|
+
//#region package.json
|
|
339
|
+
var version = "5.2.2";
|
|
340
|
+
//#endregion
|
|
338
341
|
//#region ../../internals/client/src/resolveClient.ts
|
|
339
342
|
/**
|
|
340
343
|
* Resolves which client plugin a consumer (react-query, vue-query, swr, mcp) should call for an
|
|
@@ -1297,41 +1300,39 @@ const pluginSwrName = "plugin-swr";
|
|
|
1297
1300
|
* })
|
|
1298
1301
|
* ```
|
|
1299
1302
|
*/
|
|
1300
|
-
const pluginSwr = (0, kubb_kit.definePlugin)(
|
|
1301
|
-
|
|
1302
|
-
path: "hooks",
|
|
1303
|
-
barrel: { type: "named" }
|
|
1304
|
-
}, group, exclude = [], include, override = [], mutation = {}, query = {}, mutationKey = mutationKeyTransformer, queryKey = queryKeyTransformer, client, resolver: userResolver, macros: userMacros } = options;
|
|
1305
|
-
const selectedGenerators = [queryGenerator, mutationGenerator];
|
|
1306
|
-
const groupConfig = createGroupConfig(group) ?? void 0;
|
|
1307
|
-
return {
|
|
1303
|
+
const pluginSwr = (0, kubb_kit.definePlugin)({
|
|
1304
|
+
meta: {
|
|
1308
1305
|
name: pluginSwrName,
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
})
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1306
|
+
version,
|
|
1307
|
+
compatibility: { kubb: ">=5.8.0" }
|
|
1308
|
+
},
|
|
1309
|
+
dependencies: { [_kubb_plugin_ts.pluginTsName]: {} },
|
|
1310
|
+
setup(options) {
|
|
1311
|
+
const { output = {
|
|
1312
|
+
path: "hooks",
|
|
1313
|
+
barrel: { type: "named" }
|
|
1314
|
+
}, group, exclude = [], include, override = [], mutation = {}, query = {}, mutationKey = mutationKeyTransformer, queryKey = queryKeyTransformer, client, resolver: userResolver, macros: userMacros } = options;
|
|
1315
|
+
const resolver = userResolver ? kubb_kit.Resolver.merge(resolverSwr, userResolver) : resolverSwr;
|
|
1316
|
+
(0, kubb_kit.setResolver)(resolver);
|
|
1317
|
+
if (userMacros?.length) (0, kubb_kit.setMacros)(userMacros);
|
|
1318
|
+
(0, kubb_kit.addGenerator)(queryGenerator, mutationGenerator);
|
|
1319
|
+
return {
|
|
1320
|
+
output,
|
|
1321
|
+
client: resolveContractClient({
|
|
1322
|
+
client,
|
|
1323
|
+
plugins: (0, kubb_kit.useConfig)().plugins
|
|
1324
|
+
}),
|
|
1325
|
+
queryKey,
|
|
1326
|
+
query: resolveQueryConfig(query, { importPath: "swr" }),
|
|
1327
|
+
mutationKey,
|
|
1328
|
+
mutation: resolveMutationConfig(mutation, { importPath: "swr/mutation" }),
|
|
1329
|
+
group: createGroupConfig(group) ?? void 0,
|
|
1330
|
+
exclude,
|
|
1331
|
+
include,
|
|
1332
|
+
override,
|
|
1333
|
+
resolver
|
|
1334
|
+
};
|
|
1335
|
+
}
|
|
1335
1336
|
});
|
|
1336
1337
|
//#endregion
|
|
1337
1338
|
exports.default = pluginSwr;
|