Skip to content

Add ChildrenTypeRegistry so consumers type mdx children once per project#138

Merged
KayleeWilliams merged 4 commits into
mainfrom
KayleeWilliams/mdx-children-registry
Jul 7, 2026
Merged

Add ChildrenTypeRegistry so consumers type mdx children once per project#138
KayleeWilliams merged 4 commits into
mainfrom
KayleeWilliams/mdx-children-registry

Conversation

@KayleeWilliams

Copy link
Copy Markdown
Collaborator

Summary

Closes #136 — resolves the children as ReactNode paper cut the snippet typechecker surfaced, with the registry-augmentation shape.

  • New ChildrenTypeRegistry interface (empty by default) + TagChildren resolved type exported from leadtype/mdx; all 17 children?: unknown fields across the tag prop contracts become children?: TagChildren. Non-breaking: with no augmentation, TagChildren resolves to unknown — exactly the previous behavior (guarded by a type-level test).

  • Consumers register their renderer's child type once per project:

    declare module "leadtype/mdx" {
      interface ChildrenTypeRegistry { type: import("react").ReactNode }
    }

    and every component gets typed children with no casts — leadtype still ships zero renderer dependencies (the core/adapter boundary test even flagged a React mention in a source docblock during development; the in-source examples are framework-neutral, the copy-pasteable React version lives in the docs).

  • Verified the augmentation merges through the rolled-up dist types with a scratch consumer asserting a real type error appears once string is registered.

  • Docs updated: reference/mdx typing guidance leads with the registry, and the Fumadocs integration example uses the augmentation instead of the cast — so our own snippet typechecker validates the pattern in the exact consumer scenario on every lint run.

Validation

  • Scratch-consumer proof against dist/mdx/index.d.ts (@ts-expect-error held once string was registered)
  • leadtype lint (snippet typecheck) — all 51 files pass with the new example shapes
  • bun test packages/leadtype + check-types + ultracite clean; core/adapter boundary test green
  • Commit hook: full bun test suite passed

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 126ca3e7-fa51-4dc8-8a3a-28f32b1a39c3

📥 Commits

Reviewing files that changed from the base of the PR and between fb7ecfb and 10a535a.

📒 Files selected for processing (7)
  • .changeset/mdx-children-registry.md
  • docs/integrations/integrate-with-fumadocs.mdx
  • docs/paths.lock.json
  • docs/reference/mdx.mdx
  • packages/leadtype/src/mdx/index.ts
  • packages/leadtype/src/mdx/tag-types.test.ts
  • packages/leadtype/src/mdx/tag-types.ts
📜 Recent review details
⚠️ CI failures not shown inline (2)

GitHub Actions: CI / Validate & test: Add ChildrenTypeRegistry so consumers type mdx children once per project

Conclusion: failure

View job details

##[group]Run bun run --filter leadtype test
 �[36;1mbun run --filter leadtype test�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 leadtype test:
 leadtype test: �[1m�[30m�[46m RUN �[49m�[39m�[22m �[36mv4.1.5 �[39m�[90m/home/runner/work/leadtype/leadtype/packages/leadtype�[39m
 leadtype test:
 leadtype test:  �[32m✓�[39m src/llm/llm.test.ts �[2m(�[22m�[2m86 tests�[22m�[2m)�[22m�[32m 298�[2mms�[22m�[39m
 leadtype test:  �[32m✓�[39m src/openapi/openapi.test.ts �[2m(�[22m�[2m32 tests�[22m�[2m)�[22m�[33m 409�[2mms�[22m�[39m
 leadtype test:  �[32m✓�[39m src/lint/lint.test.ts �[2m(�[22m�[2m45 tests�[22m�[2m)�[22m�[33m 1055�[2mms�[22m�[39m
 leadtype test: Converted 1 docs in 26 ms
 leadtype test: Converted 2 docs in 7 ms
 leadtype test: Converted 2 docs in 9 ms
 leadtype test: Pruned 1 orphaned .md file(s) from /tmp/leadtype-convert-3P7FDA/public
 leadtype test: Converted 2 docs in 5 ms
 leadtype test: Converted 1 docs in 3 ms
 leadtype test: Pruned 2 orphaned .md file(s) from /tmp/leadtype-convert-8isFRU/public
 leadtype test: Converted 1 docs in 8 ms
 leadtype test: Pruned 1 orphaned .md file(s) from /tmp/leadtype-convert-mHV2fd/public
 leadtype test: Converted 1 docs in 3 ms
 leadtype test: Pruned 1 orphaned .md file(s) from /tmp/leadtype-convert-iN0xsT/public
 leadtype test: Converted 1 docs in 4 ms
 leadtype test: Error: failed to process /tmp/leadtype-convert-Cv5rfQ/docs/broken.mdx: 3:1: Unexpected character after `<`, expected a valid JSX tag (note: to create a link in MDX, use `[text](url)`) (mdx-jsx:unexpected-character)
 leadtype test: Converted 1 docs in 3 ms (1 failed)
 leadtype test: Warning: prune skipped: 1 file(s) failed to convert, so the expected output set is incomplete.
 leadtype test: Warning: prune skipped: no .mdx sources under /tmp/leadtype-convert-4zxxoe/empty-docs — refusing to treat every output in /tmp/leadtype-convert-4zxxoe/public as orphaned. Check srcDir if this is unexpected.
 leadtype test: Converted 3 docs in 6 ms
 leadtype test: Conve...

GitHub Actions: CI / 0_Validate & test.txt: Add ChildrenTypeRegistry so consumers type mdx children once per project

Conclusion: failure

View job details

Current runner version: '2.335.1'
 ##[group]Runner Image Provisioner
 Hosted Compute Agent
 Version: 20260624.560
 Commit: 925d229a51159bc391ae97e54a2dd1fe20af789d
 Build Date:
 Worker ID: {10d40196-e2a6-425c-bd32-40c3196db47a}
 Azure Region: northcentralus
 ##[endgroup]
 ##[group]Operating System
 Ubuntu
 24.04.4
 LTS
 ##[endgroup]
 ##[group]Runner Image
 Image: ubuntu-24.04
 Version: 20260628.225.1
 Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20260628.225/images/ubuntu/Ubuntu2404-Readme.md
 Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20260628.225
 ##[endgroup]
 ##[group]GITHUB_TOKEN Permissions
 Contents: read
 Metadata: read
 ##[endgroup]
 Secret source: Actions
 Prepare workflow directory
 Prepare all required actions
 Getting action download info
 Download action repository 'actions/checkout@v4' (SHA:34e114876b0b11c390a56381ad16ebd13914f8d5)
 Download action repository 'oven-sh/setup-bun@v2' (SHA:0c5077e51419868618aeaa5fe8019c62421857d6)
 Complete job name: Validate & test
 Node 20 is being deprecated. This workflow is running with Node 24 by default. If you need to temporarily use Node 20, you can set the ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true environment variable. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
 ##[group]Run actions/checkout@v4
 with:
   repository: inthhq/leadtype
   ***REDACTED***
   ssh-strict: true
   ssh-user: git
   persist-credentials: true
   clean: true
   sparse-checkout-cone-mode: true
   fetch-depth: 1
   fetch-tags: false
   show-progress: true
   lfs: false
   submodules: false
   set-safe-directory: true
 ##[endgroup]
 Syncing repository: inthhq/leadtype
 ##[group]Getting Git version info
 Working directory is '/home/runner/work/leadtype/leadtype'
 [command]/usr/bin/git version
 git version 2.54.0
 ##[endgroup]
 Temporarily overriding HOME='/home/runner/work/_temp/12d78228-efe9-4975-b0c...
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • packages/leadtype/src/mdx/index.ts
  • packages/leadtype/src/mdx/tag-types.test.ts
  • packages/leadtype/src/mdx/tag-types.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • packages/leadtype/src/mdx/index.ts
  • packages/leadtype/src/mdx/tag-types.test.ts
  • packages/leadtype/src/mdx/tag-types.ts
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid barrel files (index files that re-export everything)

Files:

  • packages/leadtype/src/mdx/index.ts
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions inside it() or test() blocks
Avoid done callbacks in async tests - use async/await instead
Don't use .only or .skip in committed code
Keep test suites reasonably flat - avoid excessive describe nesting

Files:

  • packages/leadtype/src/mdx/tag-types.test.ts
🧠 Learnings (1)
📚 Learning: 2026-06-09T18:30:08.038Z
Learnt from: KayleeWilliams
Repo: inthhq/leadtype PR: 97
File: .changeset/search-prototype-safety-and-scaling.md:5-5
Timestamp: 2026-06-09T18:30:08.038Z
Learning: In this repo, `.changeset/*.md` files must not start the body with an H1/first-line heading (`#`) immediately after the YAML frontmatter. The changesets tool inlines the body as bullet entries into `CHANGELOG.md` during release, and a leading `#` heading would break the generated changelog format. As a result, MD041 (`first-line-heading`) warnings for files under `.changeset/` are expected false positives and should be ignored.

Applied to files:

  • .changeset/mdx-children-registry.md
🪛 markdownlint-cli2 (0.22.1)
.changeset/mdx-children-registry.md

[warning] 5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

🔇 Additional comments (8)
packages/leadtype/src/mdx/tag-types.test.ts (1)

1-22: Previous IsAny regression concern resolved.

The IsAny<T> guard (0 extends 1 & T) now correctly short-circuits IsUnknown to false for any, addressing the prior review comment about a silent regression from unknown to any.

.changeset/mdx-children-registry.md (1)

1-25: Markdownlint MD041 warning is an expected false positive.

Based on learnings, .changeset/*.md files intentionally omit a leading H1 since the changesets tool inlines the body into CHANGELOG.md, so this warning should be ignored.

packages/leadtype/src/mdx/tag-types.ts (2)

6-20: Solid module-augmentation pattern.

The ChildrenTypeRegistry empty-interface hook + TagChildren conditional type correctly defaults to unknown and resolves to the registered type once augmented, matching the documented contract in .changeset/mdx-children-registry.md and docs/reference/mdx.mdx.

Also applies to: 38-67


95-95: LGTM!

Also applies to: 109-129, 232-254, 267-267, 277-284, 299-299, 361-361, 383-383, 393-393, 402-402

packages/leadtype/src/mdx/index.ts (1)

78-78: LGTM!

Also applies to: 98-98

docs/integrations/integrate-with-fumadocs.mdx (1)

96-121: LGTM!

docs/reference/mdx.mdx (1)

49-94: LGTM!

docs/paths.lock.json (1)

58-58: LGTM!

Also applies to: 150-150


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added an opt-in way to register a shared child type for MDX tags, so component children can be typed consistently across a project.
    • Exposed additional MDX type definitions for easier framework integration.
  • Documentation

    • Updated integration and reference guides with the new “register once” pattern and refreshed examples.
  • Tests

    • Added type checks to ensure child types remain safely unknown unless explicitly registered.

Walkthrough

This PR adds a type-only ChildrenTypeRegistry module-augmentation hook and derived TagChildren conditional type to leadtype/mdx, applies it to tag prop children fields, exports the new types, adds a compile-time default test, and updates related documentation and lockfile hashes.

Changes

ChildrenTypeRegistry typing feature

Layer / File(s) Summary
ChildrenTypeRegistry hook and TagChildren application
packages/leadtype/src/mdx/tag-types.ts
Introduces ChildrenTypeRegistry augmentation interface and TagChildren conditional type, replacing children?: unknown with children?: TagChildren across Callout, Tabs/Tab, Steps/Step, Mermaid, Accordion, Cards/Card, FileTree/Folder, Audience, Prompt, Example, Section, and Details prop types.
Public export wiring and default test
packages/leadtype/src/mdx/index.ts, packages/leadtype/src/mdx/tag-types.test.ts
Re-exports ChildrenTypeRegistry and TagChildren from the package entry point and adds a Vitest module verifying TagChildren and CalloutProps["children"] default to unknown when no augmentation is registered.
Documentation and lockfile updates
.changeset/mdx-children-registry.md, docs/integrations/integrate-with-fumadocs.mdx, docs/reference/mdx.mdx, docs/paths.lock.json
Adds a changeset describing the new hook, updates the Fumadocs and mdx reference docs to demonstrate the register-once types.d.ts pattern instead of casting children as ReactNode, and refreshes related lockfile hashes.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • inthhq/leadtype#137: Directly overlaps with the Fumadocs Callout children example, which this PR updates to use ChildrenTypeRegistry augmentation instead of a cast.

Poem

A rabbit hopped through types unknown,
Then registered children as its own.
No casts today, just clean JSX to see,
A tiny hook for typey harmony. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a registry so MDX children can be typed once per project.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the registry, docs, and type updates.
Linked Issues check ✅ Passed The PR addresses #136 by replacing per-component casts with an opt-in ChildrenTypeRegistry while preserving unknown by default.
Out of Scope Changes check ✅ Passed The changes stay within the MDX children-typing objective; the tests, docs, and lockfile updates are supporting edits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch KayleeWilliams/mdx-children-registry

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one observation worth confirming below.

Reviewed changes — a type-level registry that lets consumers set the children type for every leadtype/mdx tag prop once per project, replacing per-component casts, with no runtime and no renderer dependency added.

  • Add ChildrenTypeRegistry + TagChildren — empty augmentation-hook interface plus a conditional type (ChildrenTypeRegistry extends { type: infer T } ? T : unknown) in tag-types.ts; both re-exported from src/mdx/index.ts.
  • Convert 17 children?: unknown fields to children?: TagChildren — every tag prop type now sources its child type from the registry; FileProps is correctly left alone (no children).
  • Add type-level testtag-types.test.ts asserts children stays unknown when nothing is registered, locking in the non-breaking default.
  • Docs adopt the registryreference/mdx.mdx (React) and integrate-with-fumadocs.mdx drop the children as ReactNode cast / Omit<…,"children"> wrapper in favor of the augmentation; Vue/Svelte/Solid/Astro examples keep the framework-appropriate Omit pattern.
  • Changesetminor bump.

The non-breaking claim holds: with no augmentation TagChildren resolves to unknown, so children?: TagChildren is behaviorally identical to the prior children?: unknown, and the new type test guards it.

ℹ️ paths.lock.json updates hashes for two pages this PR doesn't touch

The lockfile bumps body-content hashes for framework-matrix and deploy-generated-artifacts in addition to the two docs pages actually edited here. Neither page renders MDX tag-prop content (framework-matrix is a static routing table), and because TagChildren resolves to unknown by default, this change produces no visible difference in their generated output — so the extra churn most likely reflects pre-existing lockfile drift being corrected by regeneration rather than a real content change.

There's no functional risk (redirect rename-detection keys off path removal, not a hash change on a stable path), but it's worth a glance to confirm the churn is intended rather than an artifact of regenerating against unrelated local state.

Technical details
# paths.lock.json hash churn on untouched pages

## Affected sites
- docs/paths.lock.json — hash changes for `/docs/integrations/framework-matrix` and `/docs/pipeline/deploy-generated-artifacts`, neither of which is in this PR's diff.
- Hash source: `hashRedirectContent` in `packages/leadtype/src/redirects/node.ts` = `sha256(parseFrontmatter(markdown).content.trim())` — pure page-body hash, frontmatter excluded.

## Required outcome
- Confirm the two extra hash changes are intended (genuine content dependency or an accepted drift correction) and not a side effect of regenerating the lockfile against unrelated local/base state.

## Suggested approach (optional)
- Regenerate the lockfile from a clean `main` + this branch's docs edits only, and verify the diff reduces to `integrate-with-fumadocs` + `reference/mdx`. If the two extra hashes reappear, they're a pre-existing drift on `main` worth a separate note.

Pullfrog  | Fix it ➔View workflow run | Using Claude Opus𝕏

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98d3657ee8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/reference/mdx.mdx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/leadtype/src/mdx/tag-types.test.ts`:
- Around line 6-10: The current IsUnknown<T> helper in tag-types.test.ts is too
permissive because it treats any as unknown, so tighten the helper to explicitly
exclude any before checking for unknown. Update the test around TagChildren to
use a stricter type guard in IsUnknown and keep the assertion focused on the
default type so the test fails if TagChildren regresses from unknown to any.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ef9c794e-4011-42d0-b190-f2262ed30407

📥 Commits

Reviewing files that changed from the base of the PR and between 6cdb608 and fb7ecfb.

📒 Files selected for processing (7)
  • .changeset/mdx-children-registry.md
  • docs/integrations/integrate-with-fumadocs.mdx
  • docs/paths.lock.json
  • docs/reference/mdx.mdx
  • packages/leadtype/src/mdx/index.ts
  • packages/leadtype/src/mdx/tag-types.test.ts
  • packages/leadtype/src/mdx/tag-types.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • packages/leadtype/src/mdx/tag-types.test.ts
  • packages/leadtype/src/mdx/index.ts
  • packages/leadtype/src/mdx/tag-types.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • packages/leadtype/src/mdx/tag-types.test.ts
  • packages/leadtype/src/mdx/index.ts
  • packages/leadtype/src/mdx/tag-types.ts
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions inside it() or test() blocks
Avoid done callbacks in async tests - use async/await instead
Don't use .only or .skip in committed code
Keep test suites reasonably flat - avoid excessive describe nesting

Files:

  • packages/leadtype/src/mdx/tag-types.test.ts
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid barrel files (index files that re-export everything)

Files:

  • packages/leadtype/src/mdx/index.ts
🧠 Learnings (1)
📚 Learning: 2026-06-09T18:30:08.038Z
Learnt from: KayleeWilliams
Repo: inthhq/leadtype PR: 97
File: .changeset/search-prototype-safety-and-scaling.md:5-5
Timestamp: 2026-06-09T18:30:08.038Z
Learning: In this repo, `.changeset/*.md` files must not start the body with an H1/first-line heading (`#`) immediately after the YAML frontmatter. The changesets tool inlines the body as bullet entries into `CHANGELOG.md` during release, and a leading `#` heading would break the generated changelog format. As a result, MD041 (`first-line-heading`) warnings for files under `.changeset/` are expected false positives and should be ignored.

Applied to files:

  • .changeset/mdx-children-registry.md
🪛 markdownlint-cli2 (0.22.1)
.changeset/mdx-children-registry.md

[warning] 5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

🔇 Additional comments (11)
packages/leadtype/src/mdx/tag-types.ts (4)

60-67: Conditional-type fallback logic is correct.

ChildrenTypeRegistry extends { type: infer T } ? T : unknown correctly resolves to unknown when the interface is empty (structurally, {} isn't assignable to { type: infer T }) and to the registered type once a consumer merges a type member in. Logic itself is sound, independent of the re-export concern raised above.


6-20: LGTM!


95-95: LGTM!

Also applies to: 109-129, 232-254, 267-267, 277-284, 299-299, 361-361, 383-383, 393-393, 402-402


42-67: 🗄️ Data Integrity & Integration

Add an augmentation test for leadtype/mdx

The test suite should exercise declare module "leadtype/mdx" and assert TagChildren resolves to the registered child type, not just the default unknown path.

packages/leadtype/src/mdx/index.ts (1)

78-78: LGTM! (Cross-referenced concern about module-augmentation semantics for ChildrenTypeRegistry is raised at its declaration site in tag-types.ts.)

Also applies to: 98-98

.changeset/mdx-children-registry.md (2)

5-5: 📐 Maintainability & Code Quality

Markdownlint MD041 warning is a known false positive.

Based on learnings, changeset files in this repo intentionally omit a leading heading since the changesets tool inlines the body into CHANGELOG.md; MD041 warnings for .changeset/*.md are expected and should be ignored.

Source: Learnings


1-25: LGTM!

docs/integrations/integrate-with-fumadocs.mdx (1)

96-121: LGTM!

docs/reference/mdx.mdx (1)

49-94: LGTM!

docs/paths.lock.json (2)

53-58: LGTM!

Also applies to: 148-151


82-82: 🗄️ Data Integrity & Integration

Check the /docs/pipeline/deploy-generated-artifacts lockfile hash. The updated hash looks outside this PR’s scoped docs changes; if that page wasn’t edited here, remove the stale lockfile entry.

Comment thread packages/leadtype/src/mdx/tag-types.test.ts Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — the single new commit tightens the type-level test helper so it can no longer be satisfied by an any regression.

  • Harden IsUnknown against any — adds IsAny<T> = 0 extends 1 & T (the standard any-detection idiom) and reorders IsUnknown<T> to reject any before the unknown extends T check. The default-children test now fails if TagChildren ever regresses from unknown to any, closing the false-green gap in the prior helper.

Verified the helper resolves correctly: unknowntrue, anyfalse, stringfalse. The registry logic, tag-prop conversions, and docs from earlier commits are unchanged.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@KayleeWilliams KayleeWilliams force-pushed the KayleeWilliams/mdx-children-registry branch from 6228e1f to 6a411f1 Compare July 7, 2026 08:23
@KayleeWilliams KayleeWilliams merged commit 331a912 into main Jul 7, 2026
3 of 4 checks passed
@KayleeWilliams KayleeWilliams deleted the KayleeWilliams/mdx-children-registry branch July 7, 2026 09:41
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.

mdx prop types: children as unknown forces casts in consumer components

1 participant