The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
added sidemenu for CLI
Jonathan Summers-Muirf62c0858f464
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.tsindex b798ce5c99f..a879fdb4a1f 100644--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts@@ -470,7 +470,7 @@ export const reference = {name: 'Supabase CLI',url: '/new/reference/cli/start',items: [],- icon: '/img/icons/javascript.svg',+ icon: '/img/icons/cli.svg',},{name: 'Management API',diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsxindex 638cd23189d..ba32b83378f 100644--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx@@ -5,17 +5,14 @@ import { IconChevronLeft } from '~/../../packages/ui'import * as NavItems from './NavigationMenu.constants'import NavigationMenuGuideList from './NavigationMenuGuideList'import NavigationMenuRefList from './NavigationMenuRefList'+import NavigationMenuCliList from './NavigationMenuCliList'const SideNav = () => {- console.log('sidebar rerendered')const router = useRouter()const [level, setLevel] = useState('home')function handleRouteChange(url: string) {- // console.log('path changed')- // console.log(url)- // console.log('LISTEN')switch (url) {case `/docs`:setLevel('home')@@ -63,7 +60,6 @@ const SideNav = () => {}useEffect(() => {- console.log(router)handleRouteChange(router.basePath + router.asPath)// Listen for page changes after a navigation or when the query changesrouter.events.on('routeChangeComplete', handleRouteChange)@@ -72,8 +68,6 @@ const SideNav = () => {}}, [router.events])- // handleRouteChange(router.asPath)-const home = [[{@@ -149,51 +143,6 @@ const SideNav = () => {],]- const auth = [- {- label: 'back',- icon: 'home.svg',- href: '',- level: 'home',- },- ]-- const ref = [- {- label: 'back',- icon: 'home.svg',- href: '',- level: 'home',- },- {- label: 'supabase-js v2',- icon: 'home.svg',- href: '/reference/javascript/start',- level: 'ref_js',- },- {- label: 'supabase-js v1',- icon: 'home.svg',- href: '/reference/javascript/v1/start',- level: 'ref_js',- },- {- label: 'supabase-dart v1',- icon: 'home.svg',- href: '/reference/dart/start',- level: 'ref_dart',- },- ]-- const ref_js = [- {- label: 'back to ref',- icon: 'home.svg',- href: '/reference',- level: 'ref',- },- ]-return (<div className="flex relative">{/* // main menu */}@@ -255,7 +204,7 @@ const SideNav = () => {{/* reference level */}<NavigationMenuRefList id={'reference_javascript'} currentLevel={level} setLevel={setLevel} />- <NavigationMenuRefList id={'reference_cli'} currentLevel={level} setLevel={setLevel} />+ <NavigationMenuCliList id={'reference_cli'} currentLevel={level} setLevel={setLevel} />{/* // ref menu */}{/* <divdiff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuCliList.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuCliList.tsxnew file mode 100644index 00000000000..0a2e1fdaebd--- /dev/null+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuCliList.tsx@@ -0,0 +1,191 @@+import Link from 'next/link'+import { useRouter } from 'next/router'+import { IconChevronLeft } from 'ui'+import * as NavItems from './NavigationMenu.constants'+// @ts-expect-error+import jsSpec from '~/../../spec/supabase_js_v2_temp_new_shape.yml' assert { type: 'yml' }+// @ts-expect-error+import clientLibsCommon from '~/../../spec/common-cli.yml' assert { type: 'yml' }++const NavigationMenuCliList = ({ currentLevel, setLevel, id }) => {+ const router = useRouter()++ const menu = NavItems[id]+ let functions = jsSpec.functions++ functions = functions.map((func) => {+ let data = {+ ...func,+ }+ data = {+ ...data,+ ...clientLibsCommon.commands.filter((x) => {+ return x.id === func.id+ })[0],+ }+ return data+ })++ const FunctionLink = ({+ title,+ id,+ icon,+ }: {+ title: string+ name: string+ id: string+ icon?: string+ }) => {+ return (+ <li key={id}>+ <Link href={`#${id}`} passHref>+ <a className="cursor-pointer transition text-scale-1000 text-sm hover:text-brand-900 flex gap-3">+ {icon && <img className="w-3" src={`${router.basePath}${icon}`} />}+ {title}+ </a>+ </Link>+ </li>+ )+ }++ const SideMenuTitle = ({ title }: { title: string }) => {+ return (+ <span+ className="+ font-mono text-xs uppercase+ text-scale-1200 font-medium+ tracking-wider+ mb-3+ "+ >+ {title}+ </span>+ )+ }++ const Divider = () => {+ return <div className="h-px w-full bg-green-500 my-3"></div>+ }++ const MenuSections = [+ {+ key: 'general',+ label: 'General',+ },+ {+ key: 'secrets',+ label: 'Secrets',+ },+ {+ key: 'projects',+ label: 'Projects',+ },+ {+ key: 'organizations',+ label: 'Organizations',+ },+ {+ key: 'migration',+ label: 'Migration',+ },+ {+ key: 'database',+ label: 'Database',+ },+ {+ key: 'completion',+ label: 'Completion',+ },+ ]++ return (+ <div+ className={[+ 'transition-all ml-8 duration-150 ease-out',++ // enabled+ currentLevel === id && 'opacity-100 ml-0 delay-150',+ currentLevel === 'home' && 'ml-12',++ // disabled+ currentLevel !== 'home' && currentLevel !== id ? '-ml-8' : '',+ currentLevel !== id ? 'opacity-0 invisible absolute' : '',+ ].join(' ')}+ >+ <div className={'w-full flex flex-col gap-0 sticky top-8'}>+ <Link href={`${menu.parent ?? '/'}`} passHref>+ <a+ className={[+ 'flex items-center gap-1 text-xs group mb-3',+ 'text-base transition-all duration-200 text-brand-900 hover:text-brand-1200 hover:cursor-pointer ',+ ].join(' ')}+ >+ <div className="relative w-2">+ <div className="transition-all ease-out ml-0 group-hover:-ml-1">+ <IconChevronLeft size={10} strokeWidth={3} />+ </div>+ </div>+ <span>Main Menu</span>+ </a>+ </Link>+ <div className="flex items-center gap-3 my-3">+ <img+ src={`${router.basePath}` + menu.icon ?? `/img/icons/menu/${id}.svg`}+ className="w-5 rounded"+ />++ <h2 className={['text-scale-1200 ', !menu.title && 'capitalize'].join(' ')}>+ {menu.title ?? currentLevel}+ </h2>+ </div>+ <ul>+ {MenuSections.map((section) => {+ return (+ <>+ <Divider />+ <SideMenuTitle title={section.label} />++ {clientLibsCommon.commands+ .filter((x) => x.product === section.key)+ .map((x, index) => {+ console.log(functions)+ return (+ <>+ <FunctionLink {...x} />+ </>+ )+ })}+ </>+ )+ })}++ <Divider />+ </ul>+ {menu.extras && (+ <>+ <Divider />{' '}+ <span className="font-mono text-xs uppercase text-scale-1200 font-medium tracking-wider mb-2">+ Resources+ </span>+ </>+ )}+ {menu.extras?.map((x) => {+ return (+ <div key={x.name}>+ <li>+ <Link href={`/${x.href}`} passHref>+ <a className="cursor-pointer transition text-scale-1100 text-sm hover:text-brand-900 flex gap-3 my-1">+ {x.icon && <img className="w-4" src={`${router.basePath}${x.icon}`} />}+ {x.name}+ </a>+ </Link>+ </li>+ </div>+ )+ })}+ </div>+ </div>+ )+}++export default NavigationMenuCliListdiff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsxindex 0f641561157..33900c54f0d 100644--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsx+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsx@@ -5,7 +5,7 @@ import * as NavItems from './NavigationMenu.constants'// @ts-expect-errorimport jsSpec from '~/../../spec/supabase_js_v2_temp_new_shape.yml' assert { type: 'yml' }// @ts-expect-error-import clientLibsCommon from '~/../../spec/client-libs-common.yml' assert { type: 'yml' }+import clientLibsCommon from '~/../../spec/common-client-libs.yml' assert { type: 'yml' }const NavigationMenuRefList = ({ currentLevel, setLevel, id }) => {const router = useRouter()diff --git a/spec/common-cli.yml b/spec/common-cli.ymlindex a09e3fa411c..bcbfd839848 100644--- a/spec/common-cli.yml+++ b/spec/common-cli.yml@@ -2,141 +2,188 @@ clisCommon: '001'commands:- id: supabase-testtitle: supabase test+ product: 'general'++ - id: supabase-login+ title: supabase login+ product: 'general'++ - id: supabase-link+ title: supabase link+ product: 'general'++ - id: supabase-init+ title: supabase init+ product: 'general'- id: supabase-test-dbtitle: supabase test db+ product: 'general'- id: supabase-stoptitle: supabase stop+ product: 'general'- id: supabase-statustitle: supabase status+ product: 'general'- id: supabase-starttitle: supabase start+ product: 'general'++ - id: supabase-gen+ title: supabase gen+ product: 'general'++ - id: supabase-gen-types+ title: supabase gen types+ product: 'general'++ - id: supabase-gen-types-typescript+ title: supabase gen types typescript+ product: 'general'- id: supabase-secretstitle: supabase secrets+ product: 'secrets'- id: supabase-secrets-unsettitle: supabase secrets unset+ product: 'secrets'- id: supabase-secrets-settitle: supabase secrets set+ product: 'secrets'- id: supabase-secrets-listtitle: supabase secrets list+ product: 'secrets'- id: supabase-projectstitle: supabase projects+ product: 'projects'- id: supabase-projects-listtitle: supabase projects list+ product: 'projects'- id: supabase-projects-createtitle: supabase projects create+ product: 'projects'- id: supabase-orgstitle: supabase orgs+ product: 'organizations'- id: supabase-orgs-listtitle: supabase orgs list+ product: 'organizations'- id: supabase-migrationtitle: supabase migration+ product: 'migration'- id: supabase-migration-newtitle: supabase migration new+ product: 'migration'- id: supabase-migration-listtitle: supabase migration list-- - id: supabase-login- title: supabase login-- - id: supabase-link- title: supabase link-- - id: supabase-init- title: supabase init-- - id: supabase-gen- title: supabase gen-- - id: supabase-gen-types- title: supabase gen types-- - id: supabase-gen-types-typescript- title: supabase gen types typescript+ product: 'migration'- id: supabase-functionstitle: supabase functions+ product: 'functions'- id: supabase-functions-servetitle: supabase functions serve+ product: 'functions'- id: supabase-functions-newtitle: supabase functions new+ product: 'functions'- id: supabase-functions-deploytitle: supabase functions deploy+ product: 'functions'- id: supabase-functions-deletetitle: supabase functions delete+ product: 'functions'- id: supabase-domainstitle: supabase domains+ product: 'domains'- id: supabase-domains-reverifytitle: supabase domains reverify+ product: 'domains'- id: supabase-domains-gettitle: supabase domains get+ product: 'domains'- id: supabase-domains-deletetitle: supabase domains delete+ product: 'domains'- id: supabase-domains-createtitle: supabase domains create+ product: 'domains'- id: supabase-domains-activatetitle: supabase domains activate+ product: 'domains'- id: supabase-dbtitle: supabase db+ product: 'database'- id: supabase-db-resettitle: supabase db reset+ product: 'database'- id: supabase-db-remotetitle: supabase db remote+ product: 'database'- id: supabase-db-remote-committitle: supabase db remote commit+ product: 'database'- id: supabase-db-remote-changestitle: supabase db remote changes+ product: 'database'- id: supabase-db-pushtitle: supabase db push+ product: 'database'- id: supabase-db-linttitle: supabase db lint+ product: 'database'- id: supabase-db-difftitle: supabase db diff+ product: 'database'- id: supabase-completiontitle: supabase completion+ product: 'completion'- id: supabase-completion-zshtitle: supabase completion zsh+ product: 'completion'- id: supabase-completion-powershelltitle: supabase completion powershell+ product: 'completion'- id: supabase-completion-fishtitle: supabase completion fish+ product: 'completion'- id: supabase-completion-bashtitle: supabase completion bash+ product: 'completion'