mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
examples: fixing imports due to 0.16 (#226)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import type { AstroBkndConfig } from "bknd/adapter/astro";
|
import type { AstroBkndConfig } from "bknd/adapter/astro";
|
||||||
import { registerLocalMediaAdapter } from "bknd/adapter/node";
|
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";
|
import { secureRandomString } from "bknd/utils";
|
||||||
|
|
||||||
// since we're running in node, we can register the local media adapter
|
// 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
|
// register your schema to get automatic type completion
|
||||||
type Database = (typeof schema)["DB"];
|
type Database = (typeof schema)["DB"];
|
||||||
declare module "bknd/core" {
|
declare module "bknd" {
|
||||||
interface DB extends Database {}
|
interface DB extends Database {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { NextjsBkndConfig } from "bknd/adapter/nextjs";
|
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 { registerLocalMediaAdapter } from "bknd/adapter/node";
|
||||||
import { secureRandomString } from "bknd/utils";
|
import { secureRandomString } from "bknd/utils";
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ const schema = em({
|
|||||||
|
|
||||||
// register your schema to get automatic type completion
|
// register your schema to get automatic type completion
|
||||||
type Database = (typeof schema)["DB"];
|
type Database = (typeof schema)["DB"];
|
||||||
declare module "bknd/core" {
|
declare module "bknd" {
|
||||||
interface DB extends Database {}
|
interface DB extends Database {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { App } from "bknd";
|
|
||||||
import { serve } from "bknd/adapter/vite";
|
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";
|
import { secureRandomString } from "bknd/utils";
|
||||||
|
|
||||||
export default serve({
|
export default serve({
|
||||||
@@ -8,23 +7,23 @@ export default serve({
|
|||||||
data: em({
|
data: em({
|
||||||
todos: entity("todos", {
|
todos: entity("todos", {
|
||||||
title: text(),
|
title: text(),
|
||||||
done: boolean()
|
done: boolean(),
|
||||||
})
|
}),
|
||||||
}).toJSON(),
|
}).toJSON(),
|
||||||
auth: {
|
auth: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
jwt: {
|
jwt: {
|
||||||
secret: secureRandomString(64)
|
secret: secureRandomString(64),
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
seed: async (ctx) => {
|
seed: async (ctx) => {
|
||||||
await ctx.em.mutator("todos" as any).insertMany([
|
await ctx.em.mutator("todos" as any).insertMany([
|
||||||
{ title: "Learn bknd", done: true },
|
{ 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 ...
|
// here we can hook into the app lifecycle events ...
|
||||||
beforeBuild: async (app) => {
|
beforeBuild: async (app) => {
|
||||||
@@ -34,10 +33,10 @@ export default serve({
|
|||||||
// ... to create an initial user
|
// ... to create an initial user
|
||||||
await app.module.auth.createUser({
|
await app.module.auth.createUser({
|
||||||
email: "ds@bknd.io",
|
email: "ds@bknd.io",
|
||||||
password: "12345678"
|
password: "12345678",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"sync"
|
"sync",
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { registerLocalMediaAdapter } from "bknd/adapter/node";
|
import { registerLocalMediaAdapter } from "bknd/adapter/node";
|
||||||
import type { ReactRouterBkndConfig } from "bknd/adapter/react-router";
|
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";
|
import { secureRandomString } from "bknd/utils";
|
||||||
|
|
||||||
// since we're running in node, we can register the local media adapter
|
// 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
|
// register your schema to get automatic type completion
|
||||||
type Database = (typeof schema)["DB"];
|
type Database = (typeof schema)["DB"];
|
||||||
declare module "bknd/core" {
|
declare module "bknd" {
|
||||||
interface DB extends Database {}
|
interface DB extends Database {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { lazy, Suspense, useEffect, useState } from "react";
|
import { lazy, Suspense, useEffect, useState } from "react";
|
||||||
import { App } from "bknd";
|
|
||||||
import { checksum } from "bknd/utils";
|
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 { SQLocalConnection } from "@bknd/sqlocal";
|
||||||
import { Route, Router, Switch } from "wouter";
|
import { Route, Router, Switch } from "wouter";
|
||||||
import IndexPage from "~/routes/_index";
|
import IndexPage from "~/routes/_index";
|
||||||
@@ -68,7 +67,7 @@ const schema = em({
|
|||||||
|
|
||||||
// register your schema to get automatic type completion
|
// register your schema to get automatic type completion
|
||||||
type Database = (typeof schema)["DB"];
|
type Database = (typeof schema)["DB"];
|
||||||
declare module "bknd/core" {
|
declare module "bknd" {
|
||||||
interface DB extends Database {}
|
interface DB extends Database {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { registerLocalMediaAdapter } from "bknd/adapter/node";
|
import { registerLocalMediaAdapter } from "bknd/adapter/node";
|
||||||
import type { BkndConfig } from "bknd/adapter";
|
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";
|
import { secureRandomString } from "bknd/utils";
|
||||||
|
|
||||||
// since we're running in node, we can register the local media adapter
|
// 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
|
// register your schema to get automatic type completion
|
||||||
type Database = (typeof schema)["DB"];
|
type Database = (typeof schema)["DB"];
|
||||||
declare module "bknd/core" {
|
declare module "bknd" {
|
||||||
interface DB extends Database {}
|
interface DB extends Database {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user