Error code docs: render the ably-common registry into the docs site#3458
Open
lmars wants to merge 2 commits into
Open
Error code docs: render the ably-common registry into the docs site#3458lmars wants to merge 2 commits into
lmars wants to merge 2 commits into
Conversation
Render the Ably error-code registry into the docs site as a page per code plus an index, sourced from the ably-common registry. - Add ably-common as a pinned git submodule (source of the registry). - bin/generate-error-pages.ts (yarn generate:errors): reads ably-common/errors/codes/*.md and writes committed MDX pages under src/pages/docs/platform/errors/codes/ plus the codes.mdx index, each carrying a "DO NOT EDIT" MDX comment. Committing the output means the site build/deploy needs no submodule (CircleCI checkout doesn't init submodules). - CI check-error-docs: inits the submodule, regenerates, and fails on any diff so the committed pages can't drift from the registry or be hand-edited. - PageHeader gains an optional subtitle slot; MDXWrapper renders the error identifier there as the sub-title. - Error-code detail pages resolve to the Platform "Error codes" nav entry (layout-context) so they show the Platform sidebar. - Footer "Edit on GitHub" points error-code pages at their ably-common source file, and is hidden on the generated index. - Migrate 8 inline links from /docs/platform/errors/codes#<code> to the new /docs/platform/errors/codes/<code> detail pages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Committed output of `yarn generate:errors` (bin/generate-error-pages.ts): one page per code at /docs/platform/errors/codes/<code> and the index at /docs/platform/errors/codes (replacing the hand-maintained codes.mdx). Each file carries a hidden "DO NOT EDIT" MDX comment. Regenerate and commit after bumping the ably-common submodule; the check-error-docs CI job fails if these are out of date or hand-edited. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Renders the Ably error-code registry (introduced in ably-common#348) into the docs site: a documentation page per error code plus a browsable index, all sourced from
ably-common/errors/codes/*.md./docs/platform/errors/codes/<code>: heading<code>: <title>, the stableidentifieras a soft sub-title, the summary as the primary description, then the detail body (causes / how to resolve)./docs/platform/errors/codes: one section per code (linkedcode: titleheading, identifier, summary), replacing the old hand-maintainedcodes.mdx.Screenshots
Index page
Detail page (summary only)
Detail page (summary + body)
How it works
The pages are generated and committed, not built at runtime:
bin/generate-error-pages.ts(yarn generate:errors) reads theably-commonsubmodule and writes the MDX pages undersrc/pages/docs/platform/errors/codes/. Each carries a hidden{/* DO NOT EDIT */}MDX comment.checkoutdoesn't init submodules — build-time generation would silently emit nothing).check-error-docs) inits the submodule, regenerates, and fails on any diff, so the committed pages can't drift from the registry or be hand-edited.The two commits are split as machinery (submodule, generator, CI, component changes, link migrations) and generated pages (the 254 pages + index).
Supporting changes
PageHeadergains an optionalsubtitleslot;MDXWrapperrendersfrontmatter.identifierthere.ably-commonsource file (hidden on the generated index).…/errors/codes#<code>now point at the detail pages; the index keeps the/docs/platform/errors/codesURL (old/docs/errors/codesredirect preserved) and carries#<code>anchors for old deep links.Depends on / follow-ups
ably-commonmain— until then the "Edit on GitHub" links targetmainand 404.help.ably.io/error/{code}→/docs/platform/errors/codes/<code>redirect cutover.Verification
gatsby buildsucceeds: 254 detail pages + index emitted, LLM-markdown export and redirects generated.🤖 Generated with Claude Code