refactor: migrate plan data from JSON to TypeScript module and update imports

This commit is contained in:
Rotimi Best
2026-03-11 14:56:44 +01:00
parent a5157f7c6d
commit 0e153e95d3
5 changed files with 77 additions and 76 deletions
@@ -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;
-72
View File
@@ -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
}
}
}
+72
View File
@@ -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
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
export * from './constants';
export * from './utils';
import PLANS from './data.json';
import PLANS from './data';
export { PLANS };
+1 -1
View File
@@ -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,