Skip to content

refactor(resolvers): share naming templates via internal resolver bases - #668

Merged
stijnvanhulle merged 2 commits into
mainfrom
claude/resolver-pattern-migration-6469mv
Jul 12, 2026
Merged

refactor(resolvers): share naming templates via internal resolver bases#668
stijnvanhulle merged 2 commits into
mainfrom
claude/resolver-pattern-migration-6469mv

Conversation

@stijnvanhulle

Copy link
Copy Markdown
Contributor

🎯 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/utils gains capitalize, replacing the identical local helper in the react-query, swr, and vue-query resolvers.
  • @internals/tanstack-query gains createQueryResolver(variant) and createMutationResolver(), which now back the query, suspenseQuery, infiniteQuery, suspenseInfiniteQuery, and mutation namespaces of plugin-react-query, plugin-swr, and plugin-vue-query.
  • @internals/shared gains createOperationParamResolver(), createOperationResponseResolver(), operationParamName, and createCasedFile(caseLast), which now back the param, response, and file namespaces of plugin-ts, plugin-zod, and plugin-faker. Plugin-specific methods (response.options in ts, response.error and the per-param param.path/query/headers in zod) stay local.
  • plugin-react-query, plugin-vue-query, plugin-swr, and plugin-msw now export their default resolver and its type from the package index, matching plugin-ts, plugin-zod, plugin-faker, plugin-mcp, and plugin-cypress.
  • plugin-swr declares its missing @internals/utils devDependency.

Zero behavior change: the full suite (1238 tests) passes without snapshot updates, and regenerating every example produces an empty git diff.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is for the docs (no release).

🤖 Generated with Claude Code

https://claude.ai/code/session_016Hmj6RxUuXceRrDgfze9i6


Generated by Claude Code

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
@codesandbox

codesandbox Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fb9ecd1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@kubb/plugin-react-query Patch
@kubb/plugin-vue-query Patch
@kubb/plugin-swr Patch
@kubb/plugin-msw Patch
@kubb/plugin-ts Patch
@kubb/plugin-zod Patch
@kubb/plugin-faker Patch
tests-3.0.x Patch
e2e Patch
@kubb/plugin-axios Patch
@kubb/plugin-cypress Patch
@kubb/plugin-fetch Patch
@kubb/plugin-mcp Patch
performance Patch

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

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jul 10, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 10, 2026

Copy link
Copy Markdown
More templates

@kubb/plugin-axios

npm i https://pkg.pr.new/@kubb/plugin-axios@668

@kubb/plugin-cypress

npm i https://pkg.pr.new/@kubb/plugin-cypress@668

@kubb/plugin-faker

npm i https://pkg.pr.new/@kubb/plugin-faker@668

@kubb/plugin-fetch

npm i https://pkg.pr.new/@kubb/plugin-fetch@668

@kubb/plugin-mcp

npm i https://pkg.pr.new/@kubb/plugin-mcp@668

@kubb/plugin-msw

npm i https://pkg.pr.new/@kubb/plugin-msw@668

@kubb/plugin-react-query

npm i https://pkg.pr.new/@kubb/plugin-react-query@668

@kubb/plugin-redoc

npm i https://pkg.pr.new/@kubb/plugin-redoc@668

@kubb/plugin-swr

npm i https://pkg.pr.new/@kubb/plugin-swr@668

@kubb/plugin-ts

npm i https://pkg.pr.new/@kubb/plugin-ts@668

@kubb/plugin-vue-query

npm i https://pkg.pr.new/@kubb/plugin-vue-query@668

@kubb/plugin-zod

npm i https://pkg.pr.new/@kubb/plugin-zod@668

commit: fb9ecd1

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Size Change: +3.63 kB (+1.14%)

Total Size: 322 kB

📦 View Changed
Filename Size Change
packages/plugin-faker/dist/index.cjs 13.8 kB +359 B (+2.67%)
packages/plugin-faker/dist/index.js 13.7 kB +346 B (+2.59%)
packages/plugin-msw/dist/index.cjs 7.31 kB +5 B (+0.07%)
packages/plugin-msw/dist/index.js 7.23 kB +2 B (+0.03%)
packages/plugin-react-query/dist/index.cjs 18.9 kB +232 B (+1.24%)
packages/plugin-react-query/dist/index.js 18.3 kB +234 B (+1.29%)
packages/plugin-swr/dist/index.cjs 13 kB +270 B (+2.13%)
packages/plugin-swr/dist/index.js 12.5 kB +266 B (+2.18%)
packages/plugin-ts/dist/index.cjs 23.3 kB +340 B (+1.48%)
packages/plugin-ts/dist/index.js 22.6 kB +339 B (+1.52%)
packages/plugin-vue-query/dist/index.cjs 15.2 kB +302 B (+2.03%)
packages/plugin-vue-query/dist/index.js 14.7 kB +290 B (+2.01%)
packages/plugin-zod/dist/index.cjs 17.1 kB +323 B (+1.93%)
packages/plugin-zod/dist/index.js 16.9 kB +322 B (+1.94%)
ℹ️ View Unchanged
Filename Size
packages/plugin-axios/dist/index.cjs 16.2 kB
packages/plugin-axios/dist/index.js 15.7 kB
packages/plugin-axios/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-cypress/dist/index.cjs 7.74 kB
packages/plugin-cypress/dist/index.js 7.67 kB
packages/plugin-cypress/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-faker/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-fetch/dist/index.cjs 16.2 kB
packages/plugin-fetch/dist/index.js 15.7 kB
packages/plugin-fetch/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-mcp/dist/index.cjs 11.5 kB
packages/plugin-mcp/dist/index.js 11 kB
packages/plugin-mcp/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-msw/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-react-query/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-redoc/dist/index.cjs 2.21 kB
packages/plugin-redoc/dist/index.js 1.75 kB
packages/plugin-redoc/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-swr/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-ts/dist/rolldown-runtime-CNktS9qV.js 291 B
packages/plugin-vue-query/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-zod/dist/rolldown-runtime-C0LytTxp.js 168 B

compressed-size-action

…rn-migration-6469mv

# Conflicts:
#	internals/shared/src/index.ts
@stijnvanhulle
stijnvanhulle merged commit 71e2231 into main Jul 12, 2026
15 checks passed
@stijnvanhulle
stijnvanhulle deleted the claude/resolver-pattern-migration-6469mv branch July 12, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants