Skip to content

Conversation

mauricioabreu
Copy link
Contributor

@mauricioabreu mauricioabreu commented Oct 8, 2025

Description

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

  • New Features
    • Expanded public API with additional Billing types for payer and billing webhook events, improving type coverage for billing integrations.
  • Chores
    • Added a changeset for a minor backend release to publish the new Billing type exports.

Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: c2790e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@clerk/backend Minor
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

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 Oct 8, 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 Oct 8, 2025 8:18pm

Copy link
Contributor

coderabbitai bot commented Oct 8, 2025

Walkthrough

Exports four Billing-related JSON types from packages/backend/src/index.ts and adds a changeset entry for a minor release of @clerk/backend describing the exported Billing types.

Changes

Cohort / File(s) Summary
Release metadata
\.changeset/warm-steaks-count.md
Adds a changeset for a minor release of @clerk/backend noting the export of previously missing Billing types.
Backend JSON type exports
packages/backend/src/index.ts
Adds BillingPayerJSON, BillingPaymentAttemptWebhookEventJSON, BillingSubscriptionItemWebhookEventJSON, and BillingSubscriptionWebhookEventJSON to the exported JSON types from ./api/resources/JSON.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my whiskers, hop with glee,
Four new Billing names now roam free.
Payer, payment, subscription too—
Webhooks snug in the export view.
Thump-thump, a tidy little spree.

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 clearly and concisely summarizes the main change of exporting previously missing billing types in the backend API, matching the modifications in the code.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mauricio-antunes/bill-1327-missing-type-exports

📜 Recent 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 2790956 and c2790e2.

📒 Files selected for processing (2)
  • .changeset/warm-steaks-count.md (1 hunks)
  • packages/backend/src/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/warm-steaks-count.md
**/*.{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/index.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/index.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/backend/src/index.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/index.ts
packages/**/index.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use tree-shaking friendly exports

Files:

  • packages/backend/src/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
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/index.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/index.ts
**/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/backend/src/index.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). (28)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (tanstack-react-router, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Static analysis
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
.changeset/warm-steaks-count.md (1)

1-5: LGTM!

The changeset correctly documents this as a minor release for adding new type exports. The version bump and description are appropriate.

packages/backend/src/index.ts (1)

103-109: Billing JSON type exports verified All four interfaces are defined in packages/backend/src/api/resources/JSON.ts and follow existing export patterns.


Comment @coderabbitai help to get the list of available commands and usage tips.

@mauricioabreu mauricioabreu force-pushed the mauricio-antunes/bill-1327-missing-type-exports branch from 2790956 to c2790e2 Compare October 8, 2025 20:17
@mauricioabreu mauricioabreu changed the title fix(backend): export missing Billing types fix(backend): Export missing Billing types Oct 8, 2025
@mauricioabreu mauricioabreu enabled auto-merge (squash) October 8, 2025 20:17
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)
packages/backend/src/index.ts (1)

103-109: Consider alphabetical ordering for maintainability.

The new Billing type exports are grouped by category (Payer types vs. webhook event types) rather than sorted alphabetically. For consistency with the rest of the exports list, consider reordering them alphabetically.

Apply this diff to sort alphabetically:

  BillingPayerJSON,
+  BillingPaymentAttemptWebhookEventJSON,
  BillingPlanJSON,
  BillingSubscriptionJSON,
  BillingSubscriptionItemJSON,
-  BillingPaymentAttemptWebhookEventJSON,
  BillingSubscriptionItemWebhookEventJSON,
  BillingSubscriptionWebhookEventJSON,
📜 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 7edaa7a and 2790956.

📒 Files selected for processing (2)
  • .changeset/warm-steaks-count.md (1 hunks)
  • packages/backend/src/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{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/index.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/index.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/backend/src/index.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/index.ts
packages/**/index.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use tree-shaking friendly exports

Files:

  • packages/backend/src/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
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/index.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/index.ts
**/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/backend/src/index.ts
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/warm-steaks-count.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). (6)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
.changeset/warm-steaks-count.md (1)

1-5: LGTM!

The changeset correctly documents a minor version bump for the new Billing type exports. The format follows Changesets conventions and the description is clear.

packages/backend/src/index.ts (1)

103-103: <!-- [scratchpad]
[task review_file_2/2 review_segment_2/2]
[observations]

  • rg search for export (type|interface|class) BillingPayer in packages/backend/src/api/resources/ returned no results.
  • index.ts in resources directory has no BillingPayer entry.
    [analysis]
  • No BillingPayer resource type definition or export found.
  • Could be intentional (only JSON type) or an oversight.
    [pending]
  • Confirm whether a BillingPayer resource type exists elsewhere or should be added.
    [done]
    Initial verification completed; no definition found.
    [/scratchpad]**

Missing export for BillingPayer resource
BillingPayerJSON is exported, but there’s no corresponding BillingPayer type in the Resources section. Confirm whether a BillingPayer resource exists (e.g., under packages/backend/src/api/resources) and export it alongside the other Billing types if required.

Copy link

pkg-pr-new bot commented Oct 8, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: c2790e2

@mauricioabreu mauricioabreu merged commit 4910194 into main Oct 8, 2025
45 checks passed
@mauricioabreu mauricioabreu deleted the mauricio-antunes/bill-1327-missing-type-exports branch October 8, 2025 20:26
panteliselef added a commit that referenced this pull request Oct 10, 2025
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.

3 participants