From 0e153e95d316d161a748b65284672f5d5861e913 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Wed, 11 Mar 2026 14:56:44 +0100 Subject: [PATCH] refactor: migrate plan data from JSON to TypeScript module and update imports --- .../src/lib/features/app/layout-setup.ts | 5 +- packages/utils/src/plans/data.json | 72 ------------------- packages/utils/src/plans/data.ts | 72 +++++++++++++++++++ packages/utils/src/plans/index.ts | 2 +- packages/utils/tsconfig.json | 2 +- 5 files changed, 77 insertions(+), 76 deletions(-) delete mode 100644 packages/utils/src/plans/data.json create mode 100644 packages/utils/src/plans/data.ts diff --git a/apps/dashboard/src/lib/features/app/layout-setup.ts b/apps/dashboard/src/lib/features/app/layout-setup.ts index e408474b..d889503f 100644 --- a/apps/dashboard/src/lib/features/app/layout-setup.ts +++ b/apps/dashboard/src/lib/features/app/layout-setup.ts @@ -1,10 +1,11 @@ +import { getFirstOrg, getOrgBySiteName, getOrgsByCustomDomain } from '$features/org/api/org.server'; + import type { AccountOrg } from '$features/app/types'; import type { Cookies } from '@sveltejs/kit'; -import { getFirstOrg, getOrgBySiteName, getOrgsByCustomDomain } from '$features/org/api/org.server'; -import { getApiKeyHeaders } from '$lib/utils/services/api/server'; import { PUBLIC_IS_SELFHOSTED } from '$env/static/public'; import { blockedSubdomain } from '$lib/utils/constants/app'; import { env } from '$env/dynamic/private'; +import { getApiKeyHeaders } from '$lib/utils/services/api/server'; export interface OrgSiteInfo { isOrgSite: boolean; diff --git a/packages/utils/src/plans/data.json b/packages/utils/src/plans/data.json deleted file mode 100644 index f9d16f2b..00000000 --- a/packages/utils/src/plans/data.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "BASIC": { - "NAME": "Basic", - "DESCRIPTION": "Free tier plan for personal use, no credit card required.", - "PRICE": { - "CURRENCY": "$", - "MONTHLY": "0", - "YEARLY": "0", - "IS_PREMIUM": false - }, - "FEATURES": [ - "Unlimited Courses", - "Unlimited Q/A", - "20 Students", - "AI Course Builder (no video upload)", - "ClassroomIO branding" - ], - "CTA": { - "LABEL": "Signup Now", - "LINK": "/signup?plan=free", - "DASHBOARD_LABEL": "Downgrade", - "DASHBOARD_LINK": "#disabled", - "IS_DISABLED": true - } - }, - "EARLY_ADOPTER": { - "NAME": "Early Adopters", - "DESCRIPTION": "For fast growing teaching businesses that aim to scale.", - "PRICE": { - "CURRENCY": "$", - "MONTHLY": "35", - "YEARLY": "350", - "IS_PREMIUM": false - }, - "FEATURES": [ - "Everything in Basic", - "Unlimited Collaborators", - "10K Students", - "Advanced AI Course Builder (Video upload & Certificate)", - "Custom Branding", - "Slack Invite", - "Includes all upcoming features" - ], - "CTA": { - "LABEL": "I want in 😍", - "LINK": "/signup?plan=early-adopter", - "DASHBOARD_LABEL": "Upgrade now", - "DASHBOARD_LINK": "", - "IS_DISABLED": false, - "PRODUCT_ID": "1e11ad75-c422-41c1-a541-0e989281276c", - "PRODUCT_ID_YEARLY": "a84d3a82-3259-4300-b2bf-dccb7bd7814c" - } - }, - "ENTERPRISE": { - "NAME": "Enterprise", - "DESCRIPTION": "Best suited for larger businesses that need more control", - "PRICE": { - "CURRENCY": "", - "MONTHLY": "Request Pricing", - "YEARLY": "Request Pricing", - "IS_PREMIUM": true - }, - "FEATURES": ["Everything in Early Adopters plus:", "Unlimited students", "Custom Domain", "24/7 Support"], - "CTA": { - "LABEL": "Contact Us", - "LINK": "https://cal.com/classroomio/enterprise", - "DASHBOARD_LABEL": "Contact Us", - "DASHBOARD_LINK": "https://cal.com/classroomio/enterprise", - "IS_DISABLED": false - } - } -} diff --git a/packages/utils/src/plans/data.ts b/packages/utils/src/plans/data.ts new file mode 100644 index 00000000..27f6ce8f --- /dev/null +++ b/packages/utils/src/plans/data.ts @@ -0,0 +1,72 @@ +export default { + BASIC: { + NAME: 'Basic', + DESCRIPTION: 'Free tier plan for personal use, no credit card required.', + PRICE: { + CURRENCY: '$', + MONTHLY: '0', + YEARLY: '0', + IS_PREMIUM: false + }, + FEATURES: [ + 'Unlimited Courses', + 'Unlimited Q/A', + '20 Students', + 'AI Course Builder (no video upload)', + 'ClassroomIO branding' + ], + CTA: { + LABEL: 'Signup Now', + LINK: '/signup?plan=free', + DASHBOARD_LABEL: 'Downgrade', + DASHBOARD_LINK: '#disabled', + IS_DISABLED: true + } + }, + EARLY_ADOPTER: { + NAME: 'Early Adopters', + DESCRIPTION: 'For fast growing teaching businesses that aim to scale.', + PRICE: { + CURRENCY: '$', + MONTHLY: '35', + YEARLY: '350', + IS_PREMIUM: false + }, + FEATURES: [ + 'Everything in Basic', + 'Unlimited Collaborators', + '10K Students', + 'Advanced AI Course Builder (Video upload & Certificate)', + 'Custom Branding', + 'Slack Invite', + 'Includes all upcoming features' + ], + CTA: { + LABEL: 'I want in 😍', + LINK: '/signup?plan=early-adopter', + DASHBOARD_LABEL: 'Upgrade now', + DASHBOARD_LINK: '', + IS_DISABLED: false, + PRODUCT_ID: '1e11ad75-c422-41c1-a541-0e989281276c', + PRODUCT_ID_YEARLY: 'a84d3a82-3259-4300-b2bf-dccb7bd7814c' + } + }, + ENTERPRISE: { + NAME: 'Enterprise', + DESCRIPTION: 'Best suited for larger businesses that need more control', + PRICE: { + CURRENCY: '', + MONTHLY: 'Request Pricing', + YEARLY: 'Request Pricing', + IS_PREMIUM: true + }, + FEATURES: ['Everything in Early Adopters plus:', 'Unlimited students', 'Custom Domain', '24/7 Support'], + CTA: { + LABEL: 'Contact Us', + LINK: 'https://cal.com/classroomio/enterprise', + DASHBOARD_LABEL: 'Contact Us', + DASHBOARD_LINK: 'https://cal.com/classroomio/enterprise', + IS_DISABLED: false + } + } +}; diff --git a/packages/utils/src/plans/index.ts b/packages/utils/src/plans/index.ts index 883b5dfe..cdbab41f 100644 --- a/packages/utils/src/plans/index.ts +++ b/packages/utils/src/plans/index.ts @@ -1,6 +1,6 @@ export * from './constants'; export * from './utils'; -import PLANS from './data.json'; +import PLANS from './data'; export { PLANS }; diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index ac05119a..da502951 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -12,7 +12,7 @@ "declaration": true, "declarationMap": true }, - "include": ["src/**/*.ts", "src/**/*.json"], + "include": ["src/**/*.ts"], "exclude": ["node_modules", "dist", "scripts", "tsconfig.tsbuildinfo"], "tsc-alias": { "resolveFullPaths": true,