fix(apps): use brand-agnostic adopter config imports#387
fix(apps): use brand-agnostic adopter config imports#387diego-artificerinnovations wants to merge 3 commits into
Conversation
Replace deprecated BEAKERSTACK_METER_AI_SUMMARIZE with METER_AI_SUMMARIZE in all apps/* billing screens. Update test assertions in apps/* to import from @adopter/config/* so they stay correct after npm run rename. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CI Coverage & Test Summary
Suites: 64 passed, 0 failed (64 total) · Tests: 665 passed, 0 failed (665 total) ✅ All reported test suites passed. Coverage artifacts: Updated at: May 31, 2026 at 12:22 PM PDT |
Last deployed: 12:22 PDT 📱 Mobile preview: Channel 📱 Mobile Preview (OTA Updates)No native code changes detected - using OTA updates only. Step 1: Install Development Build (one-time setup)
Step 2: Load PR Preview Update
Note: You must use the full URL format - just entering the channel name ( Alternative: For local development, use: 📖 See Mobile Build Testing Guide for detailed instructions. |
There was a problem hiding this comment.
Pull request overview
This PR makes the apps/mobile and apps/web template code resilient to npm run rename -- --preserve-upstream by removing BeakerStack-prefixed billing meter imports and by replacing hardcoded branding/product-id expectations in app tests with values sourced from @adopter/config/*.
Changes:
- Replaced
BEAKERSTACK_METER_AI_SUMMARIZEimports/usages with the brand-agnosticMETER_AI_SUMMARIZEin billing screens/pages and a related web billing test. - Updated several
apps/*unit tests to assert against adopter config values (billingConfig.productId,appIdentity.productId,branding.displayName,landingConfigURLs) instead of hardcoded template strings.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/web/src/pages/billing/BillingUsagePage.tsx | Switches meter constant import to brand-agnostic METER_AI_SUMMARIZE. |
| apps/web/src/pages/billing/BillingPlansPage.tsx | Updates useUsage call to use METER_AI_SUMMARIZE. |
| apps/web/src/pages/billing/BillingOverviewPage.tsx | Updates useUsage call to use METER_AI_SUMMARIZE. |
| apps/web/src/pages/tests/SignupInvitePage.test.tsx | Uses billingConfig.productId in expected request body. |
| apps/web/src/pages/tests/DashboardPage.test.tsx | Uses landingConfig for the expected GitHub link href. |
| apps/web/src/billing/tests/useDemoCollections.test.tsx | Uses appIdentity.productId in expected RPC args. |
| apps/web/src/billing/tests/beakerstackBillingConfig.test.ts | Updates test to use METER_AI_SUMMARIZE constant. |
| apps/web/src/admin/tests/adminUsageColumns.test.ts | Uses billingConfig.productId for expected admin product id. |
| apps/mobile/src/screens/billing/BillingUsageScreen.tsx | Switches meter constant import to brand-agnostic METER_AI_SUMMARIZE. |
| apps/mobile/src/screens/billing/BillingOverviewScreen.tsx | Updates useUsage call to use METER_AI_SUMMARIZE. |
| apps/mobile/tests/screens/billing/BillingScreens.test.tsx | Uses branding.displayName in the payment-failed banner assertion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ZappoMan
left a comment
There was a problem hiding this comment.
Review summary
Solid direction for #380/#381 — the METER_AI_SUMMARIZE migration and config-driven product-id assertions look correct, and CI is green.
Two Copilot findings remain open (replied inline). One additional issue below on the Dashboard GitHub link test.
Scope note: This PR covers the listed apps/* files well. Hardcoded branding elsewhere in apps/* (e.g. beakerstack_free plan ids in other test fixtures) is out of scope for #381 but may be worth a follow-up.
- BillingScreens.test.tsx: replace new RegExp(branding.displayName) with plain string to avoid metacharacter injection on rebrand - DashboardPage.test.tsx: add explicit toBeDefined() guard; drop non-null assertion - DemoBanner.tsx: read View on GitHub href from landingConfig.finalCta .secondaryCta instead of hardcoding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ling test The payment-failed banner renders the display name mid-sentence; exact string matching fails. Switching to exact:false preserves safe plain-string assertion without regex metacharacter risk. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ZappoMan
left a comment
There was a problem hiding this comment.
Re-reviewed after follow-up commits — all prior feedback is addressed.
METER_AI_SUMMARIZEmigration and config-driven test assertions look correct- BillingScreens uses safe plain-string matching (
exact: false) - DashboardPage test has an explicit guard; DemoBanner shares the same
landingConfigsource - CI green
LGTM.
End 2 End - Test ResultsSummary
By category
Test Environment🌐 Domain: https://deploy.beakerstack.com/pr-387/ Details
Updated at: May 31, 2026 at 4:49 PM PDT |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary
Fixes #380 and #381.
#380 — Replace deprecated
BEAKERSTACK_METER_AI_SUMMARIZEinapps/*The
BEAKERSTACK_METER_AI_SUMMARIZEconstant was deprecated in favour ofMETER_AI_SUMMARIZE(brand-agnostic) inadopter/config/billing.ts. Six files inapps/still imported the old name. Updated all of them to useMETER_AI_SUMMARIZE.#381 — Replace hardcoded branding in
apps/*test assertionsFive test files asserted against hardcoded template branding values (
"Beaker Stack","beakerstack", the template GitHub URL). Afternpm run renameonlyadopter/is updated, leaving these assertions stale. Each hardcoded value is replaced with the corresponding import from@adopter/config/*:BillingScreens.test.tsx"Beaker Stack web app"branding.displayName + " web app"adminUsageColumns.test.ts'beakerstack'billingConfig.productIduseDemoCollections.test.tsx'beakerstack'(×3)appIdentity.productIdDashboardPage.test.tsxlandingConfig.finalCta.secondaryCta!.hrefSignupInvitePage.test.tsx'beakerstack'billingConfig.productIdTest plan
npm run type-check) — confirmed clean in pre-commit hook🤖 Generated with Claude Code