Skip to content

Rename breaks apps/* imports of BEAKERSTACK_METER_AI_SUMMARIZE from adopter billing config #380

@ZappoMan

Description

@ZappoMan

Summary

After npm run rename (identity phase in setup:full, with --preserve-upstream), TypeScript fails in apps/mobile and apps/web billing screens because template code imports a product-prefixed meter constant from @adopter/config/billing that rename rewrites in adopter/ but not in apps/.

Steps to reproduce

  1. Fork the template and run rename (preserve upstream is fine):

    npm run rename -- --from "Beaker Stack" --to "NewApp" --preserve-upstream
  2. Run type-check:

    npm run type-check:mobile
    # and/or npm run type-check:web

Actual behavior

adopter/config/billing.ts exports the renamed deprecated alias (e.g. NEWAPP_METER_AI_SUMMARIZE), but billing UI in apps/* still imports BEAKERSTACK_METER_AI_SUMMARIZE:

src/screens/billing/BillingOverviewScreen.tsx:16:3 - error TS2724:
'"@adopter/config/billing"' has no exported member named 'BEAKERSTACK_METER_AI_SUMMARIZE'.
Did you mean 'NEWAPP_METER_AI_SUMMARIZE'?

Affected files (template):

  • apps/mobile/src/screens/billing/BillingOverviewScreen.tsx
  • apps/mobile/src/screens/billing/BillingUsageScreen.tsx
  • apps/web/src/pages/billing/BillingOverviewPage.tsx
  • apps/web/src/pages/billing/BillingPlansPage.tsx
  • apps/web/src/pages/billing/BillingUsagePage.tsx
  • apps/web/src/billing/__tests__/beakerstackBillingConfig.test.ts

Pre-commit husky hook fails on type-check:mobile.

Expected behavior

Rename + preserve-upstream should not leave apps/* importing symbols that only exist under the old product prefix in adopter/config/billing.ts.

adopter/config/billing.ts already documents the stable export:

export const METER_AI_SUMMARIZE = 'ai_summarize' as const;
/** @deprecated Use METER_AI_SUMMARIZE */
export const beakerstackMeterAiSummarize = ... // renamed on rebrand

Template billing UI in apps/* should import METER_AI_SUMMARIZE (brand-agnostic), matching adopter dashboard code that already uses it (e.g. adopter/mobile/screens/DashboardScreen.tsx).

Root cause

Same class of issue as #379: npm run rename only walks adopter/, while apps/mobile and apps/web retain hardcoded BEAKERSTACK_* imports from @adopter/config/billing.

Suggested fix

  1. Template: Change all apps/* billing imports from BEAKERSTACK_METER_AI_SUMMARIZEMETER_AI_SUMMARIZE.
  2. Rename (optional hardening): Either extend rename to patch known apps/* import sites, or stop exporting product-prefixed meter aliases from adopter/config/billing.ts (keep only METER_AI_SUMMARIZE + deprecated beakerstackBillingConfig in preserve mode).
  3. Docs: Note in docs/renaming.md that adopter renames change deprecated prefixed exports and apps/* must use stable names.

Workaround (adopters)

Replace imports in the six files above:

import { billingConfig, METER_AI_SUMMARIZE } from '@adopter/config/billing';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions