Files
supabase/apps/docs/features/docs/MdxBase.shared.tsx
T
anthony lio 22ea45a3ba feat: getting started v2 (#52511)
## Problem

* the getting started page is a stack of content listings: an overview,
use cases, framework quickstarts and tutorials
* a new reader must find a path in that list, and the page gives no
commands or agent prompt for their setup

## Solution

* adds a stepper to the getting started page, so a reader gets the steps
and an agent prompt for their setup
* adds the `docs-getting-started-v2` posthog flag, so the stepper and
the current page can run as an a/b test
* adds events for stepper choices, link clicks and prompt copies, so the
test can compare the two pages
* adds a markdown export of the stepper, so the `.md` page lists every
path for agents
* moves the iso shapes from kb into `ui-patterns`, so the docs feature
cards use the same shapes as the kb heroes
* changes the edge functions shape to a flat puzzle piece, because the
old shape had too many parts

<!-- linear:table-colwidths:397,397 -->
<table>
<thead>
<tr>
<th>state</th>
<th>preview</th>
</tr>
</thead>
<tbody>
<tr>
<td>after</td>
<td>


https://github.com/user-attachments/assets/7127d817-4240-4d08-a1c9-6ada1b1b2563

</td>
</tr>
</tbody>
</table>

## Review instructions

1. open
[/docs/guides/getting-started?docs-getting-started-v2=stepper](<https://docs-git-docs-getting-started-explorations-supabase.vercel.app/docs/guides/getting-started?docs-getting-started-v2=stepper>)
and make sure that the stepper shows with agent selected
2. select next.js and the auth card, then make sure that the setup
prompt names next.js and has a step for auth
3. open
[/docs/guides/getting-started?docs-getting-started-v2=stepper&start=cli&fw=nextjs](<https://docs-git-docs-getting-started-explorations-supabase.vercel.app/docs/guides/getting-started?docs-getting-started-v2=stepper&start=cli&fw=nextjs>)
and make sure that connect your app shows the install command and the
quickstart button

## Checklist

Check all before review:

- [X] I have read
[CONTRIBUTING.md](<https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md>)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](<https://github.com/supabase/supabase/tree/master/apps/docs/style-guide>)
2026-11-13 17:46:38 +02:00

150 lines
5.5 KiB
TypeScript

import { AiPromptsIndex } from '~/app/guides/getting-started/ai-prompts/[slug]/AiPromptsIndex'
import { AiSkillsIndex } from '~/app/guides/getting-started/ai-skills/AiSkillsIndex'
import { AppleSecretGenerator } from '~/components/AppleSecretGenerator'
import AuthProviders from '~/components/AuthProviders'
import { AuthSmsProviderConfig } from '~/components/AuthSmsProviderConfig'
import ButtonCard from '~/components/ButtonCard'
import { ComputeDiskLimitsTable } from '~/components/ComputeDiskLimitsTable'
import { ContentListings } from '~/components/ContentListings'
import { CustomContent } from '~/components/CustomContent'
import { DatabaseAdvisorsIndex } from '~/components/DatabaseAdvisorsIndex'
import { Extensions } from '~/components/Extensions'
import Image, { type ImageProps } from '~/components/Image'
import { McpCiConfigBlock } from '~/components/McpCiConfigBlock'
import { Mermaid } from '~/components/Mermaid'
import { MetricsStackCards } from '~/components/MetricsStackCards'
import { NavData } from '~/components/NavData'
import { Price } from '~/components/Price'
import { ProjectConfigVariables } from '~/components/ProjectConfigVariables'
import { RealtimeLimitsEstimator } from '~/components/RealtimeLimitsEstimator'
import { RegionsList, SmartRegionsList } from '~/components/RegionsList'
import { SharedData } from '~/components/SharedData'
import { StepHikeCompact } from '~/components/StepHikeCompact'
import { TerraformProviderSchema } from '~/components/TerraformProviderSchema'
import { WrapperDashboardIntegration } from '~/components/WrapperDashboardIntegration'
import { CodeSampleDummy, CodeSampleWrapper } from '~/features/directives/CodeSample.client'
import { CodeTabs, NamedCodeBlock } from '~/features/directives/CodeTabs.components'
import { MdxAnchor } from '~/features/docs/MdxAnchor'
import { CodeBlock } from '~/features/ui/CodeBlock/CodeBlock'
import { ShowUntil } from '~/features/ui/ShowUntil'
import { TabPanel, Tabs } from '~/features/ui/Tabs'
import { YouTube } from '~/features/ui/YouTube'
import { ArrowDown, Check, X } from 'lucide-react'
import Link from 'next/link'
import { type ComponentPropsWithoutRef } from 'react'
import { Badge, Button, Heading, Table } from 'ui'
import { Admonition, type AdmonitionProps } from 'ui-patterns/Admonition'
import { GlassPanel } from 'ui-patterns/GlassPanel'
import SqlToRest from 'ui-patterns/SqlToRest'
import { GettingStartedStepper } from '../getting-started/GettingStartedStepper'
import { AgentPluginsPanel } from '../ui/AgentPluginsPanel'
import { AgentSetup } from '../ui/AgentSetup'
import { AgentWatchSchedule } from '../ui/AgentWatchSchedule'
import { AiPrompt, type AiPromptProps } from '../ui/AiPrompt'
import { ErrorCodes } from '../ui/ErrorCodes'
import { McpConfigPanel } from '../ui/McpConfigPanel'
// Admonition as it appears in docs pages: sits in MDX prose, so it needs a margin-bottom.
const DocsAdmonition = (props: AdmonitionProps) => {
return <Admonition {...props} className="mb-8" />
}
/**
* Route fenced ```mermaid blocks through the Mermaid component; everything else
* continues through `CodeBlock` for syntax highlighting.
*/
const Pre = (props: any) => {
const child = Array.isArray(props.children) ? props.children[0] : props.children
const className: unknown = child?.props?.className
if (typeof className === 'string' && className.split(' ').includes('language-mermaid')) {
const code = child.props.children
if (typeof code === 'string') {
return <Mermaid chart={code.trim()} />
}
}
return <CodeBlock {...props} />
}
const components = {
Admonition: DocsAdmonition,
AgentPluginsPanel,
AgentSetup,
AgentWatchSchedule,
AiPrompt: (props: Omit<AiPromptProps, 'telemetry'>) => (
<AiPrompt {...props} telemetry={{ source: 'guide' }} />
),
AiPromptsIndex,
AiSkillsIndex,
AuthSmsProviderConfig,
AppleSecretGenerator,
AuthProviders,
Badge,
Button,
ButtonCard,
CodeSampleDummy,
CodeSampleWrapper,
CodeTabs,
ComputeDiskLimitsTable,
CustomContent,
ContentListings,
DatabaseAdvisorsIndex,
ErrorCodes,
Extensions,
GettingStartedStepper,
GlassPanel,
IconArrowDown: ArrowDown,
IconCheck: Check,
IconX: X,
Image: (props: ImageProps) => <Image className="rounded-md w-full" {...props} />,
Link,
McpCiConfigBlock,
McpConfigPanel,
Mermaid,
MetricsStackCards,
NamedCodeBlock,
NavData,
ProjectConfigVariables,
RealtimeLimitsEstimator,
RegionsList,
SmartRegionsList,
SharedData,
ShowUntil,
SqlToRest,
StepHikeCompact,
Table,
Tabs,
TabPanel,
TerraformProviderSchema,
WrapperDashboardIntegration,
YouTube,
a: MdxAnchor,
h2: (props: ComponentPropsWithoutRef<'h2'>) => (
<Heading tag="h2" {...props}>
{props.children}
</Heading>
),
h3: (props: ComponentPropsWithoutRef<'h3'>) => (
<Heading tag="h3" {...props}>
{props.children}
</Heading>
),
h4: (props: ComponentPropsWithoutRef<'h4'>) => (
<Heading tag="h4" {...props}>
{props.children}
</Heading>
),
pre: Pre,
table: (props: ComponentPropsWithoutRef<'table'>) => <Table prose {...props} />,
/**
* Force inline code tags to go sync, this prevents Heading anchor resolution fail due to
* our CodeBlock component being async. We need to find a better solution for more future
* proof MDX rendering. Definitely improving the anchors utility in the ui/Heading component
* plus having a more resilient highlighting strategy.
*/
code: (props: any) => <code {...props}>{props.children}</code>,
Price,
}
export { components }