Skip to content

Commit 9e0261a

Browse files
committed
chore(repo): Typedoc: Handle simplify types
1 parent 4f3ceaf commit 9e0261a

File tree

2 files changed

+47
-12
lines changed

2 files changed

+47
-12
lines changed

.typedoc/custom-theme.mjs

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,15 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
143143
);
144144
}
145145

146+
this._insideFunctionSignature = true;
146147
md.push(this.partials.signatureParameters(model.parameters || []));
148+
this._insideFunctionSignature = false;
147149

148150
if (model.type) {
149-
md.push(`: ${this.partials.someType(model.type)}`);
151+
this._insideFunctionSignature = true;
152+
const typeOutput = this.partials.someType(model.type);
153+
this._insideFunctionSignature = false;
154+
md.push(`: ${typeOutput}`);
150155
}
151156

152157
const result = md.join('');
@@ -343,6 +348,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
343348
.replace(/<code>/g, '')
344349
.replace(/<\/code>/g, '');
345350

351+
// Only wrap in <code> if NOT inside a function signature
352+
if (this._insideFunctionSignature) {
353+
return output;
354+
}
355+
346356
return `<code>${output}</code>`;
347357
},
348358
/**
@@ -361,6 +371,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
361371
.replace(/<code>/g, '')
362372
.replace(/<\/code>/g, '');
363373

374+
// Only wrap in <code> if NOT inside a function signature
375+
if (this._insideFunctionSignature) {
376+
return output;
377+
}
378+
364379
return `<code>${output}</code>`;
365380
},
366381
/**
@@ -384,6 +399,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
384399
)
385400
.join(delimiter);
386401

402+
// Only wrap in <code> if NOT inside a function signature
403+
if (this._insideFunctionSignature) {
404+
return output;
405+
}
406+
387407
return `<code>${output}</code>`;
388408
},
389409
/**
@@ -482,6 +502,32 @@ ${tabs}
482502
.replace(/<code>/g, '')
483503
.replace(/<\/code>/g, '');
484504

505+
// Only wrap in <code> if NOT inside a function signature
506+
if (this._insideFunctionSignature) {
507+
return output;
508+
}
509+
510+
return `<code>${output}</code>`;
511+
},
512+
/**
513+
* Ensures that reflection types (like Simplify wrapped types) are wrapped in a single codeblock
514+
* @param {import('typedoc').ReflectionType} model
515+
*/
516+
reflectionType: model => {
517+
const defaultOutput = superPartials.reflectionType(model);
518+
519+
const output = defaultOutput
520+
// Remove any backticks
521+
.replace(/`/g, '')
522+
// Remove any `<code>` and `</code>` tags
523+
.replace(/<code>/g, '')
524+
.replace(/<\/code>/g, '');
525+
526+
// Only wrap in <code> if NOT inside a function signature
527+
if (this._insideFunctionSignature) {
528+
return output;
529+
}
530+
485531
return `<code>${output}</code>`;
486532
},
487533
/**

packages/backend/src/tokens/verify.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ export type VerifyTokenOptions = Simplify<
4545
* @displayFunctionSignature
4646
* @hideReturns
4747
*
48-
* @paramExtension
49-
*
50-
* ### `VerifyTokenOptions`
51-
*
52-
* 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 })`.
53-
*
54-
* > [!WARNING]
55-
* You must provide either `jwtKey` or `secretKey`.
56-
*
57-
* <Typedoc src="backend/verify-token-options" />
58-
*
5948
* @example
6049
*
6150
* The following example demonstrates how to use the [JavaScript Backend SDK](https://clerk.com/docs/reference/backend/overview) to verify the token signature.

0 commit comments

Comments
 (0)