Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/silly-jars-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Changeset file is incomplete and missing required content.

The changeset file contains only the frontmatter delimiters (---) but lacks the package bump entries and change summary. This will fail Changesets processing.

According to the Changesets format, the file should contain:

  • Inside the frontmatter: one or more package entries with their bump types (e.g., "@clerk/backend": patch)
  • After the frontmatter: a human-readable summary of the changes

Expected format:

---
"@clerk/backend": patch
---

Fix Typedoc rendering of <code> tags in function signatures

Please update the changeset file with the appropriate package name(s) and bump type based on which packages were modified in this PR.

🧰 Tools
🪛 LanguageTool

[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---

(QB_NEW_DE)

🤖 Prompt for AI Agents
In .changeset/silly-jars-shave.md around lines 1 to 2 the file only contains
frontmatter delimiters and is missing required package bump entries and a
human-readable summary; update the file by adding one or more package entries
with their bump types inside the frontmatter (e.g., "@clerk/backend": patch) and
then add a short summary of the change after the closing --- delimiter, choosing
the correct package names and bump levels that correspond to the packages
modified in this PR.

52 changes: 51 additions & 1 deletion .typedoc/custom-theme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {

const superPartials = this.partials;

this._insideFunctionSignature = false;

this.partials = {
...superPartials,
/**
Expand Down Expand Up @@ -153,10 +155,17 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
);
}

const prevInsideParams = this._insideFunctionSignature;
this._insideFunctionSignature = true;
md.push(this.partials.signatureParameters(model.parameters || []));
this._insideFunctionSignature = prevInsideParams;

if (model.type) {
md.push(`: ${this.partials.someType(model.type)}`);
const prevInsideType = this._insideFunctionSignature;
this._insideFunctionSignature = true;
const typeOutput = this.partials.someType(model.type);
this._insideFunctionSignature = prevInsideType;
md.push(`: ${typeOutput}`);
}

const result = md.join('');
Expand Down Expand Up @@ -353,6 +362,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
.replace(/<code>/g, '')
.replace(/<\/code>/g, '');

// Only wrap in <code> if NOT inside a function signature
if (this._insideFunctionSignature) {
return output;
}

return `<code>${output}</code>`;
},
/**
Expand All @@ -371,6 +385,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
.replace(/<code>/g, '')
.replace(/<\/code>/g, '');

// Only wrap in <code> if NOT inside a function signature
if (this._insideFunctionSignature) {
return output;
}

return `<code>${output}</code>`;
},
/**
Expand All @@ -394,6 +413,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
)
.join(delimiter);

// Only wrap in <code> if NOT inside a function signature
if (this._insideFunctionSignature) {
return output;
}

return `<code>${output}</code>`;
},
/**
Expand Down Expand Up @@ -492,6 +516,32 @@ ${tabs}
.replace(/<code>/g, '')
.replace(/<\/code>/g, '');

// Only wrap in <code> if NOT inside a function signature
if (this._insideFunctionSignature) {
return output;
}

return `<code>${output}</code>`;
},
/**
* 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 `<code>` and `</code>` tags
.replace(/<code>/g, '')
.replace(/<\/code>/g, '');

// Only wrap in <code> if NOT inside a function signature
if (this._insideFunctionSignature) {
return output;
}

return `<code>${output}</code>`;
},
/**
Expand Down
13 changes: 1 addition & 12 deletions packages/backend/src/tokens/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,11 @@ export type VerifyTokenOptions = Simplify<
* Verifies a Clerk-generated token signature. Networkless if the `jwtKey` is provided. Otherwise, performs a network call to retrieve the JWKS from the [Backend API](https://clerk.com/docs/reference/backend-api/tag/JWKS#operation/GetJWKS){{ target: '_blank' }}.
*
* @param token - The token to verify.
* @param options - Options for verifying the token.
* @param options - Options for verifying the token. 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: `verifyToken(token, { secretKey: process.env.CLERK_SECRET_KEY })`.
*
* @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`.
*
* <Typedoc src="backend/verify-token-options" />
*
* @example
*
* The following example demonstrates how to use the [JavaScript Backend SDK](https://clerk.com/docs/reference/backend/overview) to verify the token signature.
Expand Down
Loading