update: playwright and solid, tanstack-start exmaple
Run Tests / test (push) Successful in 6m46s

This commit is contained in:
2026-09-28 18:42:26 +05:30
parent dfa37b5244
commit a0454f82d6
10 changed files with 87 additions and 89 deletions
+51
View File
@@ -0,0 +1,51 @@
import { em, entity, text, boolean } from "userbase";
import { secureRandomString } from "userbase/utils";
import type { SolidStartUserbaseConfig } from "userbase/adapter/solid-start";
const schema = em({
todos: entity("todos", {
title: text(),
done: boolean(),
}),
});
// register your schema to get automatic type completion
type Database = (typeof schema)["DB"];
declare module "userbase" {
interface DB extends Database { }
}
export default {
connection: { url: "file:data.db" },
options: {
// the seed option is only executed if the database was empty
seed: async (ctx) => {
// create some entries
await ctx.em.mutator("todos").insertMany([
{ title: "Learn userbase", done: true },
{ title: "Build something cool", done: false },
]);
// and create a user
await ctx.app.module.auth.createUser({
email: "test@userbase.io",
password: "12345678",
});
},
},
config: {
data: schema.toJSON(),
auth: {
enabled: true,
jwt: {
secret: secureRandomString(32),
},
},
},
adminOptions: {
adminBasepath: "/admin",
assetsPath: "/admin/",
logoReturnPath: "../..",
},
} satisfies SolidStartUserbaseConfig;