-
Notifications
You must be signed in to change notification settings - Fork 406
fix(shared): Fix links for types #7158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: d6dc7ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdded 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
⏰ 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)
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. Comment |
|
plan of action: |
There was a problem hiding this 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.
📒 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])/gcorrectly 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.
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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 SetActiveParamsThis replacement still drops the backticks, so
SetActiveParamsrenders 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 linkRight 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.
📒 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
Description
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit