Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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/five-schools-repair.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 | 🟠 Major

Complete the changeset file for automated releases.

This changeset file is incomplete. According to the project's coding guidelines, automated releases require proper Changesets format. A valid changeset should include:

  1. Package names and version bump types between the YAML delimiters:
---
"@clerk/backend": patch
---
  1. A description of the changes below the front matter:
---
"@clerk/backend": patch
---

Fix typedoc paramExtension tag injection to work without "## Returns" heading
🧰 Tools
🪛 LanguageTool

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

(QB_NEW_DE)

🤖 Prompt for AI Agents
In .changeset/five-schools-repair.md around lines 1 to 2, the changeset is
empty; add a proper Changesets front matter containing the package name(s) and
the version bump type (patch/minor/major) between the YAML delimiters and then
add a short description of the change below the front matter so automated
releases can parse it (e.g., include "@clerk/backend": patch in the YAML and a
one-line description of the fix beneath).

25 changes: 20 additions & 5 deletions .typedoc/custom-theme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,27 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
if (paramExtensionTag) {
const stuff = this.helpers.getCommentParts(paramExtensionTag.content);

// Find the index of the item that contains '## Returns'
const index = splitOutput.findIndex(item => item.includes('## Returns'));
// Find the index of the item that contains '## Parameters'
const parametersIndex = splitOutput.findIndex(item => item.includes('## Parameters'));

if (parametersIndex !== -1) {
// Find the immediate next heading after Parameters
let nextHeadingIndex = -1;
for (let i = parametersIndex + 1; i < splitOutput.length; i++) {
const item = splitOutput[i].trim();

// The next header has to, at a minimum, start with ##
// because it comes after '## Parameters'
if (item.match(/^##/)) {
nextHeadingIndex = i;
break;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let nextHeadingIndex = -1;
for (let i = parametersIndex + 1; i < splitOutput.length; i++) {
const item = splitOutput[i].trim();
// The next header has to, at a minimum, start with ##
// because it comes after '## Parameters'
if (item.match(/^##/)) {
nextHeadingIndex = i;
break;
}
}
const nextHeadingIndex = splitOutput.findIndex((item, index) => {
// skip the items before the parameters
if (index <= parametersIndex) return false;
// find the next heading
return item.startsWith('##') || item.startsWith('\n##')
})

Can we just use another findIndex()?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeth .-.
bdc2522


// If the index is found, insert the stuff before it
if (index !== -1) {
splitOutput.splice(index, 0, stuff);
// Insert the stuff before the next heading
// (or at the end of the entire page if no heading found)
const insertIndex = nextHeadingIndex !== -1 ? nextHeadingIndex : splitOutput.length;
splitOutput.splice(insertIndex, 0, stuff);
}
}

Expand Down