Compile MDX documentation to HTML during release#64
Closed
Conversation
… API The registry UI renders documentation via dangerouslySetInnerHTML from pre-compiled HTML to avoid CSP unsafe-eval restrictions. This adds the compilation step to the release workflow so new releases get both raw MDX and compiled HTML. - Add mdx-compile.mjs and package.json to cmd/record-release for Node deps - Add "Compile documentation to HTML" workflow step (runs before record-release) - Add -docs-html flag to record-release binary - Add documentationHtml field to RecordReleaseRequest
Contributor
Author
|
Moving compilation out of the release pipeline to avoid introducing npm/Node into the security-sensitive release workflow. Will use admin API endpoints + export cron instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The registry UI can't use
@mdx-js/mdxruntime compilation in the browser because the CloudFront CSP policy blocksunsafe-eval. The registry API now accepts adocumentation_htmlfield (ductone/connector-registry-api#90) containing pre-rendered HTML that the browser can display directly.What this changes
Adds a compilation step to the release workflow that converts
docs/connector.mdxto static HTML before callingrecord-release. The compiled HTML is sent alongside the raw MDX via a new-docs-htmlflag.cmd/record-release/mdx-compile.mjs— Node CLI that compiles MDX to HTML with Mintlify component mappingscmd/record-release/package.json— minimal Node dependencies for the compilercmd/record-release/main.go— new-docs-htmlflag anddocumentationHtmlrequest field.github/workflows/release.yaml— new "Compile documentation to HTML" step withcontinue-on-error: true(compilation failure doesn't block the release)Depends on ductone/connector-registry-api#90 being deployed first (adds the
documentation_htmlproto field).