-
Notifications
You must be signed in to change notification settings - Fork 414
chore(clerk-js): Add API keys and Billing routes as valid reorder labels #7383
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: 97d9623 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 GitHub.
|
WalkthroughThis pull request adds 'billing' and 'apiKeys' to reorderable page labels across Astro, React, Vue, and Clerk JS packages, updating configuration arrays and public type signatures to include the new labels. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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: 1
📜 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)
packages/react/src/types.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
All code must pass ESLint checks with the project's configuration
Files:
packages/react/src/types.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/react/src/types.ts
packages/**/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/react/src/types.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Follow established naming conventions (PascalCase for components, camelCase for variables)
Prefer importing types from
@clerk/shared/typesinstead of the deprecated@clerk/typesalias
Files:
packages/react/src/types.ts
packages/**/src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
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
Implement proper logging with different levels
Files:
packages/react/src/types.ts
**/*.ts?(x)
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
Files:
packages/react/src/types.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)
**/*.{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
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Implement type guards forunknowntypes using the patternfunction isType(value: unknown): value is Type
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details in classes
Useprotectedfor inheritance hierarchies
Usepublicexplicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like<T extends { id: string }>
Use utility types likeOmit,Partial, andPickfor data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Useconst assertionswithas constfor literal types
Usesatisfiesoperator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...
Files:
packages/react/src/types.ts
⏰ 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). (6)
- GitHub Check: Publish with pkg-pr-new
- GitHub Check: Unit Tests (22, shared, clerk-js, RQ)
- GitHub Check: Unit Tests (22, **)
- GitHub Check: Static analysis
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/react/src/types.ts (1)
134-134: React and Vue type definitions are consistent; Astro and Clerk JS don't require these profile page props.The 'billing' and 'apiKeys' labels are correctly defined in
UserProfilePagePropsandOrganizationProfilePagePropsacross React and Vue packages. The reorder logic in React'suseCustomPages.tsxproperly includes both labels. Astro does not implement profile page customization types (uses a different architecture), and Clerk JS is not a UI component package. No issues found with label handling.
| }; | ||
|
|
||
| export type UserProfilePageProps = PageProps<'account' | 'security'>; | ||
| export type UserProfilePageProps = PageProps<'account' | 'security' | 'billing' | 'apiKeys'>; |
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.
🛠️ Refactor suggestion | 🟠 Major
Add JSDoc documentation for the new page labels.
As per coding guidelines, all public APIs must be documented with JSDoc. These type definitions should include comments explaining what the 'billing' and 'apiKeys' labels represent and mention that they require per-instance feature flags to be enabled.
Apply this diff to add JSDoc documentation:
+/**
+ * Props for custom pages in the UserProfile component.
+ * Use 'account', 'security', 'billing', or 'apiKeys' for built-in pages.
+ * Note: 'billing' and 'apiKeys' require per-instance feature flags to be enabled.
+ */
export type UserProfilePageProps = PageProps<'account' | 'security' | 'billing' | 'apiKeys'>;
export type UserProfileLinkProps = {
url: string;
label: string;
labelIcon: React.ReactNode;
};
+/**
+ * Props for custom pages in the OrganizationProfile component.
+ * Use 'general', 'members', 'billing', or 'apiKeys' for built-in pages.
+ * Note: 'billing' and 'apiKeys' require per-instance feature flags to be enabled.
+ */
export type OrganizationProfilePageProps = PageProps<'general' | 'members' | 'billing' | 'apiKeys'>;Based on coding guidelines: "Maintain comprehensive JSDoc comments for public APIs" and "All public APIs must be documented with JSDoc."
Also applies to: 142-142
🤖 Prompt for AI Agents
In packages/react/src/types.ts around lines 134 and 142, add JSDoc comments for
the exported PageProps type labels: document what the 'billing' label represents
(the user billing management page) and what the 'apiKeys' label represents (API
key management page), and explicitly state that both 'billing' and 'apiKeys'
require per-instance feature flags to be enabled; place concise JSDoc blocks
immediately above the type declarations so the comments are included in the
public API docs and follow existing JSDoc style in the file.
Description
Adds
apiKeysandbillingas valid reorder labels for <UserProfile.Page /> and <OrganizationProfile.Page /> components.No new tests added here. The underlying reordering logic is already covered by existing tests. The
apiKeysandbillingroutes require per-instance feature flags to be enabled.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.