diff --git a/.github/workflows/www-tests.yml b/.github/workflows/www-tests.yml index a29e1b4765c..2a824cc89ab 100644 --- a/.github/workflows/www-tests.yml +++ b/.github/workflows/www-tests.yml @@ -10,6 +10,8 @@ on: - 'apps/www/lib/**/*.js' - 'apps/www/content/md/**' - 'apps/www/scripts/**/*.mjs' + - 'apps/www/data/**' + - 'packages/shared-data/**' # Cancel old builds on new commit for same workflow + branch/PR concurrency: diff --git a/apps/www/components/Pricing/PricingDiskSection.tsx b/apps/www/components/Pricing/PricingDiskSection.tsx index a4b30841d61..decbc8198cb 100644 --- a/apps/www/components/Pricing/PricingDiskSection.tsx +++ b/apps/www/components/Pricing/PricingDiskSection.tsx @@ -18,7 +18,9 @@ const diskTypes = Object.values(DISK_PRICING).map((disk) => ({ throughput: disk.includedPerProject && disk.perUnitMonth.throughputMBps !== null ? `${disk.includedPerProject.throughputMBps} MB/s included\nthen ${usd(disk.perUnitMonth.throughputMBps)} per MB/s` - : (disk.throughputNote ?? ''), + : 'throughputNote' in disk + ? disk.throughputNote + : '', durability: `${disk.durabilityPercent}%`, })) diff --git a/apps/www/lib/llms.test.ts b/apps/www/lib/llms.test.ts new file mode 100644 index 00000000000..cb509ce6300 --- /dev/null +++ b/apps/www/lib/llms.test.ts @@ -0,0 +1,15 @@ +import { describe, expect, it } from 'vitest' + +import { generatePricingContent } from './llms' + +describe('generatePricingContent', () => { + it('builds without throwing and carries the derived billing example', () => { + let content = '' + expect(() => { + content = generatePricingContent() + }).not.toThrow() + expect(content).toContain('in compute credits') + expect(content).toContain('## Disk Storage') + expect(content).toContain('Structured pricing data (JSON): https://supabase.com/pricing.json') + }) +}) diff --git a/apps/www/lib/llms.ts b/apps/www/lib/llms.ts index 25acba76173..c50d992ac44 100644 --- a/apps/www/lib/llms.ts +++ b/apps/www/lib/llms.ts @@ -136,7 +136,9 @@ function buildDiskSection(): string { const throughput = disk.includedPerProject && disk.perUnitMonth.throughputMBps !== null ? `${qty(disk.includedPerProject.throughputMBps)} MB/s included, then ${usd(disk.perUnitMonth.throughputMBps)} per MB/s` - : (disk.throughputNote ?? '') + : 'throughputNote' in disk + ? disk.throughputNote + : '' return [ `${disk.displayName} (${type})`, diff --git a/apps/www/lib/pricing-json.ts b/apps/www/lib/pricing-json.ts index a363c7d8831..4a9b35cc0bb 100644 --- a/apps/www/lib/pricing-json.ts +++ b/apps/www/lib/pricing-json.ts @@ -65,7 +65,7 @@ function buildComputeTiers(): ComputeTier[] { export function buildPricingJson() { return { description: - 'Machine-readable pricing for https://supabase.com/pricing. Informational, not a billing API. Monthly totals depend on plan quotas, compute credits, and the spend cap encoded below; metered prices apply only beyond includedByPlan quotas.', + "Machine-readable pricing for https://supabase.com/pricing. Informational, not a billing API. Monthly totals depend on plan quotas, compute credits, and the spend cap encoded below; metered prices apply only beyond includedByPlan quotas. In includedByPlan: null means the metric is not available on that plan, 0 means available with no included quota, 'custom' means negotiated.", source: 'https://supabase.com/pricing', docs: 'https://supabase.com/docs/guides/platform/org-based-billing', currency: 'USD', @@ -94,7 +94,7 @@ export function buildPricingJson() { durabilityPercent: disk.durabilityPercent, includedPerProject: disk.includedPerProject, perUnitMonth: disk.perUnitMonth, - ...(disk.throughputNote ? { throughputNote: disk.throughputNote } : {}), + ...('throughputNote' in disk ? { throughputNote: disk.throughputNote } : {}), })), }, meters: Object.entries(METERS).map(([id, meter]) => ({