refactor(packages): consolidate 2 subscription packages into @manacore/subscriptions

Merged shared-subscription-types + shared-subscription-ui into
@manacore/subscriptions. Updated imports in 15 web apps.

Package count: 49 → 47

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-28 17:40:47 +01:00
parent d70ab97a66
commit 1f3208384b
38 changed files with 115 additions and 211 deletions

View file

@ -57,7 +57,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-splitscreen": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",

View file

@ -47,7 +47,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -50,7 +50,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -49,7 +49,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-splitscreen": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",

View file

@ -46,7 +46,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -38,7 +38,7 @@
"@manacore/shared-landing-ui": "workspace:*",
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-types": "workspace:*",
"@manacore/shared-ui": "workspace:*",

View file

@ -56,8 +56,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-subscription-types": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -44,8 +44,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-subscription-types": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -50,7 +50,7 @@
"@manacore/shared-icons": "workspace:*",
"@manacore/local-store": "workspace:*",
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -43,7 +43,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-splitscreen": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",

View file

@ -30,8 +30,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-subscription-types": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -44,7 +44,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -50,7 +50,7 @@
"@manacore/local-store": "workspace:*",
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",

View file

@ -53,7 +53,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-splitscreen": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",

View file

@ -45,7 +45,7 @@
"@manacore/shared-profile-ui": "workspace:*",
"@manacore/shared-stores": "workspace:*",
"@manacore/shared-tags": "workspace:*",
"@manacore/shared-subscription-ui": "workspace:*",
"@manacore/subscriptions": "workspace:*",
"@manacore/shared-tailwind": "workspace:*",
"@manacore/shared-theme": "workspace:*",
"@manacore/shared-theme-ui": "workspace:*",

View file

@ -1,21 +0,0 @@
{
"name": "@manacore/shared-subscription-types",
"version": "1.0.0",
"private": true,
"type": "module",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": "./src/index.ts",
"./plans": "./src/plans.ts",
"./usage": "./src/usage.ts",
"./revenueCat": "./src/revenueCat.ts"
},
"scripts": {
"type-check": "tsc --noEmit",
"lint": "eslint ."
},
"devDependencies": {
"typescript": "^5.7.3"
}
}

View file

@ -1,39 +0,0 @@
/**
* Shared subscription types for Manacore monorepo
*
* This package contains TypeScript types for subscription plans,
* mana packages, usage tracking, and RevenueCat integration.
*/
// Plan types
export {
type BillingCycle,
type PlanCategory,
type SubscriptionPlan,
type ManaPackage,
type ProductMapping,
type PackageMapping,
type FreeTierConfig,
DEFAULT_FREE_TIER,
} from './plans';
// Usage types
export {
type UsageData,
type UsageHistoryEntry,
type CostItem,
type ManaBalance,
type CreditTransaction,
type OperationPricing,
} from './usage';
// RevenueCat types
export {
type RevenueCatSubscriptionPlan,
type RevenueCatManaPackage,
type SubscriptionServiceData,
type PurchaseResult,
type CustomerSubscriptionStatus,
type RestorePurchasesResult,
type RevenueCatOffering,
} from './revenueCat';

View file

@ -1,17 +0,0 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ES2022"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"noEmit": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

View file

@ -1,59 +0,0 @@
{
"name": "@manacore/shared-subscription-ui",
"version": "1.0.0",
"private": true,
"type": "module",
"svelte": "./src/index.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"svelte": "./src/index.ts",
"types": "./src/index.ts",
"default": "./src/index.ts"
},
"./SubscriptionCard.svelte": {
"svelte": "./src/SubscriptionCard.svelte",
"default": "./src/SubscriptionCard.svelte"
},
"./PackageCard.svelte": {
"svelte": "./src/PackageCard.svelte",
"default": "./src/PackageCard.svelte"
},
"./BillingToggle.svelte": {
"svelte": "./src/BillingToggle.svelte",
"default": "./src/BillingToggle.svelte"
},
"./UsageCard.svelte": {
"svelte": "./src/UsageCard.svelte",
"default": "./src/UsageCard.svelte"
},
"./CostCard.svelte": {
"svelte": "./src/CostCard.svelte",
"default": "./src/CostCard.svelte"
},
"./SubscriptionButton.svelte": {
"svelte": "./src/SubscriptionButton.svelte",
"default": "./src/SubscriptionButton.svelte"
},
"./ManaIcon.svelte": {
"svelte": "./src/ManaIcon.svelte",
"default": "./src/ManaIcon.svelte"
}
},
"scripts": {
"check": "svelte-check --tsconfig ./tsconfig.json",
"lint": "eslint ."
},
"dependencies": {
"@manacore/shared-subscription-types": "workspace:*"
},
"devDependencies": {
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"typescript": "^5.7.3"
},
"peerDependencies": {
"svelte": "^5.0.0"
}
}

View file

@ -1,32 +0,0 @@
/**
* Shared subscription UI components for Manacore monorepo
*
* This package contains Svelte 5 components for displaying
* subscription plans, mana packages, and usage information.
*/
// Pages
export { default as SubscriptionPage } from './pages/SubscriptionPage.svelte';
// Components
export { default as SubscriptionCard } from './SubscriptionCard.svelte';
export { default as PackageCard } from './PackageCard.svelte';
export { default as BillingToggle } from './BillingToggle.svelte';
export { default as UsageCard } from './UsageCard.svelte';
export { default as CostCard } from './CostCard.svelte';
export { default as SubscriptionButton } from './SubscriptionButton.svelte';
export { default as ManaIcon } from './ManaIcon.svelte';
// Default data exports
export { default as defaultSubscriptionData } from './data/subscriptionData.json';
export { default as defaultAppCosts } from './data/appCosts.json';
export { default as defaultUsageData } from './data/defaultUsageData.json';
// Re-export types for convenience
export type {
SubscriptionPlan,
ManaPackage,
BillingCycle,
UsageData,
CostItem,
} from '@manacore/shared-subscription-types';

View file

@ -1,19 +0,0 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"types": ["svelte"]
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

View file

@ -0,0 +1,29 @@
{
"name": "@manacore/subscriptions",
"version": "1.0.0",
"private": true,
"description": "Unified subscription package — types and UI components",
"type": "module",
"svelte": "./src/index.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"svelte": "./src/index.ts",
"types": "./src/index.ts",
"default": "./src/index.ts"
}
},
"scripts": {
"type-check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"svelte-i18n": "^4.0.0",
"typescript": "^5.9.3"
},
"peerDependencies": {
"svelte": "^5.0.0"
}
}

View file

@ -1,5 +1,5 @@
<script lang="ts">
import type { BillingCycle } from '@manacore/shared-subscription-types';
import type { BillingCycle } from './plans';
interface Props {
billingCycle: BillingCycle;

View file

@ -1,5 +1,5 @@
<script lang="ts">
import type { CostItem } from '@manacore/shared-subscription-types';
import type { CostItem } from './plans';
interface Props {
costs: CostItem[];

View file

@ -1,5 +1,5 @@
<script lang="ts">
import type { ManaPackage } from '@manacore/shared-subscription-types';
import type { ManaPackage } from './plans';
import SubscriptionButton from './SubscriptionButton.svelte';
import ManaIcon from './ManaIcon.svelte';

View file

@ -1,5 +1,5 @@
<script lang="ts">
import type { SubscriptionPlan } from '@manacore/shared-subscription-types';
import type { SubscriptionPlan } from './plans';
import SubscriptionButton from './SubscriptionButton.svelte';
import ManaIcon from './ManaIcon.svelte';

View file

@ -1,5 +1,5 @@
<script lang="ts">
import type { UsageData } from '@manacore/shared-subscription-types';
import type { UsageData } from './plans';
interface Props {
title?: string;

View file

@ -0,0 +1,51 @@
/**
* @manacore/subscriptions Unified subscription package
*
* Consolidates shared-subscription-types + shared-subscription-ui.
*/
// === Types ===
export {
type BillingCycle,
type PlanCategory,
type SubscriptionPlan,
type ManaPackage,
type ProductMapping,
type PackageMapping,
type FreeTierConfig,
DEFAULT_FREE_TIER,
} from './plans';
export {
type UsageData,
type UsageHistoryEntry,
type CostItem,
type ManaBalance,
type CreditTransaction,
type OperationPricing,
} from './usage';
export {
type RevenueCatSubscriptionPlan,
type RevenueCatManaPackage,
type SubscriptionServiceData,
type PurchaseResult,
type CustomerSubscriptionStatus,
type RestorePurchasesResult,
type RevenueCatOffering,
} from './revenueCat';
// === UI Components ===
export { default as SubscriptionPage } from './pages/SubscriptionPage.svelte';
export { default as SubscriptionCard } from './SubscriptionCard.svelte';
export { default as PackageCard } from './PackageCard.svelte';
export { default as BillingToggle } from './BillingToggle.svelte';
export { default as UsageCard } from './UsageCard.svelte';
export { default as CostCard } from './CostCard.svelte';
export { default as SubscriptionButton } from './SubscriptionButton.svelte';
export { default as ManaIcon } from './ManaIcon.svelte';
// === Default data ===
export { default as defaultSubscriptionData } from './data/subscriptionData.json';
export { default as defaultAppCosts } from './data/appCosts.json';
export { default as defaultUsageData } from './data/defaultUsageData.json';

View file

@ -5,7 +5,7 @@
UsageData,
CostItem,
BillingCycle,
} from '@manacore/shared-subscription-types';
} from './plans';
import BillingToggle from '../BillingToggle.svelte';
import SubscriptionCard from '../SubscriptionCard.svelte';
import PackageCard from '../PackageCard.svelte';

View file

@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"outDir": "dist",
"declaration": true
},
"include": ["src/**/*.ts", "src/**/*.svelte"]
}