Skip to content

fix(docs): correct plugin doc claims that contradict the source code - #157

Merged
stijnvanhulle merged 4 commits into
mainfrom
claude/docs-validation-audit-lyrcbu
Jul 18, 2026
Merged

fix(docs): correct plugin doc claims that contradict the source code#157
stijnvanhulle merged 4 commits into
mainfrom
claude/docs-validation-audit-lyrcbu

Conversation

@stijnvanhulle

@stijnvanhulle stijnvanhulle commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🎯 Changes

A docs validation audit checking documentation pages against the actual kubb and plugins source. Two groups of fixes, each confirmed against the code.

1. Individual factual errors

  • plugin-react-query — suspense-hooks recipe: said suspense is "on by default"; it defaults to false (plugin.ts, types.ts, and the options reference). Reworded.
  • plugin-react-query — infinite-scroll recipe: the config omitted hooks: true, so it would generate no file at all — infiniteQueryGenerator returns null when hooks is false. Added hooks: true.
  • plugin-zod — options reference: the output.mode table listed the default as 'directory', contradicting the prose above it and core (output.mode ?? 'file'). Corrected to 'file'.
  • plugin-zod — options reference: the ResolverZodPatch example annotated the grouped param.path / param.query / param.headers methods with individual-parameter names. Corrected to the grouped schema names the resolver returns (deletePetPathSchema, findPetsByStatusQuerySchema, deletePetHeadersSchema).
  • plugin-zod — prefix-every-schema-type-name recipe: said the schema constant is renamed via resolver.schema.type; it is named by the top-level resolver.name. Corrected the caveat.
  • plugin-fetch — index: the feature list linked #validator and #sdk as same-page anchors, but those headings live on the options reference page. Pointed both at /plugins/plugin-fetch/reference/options#….

2. Systemic: recipes showed per-file output without output.mode: 'directory'

Every plugin's output.mode defaults to 'file', which writes all generated code into one file at output.path (definePlugin.ts output.mode ?? 'file'; Resolver.ts returns output.path directly for any non-directory mode). Per-operation / per-schema layout (e.g. src/gen/zod/petSchema.ts) only happens under output.mode: 'directory', which every working example project sets.

33 recipe configs showed that per-file layout but never set the mode, so following them literally produced one merged file instead of the files shown. Added output: { path: '<plugin default>', mode: 'directory' } to the plugin whose output each recipe illustrates, matching the example projects.

Audit coverage: verified plugin option/recipe pages for the 12 published plugins plus the adapter-oas, parser-ts, parser-md, diagnostics (index + 20 codes), and configuration reference pages (all of which validated clean). One residual nuance is left for a follow-up: in the query recipes the generated hook files import per-operation client/type paths, so a fully byte-accurate reproduction would also set mode: 'directory' on the dependency pluginFetch() / pluginTs() calls, not only the subject plugin.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I am using USA English (serialize, color, center, canceled, analyze, license).
  • I ran the humanizer check on any new documentation I wrote.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SCPrdJtFTDnWFxJtzpbt6i

Validation audit of the plugin docs against the plugin/core source found
several factual errors. Fix the ones confirmed against the code:

- plugin-react-query: suspense-hooks recipe said `suspense` is on by
  default; it defaults to `false` (plugin.ts, and the reference page).
- plugin-react-query: infinite-scroll recipe config omitted `hooks: true`,
  so it would generate no file at all (infiniteQueryGenerator returns null
  when `hooks` is false).
- plugin-zod: options table listed the `output.mode` default as
  `'directory'` while the prose and core (`output.mode ?? 'file'`) say
  `'file'`.
- plugin-zod: the ResolverZodPatch example annotated the grouped
  `param.path`/`param.query`/`param.headers` methods with individual
  parameter names; corrected to the grouped schema names the resolver
  returns.
- plugin-zod: prefix-every-schema-type-name recipe said the schema constant
  is renamed via `resolver.schema.type`; it is named by the top-level
  `resolver.name`.
- plugin-fetch: index feature list linked `#validator` and `#sdk` as
  same-page anchors, but those headings live on the options reference page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCPrdJtFTDnWFxJtzpbt6i
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0682be8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

claude added 3 commits July 18, 2026 08:28
…output

Every plugin's `output.mode` defaults to `'file'`, which writes all generated
code into a single file at `output.path`. Per-operation and per-schema output
(one file per operation, e.g. `src/gen/zod/petSchema.ts`) only happens with
`output.mode: 'directory'`, which every working example project sets.

33 recipe configs showed that per-file layout but never set the mode, so
following them literally produced one merged file instead of the files shown.
Add `output: { path: '<default>', mode: 'directory' }` to the plugin whose
output each recipe illustrates, matching the example projects.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCPrdJtFTDnWFxJtzpbt6i
The barrel snippet (included into every plugin options page) listed
`{ nested: true }` as an accepted `output.barrel` value, but `type` is
required on both `BarrelConfig` and `PluginBarrelConfig` (`type: BarrelType`),
and `nested` only exists on the plugin-level config alongside `type`. List the
valid forms (`{ type: 'named' }`, `{ type: 'all' }`) and show `nested: true` as
an addition to a typed config.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCPrdJtFTDnWFxJtzpbt6i
In faker mode the generator emits the request URL as a single-quoted string
(`Mock.tsx`: `urlLiteral = fakerName ? '${requestUrl}' : \`${requestUrl}\``),
not a backtick template literal. The `['faker']` example in the options
reference used backticks, which is the data-mode form. Use single quotes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCPrdJtFTDnWFxJtzpbt6i
@stijnvanhulle
stijnvanhulle merged commit 8e80e5f into main Jul 18, 2026
1 check passed
@github-actions
github-actions Bot deleted the claude/docs-validation-audit-lyrcbu branch July 18, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants