Repository navigation
[config-examples] feat: generate config option examples from real plugin output - #11133
Merged
Merged
Conversation
|
eddeee888
commented
Nov 28, 2026
Contributor
|
📖 Docs preview (rebuilds on every push, ready ~10 min after each): https://codegen-pr-11133.guild-dev-website.pages.dev/graphql/codegen |
eddeee888
force-pushed
the
claude/nifty-hypatia-mzh87f
branch
from
November 29, 2026 05:46
bd8d173 to
95fc602
Compare
AGENTS.md is an index of agent guides. Its first guide, agents/config-options.md, covers adding a plugin config option end to end: the JSDoc to write, the generated example every documented option needs, and regenerating the docs schema. Skill: cops:pr-wrap-up Approved-by: eddeee888 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NyYayEf5cspZ28zZjXzjuc
Register @graphql-codegen/config-examples: private, not built (`bob: false`), with the plugin, plugin-helpers and prettier it uses as devDependencies. Skill: cops:pr-wrap-up Approved-by: eddeee888 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NyYayEf5cspZ28zZjXzjuc
src/typescript-operations.spec.ts lists one minimal schema, operation and set of configs per documented typescript-operations option. It runs the plugin once per config and writes each option's examples to src/__examples__/typescript-operations/<option>.md as one tab per config, formatted with the repo's Prettier config. src/utils/render.ts renders the Markdown. The spec fails when a documented option has no example (an option can be skipped with a reason, as ignoreEnumValuesFromSchema is pending #11134), when an example's first config is not the option's default, or when a generated file is stale. Skill: cops:pr-wrap-up Approved-by: eddeee888 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NyYayEf5cspZ28zZjXzjuc
generate-config-schema appends each option's generated examples to its `exampleMarkdown`, in a collapsed "Generated output" section, so the docs' Config API Reference shows real plugin output. A new Config Docs Check CI job runs the config-examples tests, regenerates website/config.schema.json and fails if it differs from the committed file. Skill: cops:pr-wrap-up Approved-by: eddeee888 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NyYayEf5cspZ28zZjXzjuc
eddeee888
force-pushed
the
claude/nifty-hypatia-mzh87f
branch
from
November 29, 2026 05:56
95fc602 to
1692bc5
Compare
This was referenced Nov 29, 2026
eddeee888
commented
Nov 29, 2026
3 of 4 tasks
pnpm/setup installs pnpm (from packageManager) and Node in one step and runs `pnpm install`, replacing pnpm/action-setup, actions/setup-node and the install step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NyYayEf5cspZ28zZjXzjuc
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.
Note
Opened on autopilot by Code Ops plugin;
Description
Config option examples written by hand drift from what plugins generate. In the first draft of #11132, the
arrayInputCoercionlabels were swapped. This PR generates the examples by running the plugin, checks them in CI, shows them in the docs, and gives agents a guide to follow when they add or change an option.Main
packages/utils/config-examples(bob: false).src/typescript-operations.spec.tshas one example per documentedtypescript-operationsoption: a minimal schema, an operation and a list of configs. The first config must equal the default, and an option is skipped only withskipand a reason.src/utils/render.tsrenders one tab per config, labelled with the config as JSON. The output is written tosrc/__examples__/typescript-operations/<option>.mdand formatted with the repo's Prettier config. A config that makes the plugin throw is shown as// throws: <message>in its tab, not reported as a test failure.website/config.schema.jsonand fails on a missing example. Stale generated files also fail.ignoreEnumValuesFromSchemais skipped: its default is under discussion in [typescript-operations] Enums use the schema's internal (server-side) enum values by default #11134.website/scripts/generate-config-schema.tsappends each option's examples to itsexampleMarkdownin a collapsed<details>"Generated output" section, and throws when an examples file names an option the plugin doesn't have.website/config.schema.jsonis regenerated..github/workflows/main.ymlruns the config-examples tests, regenerates the schema and fails on a diff.AGENTS.mdis an index of agent guides. Its first entry isagents/config-options.md, which covers adding a config option end to end, including its example.Drive-by
pnpm-lock.yamlcarries a ~1,500-linepnpm deduperewrite. The repo's pre-commit hook runspnpm dedupewhenever the lockfile is staged, and master's lockfile no longer passespnpm dedupe --check, so adding the new package to the workspace forced it.Follow-up: the tab UI needs a small change in
the-guild-org/website(thePluginHeader.astroscript that turns[data-code-tabs]into tabs). Until then the docs show each config's code block under its label.Related #11132
Type of change
How Has This Been Tested?
pnpm vitest run packages/utils/config-examples packages/plugins/typescript/operationspasses (276 tests).pnpm prettier:checkandpnpm types:checkpass.the-guild-org/website.https://claude.ai/code/session_01NyYayEf5cspZ28zZjXzjuc
Generated by Claude Code