-
Notifications
You must be signed in to change notification settings - Fork 386
chore(clerk-js,types): Rename commerce files to billing #6813
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: 6c5e6a4 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.
|
WalkthroughSystematically replaces Commerce-prefixed modules, types, and utilities with Billing equivalents across core, resources, utils, shared React hooks, and types packages. Adjusts re-exports and import sources, removes a type guard in utils in favor of an in-operator check, and adds a changeset metadata file. No new features introduced. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
Comment |
e969535
to
3aa9210
Compare
@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 (3)
.changeset/all-papers-call.md (1)
1-2
: Changeset file is effectively empty.This changeset contains only the required separator lines but no actual change description or version bump specification. A proper changeset should include:
- Package names affected by the changes
- Version bump type (patch, minor, major)
- Description of the changes
Since this appears to be a systematic refactoring from Commerce to Billing across multiple packages, consider adding content like:
--- +"@clerk/clerk-js": minor +"@clerk/types": minor +"@clerk/shared": minor --- + +Rename commerce files and types to billing. This is part of rebranding the Commerce feature to Billing while maintaining backward compatibility.packages/shared/src/react/hooks/createBillingPaginatedHook.tsx (1)
28-40
: Update JSDoc comment to reflect the "billing" terminology.The JSDoc comment still references "commerce-related resources" which is outdated after the migration to billing terminology.
Apply this diff to update the comment:
/** - * A hook factory that creates paginated data fetching hooks for commerce-related resources. + * A hook factory that creates paginated data fetching hooks for billing-related resources. * It provides a standardized way to create hooks that can fetch either user or organization resources * with built-in pagination support. * * The generated hooks handle: * - Clerk authentication context * - Resource-specific data fetching * - Pagination (both traditional and infinite scroll) * - Telemetry tracking * - Type safety for the specific resource. * * @internal */packages/shared/src/react/hooks/usePaymentMethods.tsx (1)
11-11
: Consider updating resourceType to reflect billing terminology.The
resourceType: 'commerce-payment-methods'
still uses the old "commerce" prefix. For consistency with the billing migration, consider updating this to'billing-payment-methods'
.Apply this diff if you want to maintain naming consistency:
export const usePaymentMethods = createBillingPaginatedHook<BillingPaymentSourceResource, GetPaymentSourcesParams>({ hookName: 'usePaymentMethods', - resourceType: 'commerce-payment-methods', + resourceType: 'billing-payment-methods', useFetcher: resource => {Note: Only apply this change if the backend expects this new resourceType identifier.
📜 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 (20)
.changeset/all-papers-call.md
(1 hunks)packages/clerk-js/src/core/clerk.ts
(1 hunks)packages/clerk-js/src/core/modules/billing/index.ts
(1 hunks)packages/clerk-js/src/core/resources/BillingCheckout.ts
(1 hunks)packages/clerk-js/src/core/resources/BillingPlan.ts
(1 hunks)packages/clerk-js/src/core/resources/Organization.ts
(1 hunks)packages/clerk-js/src/core/resources/User.ts
(1 hunks)packages/clerk-js/src/core/resources/internal.ts
(1 hunks)packages/clerk-js/src/utils/billing.ts
(1 hunks)packages/clerk-js/src/utils/index.ts
(1 hunks)packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
(2 hunks)packages/shared/src/react/hooks/usePaymentAttempts.tsx
(1 hunks)packages/shared/src/react/hooks/usePaymentMethods.tsx
(1 hunks)packages/shared/src/react/hooks/usePlans.tsx
(1 hunks)packages/shared/src/react/hooks/useStatements.tsx
(1 hunks)packages/types/src/clerk.ts
(1 hunks)packages/types/src/index.ts
(1 hunks)packages/types/src/json.ts
(1 hunks)packages/types/src/organization.ts
(1 hunks)packages/types/src/user.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{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/index.ts
packages/clerk-js/src/core/resources/BillingCheckout.ts
packages/clerk-js/src/core/modules/billing/index.ts
packages/types/src/user.ts
packages/clerk-js/src/utils/index.ts
packages/clerk-js/src/core/resources/BillingPlan.ts
packages/types/src/json.ts
packages/clerk-js/src/core/clerk.ts
packages/clerk-js/src/core/resources/User.ts
packages/clerk-js/src/core/resources/Organization.ts
packages/types/src/clerk.ts
packages/shared/src/react/hooks/usePaymentMethods.tsx
packages/clerk-js/src/utils/billing.ts
packages/clerk-js/src/core/resources/internal.ts
packages/shared/src/react/hooks/useStatements.tsx
packages/shared/src/react/hooks/usePaymentAttempts.tsx
packages/shared/src/react/hooks/usePlans.tsx
packages/types/src/organization.ts
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
**/*.{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/index.ts
packages/clerk-js/src/core/resources/BillingCheckout.ts
packages/clerk-js/src/core/modules/billing/index.ts
packages/types/src/user.ts
packages/clerk-js/src/utils/index.ts
packages/clerk-js/src/core/resources/BillingPlan.ts
packages/types/src/json.ts
packages/clerk-js/src/core/clerk.ts
packages/clerk-js/src/core/resources/User.ts
packages/clerk-js/src/core/resources/Organization.ts
packages/types/src/clerk.ts
packages/shared/src/react/hooks/usePaymentMethods.tsx
packages/clerk-js/src/utils/billing.ts
packages/clerk-js/src/core/resources/internal.ts
packages/shared/src/react/hooks/useStatements.tsx
packages/shared/src/react/hooks/usePaymentAttempts.tsx
packages/shared/src/react/hooks/usePlans.tsx
packages/types/src/organization.ts
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/types/src/index.ts
packages/clerk-js/src/core/resources/BillingCheckout.ts
packages/clerk-js/src/core/modules/billing/index.ts
packages/types/src/user.ts
packages/clerk-js/src/utils/index.ts
packages/clerk-js/src/core/resources/BillingPlan.ts
packages/types/src/json.ts
packages/clerk-js/src/core/clerk.ts
packages/clerk-js/src/core/resources/User.ts
packages/clerk-js/src/core/resources/Organization.ts
packages/types/src/clerk.ts
packages/shared/src/react/hooks/usePaymentMethods.tsx
packages/clerk-js/src/utils/billing.ts
packages/clerk-js/src/core/resources/internal.ts
packages/shared/src/react/hooks/useStatements.tsx
packages/shared/src/react/hooks/usePaymentAttempts.tsx
packages/shared/src/react/hooks/usePlans.tsx
packages/types/src/organization.ts
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/types/src/index.ts
packages/clerk-js/src/core/resources/BillingCheckout.ts
packages/clerk-js/src/core/modules/billing/index.ts
packages/types/src/user.ts
packages/clerk-js/src/utils/index.ts
packages/clerk-js/src/core/resources/BillingPlan.ts
packages/types/src/json.ts
packages/clerk-js/src/core/clerk.ts
packages/clerk-js/src/core/resources/User.ts
packages/clerk-js/src/core/resources/Organization.ts
packages/types/src/clerk.ts
packages/shared/src/react/hooks/usePaymentMethods.tsx
packages/clerk-js/src/utils/billing.ts
packages/clerk-js/src/core/resources/internal.ts
packages/shared/src/react/hooks/useStatements.tsx
packages/shared/src/react/hooks/usePaymentAttempts.tsx
packages/shared/src/react/hooks/usePlans.tsx
packages/types/src/organization.ts
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
packages/**/index.{js,ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use tree-shaking friendly exports
Files:
packages/types/src/index.ts
packages/clerk-js/src/core/modules/billing/index.ts
packages/clerk-js/src/utils/index.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/index.ts
packages/clerk-js/src/core/resources/BillingCheckout.ts
packages/clerk-js/src/core/modules/billing/index.ts
packages/types/src/user.ts
packages/clerk-js/src/utils/index.ts
packages/clerk-js/src/core/resources/BillingPlan.ts
packages/types/src/json.ts
packages/clerk-js/src/core/clerk.ts
packages/clerk-js/src/core/resources/User.ts
packages/clerk-js/src/core/resources/Organization.ts
packages/types/src/clerk.ts
packages/shared/src/react/hooks/usePaymentMethods.tsx
packages/clerk-js/src/utils/billing.ts
packages/clerk-js/src/core/resources/internal.ts
packages/shared/src/react/hooks/useStatements.tsx
packages/shared/src/react/hooks/usePaymentAttempts.tsx
packages/shared/src/react/hooks/usePlans.tsx
packages/types/src/organization.ts
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
**/*.{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/index.ts
packages/clerk-js/src/core/resources/BillingCheckout.ts
packages/clerk-js/src/core/modules/billing/index.ts
packages/types/src/user.ts
packages/clerk-js/src/utils/index.ts
packages/clerk-js/src/core/resources/BillingPlan.ts
packages/types/src/json.ts
packages/clerk-js/src/core/clerk.ts
packages/clerk-js/src/core/resources/User.ts
packages/clerk-js/src/core/resources/Organization.ts
packages/types/src/clerk.ts
packages/shared/src/react/hooks/usePaymentMethods.tsx
packages/clerk-js/src/utils/billing.ts
packages/clerk-js/src/core/resources/internal.ts
packages/shared/src/react/hooks/useStatements.tsx
packages/shared/src/react/hooks/usePaymentAttempts.tsx
packages/shared/src/react/hooks/usePlans.tsx
packages/types/src/organization.ts
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
**/index.ts
📄 CodeRabbit inference engine (.cursor/rules/react.mdc)
Use index.ts files for clean imports but avoid deep barrel exports
Avoid barrel files (index.ts re-exports) as they can cause circular dependencies
Files:
packages/types/src/index.ts
packages/clerk-js/src/core/modules/billing/index.ts
packages/clerk-js/src/utils/index.ts
.changeset/**
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/all-papers-call.md
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{jsx,tsx}
: Use error boundaries in React components
Minimize re-renders in React components
**/*.{jsx,tsx}
: Always use functional components with hooks instead of class components
Follow PascalCase naming for components:UserProfile
,NavigationMenu
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Use useState for simple state management
Use useReducer for complex state logic
Implement proper state initialization
Use proper state updates with callbacks
Implement proper state cleanup
Use Context API for theme/authentication
Implement proper state selectors
Use proper state normalization
Implement proper state persistence
Use React.memo for expensive components
Implement proper useCallback for handlers
Use proper useMemo for expensive computations
Implement proper virtualization for lists
Use proper code splitting with React.lazy
Implement proper cleanup in useEffect
Use proper refs for DOM access
Implement proper event listener cleanup
Use proper abort controllers for fetch
Implement proper subscription cleanup
Use proper HTML elements
Implement proper ARIA attributes
Use proper heading hierarchy
Implement proper form labels
Use proper button types
Implement proper focus management
Use proper keyboard shortcuts
Implement proper tab order
Use proper skip links
Implement proper focus traps
Implement proper error boundaries
Use proper error logging
Implement proper error recovery
Use proper error messages
Implement proper error fallbacks
Use proper form validation
Implement proper error states
Use proper error messages
Implement proper form submission
Use proper form reset
Use proper component naming
Implement proper file naming
Use proper prop naming
Implement proper...
Files:
packages/shared/src/react/hooks/usePaymentMethods.tsx
packages/shared/src/react/hooks/useStatements.tsx
packages/shared/src/react/hooks/usePaymentAttempts.tsx
packages/shared/src/react/hooks/usePlans.tsx
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/react.mdc)
**/*.tsx
: Use proper type definitions for props and state
Leverage TypeScript's type inference where possible
Use proper event types for handlers
Implement proper generic types for reusable components
Use proper type guards for conditional rendering
Files:
packages/shared/src/react/hooks/usePaymentMethods.tsx
packages/shared/src/react/hooks/useStatements.tsx
packages/shared/src/react/hooks/usePaymentAttempts.tsx
packages/shared/src/react/hooks/usePlans.tsx
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
🧬 Code graph analysis (5)
packages/shared/src/react/hooks/usePaymentMethods.tsx (2)
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx (1)
createBillingPaginatedHook
(41-112)packages/types/src/billing.ts (2)
BillingPaymentSourceResource
(276-329)GetPaymentSourcesParams
(228-228)
packages/shared/src/react/hooks/useStatements.tsx (4)
packages/clerk-js/src/ui/contexts/components/Plans.tsx (1)
useStatements
(52-61)packages/shared/src/react/hooks/index.ts (1)
useStatements
(11-11)packages/shared/src/react/hooks/createBillingPaginatedHook.tsx (1)
createBillingPaginatedHook
(41-112)packages/types/src/billing.ts (2)
BillingStatementResource
(430-451)GetStatementsParams
(415-415)
packages/shared/src/react/hooks/usePaymentAttempts.tsx (4)
packages/clerk-js/src/ui/contexts/components/Plans.tsx (1)
usePaymentAttempts
(42-50)packages/shared/src/react/hooks/index.ts (1)
usePaymentAttempts
(12-12)packages/shared/src/react/hooks/createBillingPaginatedHook.tsx (1)
createBillingPaginatedHook
(41-112)packages/types/src/billing.ts (2)
BillingPaymentResource
(368-405)GetPaymentAttemptsParams
(410-410)
packages/shared/src/react/hooks/usePlans.tsx (4)
packages/clerk-js/src/ui/contexts/components/Plans.tsx (1)
usePlans
(80-90)packages/shared/src/react/hooks/index.ts (1)
usePlans
(14-14)packages/shared/src/react/hooks/createBillingPaginatedHook.tsx (1)
createBillingPaginatedHook
(41-112)packages/types/src/billing.ts (2)
BillingPlanResource
(122-189)GetPlansParams
(110-115)
packages/shared/src/react/hooks/createBillingPaginatedHook.tsx (3)
packages/types/src/resource.ts (1)
ClerkResource
(8-21)packages/shared/src/react/types.ts (2)
PagesOrInfiniteOptions
(133-156)PaginatedHookConfig
(90-103)packages/types/src/billing.ts (1)
ForPayerType
(69-69)
⏰ 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). (26)
- GitHub Check: pr-title-lint
- GitHub Check: Integration Tests (custom, chrome)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (vue, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (nextjs, chrome, 15)
- GitHub Check: Integration Tests (nextjs, chrome, 14)
- GitHub Check: Integration Tests (elements, chrome)
- GitHub Check: Integration Tests (machine, chrome)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (react-router, chrome)
- GitHub Check: Integration Tests (tanstack-react-router, chrome)
- GitHub Check: Integration Tests (expo-web, chrome)
- GitHub Check: Integration Tests (ap-flows, chrome)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (astro, chrome)
- GitHub Check: Integration Tests (tanstack-react-start, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: Integration Tests (quickstart, chrome)
- GitHub Check: Publish with pkg-pr-new
- GitHub Check: Static analysis
- GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
- GitHub Check: Unit Tests (22, **)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (22)
packages/types/src/json.ts (1)
14-14
: LGTM! Import source updated correctly.The billing-related types are now properly imported from the
./billing
module, aligning with the broader migration from commerce to billing terminology.packages/types/src/user.ts (1)
2-2
: LGTM! Import source migrated to billing module.The
BillingPaymentSourceMethods
import has been correctly updated to reference the new billing module location while maintaining the same interface contract.packages/types/src/clerk.ts (1)
30-31
: LGTM! Billing imports migrated correctly.The import reorganization properly moves all billing-related types from
./commerce
to./billing
while maintaining clean separation between billing imports and other imports. The ClientResource import positioning is also appropriate.packages/types/src/organization.ts (1)
1-1
: LGTM! Import source updated to billing module.The
BillingPaymentSourceMethods
import has been correctly migrated from./commerce
to./billing
, aligning with the broader refactoring while preserving the interface contract.packages/clerk-js/src/utils/billing.ts (1)
34-36
: LGTM! Type guard replaced with inline property check.The replacement of the
hasPastDue
type guard with a directin
operator check is appropriate and simpler. This change maintains the same runtime behavior while reducing code complexity by inlining the property existence check.packages/clerk-js/src/utils/index.ts (1)
3-3
: LGTM! Utils export switched to billing module.The export statement correctly references the new
./billing
module, completing the migration from commerce to billing terminology in the utilities layer.packages/types/src/index.ts (1)
9-9
: LGTM — billing exported; no './commerce' export remains.export * from './billing'
is present in packages/types/src/index.ts; there is noexport * from './commerce'
(onlyexport * from './commerceSettings'
remains) and no other './commerce' exports were found in packages/types/src.packages/shared/src/react/hooks/createBillingPaginatedHook.tsx (3)
16-25
: LGTM! The type rename is consistent with the broader migration.The
BillingHookConfig
type correctly replaces the previousCommerceHookConfig
and maintains the same generic structure and properties.
41-46
: LGTM! Function and internal hook naming is consistent.Both
createBillingPaginatedHook
anduseBillingHook
follow the established billing nomenclature correctly.Also applies to: 51-51
87-89
: Verify commerceSettings path still exists after billing migrationpackages/shared/src/react/hooks/createBillingPaginatedHook.tsx (≈lines 87–89) references
environment?.commerceSettings.billing.{organization|user}.enabled
. Automated search returned no matches and rg reported "unrecognized file type: tsx" — unable to confirm the config shape. Verify the billing settings path still exists or update usage; run locally:rg -n --hidden "commerceSettings|billing\.organization\.enabled|billing\.user\.enabled|environment.*billing.*enabled" -g '!node_modules'
packages/shared/src/react/hooks/usePlans.tsx (1)
4-4
: LGTM! Import and hook factory usage correctly updated.The change from importing a re-export alias to directly importing
createBillingPaginatedHook
is correct and maintains the same functionality.Also applies to: 9-9
packages/shared/src/react/hooks/usePaymentAttempts.tsx (1)
4-4
: LGTM! Consistent migration to billing hook factory.The import and usage changes align with the broader billing migration and maintain functional consistency.
Also applies to: 9-9
packages/shared/src/react/hooks/usePaymentMethods.tsx (1)
4-4
: LGTM! Payment methods hook correctly migrated.The change is consistent with other hook migrations in this PR.
Also applies to: 9-9
packages/shared/src/react/hooks/useStatements.tsx (1)
4-4
: LGTM! Statements hook correctly migrated.The import and usage changes are consistent with the billing migration.
Also applies to: 9-9
packages/clerk-js/src/core/resources/BillingCheckout.ts (2)
14-14
: LGTM! Import updated correctly for billing migration.The change from
./CommercePayer
to./BillingPayer
is consistent with the file renaming pattern.
64-65
: Do not rename endpoints — /commerce/ is the intended billing pathCHANGELOG and multiple billing modules use
/commerce/
(e.g. packages/clerk-js/CHANGELOG.md; packages/clerk-js/src/core/resources/BillingCheckout.ts:64-65), so the original suggestion to switch to/billing/
is incorrect.Likely an incorrect or invalid review comment.
packages/clerk-js/src/core/clerk.ts (1)
151-151
: LGTM! Import path correctly updated for billing module.The import change from
./modules/commerce
to./modules/billing
is consistent with the module restructuring.packages/clerk-js/src/core/resources/Organization.ts (1)
31-31
: LGTM! Import path updated correctly for billing helpers.The import change from
../modules/commerce
to../modules/billing
aligns with the module reorganization.packages/clerk-js/src/core/resources/User.ts (1)
39-39
: Import path updated correctly from commerce to billing module.The change updates the import source from
../modules/commerce
to../modules/billing
, which aligns with the PR's objective to rename commerce-related files to billing. The imported functionsaddPaymentSource
,getPaymentSources
, andinitializePaymentSource
remain unchanged, maintaining backward compatibility at the function level.packages/clerk-js/src/core/resources/BillingPlan.ts (1)
3-3
: Import path updated correctly from commerce to billing utilities.The change updates the import source from
@/utils/commerce
to@/utils/billing
, which aligns with the broader migration from Commerce to Billing terminology. The imported functionbillingMoneyAmountFromJSON
remains functionally unchanged.packages/clerk-js/src/core/resources/internal.ts (1)
7-13
: Verified — Billing exports present; no Commerce references remainAll Billing resource files and Feature.ts exist in packages/clerk-js/src/core/resources, and no Commerce imports or references were detected in packages/clerk-js/src/.
packages/clerk-js/src/core/modules/billing/index.ts (1)
1-1
: Approve — namespace module present and exports expected Billing APIpackages/clerk-js/src/core/modules/billing/namespace.ts exports
class Billing implements BillingNamespace
with methods getPlans, getPlan, getSubscription, getStatements, getStatement, getPaymentAttempts, getPaymentAttempt, and startCheckout; no remaining references to CommerceBilling were found.
Description
🧹 cleaning up references to commerce
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit