chore: bump version to 0.20.0-rc.1 and fix client context

This commit is contained in:
dswbx
2025-12-02 15:14:27 +01:00
parent 7ba542c040
commit 506c7d84cc
3 changed files with 24 additions and 22 deletions

View File

@@ -3,7 +3,7 @@
"type": "module",
"sideEffects": false,
"bin": "./dist/cli/index.js",
"version": "0.19.0",
"version": "0.20.0-rc.1",
"description": "Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.",
"homepage": "https://bknd.io",
"repository": {

View File

@@ -5,7 +5,7 @@ import { BkndProvider } from "ui/client/bknd";
import { useTheme, type AppTheme } from "ui/client/use-theme";
import { Logo } from "ui/components/display/Logo";
import * as AppShell from "ui/layouts/AppShell/AppShell";
import { ClientProvider, useBkndWindowContext, type ClientProviderProps } from "./client";
import { ClientProvider, useBkndWindowContext, type ClientProviderProps } from "bknd/client";
import { createMantineTheme } from "./lib/mantine/theme";
import { Routes } from "./routes";
import type { BkndAdminAppShellOptions, BkndAdminEntitiesOptions } from "./options";
@@ -52,26 +52,30 @@ export type BkndAdminProps = {
children?: ReactNode;
};
export default function Admin({
baseUrl: baseUrlOverride,
withProvider = false,
config: _config = {},
children,
}: BkndAdminProps) {
const { theme } = useTheme();
export default function Admin(props: BkndAdminProps) {
const Provider = ({ children }: any) =>
withProvider ? (
props.withProvider ? (
<ClientProvider
baseUrl={baseUrlOverride}
{...(typeof withProvider === "object" ? withProvider : {})}
baseUrl={props.baseUrl}
{...(typeof props.withProvider === "object" ? props.withProvider : {})}
>
{children}
</ClientProvider>
) : (
children
);
return (
<Provider>
<AdminInner {...props} />
</Provider>
);
}
function AdminInner(props: BkndAdminProps) {
const { theme } = useTheme();
const config = {
..._config,
...props.config,
...useBkndWindowContext(),
};
@@ -82,14 +86,12 @@ export default function Admin({
);
return (
<Provider>
<MantineProvider {...createMantineTheme(theme as any)}>
<Notifications position="top-right" />
<Routes BkndWrapper={BkndWrapper} basePath={config?.basepath}>
{children}
{props.children}
</Routes>
</MantineProvider>
</Provider>
);
}

View File

@@ -15,7 +15,7 @@ export const prerender = false;
<Admin
withProvider={{ user }}
config={{ basepath: "/admin", theme: "dark", logo_return_path: "/../" }}
client:only
client:only="react"
/>
</body>
</html>