refactor: move billing frontend to billing repo#3577
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
41ddc9f to
7bc97f9
Compare
Move all billing frontend code from webapp/src/ee/billing/ to the billing repo's frontend/ directory. Platform now references billing code via path aliases and Vite config, mirroring the backend pattern. Key changes: - Add tsconfig.vite.json for Vite-only path resolution (no npm paths) - Update vite.config.ts with conditional billing aliases and fs.allow - Refactor eeModule.ee.tsx to use billingModule entry point - Move billingApiSchema.generated.ts to billing repo - Update dataCy.plugin to generate separate billing dataCyType.d.ts - Update eslint script to cover billing frontend code Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This test uses billing-specific data-cy values and belongs in billing e2e. Also updates billingApiSchema stub with permissive types and commits dataCyType.d.ts without billing values (CI-compatible).
Move translation of billing admin menu labels from eeModule to billingModule.useAdministrationMenuItems() hook so translation keys are extractable from the billing repo.
The committed version must match what CI generates (without billing). Billing e2e regenerates it before typecheck.
Platform's generate-data-cy.mjs and Vite plugin only scan src/ — no billing dependency. Billing e2e has its own generate script that combines platform + billing values before typechecking.
Switch can't see through Fragment children in React Router v5. Since routes.Administration is rendered outside a Switch by its consumer, Fragment works correctly.
Restores shared billing UI components (Plan, ActiveSubscription), billingApiSchema stub, tsconfig fallback paths, and tg.billing alias that were lost during rebase on main. Also updates dataCyType.d.ts.
Billing code from outside webapp/ gets duplicate package instances in production builds. Adding react-router-dom, formik, react-query, yup, clsx to resolve.dedupe ensures single instances. Also uses separate Switch blocks for platform and billing admin routes.
Change dataCyType.d.ts format from union type to interface-based pattern (DataCy.Values). TypeScript merges interface declarations across files, so each repo generates only its own values and they combine automatically. No more regeneration conflicts.
…s test Move limitPopover/, CriticalUsageCircle, TrialChip, TrialAnnouncement, BillingProgress, and other UI components that are only consumed by platform back to ee/billing/. Extract getHighlightColor to shared planUtils.ts. Move selfHostedLimits.cy.ts back to platform e2e.
GlobalLimitPopover, CriticalUsageCircle, TrialAnnouncement, TrialChip are platform components — import them directly instead of routing through billingModule.
a160cbd to
f888cea
Compare
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
webapp/src/ee/billing/to thebillingrepo'sfrontend/directorybillingModule.tsxentry point so new billing features don't require platform changestsconfig.vite.json(for Vite, no npm package paths) andtsconfig.extend.json(for tsc)Depends on
dkrizan/split-billing-frontendbranchTest plan
npm run tscpassesnpm run eslintpassesnpm run buildproduces valid bundle