Skip to content

refactor: remove unused exports flagged by Fallow - #670

Merged
stijnvanhulle merged 1 commit into
mainfrom
claude/fallow-dead-code-dupes-9hrjui
Jul 11, 2026
Merged

refactor: remove unused exports flagged by Fallow#670
stijnvanhulle merged 1 commit into
mainfrom
claude/fallow-dead-code-dupes-9hrjui

Conversation

@stijnvanhulle

Copy link
Copy Markdown
Contributor

🎯 Changes

Ran Fallow (fallow dead-code --format json --quiet --unused-exports and fallow dupes --mode mild) over the repo. It flagged 1676 unused exports, but nearly all of them live in Kubb-generated output (tests/3.0.x, examples/*, __snapshots__) that has to stay as-is. This PR fixes the hand-written ones:

  • packages/plugin-ts/src/factory.ts: 14 factory helpers (createIndexSignature, createTypeAliasDeclaration, createInterfaceDeclaration, and the factory.* aliases like createIdentifier, createTrue, createFalse) are now module-private, and the unused export { SyntaxKind } statement is gone. Every one of them is still used inside the file; nothing imported them from outside, including factory.test.ts.
  • packages/plugin-react-query/src/utils.ts: drops the export { resolveErrorNames, resolveSuccessNames } re-export. Both are still imported and used internally by buildResponseTypes.
  • packages/plugin-swr/src/utils.ts: drops the unused resolveOperationOverrides re-export.
  • packages/plugin-vue-query/src/utils.ts: drops the unused buildQueryKeyParams and resolveOperationOverrides re-exports.
  • configs/mocks.ts: deletes the unused mockedPluginDriver and its now-unneeded import.

None of these symbols are reachable through a package's public exports map (each plugin exposes only .), so the published API is unchanged. A changeset with patch bumps for the four touched packages is included.

Duplication scan for reference (fallow dupes): the biggest hand-written clone families are the serializers.ts template shared verbatim between plugin-axios and plugin-fetch (427 lines), large shared blocks between templates/axios.ts and templates/fetch.ts, and the InfiniteQueryOptions/SuspenseInfiniteQueryOptions components in react-query/vue-query. Consolidating those is a bigger refactor left out of this PR.

Verified with pnpm turbo run typecheck and test for the four packages (all green), pnpm lint, and pnpm format. A rerun of Fallow reports no remaining unused exports in packages/, internals/, or configs/.

✅ 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_014dHSbuoSN5pYaXowWwZj5B


Generated by Claude Code

Fallow (fallow dead-code --unused-exports) flagged 1676 unused exports;
all but a handful sit in generated tests/, examples/, and __snapshots__
output that stays as-is. The hand-written ones are fixed here: plugin-ts
factory helpers become module-private, the react-query/swr/vue-query
utils drop re-exports nothing imports, and the unused mockedPluginDriver
mock is deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014dHSbuoSN5pYaXowWwZj5B
@codesandbox

codesandbox Bot commented Jul 11, 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 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8ed9772

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

This PR includes changesets to release 13 packages
Name Type
@kubb/plugin-ts Patch
@kubb/plugin-react-query Patch
@kubb/plugin-swr Patch
@kubb/plugin-vue-query Patch
@kubb/plugin-axios Patch
@kubb/plugin-cypress Patch
@kubb/plugin-faker Patch
@kubb/plugin-fetch Patch
@kubb/plugin-mcp Patch
@kubb/plugin-msw Patch
tests-3.0.x Patch
e2e 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:M This PR changes 30-99 lines, ignoring generated files. label Jul 11, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 11, 2026

Copy link
Copy Markdown
More templates

@kubb/plugin-axios

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

@kubb/plugin-cypress

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

@kubb/plugin-faker

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

@kubb/plugin-fetch

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

@kubb/plugin-mcp

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

@kubb/plugin-msw

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

@kubb/plugin-react-query

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

@kubb/plugin-redoc

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

@kubb/plugin-swr

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

@kubb/plugin-ts

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

@kubb/plugin-vue-query

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

@kubb/plugin-zod

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

commit: 8ed9772

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: -241 B (-0.08%)

Total Size: 319 kB

📦 View Changed
Filename Size Change
packages/plugin-ts/dist/index.cjs 23.1 kB -117 B (-0.5%)
packages/plugin-ts/dist/index.js 22.5 kB -124 B (-0.55%)
ℹ️ 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/index.cjs 13.8 kB
packages/plugin-faker/dist/index.js 13.7 kB
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/index.cjs 7.31 kB
packages/plugin-msw/dist/index.js 7.23 kB
packages/plugin-msw/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-react-query/dist/index.cjs 18.6 kB
packages/plugin-react-query/dist/index.js 18.1 kB
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/index.cjs 12.7 kB
packages/plugin-swr/dist/index.js 12.2 kB
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/index.cjs 14.9 kB
packages/plugin-vue-query/dist/index.js 14.4 kB
packages/plugin-vue-query/dist/rolldown-runtime-C0LytTxp.js 168 B
packages/plugin-zod/dist/index.cjs 16.7 kB
packages/plugin-zod/dist/index.js 16.5 kB
packages/plugin-zod/dist/rolldown-runtime-C0LytTxp.js 168 B

compressed-size-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants