docs(backend): fix Dashboard links and method reference layout - #9372
Conversation
🦋 Changeset detectedLatest commit: d2625f8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 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.
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@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: |
📝 WalkthroughWalkthroughThe Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.typedoc/__tests__/__snapshots__/user-api-methods-remove-password.mdx:
- Line 8: Update the TypeDoc signature rendering for removePassword so its
defaulted params argument is rendered as optional, then regenerate the
user-api-methods-remove-password snapshot to reflect the corrected signature.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 6ac35b91-0f95-40df-973b-d4e7dadefda8
📒 Files selected for processing (3)
.typedoc/__tests__/__snapshots__/user-api-methods-remove-password.mdx.typedoc/__tests__/extract-methods.test.ts.typedoc/extract-methods.mjs
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
clerk/clerk_go(manual)clerk/dashboard(manual)clerk/accounts(manual)clerk/backoffice(manual)clerk/clerk(manual)clerk/clerk-docs(manual)clerk/cloudflare-workers(manual)clerk/cli(auto-detected)clerk/clerk-ios(auto-detected)clerk/clerk-android(auto-detected)
| Returns the updated [`User`](/docs/reference/backend/types/backend-user). | ||
|
|
||
| ```typescript | ||
| function removePassword(userId: string, params: { signOutOfOtherSessions?: boolean }): Promise<User> |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
source_file='packages/backend/src/api/endpoints/UserApi.ts'
snapshot_file='.typedoc/__tests__/__snapshots__/user-api-methods-remove-password.mdx'
rg -n -A3 -B2 'removePassword' "$source_file"
rg -n 'function removePassword' "$snapshot_file"
if rg -q 'function removePassword\(userId: string, params: ' "$snapshot_file" &&
! rg -q 'function removePassword\(userId: string, params\?: ' "$snapshot_file"; then
echo 'Generated signature marks params as required.'
exit 1
fiRepository: clerk/javascript
Length of output: 797
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- TypeDoc configuration and custom rendering references ---'
rg -n -S -i 'typedoc|signature.*render|default.*param|optional.*param|RemovePasswordParams' \
.typedoc packages package.json pnpm-workspace.yaml 2>/dev/null | head -n 240
printf '%s\n' '--- Relevant snapshot and source context ---'
sed -n '1,24p' .typedoc/__tests__/__snapshots__/user-api-methods-remove-password.mdx
sed -n '700,742p' packages/backend/src/api/endpoints/UserApi.ts
printf '%s\n' '--- Tests and scripts that generate or validate TypeDoc snapshots ---'
rg -n -S 'typedoc|user-api-methods-remove-password|__snapshots__' \
.github package.json .typedoc packages 2>/dev/null | head -n 240Repository: clerk/javascript
Length of output: 50374
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- Signature rendering implementation ---'
sed -n '1220,1435p' .typedoc/custom-theme.mjs
printf '%s\n' '--- Optional-parameter helper implementation ---'
sed -n '420,455p' .typedoc/custom-theme.mjs
sed -n '560,605p' .typedoc/custom-theme.mjs
printf '%s\n' '--- TypeDoc configuration ---'
sed -n '1,220p' typedoc.config.mjsRepository: clerk/javascript
Length of output: 15853
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- Signature-parameter hooks and custom partials ---'
rg -n -C 12 'signatureParameters|signatureParameter|isOptional|defaultValue' .typedoc/custom-theme.mjs | head -n 260
printf '%s\n' '--- TypeDoc model fixtures or generated metadata for removePassword ---'
rg -n -S -C 8 'removePassword|RemovePasswordParams' .typedoc packages/backend/src/api/__tests__ packages/backend/src/api/endpoints | head -n 220
printf '%s\n' '--- Comparable default-parameter signatures in snapshots ---'
rg -n -S 'function .*\([^)]*=|function .*\([^)]*\?:' .typedoc/__tests__/__snapshots__ | head -n 160Repository: clerk/javascript
Length of output: 23999
🏁 Script executed:
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
source = Path("packages/backend/src/api/endpoints/UserApi.ts").read_text()
snapshot = Path(".typedoc/__tests__/__snapshots__/user-api-methods-remove-password.mdx").read_text()
comparables = {
p.name: p.read_text()
for p in Path(".typedoc/__tests__/__snapshots__").glob("*.mdx")
}
method = re.search(
r"public async removePassword\(\s*userId:\s*string,\s*params:\s*RemovePasswordParams\s*=\s*\{\}\s*\)",
source,
)
rendered = re.search(
r"function removePassword\(userId: string, params(\?)?: \{ signOutOfOtherSessions\?: boolean \}\)",
snapshot,
)
assert method, "removePassword source declaration was not found"
assert rendered, "removePassword snapshot signature was not found"
print("source_default_parameter:", True)
print("snapshot_params_optional:", rendered.group(1) == "?")
print("snapshot_signature:", rendered.group(0))
for name, text in comparables.items():
if re.search(r"function (?:signOut|sendCode)\([^)]*\?:", text):
print("comparable_optional_signature:", name)
PYRepository: clerk/javascript
Length of output: 469
Render params as optional.
removePassword provides a default value for params, but the generated signature marks it as required. Update the TypeDoc signature rendering and regenerate the snapshot.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.typedoc/__tests__/__snapshots__/user-api-methods-remove-password.mdx at
line 8, Update the TypeDoc signature rendering for removePassword so its
defaulted params argument is rendered as optional, then regenerate the
user-api-methods-remove-password snapshot to reflect the corrected signature.
There was a problem hiding this comment.
Skipping this one. It's semantically right — params has a = {} default, so TS declaration output would render it as params? — but the missing ? comes from formatTypeScriptSignature(), which this PR doesn't touch. The snapshot has to mirror generated output, so patching just the snapshot would make the test lie. A real fix means teaching the formatter to detect default-initialized params and regenerating every affected snapshot, which is out of scope here.
There was a problem hiding this comment.
@manovotny, agreed. The snapshot must reflect the current formatter output. A snapshot-only change would be incorrect.
This finding is out of scope for this PR. A separate fix should update formatTypeScriptSignature() and regenerate all affected snapshots.
Would you like me to open a follow-up issue for that work?
✏️ Learnings added
Learnt from: manovotny
Repo: clerk/javascript PR: 9372
File: .typedoc/__tests__/__snapshots__/user-api-methods-remove-password.mdx:8-8
Timestamp: 2026-08-10T18:13:38.851Z
Learning: In the `.typedoc` documentation generator, `.typedoc/formatTypeScriptSignature()` controls parameter optionality in generated TypeScript signatures. Snapshots must mirror formatter output. Correctly rendering default-initialized parameters such as `params: RemovePasswordParams = {}` as optional requires a formatter change and regeneration of all affected snapshots.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
You are interacting with an AI system.
Description
This PR fixes two outdated Dashboard links in the generated
UserAPIandlockUser()reference documentation by pointing them to the current Rules page.It also updates the Typedoc extractor to omit
@exampleblocks only from dedicated backend method page fragments, ensuring those pages follow a consistent layout while preserving examples in JSDoc, aggregate API documentation, and shared object reference fragments.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change