Skip to content

[config-examples] feat: generate config option examples from real plugin output - #11133

Merged
eddeee888 merged 5 commits into
masterfrom
claude/nifty-hypatia-mzh87f
Nov 29, 2026
Merged

eddeee888 merged 5 commits into
masterfrom
claude/nifty-hypatia-mzh87f

Conversation

@eddeee888

@eddeee888 eddeee888 commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

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 arrayInputCoercion labels 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

  • New private package packages/utils/config-examples (bob: false). src/typescript-operations.spec.ts has one example per documented typescript-operations option: a minimal schema, an operation and a list of configs. The first config must equal the default, and an option is skipped only with skip and a reason.
  • src/utils/render.ts renders one tab per config, labelled with the config as JSON. The output is written to src/__examples__/typescript-operations/<option>.md and 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.
  • A coverage test reads the documented options from website/config.schema.json and fails on a missing example. Stale generated files also fail.
  • ignoreEnumValuesFromSchema is 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.ts appends each option's examples to its exampleMarkdown in a collapsed <details> "Generated output" section, and throws when an examples file names an option the plugin doesn't have. website/config.schema.json is regenerated.
  • CI: a new "Config Docs Check" job in .github/workflows/main.yml runs the config-examples tests, regenerates the schema and fails on a diff.
  • AGENTS.md is an index of agent guides. Its first entry is agents/config-options.md, which covers adding a config option end to end, including its example.

Drive-by

  • pnpm-lock.yaml carries a ~1,500-line pnpm dedupe rewrite. The repo's pre-commit hook runs pnpm dedupe whenever the lockfile is staged, and master's lockfile no longer passes pnpm 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 (the PluginHeader.astro script 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

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • pnpm vitest run packages/utils/config-examples packages/plugins/typescript/operations passes (276 tests).
  • pnpm prettier:check and pnpm types:check pass.
  • The website schema was regenerated with no diff.
  • Rendered locally in the-guild-org/website.

https://claude.ai/code/session_01NyYayEf5cspZ28zZjXzjuc


Generated by Claude Code

@changeset-bot

changeset-bot Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: cb37387

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@eddeee888 eddeee888 added the autopilot Experimental AI PRs label Nov 28, 2026 — with Claude
@eddeee888 eddeee888 self-assigned this Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview (rebuilds on every push, ready ~10 min after each): https://codegen-pr-11133.guild-dev-website.pages.dev/graphql/codegen

@eddeee888
eddeee888 force-pushed the claude/nifty-hypatia-mzh87f branch from bd8d173 to 95fc602 Compare November 29, 2026 05:46
@eddeee888 eddeee888 changed the title [testing] feat: generate config option examples from real plugin output [config-examples] feat: generate config option examples from real plugin output Nov 29, 2026
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
Comment thread .github/workflows/main.yml Resolved
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
@eddeee888
eddeee888 marked this pull request as ready for review November 29, 2026 09:31
@eddeee888
eddeee888 merged commit 9ed9eb6 into master Nov 29, 2026
20 checks passed
@eddeee888
eddeee888 deleted the claude/nifty-hypatia-mzh87f branch November 29, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autopilot Experimental AI PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants