mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 14:49:10 +03:00
Resolves [DOCS-1252](https://linear.app/supabase/issue/DOCS-1252/resolve-e2e-broken-link-errors-for-the-cli-guide). #48453 updated most `/cli` links to `/local-development`. This PR covers the remaining `/cli` references. ## Changes - **Delete `apps/docs/content/guides/cli.mdx`.** The file has had no route since the October 2024 docs IA reorganization (#29364), which moved the CLI guides under `local-development/`. - In production, `/docs/guides/cli` redirects to `/docs/guides/local-development` through `apps/www/lib/redirects.js`, so the file's content never renders. - On Vercel previews, which don't have `www` redirects, the URL returns 404. Docs E2E tests every changed guide file, so any edit to `cli.mdx` fails the required check. - Deleting it is safe for Docs E2E, which only scopes added or changed files. The redirect still covers the old URL. - **Update the connection-refused troubleshooting page** to link to `/docs/guides/local-development` instead of the redirected `/docs/guides/cli`. - **Point the "Go to Local Dev / CLI" command palette entry at `/guides/local-development`.** It routed to `/guides/cli`, which only resolves through the `www` redirect and returns 404 on previews. - **Remove the unused `cli` navigation menu** from `NavigationMenu.constants.ts`. No `MenuId` resolves to it, so it was never rendered, and its links pointed to pages that no longer exist. Question for @czenko: #48453 left `cli.mdx` alone on purpose, describing it as needing a routing or content decision. Deleting it seemed like the simplest fix, but is there a reason to keep it? It looks like it's an artifact that sometimes gets updated because it's being mistaken as a living document. Also, I believe troubleshooting guides are being currently moved - this ticket and change might coincide with the new https://github.com/supabase/troubleshooting repository, but I didn't see this file existing in there just yet - it's being currently being moved in this PR https://github.com/supabase/troubleshooting/pull/330/changes#diff-b5908c6861f711c3a38fba99aa133cdb796f26c27a35e77c674cb21f988a1046 (so I think I should do the link change in that PR and I can remove it from this PR as to not create merge conflicts or drift). But it makes questions come up about how broken links are handled in that repository 👀 --------- Co-authored-by: Miranda Limonczenko <miranda.limonczenko@supabase.io>
169 lines
4.3 KiB
TypeScript
169 lines
4.3 KiB
TypeScript
import { ArrowRight } from 'lucide-react'
|
|
|
|
import { isFeatureEnabled } from 'common'
|
|
import type { ICommand } from 'ui-patterns/CommandMenu'
|
|
import { useRegisterCommands } from 'ui-patterns/CommandMenu'
|
|
|
|
const navCommands = [
|
|
{
|
|
id: 'nav-getting-started',
|
|
name: 'Go to Getting Started',
|
|
route: '/guides/getting-started',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-database',
|
|
name: 'Go to Database',
|
|
route: '/guides/database/overview',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-auth',
|
|
name: 'Go to Auth',
|
|
route: '/guides/auth',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-storage',
|
|
name: 'Go to Storage',
|
|
route: '/guides/storage',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-functions',
|
|
name: 'Go to Functions',
|
|
route: '/guides/functions',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-realtime',
|
|
name: 'Go to Realtime',
|
|
route: '/guides/realtime',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-ai',
|
|
name: 'Go to AI & Vectors',
|
|
route: '/guides/ai',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-rest',
|
|
name: 'Go to REST API',
|
|
route: '/guides/api',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-graphql',
|
|
name: 'Go to GraphQL',
|
|
route: '/guides/graphql',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-local-cli',
|
|
name: 'Go to Local Dev / CLI',
|
|
route: '/guides/local-development',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-platform',
|
|
name: 'Go to Platform',
|
|
route: '/guides/platform',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-self-hosting',
|
|
name: 'Go to Self-Hosting',
|
|
route: '/guides/self-hosting',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-ref-javascript',
|
|
name: 'Go to JavaScript reference',
|
|
value: 'Reference, API, SDK: Go to JavaScript reference (JS)',
|
|
route: '/reference/javascript/introduction',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-ref-dart',
|
|
name: 'Go to Dart reference',
|
|
value: 'Reference, API, SDK: Go to Dart reference (Flutter)',
|
|
route: '/reference/dart/introduction',
|
|
icon: () => <ArrowRight />,
|
|
enabled: isFeatureEnabled('sdk:dart'),
|
|
},
|
|
{
|
|
id: 'nav-ref-python',
|
|
name: 'Go to Python reference',
|
|
value: 'Reference, API, SDK: Go to Python reference',
|
|
route: '/reference/python/introduction',
|
|
icon: () => <ArrowRight />,
|
|
enabled: isFeatureEnabled('sdk:python'),
|
|
},
|
|
{
|
|
id: 'nav-ref-csharp',
|
|
name: 'Go to C# reference',
|
|
value: 'Reference, API, SDK: Go to C# reference',
|
|
route: '/reference/csharp/introduction',
|
|
icon: () => <ArrowRight />,
|
|
enabled: isFeatureEnabled('sdk:csharp'),
|
|
},
|
|
{
|
|
id: 'nav-ref-swift',
|
|
name: 'Go to Swift reference',
|
|
value: 'Reference, API, SDK: Go to Swift reference',
|
|
route: '/reference/swift/introduction',
|
|
icon: () => <ArrowRight />,
|
|
enabled: isFeatureEnabled('sdk:swift'),
|
|
},
|
|
{
|
|
id: 'nav-ref-kotlin',
|
|
name: 'Go to Kotlin reference',
|
|
value: 'Reference, API, SDK: Go to Kotlin reference',
|
|
route: '/reference/kotlin/introduction',
|
|
icon: () => <ArrowRight />,
|
|
enabled: isFeatureEnabled('sdk:kotlin'),
|
|
},
|
|
{
|
|
id: 'nav-ref-cli',
|
|
name: 'Go to CLI reference',
|
|
value: 'Reference, API, SDK: Go to CLI reference',
|
|
route: '/reference/cli/introduction',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-ref-api',
|
|
name: 'Go to Management API reference',
|
|
value: 'Reference, API, SDK: Go to Management API reference',
|
|
route: '/reference/api/introduction',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-resources',
|
|
name: 'Go to Guides & Examples',
|
|
route: '/guides/resources',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
{
|
|
id: 'nav-integrations',
|
|
name: 'Go to Partner Catalog',
|
|
route: 'https://supabase.com/partners/catalog',
|
|
icon: () => <ArrowRight />,
|
|
enabled: isFeatureEnabled('integrations:partners'),
|
|
},
|
|
{
|
|
id: 'nav-ui',
|
|
name: 'Go to Supabase Library',
|
|
route: 'https://supabase.com/library',
|
|
icon: () => <ArrowRight />,
|
|
},
|
|
] satisfies Array<ICommand & { enabled?: boolean }>
|
|
|
|
const filteredNavCommands = navCommands.filter((command) => command.enabled !== false)
|
|
|
|
const useDocsNavCommands = () => {
|
|
useRegisterCommands('Go to', filteredNavCommands)
|
|
}
|
|
|
|
export { useDocsNavCommands }
|