From 9e0261a3384c69c6658c586c2c2fb2e02730a6b7 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Thu, 16 Oct 2025 14:49:16 -0400 Subject: [PATCH] chore(repo): Typedoc: Handle simplify types --- .typedoc/custom-theme.mjs | 48 ++++++++++++++++++++++++++- packages/backend/src/tokens/verify.ts | 11 ------ 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index 1ce9c403d22..ca55a41a3e2 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -143,10 +143,15 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { ); } + this._insideFunctionSignature = true; md.push(this.partials.signatureParameters(model.parameters || [])); + this._insideFunctionSignature = false; if (model.type) { - md.push(`: ${this.partials.someType(model.type)}`); + this._insideFunctionSignature = true; + const typeOutput = this.partials.someType(model.type); + this._insideFunctionSignature = false; + md.push(`: ${typeOutput}`); } const result = md.join(''); @@ -343,6 +348,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { .replace(//g, '') .replace(/<\/code>/g, ''); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** @@ -361,6 +371,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { .replace(//g, '') .replace(/<\/code>/g, ''); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** @@ -384,6 +399,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { ) .join(delimiter); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** @@ -482,6 +502,32 @@ ${tabs} .replace(//g, '') .replace(/<\/code>/g, ''); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + + return `${output}`; + }, + /** + * Ensures that reflection types (like Simplify wrapped types) are wrapped in a single codeblock + * @param {import('typedoc').ReflectionType} model + */ + reflectionType: model => { + const defaultOutput = superPartials.reflectionType(model); + + const output = defaultOutput + // Remove any backticks + .replace(/`/g, '') + // Remove any `` and `` tags + .replace(//g, '') + .replace(/<\/code>/g, ''); + + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** diff --git a/packages/backend/src/tokens/verify.ts b/packages/backend/src/tokens/verify.ts index 019dcae1a38..60a48c6917e 100644 --- a/packages/backend/src/tokens/verify.ts +++ b/packages/backend/src/tokens/verify.ts @@ -45,17 +45,6 @@ export type VerifyTokenOptions = Simplify< * @displayFunctionSignature * @hideReturns * - * @paramExtension - * - * ### `VerifyTokenOptions` - * - * It is recommended to set these options as [environment variables](/docs/guides/development/clerk-environment-variables#api-and-sdk-configuration) where possible, and then pass them to the function. For example, you can set the `secretKey` option using the `CLERK_SECRET_KEY` environment variable, and then pass it to the function like this: `createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })`. - * - * > [!WARNING] - * You must provide either `jwtKey` or `secretKey`. - * - * - * * @example * * The following example demonstrates how to use the [JavaScript Backend SDK](https://clerk.com/docs/reference/backend/overview) to verify the token signature.