Skip to content

fix(docs): unbreak the MDX build and read trigger config from the registry - #6360

Closed
waleedlatif1 wants to merge 1 commit into
stagingfrom
docs-mdx-prose-escape
Closed

fix(docs): unbreak the MDX build and read trigger config from the registry#6360
waleedlatif1 wants to merge 1 commit into
stagingfrom
docs-mdx-prose-escape

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Unbreaks the docs build. It has been failing on staging since the Smartlead merge:

./apps/docs/content/docs/en/integrations/smartlead.mdx
Expected a closing tag for `<original>` before the end of `paragraph`

Tool descriptions are emitted as prose, and that path escaped only braces — every table-cell path already escaped angle brackets. MDX reads < as the start of a JSX tag, so The copy is named "<original> - copy" fails the build outright. escapeMdxProse handles the MDX-hostile characters and deliberately leaves pipes/parens/brackets alone, which are legal in prose and whose escaping would mangle markdown links.

Trigger config now comes from the evaluated registry, not regex over source. Static parsing silently dropped every field whose builder assembled its array imperatively or took a description as a parameter — all ten Jira triggers lost webhookSecret and jqlFilter, and Monday lost its config too. Regenerating the docs was destructive. Reading real objects also deletes 232 lines of parsing.

Tool headings show the tool's name, not its id### \a2a_send_message`### A2A Send Message, unformatted, across 241 pages. Names come from tools/generated/tool-metadata.ts, which CI keeps in sync. These headings feed each page's table of contents. a2a.mdx` is hand-written so its headings were updated directly.

Cleanup: five hand-inlined copies of the escape chain collapsed into the escapeMdxCell that already existed, and 44 comments that restated the line below them removed. 4,306 → 4,069 lines.

Type of Change

  • Bug fix

Testing

Every refactor step was verified against a golden manifest of all 289 generated files, itself validated in both directions — deterministic across repeated runs, and proven to catch a one-character change. So the only output differences are intended ones.

StepResult
escape-chain consolidationbyte-identical, 289 files
44 comment removalsbyte-identical, 289 files
trigger config from registrydiff reviewed line by line
post-rebase regenzero drift

Two things I built, measured, and threw away rather than ship:

  • A regex fix for the imperative-array pattern — it "recovered" the Jira config but invented fieldFilters on the 9 triggers that never declare it and degraded descriptions to placeholder titles. Wrong docs are worse than missing docs.
  • Sourcing trigger outputs from the registry too — symmetric with the config fix, and it deleted 10,298 lines across 53 files. Reverted on sight.

Also caught a bug I introduced: required may be a condition object ({ field, value }), so Boolean(required) wrongly rendered "Yes" on 4 HubSpot fields. Only an unconditional true counts, matching previous behavior.

Known gap (please don't read this PR as "the generator is now trustworthy")

extractTriggerOutputs still parses source and has the same blind spot — it already drops one Jira #### Output section on main, which I verified predates this change. Regenerating is now safe for trigger config but still lossy for trigger outputs.

Separately: openai.mdx is a stale orphan with no backing block since the multi-provider Embeddings work (#6317) — the generator doesn't rewrite it and the stale-doc cleanup doesn't delete it. Left alone here; it probably just wants deleting.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…istry
The docs build has been failing on staging since the Smartlead merge:
./apps/docs/content/docs/en/integrations/smartlead.mdx
Expected a closing tag for `<original>` before the end of `paragraph`
Tool descriptions are emitted as prose, and that path escaped only braces --
every table-cell path already escaped angle brackets. MDX reads `<` as the start
of a JSX tag, so a description like 'The copy is named "<original> - copy"' fails
the build outright. escapeMdxProse handles the MDX-hostile characters and leaves
pipes, parens and brackets alone, which are legal in prose and whose escaping
would mangle markdown links.
Trigger configuration now comes from the evaluated registry instead of regex over
source. Static parsing silently dropped every field whose builder assembled its
array imperatively or took a description as a parameter -- all ten Jira triggers
lost `webhookSecret` and `jqlFilter` that way, and Monday lost its config too, so
regenerating the docs was destructive. Reading real objects also deletes 232 lines
of parsing. Note `required` may be a condition object rather than `true`; only an
unconditional `true` renders as Required, matching the previous behavior.
Tool headings now show the tool's name ("A2A Send Message") rather than its id
(`a2a_send_message`), unformatted, across 241 generated pages. Names come from
tools/generated/tool-metadata.ts, which CI keeps in sync. These headings feed each
page's table of contents. a2a.mdx is hand-written, so its headings were updated
directly.
Also consolidates five hand-inlined copies of the escape chain into the
escapeMdxCell that already existed, and drops 44 comments that restated the line
below them. Generator: 4306 -> 4069 lines.
Every refactor step was verified against a golden manifest of all 289 generated
files -- proven deterministic across runs and proven to catch a one-character
change -- so the only output differences are the intended ones.
KNOWN GAP: extractTriggerOutputs still parses source and has the same blind spot;
it already drops one Jira output section on main. Regenerating is now safe for
trigger config but still lossy for trigger outputs.
@greptile-apps

Copy link
Copy Markdown
Contributor

Too many files changed for review (243 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@vercel

vercelBot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
docsReadyReadyPreviewAug 7, 2026 1:33am

Request Review

@cursor

cursorBot commented Aug 7, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation and doc-generator changes only; no runtime product logic. Risk is limited to incorrect or missing integration docs if regen is run again before trigger outputs are fixed.

Overview
Docs build and generator fixes sit alongside a large regeneration of integration MDX: tool/action headings now use human-readable names (e.g. A2A Send Message instead of `a2a_send_message`) across the affected integration pages, including hand-maintained a2a.mdx.

The generator now escapes prose so characters like < in descriptions no longer break MDX parsing (e.g. Smartlead). Trigger config is read from the evaluated registry instead of regex on source, so fields like Jira webhookSecret / jqlFilter and Monday config are documented again without silent drops. Shared MDX cell escaping is consolidated and redundant comments removed in the generator (~4.3k → ~4k lines).

Trigger output sections are still parsed from source (known gap; Jira output docs can remain incomplete). openai.mdx orphan noted but not removed in this PR.

Reviewed by Cursor Bugbot for commit c94f64f. Configure here.

Sign up for freeto 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.

1 participant

@waleedlatif1