diff --git a/app/package.json b/app/package.json index 0429a81b..7f898f84 100644 --- a/app/package.json +++ b/app/package.json @@ -3,7 +3,7 @@ "type": "module", "sideEffects": false, "bin": "./dist/cli/index.js", - "version": "0.0.2", + "version": "0.0.4", "description": "Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.", "homepage": "https://gitea.bsws.in/shishantbiswas/userbase", "repository": { diff --git a/app/src/index.ts b/app/src/index.ts index 6871493d..a96ef6de 100644 --- a/app/src/index.ts +++ b/app/src/index.ts @@ -32,7 +32,7 @@ export { export type * from "modules/ModuleApi"; export type { ServerEnv } from "modules/Controller"; -export type { UserbaseConfig } from "userbase/adapter"; +export type { UserbaseConfig } from "./adapter"; export * as middlewares from "modules/middlewares"; export { registries } from "modules/registries"; diff --git a/app/src/ui/client/UserbaseProvider.tsx b/app/src/ui/client/UserbaseProvider.tsx index c0de4d91..3cb9b1b9 100644 --- a/app/src/ui/client/UserbaseProvider.tsx +++ b/app/src/ui/client/UserbaseProvider.tsx @@ -31,7 +31,7 @@ export type UserbaseContext = { fallback: boolean; }; -const UserbaseContext = createContext(undefined!); +const UserbaseContext = createContext(null); export type { TSchemaActions }; enum Fetching { @@ -174,15 +174,15 @@ function AccessDenied() { export function useUserbase({ withSecrets }: { withSecrets?: boolean } = {}): UserbaseContext { const ctx = useContext(UserbaseContext); - if (withSecrets) ctx.requireSecrets(); + if (withSecrets) ctx?.requireSecrets(); - return ctx; + return ctx!; } export function useUserbaseOptions(): UserbaseAdminProps["config"] { const ctx = useContext(UserbaseContext); return ( - ctx.options ?? { + ctx?.options ?? { basepath: "/", } ); diff --git a/app/src/ui/components/wouter/Link.tsx b/app/src/ui/components/wouter/Link.tsx index b1f4f5a4..b4572858 100644 --- a/app/src/ui/components/wouter/Link.tsx +++ b/app/src/ui/components/wouter/Link.tsx @@ -103,9 +103,10 @@ export function Link({ }; return ( - // @ts-expect-error className is not typed on WouterLink + // @ts-ignore: className is not typed on WouterLink