Skip to content

docs: document the match predicate on generators and macros - #158

Merged
stijnvanhulle merged 1 commit into
mainfrom
claude/generator-macro-match-docs
Jul 18, 2026
Merged

docs: document the match predicate on generators and macros#158
stijnvanhulle merged 1 commit into
mainfrom
claude/generator-macro-match-docs

Conversation

@stijnvanhulle

Copy link
Copy Markdown
Contributor

🎯 Changes

kubb-labs/kubb#3828 adds an optional match(node, ctx) predicate to Generator: a generator whose match returns false is skipped for that node entirely, instead of being called and bailing out itself. The same PR renames Macro's when gate to match for the same reason (when hadn't shipped in any release yet).

  • reference/kit/generators.md: new "Scoping with match" section, with a short example
  • guide/concepts/generators.md: a short conceptual pointer to it, next to the existing "What each method handles" section
  • snippets/how-to/macros.md: whenmatch throughout (type definition, prose, and the enforce.ts example)

Depends on kubb-labs/kubb#3828 merging and releasing before match is real. No urgency to merge this ahead of that, but the content is accurate to the shipped API design either way.

✅ 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 by Claude Code

kubb-labs/kubb#3828 adds an optional match(node, ctx) predicate to
Generator, letting a generator declare its own scope instead of running
for every node and bailing out itself. It also renames Macro's when
gate to match for the same reason, since when hadn't shipped in any
release yet.

- reference/kit/generators.md: new "Scoping with match" section
- guide/concepts/generators.md: short conceptual pointer to it
- snippets/how-to/macros.md: when -> match throughout

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LnAWjXX2zoWWScgn7NsLaf
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 651a4cd

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

@stijnvanhulle
stijnvanhulle merged commit af6bf7d into main Jul 18, 2026
1 check passed
@github-actions
github-actions Bot deleted the claude/generator-macro-match-docs branch July 18, 2026 13:36
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