Files
supabase/apps/docs/components/Navigation/Navigation.commands.tsx
Saxon Fletcher cb35e1f98e chore(library): update routes, redirects, and naming (#48668)
Our UI Library registry is expanding to include blocks that go beyond UI
and in some cases focus purely on back-end. This PR is a precursor to
adding more back-end related blocks. This PR includes the `ui-library ->
library` rename plus redirects and small UI copy updates. Since this is
a rename we'll need to update Vercel configuration.

## Vercel rollout

Keep the Library project Root Directory as `apps/ui-library`

1. In the **Library** Vercel project, set:

   `NEXT_PUBLIC_BASE_PATH=/library`

Apply it to Preview and Production, then redeploy the Library project.

2. In the **www** Vercel project, add:

`NEXT_PUBLIC_LIBRARY_URL=<current value of NEXT_PUBLIC_UI_LIBRARY_URL>`

Apply it to Preview and Production. Keep `NEXT_PUBLIC_UI_LIBRARY_URL`
during the migration, then redeploy the www project.

3. Deploy in this order:

   1. Library project
   2. www project

4. Validate:

   - `/library`
   - `/library/docs/nextjs/password-based-auth`
   - `/ui` redirects to `/library`
- `/ui/docs/nextjs/password-based-auth` redirects to
`/library/docs/nextjs/password-based-auth`
- `/ui/docs/ai-editors-rules/*` still uses its existing Docs redirects

No Vercel dashboard redirect rules are needed. Environment-variable
changes require a new deployment.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Supabase UI Library has been renamed to **Supabase Library** across
navigation, pages, documentation, and resource links.
* The Library is now available at `/library`, with updated descriptions
covering components, blocks, and developer tools.
* **Bug Fixes**
* Added permanent redirects from legacy `/ui` URLs to corresponding
`/library` paths.
* Updated links throughout the site and documentation to prevent broken
navigation and references.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-11 13:37:32 +10:00

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/cli',
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 }