From 412eab665322c3d3357e54d098ab7c231fce15da Mon Sep 17 00:00:00 2001 From: dswbx Date: Sun, 3 Aug 2025 13:15:01 +0200 Subject: [PATCH] examples: fixing imports due to 0.16 --- examples/astro/bknd.config.ts | 4 ++-- examples/nextjs/bknd.config.ts | 4 ++-- examples/plasmic/src/server.ts | 23 +++++++++++------------ examples/react-router/bknd.config.ts | 4 ++-- examples/react/src/App.tsx | 5 ++--- examples/waku/bknd.config.ts | 4 ++-- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/examples/astro/bknd.config.ts b/examples/astro/bknd.config.ts index 8ddea7e..b7b20bb 100644 --- a/examples/astro/bknd.config.ts +++ b/examples/astro/bknd.config.ts @@ -1,6 +1,6 @@ import type { AstroBkndConfig } from "bknd/adapter/astro"; import { registerLocalMediaAdapter } from "bknd/adapter/node"; -import { boolean, em, entity, text } from "bknd/data"; +import { boolean, em, entity, text } from "bknd"; import { secureRandomString } from "bknd/utils"; // since we're running in node, we can register the local media adapter @@ -16,7 +16,7 @@ const schema = em({ // register your schema to get automatic type completion type Database = (typeof schema)["DB"]; -declare module "bknd/core" { +declare module "bknd" { interface DB extends Database {} } diff --git a/examples/nextjs/bknd.config.ts b/examples/nextjs/bknd.config.ts index 39a12a7..186ef04 100644 --- a/examples/nextjs/bknd.config.ts +++ b/examples/nextjs/bknd.config.ts @@ -1,5 +1,5 @@ import type { NextjsBkndConfig } from "bknd/adapter/nextjs"; -import { boolean, em, entity, text } from "bknd/data"; +import { boolean, em, entity, text } from "bknd"; import { registerLocalMediaAdapter } from "bknd/adapter/node"; import { secureRandomString } from "bknd/utils"; @@ -22,7 +22,7 @@ const schema = em({ // register your schema to get automatic type completion type Database = (typeof schema)["DB"]; -declare module "bknd/core" { +declare module "bknd" { interface DB extends Database {} } diff --git a/examples/plasmic/src/server.ts b/examples/plasmic/src/server.ts index 5ac41cb..e8e931d 100644 --- a/examples/plasmic/src/server.ts +++ b/examples/plasmic/src/server.ts @@ -1,6 +1,5 @@ -import { App } from "bknd"; import { serve } from "bknd/adapter/vite"; -import { boolean, em, entity, text } from "bknd/data"; +import { App, boolean, em, entity, text } from "bknd"; import { secureRandomString } from "bknd/utils"; export default serve({ @@ -8,23 +7,23 @@ export default serve({ data: em({ todos: entity("todos", { title: text(), - done: boolean() - }) + done: boolean(), + }), }).toJSON(), auth: { enabled: true, jwt: { - secret: secureRandomString(64) - } - } + secret: secureRandomString(64), + }, + }, }, options: { seed: async (ctx) => { await ctx.em.mutator("todos" as any).insertMany([ { title: "Learn bknd", done: true }, - { title: "Build something cool", done: false } + { title: "Build something cool", done: false }, ]); - } + }, }, // here we can hook into the app lifecycle events ... beforeBuild: async (app) => { @@ -34,10 +33,10 @@ export default serve({ // ... to create an initial user await app.module.auth.createUser({ email: "ds@bknd.io", - password: "12345678" + password: "12345678", }); }, - "sync" + "sync", ); - } + }, }); diff --git a/examples/react-router/bknd.config.ts b/examples/react-router/bknd.config.ts index 06239b3..8be1756 100644 --- a/examples/react-router/bknd.config.ts +++ b/examples/react-router/bknd.config.ts @@ -1,6 +1,6 @@ import { registerLocalMediaAdapter } from "bknd/adapter/node"; import type { ReactRouterBkndConfig } from "bknd/adapter/react-router"; -import { boolean, em, entity, text } from "bknd/data"; +import { boolean, em, entity, text } from "bknd"; import { secureRandomString } from "bknd/utils"; // since we're running in node, we can register the local media adapter @@ -15,7 +15,7 @@ const schema = em({ // register your schema to get automatic type completion type Database = (typeof schema)["DB"]; -declare module "bknd/core" { +declare module "bknd" { interface DB extends Database {} } diff --git a/examples/react/src/App.tsx b/examples/react/src/App.tsx index f288529..d72cfb5 100644 --- a/examples/react/src/App.tsx +++ b/examples/react/src/App.tsx @@ -1,7 +1,6 @@ import { lazy, Suspense, useEffect, useState } from "react"; -import { App } from "bknd"; import { checksum } from "bknd/utils"; -import { boolean, em, entity, text } from "bknd/data"; +import { App, boolean, em, entity, text } from "bknd"; import { SQLocalConnection } from "@bknd/sqlocal"; import { Route, Router, Switch } from "wouter"; import IndexPage from "~/routes/_index"; @@ -68,7 +67,7 @@ const schema = em({ // register your schema to get automatic type completion type Database = (typeof schema)["DB"]; -declare module "bknd/core" { +declare module "bknd" { interface DB extends Database {} } diff --git a/examples/waku/bknd.config.ts b/examples/waku/bknd.config.ts index 28ecf03..3b384cc 100644 --- a/examples/waku/bknd.config.ts +++ b/examples/waku/bknd.config.ts @@ -1,6 +1,6 @@ import { registerLocalMediaAdapter } from "bknd/adapter/node"; import type { BkndConfig } from "bknd/adapter"; -import { boolean, em, entity, text } from "bknd/data"; +import { boolean, em, entity, text } from "bknd"; import { secureRandomString } from "bknd/utils"; // since we're running in node, we can register the local media adapter @@ -15,7 +15,7 @@ const schema = em({ // register your schema to get automatic type completion type Database = (typeof schema)["DB"]; -declare module "bknd/core" { +declare module "bknd" { interface DB extends Database {} }