Skip to content

Conversation

alexisintech
Copy link
Member

@alexisintech alexisintech commented Sep 18, 2025

Description

Adds support for a custom @hideReturns tag to hide the returns section from typedoc output

For example, the verifyWebhook() method was outputting this returns section:
Screenshot 2025-09-18 at 16 46 31

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:
Screenshot 2025-09-18 at 16 46 41

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 API reference readability by supporting a new tag to hide “Returns” sections where not needed. Applied to select verification endpoints for clearer function pages. No runtime or API behavior changes.
  • Chores
    • Added a changeset entry and updated documentation tooling configuration to recognize the new tag.

Copy link

changeset-bot bot commented Sep 18, 2025

🦋 Changeset detected

Latest commit: 27b0222

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

Copy link

vercel bot commented Sep 18, 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 Sep 18, 2025 8:50pm

Copy link
Contributor

coderabbitai bot commented Sep 18, 2025

Walkthrough

Introduces 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

Cohort / File(s) Summary
TypeDoc config and theme
typedoc.config.mjs, .typedoc/custom-theme.mjs
Config registers @hideReturns as a block tag and marks it not-rendered; theme’s signatureReturns partial now early-returns empty when @hideReturns is present.
Backend JSDoc annotations
packages/backend/src/tokens/verify.ts, packages/backend/src/webhooks.ts
Adds @hideReturns to JSDoc for VerifyTokenOptions and verifyWebhook to hide Returns in generated docs. No code or signature changes.
Repo metadata
.changeset/slow-rules-travel.md
Adds empty changeset file with YAML front matter only.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A nibble of tags, a hop through themes,
I hide the Returns like moonlit dreams.
Configs aligned, the docs now neat—
Soft paws press build, a tidy feat.
With whiskers twitching, I sign and grin:
“Ship it, friends—let typings begin!” 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore(repo): Add custom @hideReturns tag for typedoc usage" is concise and accurately describes the primary change—adding support for a @hideReturns tag for TypeDoc/typedoc documentation—so a reviewer scanning PR history can quickly understand its intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch aa/fix-types

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.

Copy link

pkg-pr-new bot commented Sep 18, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: 27b0222

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

🧹 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 13d08c8 and 27b0222.

📒 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
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly 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
Use const assertions for literal types: as const
Use satisfies 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 ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly 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 to CUSTOM_BLOCK_TAGS ensures it’s recognized and suppressed via notRenderedTags/blockTags.

.changeset/slow-rules-travel.md (1)

1-2: Empty changeset may be invalid in CI

File .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 packages none). 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants