mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## 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>)
34 lines
2.3 KiB
TypeScript
34 lines
2.3 KiB
TypeScript
import { setupCommand } from '~/components/HomePageCover.constants'
|
|
import { PROD_URL } from '~/lib/constants'
|
|
|
|
import { CREATE_PROJECT_URL, EXPLORE_ITEMS } from './GettingStarted.data'
|
|
|
|
const toMarkdownUrl = (href: string) => `${PROD_URL}${href}.md`
|
|
|
|
export const buildPrompt = (features: string[]): string => {
|
|
const selected = EXPLORE_ITEMS.filter((item) => features.includes(item.id))
|
|
const productGuides = EXPLORE_ITEMS.filter((item) => item.id !== 'ai-tools')
|
|
.map((item) => `${item.feature} (${toMarkdownUrl(item.href)})`)
|
|
.join(', ')
|
|
const featureLines =
|
|
selected.length > 0
|
|
? selected.map((item) => `Set up ${item.feature}. Follow ${toMarkdownUrl(item.href)}.`)
|
|
: [`Ask me which features I need, then follow the matching guides: ${productGuides}.`]
|
|
const lines = [
|
|
'Find the framework and language of my app from its project files, such as `package.json`, `pubspec.yaml`, or `Package.swift`. If the folder has no app, ask what I want to build, then suggest a framework and wait for my choice.',
|
|
// the npm install needs a Node.js project, which other SDKs do not have
|
|
`Install the Supabase CLI. In a Node.js project, install it as a dev dependency with \`${setupCommand.installCli}\`. Otherwise, use the method for my operating system from ${toMarkdownUrl('/guides/local-development/cli/getting-started')}.`,
|
|
`Install the Supabase plugin with \`${setupCommand.installPlugin}\`.`,
|
|
`If I do not have a Supabase project, ask whether I want a hosted project (${CREATE_PROJECT_URL}) or a local one (\`supabase init\`, then \`supabase start\`). In a Node.js project, put \`npx\` before each command.`,
|
|
`Connect my app. Follow the quickstart for its framework from ${toMarkdownUrl('/guides/getting-started')}.`,
|
|
...featureLines,
|
|
'Check the connection. Create a `todos` table with a `title` column and one row, and enable Row Level Security with a policy that lets anyone read it. Then read the row from my app and show its title, and ask whether I want to keep the `todos` table or drop it.',
|
|
'Finish by telling me what you changed and how to run my app.',
|
|
]
|
|
|
|
return [
|
|
'Help me set up Supabase in my app. Before you create a project or change my files, tell me your plan and wait for my go-ahead. Do the following:',
|
|
...lines.map((line, index) => `${index + 1}. ${line}`),
|
|
].join('\n')
|
|
}
|