@kubb/plugin-react-query 5.9.0-canary.20261029T142044 → 5.9.0-canary.20261029T145027
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 +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -53,19 +53,19 @@ function operationFileEntry(node, name, extname = ".ts") {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Resolves a dependency plugin's generated file for `node.operationId`, cached in `
|
|
57
|
-
*
|
|
56
|
+
* Resolves a dependency plugin's generated file for `node.operationId`, cached in `memo` (the
|
|
57
|
+
* build's `ctx.memo`) under the resolver's own plugin name and the operation. Several dependents reading the
|
|
58
58
|
* same dependency for the same operation in one pass (a query plugin's several hook generators, the
|
|
59
59
|
* MCP handler, ...) share one computed name and path instead of each calling `resolver.file` again.
|
|
60
60
|
*
|
|
61
61
|
* @example Cache `plugin-ts`'s file for the current operation
|
|
62
62
|
* ```ts
|
|
63
|
-
* const fileTs = resolveDependencyOperationFile({
|
|
63
|
+
* const fileTs = resolveDependencyOperationFile({ memo: ctx.memo, node, resolver: tsResolver, root, output })
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
66
|
function resolveDependencyOperationFile(options) {
|
|
67
|
-
const {
|
|
68
|
-
return
|
|
67
|
+
const { memo, node, resolver, root, output, group } = options;
|
|
68
|
+
return memo(`${resolver.pluginName}:operationFile:${node.operationId}`, () => resolver.file({
|
|
69
69
|
...operationFileEntry(node, node.operationId),
|
|
70
70
|
root,
|
|
71
71
|
output,
|
|
@@ -510,7 +510,7 @@ var compatibility = {
|
|
|
510
510
|
"node": ">=22.22"
|
|
511
511
|
};
|
|
512
512
|
// package.json
|
|
513
|
-
var version = "5.9.0-canary.
|
|
513
|
+
var version = "5.9.0-canary.20261029T145027";
|
|
514
514
|
// ../../internals/client/src/resolveOperationTypes.ts
|
|
515
515
|
/**
|
|
516
516
|
* A `plugin-ts` shaped resolver whose operation type names point at the types `pluginZod({ inferred })`
|
|
@@ -707,7 +707,7 @@ function resolveImportPath(options) {
|
|
|
707
707
|
* output root, the same path consumers read `RequestConfig` / `ResponseErrorConfig` from.
|
|
708
708
|
* With plugin-client they come from the user's `importPath` module instead.
|
|
709
709
|
*
|
|
710
|
-
* The result is cached in the
|
|
710
|
+
* The result is cached in `memo` (the build's `ctx.memo`) under the client plugin's name and the operation,
|
|
711
711
|
* so several dependents reading the same client plugin for one operation in a single pass
|
|
712
712
|
* (react-query's query/mutation/infinite generators, vue-query, swr, the MCP handler, ...) share
|
|
713
713
|
* one computed result instead of each re-deriving the name and path.
|
|
@@ -717,9 +717,9 @@ function resolveImportPath(options) {
|
|
|
717
717
|
* and import path therefore match the `<op>` actually emitted, even when an `override` changes it.
|
|
718
718
|
*/
|
|
719
719
|
function resolveClientOperation(options) {
|
|
720
|
-
const { clientPlugin, driver, node, root, output,
|
|
720
|
+
const { clientPlugin, driver, node, root, output, memo } = options;
|
|
721
721
|
if (!clientPlugin) return null;
|
|
722
|
-
return
|
|
722
|
+
return memo(`${clientPlugin.pluginName}:clientOperation:${node.operationId}`, () => {
|
|
723
723
|
const resolver = driver.getResolver(clientPlugin.pluginName);
|
|
724
724
|
const pluginOptions = driver.getPlugin(clientPlugin.pluginName)?.options ?? {};
|
|
725
725
|
const { exclude, include, override } = pluginOptions;
|
|
@@ -770,7 +770,7 @@ function resolveHookFile(node, ctx, options) {
|
|
|
770
770
|
group: group ?? void 0
|
|
771
771
|
});
|
|
772
772
|
const fileTs = resolveDependencyOperationFile({
|
|
773
|
-
|
|
773
|
+
memo: ctx.memo,
|
|
774
774
|
node,
|
|
775
775
|
resolver: tsResolver,
|
|
776
776
|
root,
|
|
@@ -1856,7 +1856,7 @@ function createQueryGenerator({ name, variant }) {
|
|
|
1856
1856
|
node,
|
|
1857
1857
|
root,
|
|
1858
1858
|
output,
|
|
1859
|
-
|
|
1859
|
+
memo: ctx.memo
|
|
1860
1860
|
});
|
|
1861
1861
|
if (!contractOp) return null;
|
|
1862
1862
|
const importPath = query ? query.importPath : "@tanstack/react-query";
|
|
@@ -2113,7 +2113,7 @@ const mutationGenerator = (0, _kubb_kit.defineGenerator)({
|
|
|
2113
2113
|
node,
|
|
2114
2114
|
root,
|
|
2115
2115
|
output,
|
|
2116
|
-
|
|
2116
|
+
memo: ctx.memo
|
|
2117
2117
|
});
|
|
2118
2118
|
if (!contractOp) return null;
|
|
2119
2119
|
const mutationHookName = resolver.mutation.name(node);
|