Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix type issues

Jonathan Summers-Muirad4dc5584cab
diff --git a/apps/www/public/sitemap_www.xml b/apps/www/public/sitemap_www.xml
index a0922df9c0d..0de81dc6170 100644
--- a/apps/www/public/sitemap_www.xml
+++ b/apps/www/public/sitemap_www.xml
@@ -79,7 +79,7 @@
</url>
<url>
- <loc>https://supabase.com/edge-functions</loc>
+ <loc>https://supabase.com/legal/dpa</loc>
<changefreq>weekly</changefreq>
<changefreq>0.5</changefreq>
</url>
@@ -91,7 +91,7 @@
</url>
<url>
- <loc>https://supabase.com/legal/dpa</loc>
+ <loc>https://supabase.com/edge-functions</loc>
<changefreq>weekly</changefreq>
<changefreq>0.5</changefreq>
</url>
@@ -1058,6 +1058,30 @@
<changefreq>0.5</changefreq>
</url>
+ <url>
+ <loc>https://supabase.com/blog/case-study-happyteams</loc>
+ <changefreq>weekly</changefreq>
+ <changefreq>0.5</changefreq>
+ </url>
+
+ <url>
+ <loc>https://supabase.com/blog/type-constraints-in-65-lines-of-sql</loc>
+ <changefreq>weekly</changefreq>
+ <changefreq>0.5</changefreq>
+ </url>
+
+ <url>
+ <loc>https://supabase.com/blog/geo-queries-with-postgis-in-ionic-angular</loc>
+ <changefreq>weekly</changefreq>
+ <changefreq>0.5</changefreq>
+ </url>
+
+ <url>
+ <loc>https://supabase.com/blog/supabase-beta-update-february-2023</loc>
+ <changefreq>weekly</changefreq>
+ <changefreq>0.5</changefreq>
+ </url>
+
<url>
<loc>https://supabase.com/alternatives/supabase-vs-firebase</loc>
<changefreq>weekly</changefreq>
diff --git a/apps/www/types/sse.d.ts b/apps/www/types/sse.d.ts
new file mode 100644
index 00000000000..dbf97ac0836
--- /dev/null
+++ b/apps/www/types/sse.d.ts
@@ -0,0 +1,12 @@
+declare module 'sse.js' {
+ export type SSEOptions = EventSourceInit & {
+ headers?: Record<string, string>
+ payload?: string
+ method?: string
+ }
+
+ export class SSE extends EventSource {
+ constructor(url: string | URL, sseOptions?: SSEOptions)
+ stream(): void
+ }
+}
diff --git a/packages/ui/src/components/Command/AiCommand.tsx b/packages/ui/src/components/Command/AiCommand.tsx
index bb92ff1983a..dd39deb4b34 100644
--- a/packages/ui/src/components/Command/AiCommand.tsx
+++ b/packages/ui/src/components/Command/AiCommand.tsx
@@ -107,7 +107,7 @@ function promptDataReducer(
export interface AiCommandProps {
query?: string
- setQuery?: (query: string) => void
+ setQuery: (query: string) => void
page?: string
}
@@ -216,7 +216,7 @@ const AiCommand = ({ query, setQuery, page }: AiCommandProps) => {
const eventSource = new SSE(`${edgeFunctionUrl}/clippy-search`, {
headers: {
- apikey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
+ apikey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ?? '',
Authorization: `Bearer ${process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY}`,
'Content-Type': 'application/json',
},
diff --git a/packages/ui/src/components/Command/Command.utils.tsx b/packages/ui/src/components/Command/Command.utils.tsx
index 096d51fc4c1..06c5b5fd85c 100644
--- a/packages/ui/src/components/Command/Command.utils.tsx
+++ b/packages/ui/src/components/Command/Command.utils.tsx
@@ -179,6 +179,7 @@ interface ICommandItem extends React.ElementRef<typeof CommandPrimitive.Item> {
const CommandItem = React.forwardRef<
ICommandItem,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
+ // @ts-ignore
>(({ className, type, ...props }, ref) => (
<CommandPrimitive.Item
ref={ref}
diff --git a/packages/ui/src/components/Command/CommandMenu.tsx b/packages/ui/src/components/Command/CommandMenu.tsx
index b1c6ecde1ab..45a58e68fed 100644
--- a/packages/ui/src/components/Command/CommandMenu.tsx
+++ b/packages/ui/src/components/Command/CommandMenu.tsx
@@ -1,11 +1,20 @@
+import { useCommandState } from 'cmdk-supabase'
import { useRouter } from 'next/router'
import * as React from 'react'
+import { IconHome } from '../Icon/icons/IconHome'
+
+import { IconArrowRight } from './../Icon/icons/IconArrowRight'
+import { IconBook } from './../Icon/icons/IconBook'
+import { IconColumns } from './../Icon/icons/IconColumns'
+import { IconInbox } from './../Icon/icons/IconInbox'
+import { IconLifeBuoy } from './../Icon/icons/IconLifeBuoy'
+import { IconMonitor } from './../Icon/icons/IconMonitor'
+import { IconPhone } from './../Icon/icons/IconPhone'
+import { IconUser } from './../Icon/icons/IconUser'
-import { useCommandState } from 'cmdk-supabase'
-import { IconBook } from '../Icon/icons/IconBook'
-import { IconInbox } from '../Icon/icons/IconInbox'
-import { IconMonitor } from '../Icon/icons/IconMonitor'
import AiCommand from './AiCommand'
+import navItems from './command-nav-items.json'
+import { AiIcon } from './Command.icons'
import {
CommandDialog,
CommandGroup,
@@ -16,11 +25,6 @@ import {
CommandShortcut,
} from './Command.utils'
import { useCommandMenu } from './CommandMenuProvider'
-// import { SearchProvider } from './SearchProvider'
-import { IconArrowRight } from '../Icon/icons/IconArrowRight'
-import { IconLifeBuoy } from '../Icon/icons/IconLifeBuoy'
-import navItems from './command-nav-items.json'
-import { AiIcon } from './Command.icons'
import DocsSearch from './DocsSearch'
export const COMMAND_ROUTES = {
@@ -41,10 +45,16 @@ interface IActions {
toggleTheme: () => void
}
-const iconPicker = {
+const iconPicker: { [key: string]: React.ReactNode } = {
arrowRight: <IconArrowRight />,
book: <IconBook />,
inbox: <IconInbox />,
+ mobile: <IconPhone />,
+ person: <IconUser />,
+ services: <IconColumns />,
+ contact: <IconMonitor />,
+ icon: <IconHome />,
+ products: <IconColumns />,
}
const SearchOnlyItem = ({ children, isSubItem, ...props }: any) => {
@@ -229,7 +239,7 @@ const CommandMenu = () => {
<CommandGroup heading="General">
{navItems.docsGeneral.map((item) => (
<CommandItem onSelect={() => router.push(item.url)}>
- {item.icon && iconPicker[item.icon]}
+ {item?.icon && iconPicker[item.icon]}
<CommandLabel>{item.label}</CommandLabel>
</CommandItem>
))}
diff --git a/packages/ui/src/components/Command/CommandMenuProvider.tsx b/packages/ui/src/components/Command/CommandMenuProvider.tsx
index cce5169d31f..aebb9ffd942 100644
--- a/packages/ui/src/components/Command/CommandMenuProvider.tsx
+++ b/packages/ui/src/components/Command/CommandMenuProvider.tsx
@@ -15,7 +15,7 @@ export interface CommandMenuContextValue {
setPages: React.Dispatch<React.SetStateAction<string[]>>
page: string
}
-export const CommandMenuContext = createContext<CommandMenuContextValue>(undefined)
+export const CommandMenuContext = createContext<CommandMenuContextValue | undefined>(undefined)
export const useCommandMenu = () => {
const context = useContext(CommandMenuContext)