docs(repo): Add additional typedoc outputs#8483
Conversation
…ectionsamlconnection
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 22fe185 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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 |
📝 WalkthroughWalkthroughAdds SAML and OAuth nested types to Backend EnterpriseConnection and updates its fromJSON mapping; tightens useOAuthConsent API by making its params and related types required; introduces camelCase public OAuth consent types and removes the optional scope from GetOAuthConsentInfoParams; updates a JSDoc line for EnterpriseAccountConnection; and extends the TypeDoc custom plugin with additional files-to-strip and link-replacement rules (including o-auth-consent entries, enterprise-connection variants, clerk-api-error, and a catch-all for ClerkAPIResponseError). Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@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: |
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 `@packages/shared/src/react/hooks/useOAuthConsent.tsx`:
- Around line 27-30: The hook useOAuthConsent currently destructures params
immediately which crashes when callers omit params; make it runtime-safe by
defaulting params to an empty object (or provide a default in the destructuring)
so the destructuring of oauthClientIdParam, scope, keepPreviousData, and enabled
succeeds even when params is undefined; update the function signature or the
const line that extracts oauthClientId: oauthClientIdParam, scope,
keepPreviousData = true, enabled = true to use a safe default (e.g., params = {}
or ({ ... } = params || {})) and keep the existing empty-client-id fallback
logic intact.
🪄 Autofix (Beta)
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
Run ID: 0e5af9cc-d8af-4adf-892a-9cfd9f16aea4
📒 Files selected for processing (6)
.typedoc/custom-plugin.mjspackages/backend/src/api/resources/EnterpriseAccount.tspackages/backend/src/api/resources/EnterpriseConnection.tspackages/shared/src/react/hooks/useOAuthConsent.tsxpackages/shared/src/react/hooks/useOAuthConsent.types.tspackages/shared/src/types/oauthApplication.ts
| export function useOAuthConsent(params: UseOAuthConsentParams): UseOAuthConsentReturn { | ||
| useAssertWrappedByClerkProvider(HOOK_NAME); | ||
|
|
||
| const { oauthClientId: oauthClientIdParam, scope, keepPreviousData = true, enabled = true } = params; |
There was a problem hiding this comment.
Keep useOAuthConsent() runtime-safe when params are omitted.
Removing the default object turns useOAuthConsent() into a runtime crash for JS/untyped callers: Line 30 destructures params immediately, so useOAuthConsent() now throws before it reaches the existing empty-client-id fallback. That is a breaking behavior change for a public hook in a docs-focused PR.
Suggested fix
export function useOAuthConsent(params: UseOAuthConsentParams): UseOAuthConsentReturn {
useAssertWrappedByClerkProvider(HOOK_NAME);
- const { oauthClientId: oauthClientIdParam, scope, keepPreviousData = true, enabled = true } = params;
+ const {
+ oauthClientId: oauthClientIdParam,
+ scope,
+ keepPreviousData = true,
+ enabled = true,
+ } = params ?? ({} as UseOAuthConsentParams);
const clerk = useClerkInstanceContext();
const user = useUserBase();🤖 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 `@packages/shared/src/react/hooks/useOAuthConsent.tsx` around lines 27 - 30,
The hook useOAuthConsent currently destructures params immediately which crashes
when callers omit params; make it runtime-safe by defaulting params to an empty
object (or provide a default in the destructuring) so the destructuring of
oauthClientIdParam, scope, keepPreviousData, and enabled succeeds even when
params is undefined; update the function signature or the const line that
extracts oauthClientId: oauthClientIdParam, scope, keepPreviousData = true,
enabled = true to use a safe default (e.g., params = {} or ({ ... } = params ||
{})) and keep the existing empty-client-id fallback logic intact.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.changeset/dry-mice-begin.md (1)
6-6: ⚡ Quick winConsider a more detailed summary for the changelog.
The current summary "Fix OAuth consent component and hook related types" is quite vague. Based on the PR objectives and AI summary, the changes include:
- Making
oauthClientIdrequired inuseOAuthConsentparams (was optional)- Adding new backend enterprise connection types (
EnterpriseConnectionSamlConnection,EnterpriseConnectionOauthConfig)- Exposing previously internal OAuth consent types for TypeDoc
A more descriptive summary would help users understand the impact when reading the changelog. For example:
Expose OAuth consent types and enterprise connection nested types for documentation. Make `oauthClientId` required in `useOAuthConsent` to align types with runtime behavior.🤖 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 @.changeset/dry-mice-begin.md at line 6, Update the changelog summary to be more descriptive: replace the vague line "Fix OAuth consent component and hook related types" with a concise explanation reflecting the actual changes (e.g., "Expose OAuth consent types and enterprise connection nested types for documentation; make `oauthClientId` required in `useOAuthConsent` to align types with runtime behavior"), and mention the added types `EnterpriseConnectionSamlConnection` and `EnterpriseConnectionOauthConfig` plus the exposure of previously internal OAuth consent types for TypeDoc so users immediately see scope and impact.
🤖 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 @.changeset/dry-mice-begin.md:
- Line 6: Update the changelog sentence "Fix OAuth consent component and hook
related types." to hyphenate the compound modifier by changing it to "Fix OAuth
consent component and hook-related types." Locate the exact string in the
.changeset entry and replace only the phrase "hook related" with "hook-related"
so punctuation and capitalization remain consistent.
---
Nitpick comments:
In @.changeset/dry-mice-begin.md:
- Line 6: Update the changelog summary to be more descriptive: replace the vague
line "Fix OAuth consent component and hook related types" with a concise
explanation reflecting the actual changes (e.g., "Expose OAuth consent types and
enterprise connection nested types for documentation; make `oauthClientId`
required in `useOAuthConsent` to align types with runtime behavior"), and
mention the added types `EnterpriseConnectionSamlConnection` and
`EnterpriseConnectionOauthConfig` plus the exposure of previously internal OAuth
consent types for TypeDoc so users immediately see scope and impact.
🪄 Autofix (Beta)
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
Run ID: b385e1f5-cab1-4173-b00c-64c623024721
📒 Files selected for processing (1)
.changeset/dry-mice-begin.md
| "@clerk/shared": patch | ||
| --- | ||
|
|
||
| Fix OAuth consent component and hook related types. |
There was a problem hiding this comment.
Fix grammar: hyphenate compound modifier.
"hook related types" should be "hook-related types" (hyphenated compound modifier).
📝 Proposed fix
-Fix OAuth consent component and hook related types.
+Fix OAuth consent component and hook-related types.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Fix OAuth consent component and hook related types. | |
| Fix OAuth consent component and hook-related types. |
🧰 Tools
🪛 LanguageTool
[grammar] ~6-~6: Use a hyphen to join words.
Context: ...-- Fix OAuth consent component and hook related types.
(QB_NEW_EN_HYPHEN)
🤖 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 @.changeset/dry-mice-begin.md at line 6, Update the changelog sentence "Fix
OAuth consent component and hook related types." to hyphenate the compound
modifier by changing it to "Fix OAuth consent component and hook-related types."
Locate the exact string in the .changeset entry and replace only the phrase
"hook related" with "hook-related" so punctuation and capitalization remain
consistent.
|
@alexisintech Rob and I just finished wrapping up this PR if we could get your eyes on it! Thank you! |
Description
This PR is two fold:
It adds changes to bring in Typedoc outputs to help with this PR. The changes are the following:
@internalfromuseOAuthConsent()and its params/return types so Typedoc generates outputs for them that can be used in the docs.oauthClientIdis explicitly required.OAuthConsentInfo,OAuthConsentScope, and related OAuth consent fields that can be used as types in the docs..typedoc/custom-plugin.mjsso new generated params/returns/types link correctly in docs.It adds changes to resolve the issue raised here related to creating a page for
enterprise-connection-oauth-config..typedoc/custom-plugin.mjsso new generated enterprise types link correctly in docs.EnterpriseAccountConnectionandEnterpriseConnectionSamlConnectionbackend resource types used in the generated output.Apart from these two objectives, I also made sure that
ClerkAPIResponseErrorandClerkAPIErrorwere correctly linked through updates in the.typedoc/custom-plugin.mjsfile.When this is released, I will generate a Typedoc PR in
clerk-docsand will add the docs specific changes that are needed to bring all of this together. Once that Typedoc PR is released, we will then be able to modify this PR from @wobsoriano to be using typedoc rather than manual input.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change