refactor: extract cloud billing behind host extension points - #119
Merged
Conversation
Cloud billing no longer lives in this repository. The hosting deployment
owns it end-to-end and plugs in through generic extension points:
- OrganizationBillingPort is replaced by the billing-agnostic
OrganizationLifecyclePort (organizationCreated hook, noop community
layer); generate-id gains createIdGenerator so hosts mint their own
prefixed ids without registering prefixes here.
- The five billing tables (organization_billing, usage_record,
usage_aggregate, billing_webhook_event, billing_provider_meter) leave
the schema. The new migration is deliberately a no-op: the tables are
owned by the hosting deployment and keep their data; drizzle
tablesFilter entries guard against future generated drops.
- BackendRuntimeCapabilities becomes a generic Record<string, boolean>;
the community backend advertises {} and the selfhost smoke asserts
that.
- The studio sidebar takes extension nav items from a slot module, the
marketing nav from a config module (both empty here, aliased by the
hosted app), and the cloud /pricing page plus the pricing-preview
harness and unused billing API error contracts are removed.
Product payment semantics (App Store / Google Play / Stripe billing
retry, grace periods, Play Billing SDK) are untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Thank you for following the naming conventions for pull request titles! 🙏 |
|
Install the packages built from acb469f: @voidhash/paywalls pnpm add @voidhash/paywalls@https://pkg.voidha.sh/paywalls/acb469f@voidhash/node pnpm add @voidhash/node@https://pkg.voidha.sh/node/acb469f@voidhash/web pnpm add @voidhash/web@https://pkg.voidha.sh/web/acb469fvoidhash-cli pnpm add voidhash-cli@https://pkg.voidha.sh/cli/acb469f@voidhash/react-native pnpm add @voidhash/react-native@https://pkg.voidha.sh/react-native/acb469fInternal workspace deps (generated-clients, shared, studio) are published at the same sha and resolved automatically. Replace the sha with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes every trace of cloud billing from this repository so the hosted deployment can ship billing and pricing changes independently. Companion PR in the mono wires the other side (see
voidhash-monoPR referenced below).OrganizationBillingPort→ billing-agnosticOrganizationLifecyclePort(organizationCreatedhook, noop community layer).OrganizationServicecalls it non-fatally exactly as before.generate-id.tsexportscreateIdGeneratorso host packages mint prefixed ids without registering prefixes here; the billing prefixes are gone.organization_billing,usage_record,usage_aggregate,billing_webhook_event,billing_provider_meter) leaveschema.ts/types.ts/relations.ts. The new20260728120000_remove_billing_tablesmigration is deliberately a no-op — the tables are owned by the hosting deployment and keep their data.drizzle.config.tstablesFilterentries (with an explanatory comment) guard against any future generated drop.BackendRuntimeCapabilitiesis now a genericReadonly<Record<string, boolean>>; the community backend serves{ enterprise: {} }andselfhost/smoke.mtsasserts that.organization-nav-slotmodule and marketing nav links frommarketing-nav-config(both empty here; the hosted app vite-aliases them). The cloud/pricingpage, itspricing-previewharness, the deadorganization-settings-sidebarfile, unused billing API error contracts, thepackages/sharedbilling tombstone, and the stalePOLAR_ACCESS_TOKENturbo env entry are removed.routeTree.gen.tshand-mirrored.Untouched by design: product payment semantics — App Store / Google Play / Stripe billing-retry and grace-period handling, Play Billing SDK bindings, StoreKit
PAY_AS_YOU_GOoffer types.Validation
tsc --noEmitclean inpackages/core,packages/db,packages/shared,packages/api-contracts,apps/backend,apps/www.packages/coreorganizations + generate-id: 54).billing/autumn/polarhits are only product payment semantics, historical migration snapshots, and the documentedtablesFilterguard.🤖 Generated with Claude Code