refactor(repo): unify typedoc pipeline around parent H2 aggregator sections#9073
refactor(repo): unify typedoc pipeline around parent H2 aggregator sections#9073alexisintech wants to merge 2 commits into
Conversation
…e extract-methods to a marker slicer Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 535edb6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
… sub-docs Extend custom-theme.mjs so every reference-object and backend-api parent page carries all method info in a canonical `## `name()`` / `## `name`` H2 shape: - renderAggregatorMethodSection synthesizes sections for callable members typedoc doesn't emit naturally (function-typed interface properties, extraMethodInterfaces, @extractMethods namespace callables emitted with qualified names). - insertSignatureBlocksIntoNaturalMethodSections injects a ```typescript block after each backend-class method's description so natural and synthesized sections share one shape. - removeMethodH2Section strips typedoc's per-overload `### Call Signature` sub-headings and lets the aggregator re-emit a single section for the primary signature. - renderAggregatorPropertyTableSection emits `## `name`` H2s for @extractMethods namespaces (listing non-callable members) and their non-callable object-shape members (expanding the object shape). Reduce extract-methods.mjs to a pure text-slicer over those sections. Zero reflection access downstream. findMethodH2Sections detects both `## `name()`` and `## `name`` shapes; reshape helpers demote to H3 and reflow into the per-method / per-property-table sub-doc shape (byte-identical to what the previous marker-block builders produced). Delete the marker-block emission entirely: renderInlineMethodsBlock, buildMethodMdx, extractCallableMembersFromDeclaration, processExtractMethodsNamespace, buildPropertyTableDocMdx, buildExtractMethodsNamespacePropertyTableMdx, and orphaned appendSignatureOnlyReturns removed from custom-theme.mjs; parseMethodMarkers, stripMethodsBlock, and both marker-block fallback paths removed from extract-methods.mjs. The `<!-- clerk:properties-start/end -->` markers stay — properties.mdx extraction still uses them post-prettier for column alignment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Description
Unifies the
.typedoc/pipeline so every reference-object and backend-api parent page carries all the info its extracted sub-docs need in a canonical##H2 shape, andextract-methods.mjsbecomes a pure text-slicer over those H2s — no reflection access, no marker block. Same generated docs.Before:
extract-methods.mjswas a second reflection walker layered on top of the markdown theme. It re-imported TypeDoc AST types, re-derived method/property partitioning, and re-invokedMarkdownThemeContextpartials to build each per-method MDX file. Two places in the codebase had to agree on how methods vs properties are partitioned, which acronyms slug how, and which comment tags trigger inline extraction.After: all reflection work lives in
custom-theme.mjs, which now synthesizes:##name()H2 sections for every callable member that typedoc-plugin-markdown doesn't emit naturally (function-typed interface properties, `extraMethodInterfaces`, `@extractMethods` namespace callables like `emailCode.sendCode`). Backend-class methods get a```typescript `` signature block injected after their natural description so all H2s share one shape.##name`` H2 sections for@extractMethodsnamespaces with non-callable object-shape members (`emailLink` on `SignInFutureResource`) and each such non-callable member (`emailLink.verification`) — the same rows the marker-block builders used to write directly to sub-docs.### Call Signaturesub-headings and re-emit a single section for the primary signature, so the parent's shape is uniform across single- and multi-overload methods.extract-methods.mjsslices those H2s pre-prettier, reshapes each intomethods/<slug>.mdx(H2 → H3, then straight verbatim), and defers Properties extraction to apreWriteAsyncJobthat reads the (now prettier-aligned)<!-- clerk:properties-start/end -->markers and writesproperties.mdx.Commits
refactor(repo): move typedoc reflection work into custom-theme, reduce extract-methods to a marker slicer— the first move: reflection walks live in one place,extract-methodsreads marker-wrapped output produced by the theme. Byte-identical to the pre-refactor docs.refactor(repo): text-slice parent H2 aggregator sections into methods sub-docs— the follow-through: parent pages carry the info directly (methods + property tables),extract-methodsbecomes a pure text-slicer, and the marker-block emission is deleted entirely. Byte-identical for every sub-doc; the only expected output delta is the parent pages themselves, which now show their##name()/ `## `nameH2 sections in full.Refs
Checklist
pnpm testruns as expected. (.typedocvitest: 16/16 pass)pnpm buildruns as expected.Type of change