fix(docs): unbreak the MDX build and read trigger config from the registry - #6360
fix(docs): unbreak the MDX build and read trigger config from the registry#6360waleedlatif1 wants to merge 1 commit into
Conversation
…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.
|
Too many files changed for review (243 files, 100 file limit). Bypass the limit by tagging |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The generator now escapes prose so characters like Trigger output sections are still parsed from source (known gap; Jira output docs can remain incomplete). Reviewed by Cursor Bugbot for commit c94f64f. Configure here. |
Summary
Unbreaks the docs build. It has been failing on staging since the Smartlead merge:
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, soThe copy is named "<original> - copy"fails the build outright.escapeMdxProsehandles 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
webhookSecretandjqlFilter, 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 fromtools/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
escapeMdxCellthat already existed, and 44 comments that restated the line below them removed. 4,306 → 4,069 lines.Type of Change
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.
Two things I built, measured, and threw away rather than ship:
fieldFilterson the 9 triggers that never declare it and degraded descriptions to placeholder titles. Wrong docs are worse than missing docs.outputsfrom 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:
requiredmay be a condition object ({ field, value }), soBoolean(required)wrongly rendered "Yes" on 4 HubSpot fields. Only an unconditionaltruecounts, matching previous behavior.Known gap (please don't read this PR as "the generator is now trustworthy")
extractTriggerOutputsstill parses source and has the same blind spot — it already drops one Jira#### Outputsection onmain, which I verified predates this change. Regenerating is now safe for trigger config but still lossy for trigger outputs.Separately:
openai.mdxis 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