refactor(resolvers): share naming templates via internal resolver bases - #668
Merged
Merged
Conversation
Dedupe the resolver naming that repeated across plugins: - @internals/utils gains capitalize; react-query/swr/vue-query drop their identical local copies - @internals/tanstack-query gains createQueryResolver/createMutationResolver, consumed by plugin-react-query, plugin-swr, and plugin-vue-query - @internals/shared gains createOperationParamResolver, createOperationResponseResolver, operationParamName, and createCasedFile, consumed by plugin-ts, plugin-zod, and plugin-faker - Export the default resolver and its type from plugin-react-query, plugin-vue-query, plugin-swr, and plugin-msw for parity with the other plugins Generated output is unchanged: full test suite passes without snapshot updates and regenerating the examples produces an empty diff. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Hmj6RxUuXceRrDgfze9i6
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: fb9ecd1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
More templates
@kubb/plugin-axios
@kubb/plugin-cypress
@kubb/plugin-faker
@kubb/plugin-fetch
@kubb/plugin-mcp
@kubb/plugin-msw
@kubb/plugin-react-query
@kubb/plugin-redoc
@kubb/plugin-swr
@kubb/plugin-ts
@kubb/plugin-vue-query
@kubb/plugin-zod
commit: |
Contributor
|
Size Change: +3.63 kB (+1.14%) Total Size: 322 kB 📦 View Changed
ℹ️ View Unchanged
|
…rn-migration-6469mv # Conflicts: # internals/shared/src/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
The resolver rollout left the same naming templates copied across plugins. This PR moves them into shared internal bases so each resolver only states what is plugin-specific, with zero change to generated output.
@internals/utilsgainscapitalize, replacing the identical local helper in the react-query, swr, and vue-query resolvers.@internals/tanstack-querygainscreateQueryResolver(variant)andcreateMutationResolver(), which now back thequery,suspenseQuery,infiniteQuery,suspenseInfiniteQuery, andmutationnamespaces of plugin-react-query, plugin-swr, and plugin-vue-query.@internals/sharedgainscreateOperationParamResolver(),createOperationResponseResolver(),operationParamName, andcreateCasedFile(caseLast), which now back theparam,response, andfilenamespaces of plugin-ts, plugin-zod, and plugin-faker. Plugin-specific methods (response.optionsin ts,response.errorand the per-paramparam.path/query/headersin zod) stay local.@internals/utilsdevDependency.Zero behavior change: the full suite (1238 tests) passes without snapshot updates, and regenerating every example produces an empty git diff.
✅ Checklist
pnpm run test.🚀 Release Impact
🤖 Generated with Claude Code
https://claude.ai/code/session_016Hmj6RxUuXceRrDgfze9i6
Generated by Claude Code