-
Notifications
You must be signed in to change notification settings - Fork 386
chore(repo): Add custom @hideReturns tag for typedoc usage #6807
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 27b0222 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.
|
WalkthroughIntroduces a new TypeDoc block tag "@hideReturns" by updating typedoc.config.mjs and the custom theme to skip rendering Returns when present. Adds the tag to JSDoc blocks in two backend files. Also adds an empty changeset file. No runtime or public API changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant TD as TypeDoc
participant Cfg as typedoc.config.mjs
participant Theme as custom-theme.mjs
participant Src as Source JSDoc
Dev->>TD: Run docs generation
TD->>Cfg: Load config (block tags)
Cfg-->>TD: Register @hideReturns as block tag (not rendered)
TD->>Src: Parse JSDoc (may include @hideReturns)
TD->>Theme: Render signatureReturns partial
alt @hideReturns present
Theme-->>TD: "" (skip Returns section)
else no @hideReturns
Theme-->>TD: Render default Returns section
end
TD-->>Dev: Generated docs
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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 |
@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: |
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
🧹 Nitpick comments (1)
.typedoc/custom-theme.mjs (1)
161-166
: Make tag lookup resilient to declaration-vs‑signature comments.In some reflections, the doc comment may live on the parent declaration rather than the signature. Fallback to
model.parent?.comment
to avoid missing@hideReturns
.Apply:
- // Check if @hideReturns tag is present - if so, hide the Returns section (e.g. `## Returns`) - const hideReturnsTag = model.comment?.getTag('@hideReturns'); - if (hideReturnsTag) { - return ''; - } + // Check @hideReturns on the signature or its parent declaration + const comment = model.comment ?? model.parent?.comment; + if (comment?.getTag('@hideReturns')) { + return ''; + }
📜 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 (5)
.changeset/slow-rules-travel.md
(1 hunks).typedoc/custom-theme.mjs
(1 hunks)packages/backend/src/tokens/verify.ts
(1 hunks)packages/backend/src/webhooks.ts
(1 hunks)typedoc.config.mjs
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}
: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/backend/src/webhooks.ts
packages/backend/src/tokens/verify.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/backend/src/webhooks.ts
packages/backend/src/tokens/verify.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/backend/src/webhooks.ts
packages/backend/src/tokens/verify.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/backend/src/webhooks.ts
packages/backend/src/tokens/verify.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}
: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidany
type - preferunknown
when type is uncertain, then narrow with type guards
Useinterface
for object shapes that might be extended
Usetype
for unions, primitives, and computed types
Preferreadonly
properties for immutable data structures
Useprivate
for internal implementation details
Useprotected
for inheritance hierarchies
Usepublic
explicitly for clarity in public APIs
Preferreadonly
for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertions
for literal types:as const
Usesatisfies
operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noany
types without justification
Proper error handling with typed errors
Consistent use ofreadonly
for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/backend/src/webhooks.ts
packages/backend/src/tokens/verify.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/backend/src/webhooks.ts
packages/backend/src/tokens/verify.ts
.changeset/**
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/slow-rules-travel.md
⏰ 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: Build Packages
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
packages/backend/src/webhooks.ts (1)
59-61
: LGTM: @hideReturns applied to verifyWebhook docs.Consistent with the theme hook; should suppress the Returns section.
After docs build, ensure no “## Returns” block appears on
verifyWebhook
.typedoc.config.mjs (1)
6-12
: LGTM: Tag registered with TypeDoc.Adding
@hideReturns
toCUSTOM_BLOCK_TAGS
ensures it’s recognized and suppressed vianotRenderedTags
/blockTags
..changeset/slow-rules-travel.md (1)
1-2
: Empty changeset may be invalid in CIFile .changeset/slow-rules-travel.md contains only front‑matter delimiters (
--- … ---
). Verification failed because the Changesets CLI isn't available and node_modules are missing (sh: 1: changeset: not found; Local package.json exists, but node_modules missing). Either remove the file or replace it with a no‑release changeset (mark affected packagesnone
). Verify after installing deps:pnpm install && pnpm changeset status --verbose
packages/backend/src/tokens/verify.ts (1)
42-44
: LGTM — @hideReturns placement is correct; generated docs will omit the Returns section.JSDoc tags are present immediately above verifyToken (packages/backend/src/tokens/verify.ts — lines ~42–43); typedoc.config.mjs registers the tags and .typedoc/custom-theme.mjs contains logic to hide the "Returns" section when @hideReturns is present.
Description
Adds support for a custom
@hideReturns
tag to hide the returns section from typedoc outputFor example, the

verifyWebhook()
method was outputting this returns section:We never had the returns section for this method documented. It's a complex type that we may document in the future, but for now, we'll keep the docs as we've always had them - and hide that section.
So now, with the

@hideReturns
tag on its JSdoc comment, typedoc outputs no returns section:Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit