-
Notifications
You must be signed in to change notification settings - Fork 382
chore(types): Fix LocalizationResource
& CommerceSubscriptionItemResource
Typedoc links
#6531
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: e41768f The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@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: |
export type LocalizationResource = DeepPartial<DeepLocalizationWithoutObjects<__internal_LocalizationResource>>; | ||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- Needs to be an interface for typedoc to link correctly | ||
export interface LocalizationResource | ||
extends DeepPartial<DeepLocalizationWithoutObjects<__internal_LocalizationResource>> {} |
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.
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.
I am not sure if this change from type
to interface
is ok with just doing an empty changeset, or if this should be a patch
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.
We use it internally in @clerk/clerk-js
and @clerk/localizations
, but technically it's still public because anyone can import it from @clerk/types
for some random reason. So at least a patch changeset would be appropriate 🤔
📝 WalkthroughWalkthrough
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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 (10)
.typedoc/custom-plugin.mjs (2)
12-13
: Deduplicate entry in FILES_WITHOUT_HEADINGS.The file
pages-or-infinite-options.mdx
appears twice. Minor nit, but removing the duplicate avoids redundant work.Apply this diff:
'pages-or-infinite-options.mdx', - 'pages-or-infinite-options.mdx',
28-58
: Consider adding unit coverage for LINK_REPLACEMENTS.Even a lightweight test asserting that getRelativeLinkReplacements() transforms representative relative links (with and without anchors) to the expected absolute paths would prevent regressions for these entries.
I can scaffold a small test harness around the replacement function if you want.
packages/types/src/clerk.ts (7)
656-660
: Normalize JSX spacing in JSDoc component references.Keep the formatting consistent across the file as
<SignIn />
.- * Returns the configured url where `<SignIn/>` is mounted or a custom sign-in page is rendered. + * Returns the configured url where `<SignIn />` is mounted or a custom sign-in page is rendered.
663-667
: Normalize JSX spacing in JSDoc component references.Use
<SignUp />
consistently.- * Returns the configured url where `<SignUp/>` is mounted or a custom sign-up page is rendered. + * Returns the configured url where `<SignUp />` is mounted or a custom sign-up page is rendered.
710-713
: Normalize JSX spacing in JSDoc component references.Use
<Waitlist />
consistently.- * Returns the configured url where `<Waitlist/>` is mounted or a custom waitlist page is rendered. + * Returns the configured url where `<Waitlist />` is mounted or a custom waitlist page is rendered.
723-727
: Normalize JSX spacing in JSDoc component references.Use
<SignIn />
consistently.- * Redirects to the configured URL where `<SignIn/>` is mounted. + * Redirects to the configured URL where `<SignIn />` is mounted.
730-734
: Normalize JSX spacing in JSDoc component references.Use
<SignUp />
consistently.- * Redirects to the configured URL where `<SignUp/>` is mounted. + * Redirects to the configured URL where `<SignUp />` is mounted.
737-740
: Normalize JSX spacing in JSDoc component references.Use
<UserProfile />
consistently.- * Redirects to the configured URL where `<UserProfile/>` is mounted. + * Redirects to the configured URL where `<UserProfile />` is mounted.
767-770
: Normalize JSX spacing in JSDoc component references.Use
<Waitlist />
consistently.- * Redirects to the configured URL where `<Waitlist/>` is mounted. + * Redirects to the configured URL where `<Waitlist />` is mounted.packages/types/src/localization.ts (1)
63-66
: Optional: Add a direct @see to the public docs.Since you added an explicit link replacement for this type, a JSDoc @see will also help editors and IDEs.
-// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- Needs to be an interface for typedoc to link correctly +// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- Needs to be an interface for typedoc to link correctly +/** + * @see https://clerk.com/docs/customization/localization + */ export interface LocalizationResource extends DeepPartial<DeepLocalizationWithoutObjects<__internal_LocalizationResource>> {}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.typedoc/custom-plugin.mjs
(1 hunks)packages/types/src/clerk.ts
(4 hunks)packages/types/src/localization.ts
(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/types/src/clerk.ts
packages/types/src/localization.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/types/src/clerk.ts
packages/types/src/localization.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/types/src/clerk.ts
packages/types/src/localization.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/types/src/clerk.ts
packages/types/src/localization.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/types/src/clerk.ts
packages/types/src/localization.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/types/src/clerk.ts
packages/types/src/localization.ts
**/*
⚙️ CodeRabbit Configuration File
If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.
Files:
packages/types/src/clerk.ts
packages/types/src/localization.ts
🧬 Code Graph Analysis (2)
packages/types/src/clerk.ts (1)
packages/types/src/redirects.ts (1)
RedirectOptions
(40-44)
packages/types/src/localization.ts (1)
packages/types/src/utils.ts (1)
DeepPartial
(32-34)
⏰ 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). (5)
- GitHub Check: Build Packages
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: semgrep/ci
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (9)
.typedoc/custom-plugin.mjs (2)
56-57
: Explicit replacements for Localization and Commerce subscription item look correct.These additions align with the intended doc targets and preserve anchors via the shared replacement logic. Good call removing the previous catch-all mapping in favor of explicit rules to avoid unintended matches.
56-57
: No stale legacy references detectedA repository-wide search for
_LocalizationResource
or non-hyphenatedlocalizationresource.mdx
returned only valid hyphenated entries in snapshot tests:
- .typedoc/tests/snapshots/file-structure.test.ts.snap:56 —
"types/commerce-subscription-item-resource.mdx"
- .typedoc/tests/snapshots/file-structure.test.ts.snap:85 —
"types/localization-resource.mdx"
All references align with the new interface-based naming and hyphenated slugs. No further action required.
packages/types/src/clerk.ts (5)
670-673
: JSDoc update looks good.Backtick-wrapped component name reads well and should generate correct links.
675-678
: JSDoc update looks good.Consistent formatting and wording.
680-683
: JSDoc update looks good.Consistent with other component references.
742-745
: JSDoc update looks good.Consistent with other component references.
747-750
: JSDoc update looks good.Consistent with other component references.
packages/types/src/localization.ts (2)
63-66
: Switching to an interface for Typedoc linking — LGTM.This preserves assignability via
extends
while enabling stable TypeDoc linking. The ESLint disable is justified given the empty interface body.
63-66
: LocalizationResource interface has no duplicatesA ripgrep search across the repository only finds the single declaration in
packages/types/src/localization.ts
(line 64). There are no other ambient or duplicate definitions, so there’s no risk of accidental declaration merging.
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 (2)
.changeset/full-times-wear.md (2)
5-5
: Consider expanding the summary to reflect both the interface change and doc link fixesOptional: make the message a bit more descriptive to aid changelog readers, e.g., mention Typedoc link improvements for CommerceSubscriptionItemResource too.
Suggested edit:
-Convert LocalizationResource to interface for typedoc documentation +Convert LocalizationResource to an interface for Typedoc documentation; improve Typedoc links (incl. CommerceSubscriptionItemResource)
6-6
: Potential stray character at end of fileThere appears to be a lone “6” line at the end. If present in the actual file, please remove to avoid noise in the generated release notes.
-6 +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.changeset/full-times-wear.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**
📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/full-times-wear.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). (5)
- GitHub Check: Build Packages
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: semgrep/ci
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
.changeset/full-times-wear.md (1)
1-3
: Changeset frontmatter looks correct for @clerk/types patch bumpPackage name and bump type are valid. This will correctly publish a patch release of @clerk/types.
…esource` Typedoc links (clerk#6531)
Description
While reviewing clerk/clerk-docs#2488 came across regressions in the jsdocs this pr aims to resolve clerk/clerk-docs#2488 (comment) & clerk/clerk-docs#2488 (comment).
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit