Skip to content

Conversation

@SarahSoutoul
Copy link
Contributor

@SarahSoutoul SarahSoutoul commented Nov 5, 2025

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • Documentation
    • Improved cross-reference linking for resource and type references, making documentation navigation and lookups more consistent and accurate.
  • Chores
    • Added a placeholder changeset entry to track upcoming documentation updates.

@SarahSoutoul SarahSoutoul self-assigned this Nov 5, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

🦋 Changeset detected

Latest commit: d6dc7ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@vercel
Copy link

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Nov 6, 2025 6:17pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

Added a placeholder changeset file and expanded/refactored the TypeDoc custom plugin to replace many hardcoded type-link patterns with broader, lookaround-aware regex replacements for multiple resource and param types.

Changes

Cohort / File(s) Summary
Changeset entry
\.changeset/ripe-parks-find.md
Added a new placeholder changeset file containing a minimal header (---).
TypeDoc custom plugin
\.typedoc/custom-plugin.mjs
Reworked link-replacement logic: replaced narrow hardcoded patterns with expanded catch-all regex rules (handles Appearance<Theme>, LocalizationResource, SessionResource and SessionResource[], SessionStatusClaim, SetActiveParams, SignInResource, SignedInSessionResource, SignUpResource, OrganizationResource, UserResource, etc.); added lookaround assertions to avoid matches inside brackets/backticks or adjacent punctuation; adjusted replacement targets to newer/specific docs sections and preserved other existing replacements.

Sequence Diagram(s)

sequenceDiagram
    participant Doc as TypeDoc
    participant Plugin as custom-plugin.mjs
    participant Out as RenderedDocs

    Note over Doc,Plugin `#D6EAF8`: incoming doc comment text
    Doc->>Plugin: provide raw comment text
    Plugin->>Plugin: run expanded regex replacements\n(with lookarounds to skip brackets/backticks/adjacent punctuation)
    alt match found
        Plugin-->>Out: emit replaced link tokens (mapped to docs paths)
    else no match
        Plugin-->>Out: emit original text
    end
    Note right of Out `#F9E79F`: final document text with standardized links
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review complex regex lookaround logic for false positives/negatives.
  • Verify array-form (e.g., SessionResource[]) and generic forms (e.g., Appearance<Theme>) are matched and replaced correctly.
  • Confirm replacements do not conflict with existing organization-related mappings or other downstream replacements.
  • Test against representative doc comments to ensure no unintended regressions.

Poem

"I nibble at patterns, hop through the code,
Swapping old links for a tidy road.
Tokens arrange like clover in spring,
Small rabbit fixes—quiet little thing. 🐇"

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(shared): Fix links for types' directly relates to the main change: updating documentation links in the TypeDoc custom plugin configuration for various resource and parameter types.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ss/fix-types-hooks

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between aec728a and 8958608.

📒 Files selected for processing (1)
  • .typedoc/custom-plugin.mjs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alexisintech
Copy link
Member

plan of action:
lets get #7158 merged first
then trigger new CI action
then merge clerk/clerk-docs#2756 into that newly created PR from the cI action

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5536429 and ad2e0d9.

📒 Files selected for processing (2)
  • .changeset/ripe-parks-find.md (1 hunks)
  • .typedoc/custom-plugin.mjs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/ripe-parks-find.md
🪛 LanguageTool
.changeset/ripe-parks-find.md

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

(QB_NEW_DE)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
.typedoc/custom-plugin.mjs (4)

101-103: LGTM - Appearance pattern handles edge cases correctly.

The negative lookbehind prevents false matches inside existing links or code blocks.


105-115: LGTM - BillingMoneyAmount and LoadedClerk patterns are well-structured.

The patterns correctly handle both plain text and backtick-wrapped occurrences.


120-125: Pattern inconsistency confirmed—verify whether other resources require array handling.

The SessionResource pattern is the only one that handles array notation (SessionResource[]) using word boundaries and capture group $1. Other resources (SignInResource, SignUpResource, OrganizationResource, UserResource, SignedInSessionResource) use a different approach with character-class lookarounds and don't preserve arrays.

This inconsistency is genuine. However, whether it requires fixing depends on whether other resource types actually appear with array notation in generated output. The search in .typedoc/ returned no results for arrays on other resources, which is inconclusive—the generated docs may be elsewhere or not yet built.


180-183: Complex UserResource pattern is justified and necessary—no changes required.

The pattern /(?<![\[\w])?UserResource?(?![]\w])/g correctly uses negative lookahead/lookbehind to avoid double-matching in existing links and code contexts. The simpler suggested alternative (/\| \UserResource` |/`) would only match table cells, missing UserResource references in prose, parameter descriptions, and other generated markdown contexts.

This pattern is consistent with seven other similar Resource types (BillingMoneyAmount, LocalizationResource, SessionStatusClaim, SignInResource, SignedInSessionResource, SignUpResource, OrganizationResource), indicating deliberate design to handle diverse output contexts from TypeDoc generation.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 5, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7158

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7158

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7158

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7158

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7158

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7158

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7158

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@7158

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7158

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7158

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7158

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7158

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7158

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7158

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@7158

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7158

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7158

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7158

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7158

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7158

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7158

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7158

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7158

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7158

commit: d6dc7ec

@blacksmith-sh

This comment has been minimized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
.typedoc/custom-plugin.mjs (1)

132-134: Restore inline-code styling for SetActiveParams

This replacement still drops the backticks, so SetActiveParams renders differently from the other type links. Please keep the inline-code styling.

-      replace: '[SetActiveParams](/docs/reference/javascript/types/set-active-params)',
+      replace: '[`SetActiveParams`](/docs/reference/javascript/types/set-active-params)',
🧹 Nitpick comments (1)
.typedoc/custom-plugin.mjs (1)

123-125: Keep the SessionResource suffix inside the link

Right now SessionResource[] becomes [SessionResource](/docs/... )[], so the brackets aren’t clickable. Fold the optional [] into the link text so the whole token points to the reference.

-      replace: '[`SessionResource`](/docs/reference/javascript/session)$1',
+      replace: '[`SessionResource$1`](/docs/reference/javascript/session)',
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ad2e0d9 and aec728a.

📒 Files selected for processing (1)
  • .typedoc/custom-plugin.mjs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Static analysis
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

@alexisintech alexisintech changed the title fix(shared): Fix types for hooks fix(shared): Fix links for types Nov 5, 2025
@SarahSoutoul SarahSoutoul merged commit 9abb76f into main Nov 6, 2025
40 checks passed
@SarahSoutoul SarahSoutoul deleted the ss/fix-types-hooks branch November 6, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants