docs(repo): Add typedoc comments; generate typedoc output for /objects docs#8276
docs(repo): Add typedoc comments; generate typedoc output for /objects docs#8276alexisintech wants to merge 83 commits into
Conversation
🦋 Changeset detectedLatest commit: 0cdd2a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
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.
|
This reverts commit 9100976.
…ct>-methods folder
|
@alexisintech just pushed this Fix external link as the external link wasn't working. |
sorry was still generating to test, and in between tasks, but thanks for catching! 🤦♀️ |
manovotny
left a comment
There was a problem hiding this comment.
Here's some things that caught my eye.
|
|
||
| /** | ||
| * | ||
| */ |
There was a problem hiding this comment.
Why are there several empty comments like this one in the file?
In the following files too:
- packages/shared/src/types/resource.ts
- packages/shared/src/types/session.ts
- packages/shared/src/types/signInFuture.ts
- packages/shared/src/types/signUpFuture.ts
- packages/shared/src/types/user.ts
- packages/shared/src/types/waitlist.ts
(I probably missed a few other files)
There was a problem hiding this comment.
it's to tell typedoc to generate them. typedoc requires jsdoc comments as a signal that something needs to get generated. these don't always require anything written - if it makes more sense to fill these with descriptions, we can (but will need to test that it doesn't break any output). should we fill these comments so that no one else is confused?
There was a problem hiding this comment.
I think something slightly better is we can change it from
/**
*
*/to
/** */I can do it once the other PR gets pulled in here so its not twice the work or causing any merge conflicts
There was a problem hiding this comment.
That would be better. I'd still like to see if we can remove them altogether or have a placeholder reason. But we can revisit both later.
|
i've got the refactor here ready: refactor(repo): Inline extract-methods + tighten parameter rendering |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@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: |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…orts Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Pushed some changes directly in 9be16f7.
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>


Description
For the
/objectsin 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.clerkobject gets.typedoc/docs/shared/clerkfolder. This folder will have a<OBJECTNAME>-properties.mdxfile and a<OBJECTNAME>-methodsfolder 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.mjsscript 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.mjsREFERENCE_OBJECT_PAGE_SYMBOLS, dedicated folders are created for each object. Soclerk.mdxno longer gets added to.typedoc/docs/shared/, it gets added to its own folder:.typedoc/docs/shared/clerk/In
custom-plugin.mjsapplyRelativeLinkReplacements()helper that theextract-methods.mjsscript uses to incorporate the link replacements into the files it generatesapplyCatchAllMdReplacements()helper that theextract-methods.mjsscript uses to incorporate the catch-all replacements into the files it generatesstripReferenceObjectPropertiesSection()which removes the Properties section from a generated file and puts it into its own file. For example, ifshared/clerk/clerk.mdxis generated, it pulls the Properties section from it and puts it into its ownshared/clerk/clerk-properties.mdxfile.comment-utils.mjsis used as a helper to remove "TODO" and its following text from generated content.standalone-page-tag.mjsadds support for a custom tag called@standalonePagethat can be used in conjunction with the@inlinetag to indicate to typedoc to still generate a dedicated page for that type, even though it is recognized as@inline. Using both of these tags means that the type will show up as inlined in a table, but will also still have a generated MDX file.Notable additions:
See the following examples (with before on left, after on right):
joinWaitlist(), it accepts a params object of typeJoinWaitlistParams. Instead of a "Parameters" section, it has a "JoinWaitlistParams" section:Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change