fix(docs): correct plugin doc claims that contradict the source code - #157
Merged
Conversation
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
|
…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
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
A docs validation audit checking documentation pages against the actual
kubbandpluginssource. Two groups of fixes, each confirmed against the code.1. Individual factual errors
suspenseis "on by default"; it defaults tofalse(plugin.ts,types.ts, and the options reference). Reworded.hooks: true, so it would generate no file at all —infiniteQueryGeneratorreturnsnullwhenhooksisfalse. Addedhooks: true.output.modetable listed the default as'directory', contradicting the prose above it and core (output.mode ?? 'file'). Corrected to'file'.ResolverZodPatchexample annotated the groupedparam.path/param.query/param.headersmethods with individual-parameter names. Corrected to the grouped schema names the resolver returns (deletePetPathSchema,findPetsByStatusQuerySchema,deletePetHeadersSchema).resolver.schema.type; it is named by the top-levelresolver.name. Corrected the caveat.#validatorand#sdkas 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.modedefaults to'file', which writes all generated code into one file atoutput.path(definePlugin.tsoutput.mode ?? 'file';Resolver.tsreturnsoutput.pathdirectly for any non-directorymode). Per-operation / per-schema layout (e.g.src/gen/zod/petSchema.ts) only happens underoutput.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.✅ Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01SCPrdJtFTDnWFxJtzpbt6i