Skip to content

docs(shared): Add typedoc comments; remove functions from generated property tables for /objects#8276

Draft
alexisintech wants to merge 17 commits intomainfrom
aa/generate-object-docs
Draft

docs(shared): Add typedoc comments; remove functions from generated property tables for /objects#8276
alexisintech wants to merge 17 commits intomainfrom
aa/generate-object-docs

Conversation

@alexisintech
Copy link
Copy Markdown
Member

@alexisintech alexisintech commented Apr 9, 2026

⚠️ In conjunction with Generate object reference docs

Description

For the /objects in clerk-docs, we want to generate the reference information. In summary, this PR's main change is that:
When typedoc goes to generate files, it creates a folder for each defined object (which we define in reference-objects.mjs. E.g. clerk object gets .typedoc/docs/shared/clerk folder. This folder will have a <OBJECTNAME>-properties.mdx file and a <OBJECTNAME>-methods folder that includes each of the methods.

In a little more detail:

In reference-objects.mjs, we define these objects by defining the Typedoc output paths and by defining the primary interface/class on each reference object page in order to resolve TypeDoc reflections.

The extract-methods.mjs script will extract all of the methods from that object's primary interface/class and create a dedicated file for each one. I won't go into lengthy detail here, but the file is heavily commented through.

In custom-router.mjs

  • Adds logic to ensure that for the defined REFERENCE_OBJECT_PAGE_SYMBOLS, dedicated folders are created for each object. So clerk.mdx no longer gets added to .typedoc/docs/shared/, it gets added to its own folder: .typedoc/docs/shared/clerk/

In custom-plugin.mjs

  • Updates all regex so that links are never added to headings (# - #######)
  • Adds applyRelativeLinkReplacements() helper that the extract-methods.mjs script uses to incorporate the link replacements into the files it generates
  • Adds applyCatchAllMdReplacements() helper that the extract-methods.mjs script uses to incorporate the catch-all replacements into the files it generates
  • Adds stripReferenceObjectPropertiesSection() which removes the Properties section from a generated file and puts it into its own file. For example, if shared/clerk/clerk.mdx is generated, it pulls the Properties section from it and puts it into its own shared/clerk/clerk-properties.mdx file.

Notable additions:

  • Parameters that accept objects will include the object's properties in the table as children of that parameter.
    See the following examples (with before on left, after on right):
    Screenshot 2026-04-13 at 18 55 29
    Screenshot 2026-04-13 at 18 57 42
  • If a method accepts only one parameter, the parameters section will be of that type. E.g. for joinWaitlist(), it accepts a params object of type JoinWaitlistParams. Instead of a "Parameters" section, it has a "JoinWaitlistParams" section:
    Screenshot 2026-04-13 at 18 59 45

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: 064abe1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Apr 14, 2026 2:55am

Request Review

@alexisintech alexisintech changed the title Drop functions from property tables; add JSDoc comments docs(shared): Add/update typedoc comments; remove functions from generated property tables Apr 9, 2026
@alexisintech alexisintech changed the title docs(shared): Add/update typedoc comments; remove functions from generated property tables docs(shared): Add/update typedoc comments; remove functions from generated property tables for /objects Apr 10, 2026
@alexisintech alexisintech changed the title docs(shared): Add/update typedoc comments; remove functions from generated property tables for /objects docs(shared): Add typedoc comments; remove functions from generated property tables for /objects Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant