@batijs/cli 0.0.541 → 0.0.543

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/boilerplates/@batijs/auth0/files/$.env.js +1 -1
  2. package/dist/boilerplates/@batijs/auth0/files/$TODO.md.js +1 -1
  3. package/dist/boilerplates/@batijs/auth0/files/$wrangler.jsonc.js +1 -1
  4. package/dist/boilerplates/@batijs/authjs/files/$package.json.js +1 -1
  5. package/dist/boilerplates/@batijs/aws/files/$README.md.js +1 -1
  6. package/dist/boilerplates/@batijs/aws/files/$TODO.md.js +1 -1
  7. package/dist/boilerplates/@batijs/aws/files/$package.json.js +1 -1
  8. package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
  9. package/dist/boilerplates/@batijs/aws/files/cdk/bin/infrastructure.ts +1 -1
  10. package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
  11. package/dist/boilerplates/@batijs/cloudflare/files/$TODO.md.js +1 -1
  12. package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +1 -1
  13. package/dist/boilerplates/@batijs/cloudflare/files/$tsconfig.json.js +1 -1
  14. package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
  15. package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +1 -1
  16. package/dist/boilerplates/@batijs/d1/files/$TODO.md.js +1 -1
  17. package/dist/boilerplates/@batijs/d1/files/$package.json.js +1 -1
  18. package/dist/boilerplates/@batijs/d1/files/$wrangler.jsonc.js +1 -1
  19. package/dist/boilerplates/@batijs/d1-kysely/bati.config.js +17 -0
  20. package/dist/boilerplates/@batijs/d1-kysely/files/$package.json.js +77 -0
  21. package/dist/boilerplates/@batijs/d1-kysely/files/database/migrations/todos.sql +4 -0
  22. package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +1 -1
  23. package/dist/boilerplates/@batijs/drizzle/files/$.env.js +1 -1
  24. package/dist/boilerplates/@batijs/drizzle/files/$TODO.md.js +1 -1
  25. package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +1 -1
  26. package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -1
  27. package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
  28. package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -1
  29. package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
  30. package/dist/boilerplates/@batijs/h3/files/$package.json.js +1 -1
  31. package/dist/boilerplates/@batijs/hono/files/$package.json.js +1 -1
  32. package/dist/boilerplates/@batijs/kysely/bati.config.js +35 -0
  33. package/dist/boilerplates/@batijs/kysely/files/$.env.js +19 -0
  34. package/dist/boilerplates/@batijs/kysely/files/$TODO.md.js +30 -0
  35. package/dist/boilerplates/@batijs/kysely/files/$package.json.js +120 -0
  36. package/dist/boilerplates/@batijs/kysely/files/database/kysely/db.ts +25 -0
  37. package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrate.ts +45 -0
  38. package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrations/001_create_todos_table.ts +16 -0
  39. package/dist/boilerplates/@batijs/kysely/files/database/kysely/queries/todos.ts +20 -0
  40. package/dist/boilerplates/@batijs/kysely/files/database/kysely/types.ts +13 -0
  41. package/dist/boilerplates/@batijs/kysely/types/database/kysely/db.d.ts +5 -0
  42. package/dist/boilerplates/@batijs/kysely/types/database/kysely/migrate.d.ts +1 -0
  43. package/dist/boilerplates/@batijs/kysely/types/database/kysely/migrations/001_create_todos_table.d.ts +4 -0
  44. package/dist/boilerplates/@batijs/kysely/types/database/kysely/queries/todos.d.ts +15 -0
  45. package/dist/boilerplates/@batijs/kysely/types/database/kysely/types.d.ts +10 -0
  46. package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
  47. package/dist/boilerplates/@batijs/mantine/files/$package.json.js +1 -1
  48. package/dist/boilerplates/@batijs/oxlint/files/$package.json.js +1 -1
  49. package/dist/boilerplates/@batijs/photon/files/$README.md.js +1 -1
  50. package/dist/boilerplates/@batijs/photon/files/$package.json.js +1 -1
  51. package/dist/boilerplates/@batijs/plausible.io/files/$TODO.md.js +1 -1
  52. package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +1 -1
  53. package/dist/boilerplates/@batijs/prettier/files/$package.json.js +1 -1
  54. package/dist/boilerplates/@batijs/prisma/files/$.env.js +1 -1
  55. package/dist/boilerplates/@batijs/prisma/files/$TODO.md.js +1 -1
  56. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +1 -1
  57. package/dist/boilerplates/@batijs/react/files/$README.md.js +1 -1
  58. package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
  59. package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +1 -1
  60. package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +1 -1
  61. package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +1 -1
  62. package/dist/boilerplates/@batijs/sentry/files/$.env.js +1 -1
  63. package/dist/boilerplates/@batijs/sentry/files/$README.md.js +1 -1
  64. package/dist/boilerplates/@batijs/sentry/files/$TODO.md.js +1 -1
  65. package/dist/boilerplates/@batijs/sentry/files/$package.json.js +1 -1
  66. package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +1 -1
  67. package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +1 -1
  68. package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +1 -1
  69. package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +1 -1
  70. package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +1 -1
  71. package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +1 -1
  72. package/dist/boilerplates/@batijs/shared/files/$README.md.js +1 -1
  73. package/dist/boilerplates/@batijs/shared/files/$TODO.md.js +1 -1
  74. package/dist/boilerplates/@batijs/shared-db/files/server/db-middleware.ts +10 -3
  75. package/dist/boilerplates/@batijs/shared-db/types/server/db-middleware.d.ts +3 -0
  76. package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +1 -1
  77. package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +6 -0
  78. package/dist/boilerplates/@batijs/shared-server/types/server/create-todo-handler.d.ts +7 -0
  79. package/dist/boilerplates/@batijs/shared-todo/files/global.d.ts +3 -0
  80. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +5 -0
  81. package/dist/boilerplates/@batijs/solid/files/$README.md.js +1 -1
  82. package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -1
  83. package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +1 -1
  84. package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +1 -1
  85. package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +1 -1
  86. package/dist/boilerplates/@batijs/sqlite/files/$.env.js +1 -1
  87. package/dist/boilerplates/@batijs/sqlite/files/$TODO.md.js +1 -1
  88. package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +1 -1
  89. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +1 -1
  90. package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
  91. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +1 -1
  92. package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +1 -1
  93. package/dist/boilerplates/@batijs/telefunc/files/global.d.ts +3 -0
  94. package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +4 -0
  95. package/dist/boilerplates/@batijs/telefunc/files/server/telefunc-handler.ts +3 -0
  96. package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
  97. package/dist/boilerplates/@batijs/trpc/files/trpc/server.ts +6 -0
  98. package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +4 -0
  99. package/dist/boilerplates/@batijs/trpc/types/trpc/server.d.ts +13 -0
  100. package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +1 -1
  101. package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +6 -0
  102. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
  103. package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +1 -1
  104. package/dist/boilerplates/@batijs/vue/files/$README.md.js +1 -1
  105. package/dist/boilerplates/@batijs/vue/files/$package.json.js +1 -1
  106. package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +1 -1
  107. package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +1 -1
  108. package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +1 -1
  109. package/dist/boilerplates/boilerplates.json +12 -0
  110. package/dist/{chunk-QROV3BVS.js → chunk-QHC4GN53.js} +2 -2
  111. package/dist/index.js +40 -20
  112. package/package.json +5 -5
@@ -0,0 +1,45 @@
1
+ /*{ @if (!it.BATI.hasD1) }*/
2
+
3
+ import * as fs from "node:fs/promises";
4
+ import * as path from "node:path";
5
+ import { dirname } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+ import { FileMigrationProvider, Migrator } from "kysely";
8
+ import { dbKysely } from "./db";
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+
13
+ async function migrateToLatest() {
14
+ const db = dbKysely();
15
+ const migrator = new Migrator({
16
+ db,
17
+ provider: new FileMigrationProvider({
18
+ fs,
19
+ path,
20
+ // This needs to be an absolute path.
21
+ migrationFolder: path.join(__dirname, "migrations"),
22
+ }),
23
+ });
24
+
25
+ const { error, results } = await migrator.migrateToLatest();
26
+
27
+ results?.forEach((it) => {
28
+ if (it.status === "Success") {
29
+ console.log(`migration "${it.migrationName}" was executed successfully`);
30
+ } else if (it.status === "Error") {
31
+ console.error(`failed to execute migration "${it.migrationName}"`);
32
+ }
33
+ });
34
+
35
+ if (error) {
36
+ console.error("failed to migrate");
37
+ console.error(error);
38
+ process.exit(1);
39
+ }
40
+
41
+ await db.destroy();
42
+ }
43
+
44
+ await migrateToLatest();
45
+ /*{ /if }*/
@@ -0,0 +1,16 @@
1
+ /*{ @if (!it.BATI.hasD1) }*/
2
+ import type { Kysely } from "kysely";
3
+ import type { Database } from "../types";
4
+
5
+ export async function up(db: Kysely<Database>): Promise<void> {
6
+ await db.schema
7
+ .createTable("todos")
8
+ .addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
9
+ .addColumn("text", "text", (col) => col.notNull())
10
+ .execute();
11
+ }
12
+
13
+ export async function down(db: Kysely<Database>): Promise<void> {
14
+ await db.schema.dropTable("todos").execute();
15
+ }
16
+ /*{ /if }*/
@@ -0,0 +1,20 @@
1
+ import type { dbKysely, dbKyselyD1 } from "../db";
2
+
3
+ export async function insertTodo(
4
+ db: BATI.If<{
5
+ "!BATI.hasD1": ReturnType<typeof dbKysely>;
6
+ "BATI.hasD1": ReturnType<typeof dbKyselyD1>;
7
+ }>,
8
+ text: string,
9
+ ) {
10
+ return await db.insertInto("todos").values({ text }).returningAll().executeTakeFirstOrThrow();
11
+ }
12
+
13
+ export async function getAllTodos(
14
+ db: BATI.If<{
15
+ "!BATI.hasD1": ReturnType<typeof dbKysely>;
16
+ "BATI.hasD1": ReturnType<typeof dbKyselyD1>;
17
+ }>,
18
+ ) {
19
+ return await db.selectFrom("todos").selectAll().execute();
20
+ }
@@ -0,0 +1,13 @@
1
+ import type { Generated, Insertable, Selectable } from "kysely";
2
+
3
+ export interface Database {
4
+ todos: TodoTable;
5
+ }
6
+
7
+ export interface TodoTable {
8
+ id: Generated<number>;
9
+ text: string;
10
+ }
11
+
12
+ export type Todo = Selectable<TodoTable>;
13
+ export type NewTodo = Insertable<TodoTable>;
@@ -0,0 +1,5 @@
1
+ import "dotenv/config";
2
+ import type { Database } from "./types";
3
+ import { Kysely } from "kysely";
4
+ export declare function dbKysely(): Kysely<Database>;
5
+ export declare function dbKyselyD1(d1: D1Database): Kysely<Database>;
@@ -0,0 +1,4 @@
1
+ import type { Kysely } from "kysely";
2
+ import type { Database } from "../types";
3
+ export declare function up(db: Kysely<Database>): Promise<void>;
4
+ export declare function down(db: Kysely<Database>): Promise<void>;
@@ -0,0 +1,15 @@
1
+ import type { dbKysely, dbKyselyD1 } from "../db";
2
+ export declare function insertTodo(db: BATI.If<{
3
+ "!BATI.hasD1": ReturnType<typeof dbKysely>;
4
+ "BATI.hasD1": ReturnType<typeof dbKyselyD1>;
5
+ }>, text: string): Promise<{
6
+ id: number;
7
+ text: string;
8
+ }>;
9
+ export declare function getAllTodos(db: BATI.If<{
10
+ "!BATI.hasD1": ReturnType<typeof dbKysely>;
11
+ "BATI.hasD1": ReturnType<typeof dbKyselyD1>;
12
+ }>): Promise<{
13
+ id: number;
14
+ text: string;
15
+ }[]>;
@@ -0,0 +1,10 @@
1
+ import type { Generated, Insertable, Selectable } from "kysely";
2
+ export interface Database {
3
+ todos: TodoTable;
4
+ }
5
+ export interface TodoTable {
6
+ id: Generated<number>;
7
+ text: string;
8
+ }
9
+ export type Todo = Selectable<TodoTable>;
10
+ export type NewTodo = Insertable<TodoTable>;
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  gSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  gSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  gSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  SSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  r9s
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  Nus,
7
7
  gSs
8
- } from "../../../../chunk-QROV3BVS.js";
8
+ } from "../../../../chunk-QHC4GN53.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-IHX3I5SM.js";
11
11
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  gSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  ySs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  TSs,
7
7
  pri
8
- } from "../../../../chunk-QROV3BVS.js";
8
+ } from "../../../../chunk-QHC4GN53.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-IHX3I5SM.js";
11
11
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  r9s
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  Nus,
7
7
  gSs
8
- } from "../../../../chunk-QROV3BVS.js";
8
+ } from "../../../../chunk-QHC4GN53.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-IHX3I5SM.js";
11
11
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  gSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -6,7 +6,7 @@ import {
6
6
  TSs,
7
7
  Unr,
8
8
  pri
9
- } from "../../../../chunk-QROV3BVS.js";
9
+ } from "../../../../chunk-QHC4GN53.js";
10
10
  import "../../../../chunk-IAWYWZSL.js";
11
11
  import "../../../../chunk-IHX3I5SM.js";
12
12
 
@@ -7,7 +7,7 @@ import {
7
7
  Z5,
8
8
  jme,
9
9
  yK
10
- } from "../../../../../chunk-QROV3BVS.js";
10
+ } from "../../../../../chunk-QHC4GN53.js";
11
11
  import "../../../../../chunk-IAWYWZSL.js";
12
12
  import "../../../../../chunk-IHX3I5SM.js";
13
13
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  Nus,
7
7
  gSs
8
- } from "../../../../chunk-QROV3BVS.js";
8
+ } from "../../../../chunk-QHC4GN53.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-IHX3I5SM.js";
11
11
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  ySs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  Mnr,
7
7
  TSs
8
- } from "../../../../chunk-QROV3BVS.js";
8
+ } from "../../../../chunk-QHC4GN53.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-IHX3I5SM.js";
11
11
 
@@ -6,7 +6,7 @@ import {
6
6
  Z7s,
7
7
  e9s,
8
8
  gSs
9
- } from "../../../../chunk-QROV3BVS.js";
9
+ } from "../../../../chunk-QHC4GN53.js";
10
10
  import "../../../../chunk-IAWYWZSL.js";
11
11
  import "../../../../chunk-IHX3I5SM.js";
12
12
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  gSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { getDbFromRuntime } from "@batijs/d1/database/d1/helpers";
4
4
  import { dbD1, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
5
+ import { dbKysely, dbKyselyD1 } from "@batijs/kysely/database/kysely/db";
5
6
  import { db as sqliteDb } from "@batijs/sqlite/database/sqlite/db";
6
7
  import { enhance, type UniversalMiddleware } from "@universal-middleware/core";
7
8
 
@@ -13,6 +14,8 @@ declare global {
13
14
  'BATI.has("sqlite") && !BATI.hasD1': ReturnType<typeof sqliteDb>;
14
15
  'BATI.has("drizzle") && !BATI.hasD1': ReturnType<typeof dbSqlite>;
15
16
  'BATI.has("drizzle")': ReturnType<typeof dbD1>;
17
+ 'BATI.has("kysely") && !BATI.hasD1': ReturnType<typeof dbKysely>;
18
+ 'BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
16
19
  "BATI.hasD1": D1Database;
17
20
  }>;
18
21
  }
@@ -27,9 +30,13 @@ export const dbMiddleware: UniversalMiddleware = enhance(
27
30
  ? sqliteDb()
28
31
  : BATI.has("drizzle") && !BATI.hasD1
29
32
  ? dbSqlite()
30
- : BATI.has("drizzle")
31
- ? dbD1(await getDbFromRuntime(_runtime))
32
- : await getDbFromRuntime(_runtime);
33
+ : BATI.has("kysely") && !BATI.hasD1
34
+ ? dbKysely()
35
+ : BATI.has("kysely")
36
+ ? dbKyselyD1(await getDbFromRuntime(_runtime))
37
+ : BATI.has("drizzle")
38
+ ? dbD1(await getDbFromRuntime(_runtime))
39
+ : await getDbFromRuntime(_runtime);
33
40
 
34
41
  return {
35
42
  ...context,
@@ -1,4 +1,5 @@
1
1
  import { dbD1, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
2
+ import { dbKysely, dbKyselyD1 } from "@batijs/kysely/database/kysely/db";
2
3
  import { db as sqliteDb } from "@batijs/sqlite/database/sqlite/db";
3
4
  import { type UniversalMiddleware } from "@universal-middleware/core";
4
5
  declare global {
@@ -8,6 +9,8 @@ declare global {
8
9
  'BATI.has("sqlite") && !BATI.hasD1': ReturnType<typeof sqliteDb>;
9
10
  'BATI.has("drizzle") && !BATI.hasD1': ReturnType<typeof dbSqlite>;
10
11
  'BATI.has("drizzle")': ReturnType<typeof dbD1>;
12
+ 'BATI.has("kysely") && !BATI.hasD1': ReturnType<typeof dbKysely>;
13
+ 'BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
11
14
  "BATI.hasD1": D1Database;
12
15
  }>;
13
16
  }
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -3,6 +3,8 @@
3
3
  import * as d1Queries from "@batijs/d1-sqlite/database/d1/queries/todos";
4
4
  import type { dbD1, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
5
5
  import * as drizzleQueries from "@batijs/drizzle/database/drizzle/queries/todos";
6
+ import type { dbKysely, dbKyselyD1 } from "@batijs/kysely/database/kysely/db";
7
+ import * as kyselyQueries from "@batijs/kysely/database/kysely/queries/todos";
6
8
  import type { db as sqliteDb } from "@batijs/sqlite/database/sqlite/db";
7
9
  import * as sqliteQueries from "@batijs/sqlite/database/sqlite/queries/todos";
8
10
  import { enhance, type UniversalHandler } from "@universal-middleware/core";
@@ -13,6 +15,8 @@ export const createTodoHandler: UniversalHandler<
13
15
  'BATI.has("sqlite") && !BATI.hasD1': { db: ReturnType<typeof sqliteDb> };
14
16
  'BATI.has("drizzle") && !BATI.hasD1': { db: ReturnType<typeof dbSqlite> };
15
17
  'BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
18
+ 'BATI.has("kysely") && !BATI.hasD1': { db: ReturnType<typeof dbKysely> };
19
+ 'BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
16
20
  "BATI.hasD1": { db: D1Database };
17
21
  _: object;
18
22
  }>
@@ -25,6 +29,8 @@ export const createTodoHandler: UniversalHandler<
25
29
  await drizzleQueries.insertTodo(_context.db, newTodo.text);
26
30
  } else if (BATI.has("sqlite") && !BATI.hasD1) {
27
31
  sqliteQueries.insertTodo(_context.db, newTodo.text);
32
+ } else if (BATI.has("kysely")) {
33
+ await kyselyQueries.insertTodo(_context.db, newTodo.text);
28
34
  } else if (BATI.hasD1) {
29
35
  await d1Queries.insertTodo(_context.db, newTodo.text);
30
36
  } else {
@@ -1,4 +1,5 @@
1
1
  import type { dbD1, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
2
+ import type { dbKysely, dbKyselyD1 } from "@batijs/kysely/database/kysely/db";
2
3
  import type { db as sqliteDb } from "@batijs/sqlite/database/sqlite/db";
3
4
  import { type UniversalHandler } from "@universal-middleware/core";
4
5
  export declare const createTodoHandler: UniversalHandler<Universal.Context & BATI.If<{
@@ -11,6 +12,12 @@ export declare const createTodoHandler: UniversalHandler<Universal.Context & BAT
11
12
  'BATI.has("drizzle")': {
12
13
  db: ReturnType<typeof dbD1>;
13
14
  };
15
+ 'BATI.has("kysely") && !BATI.hasD1': {
16
+ db: ReturnType<typeof dbKysely>;
17
+ };
18
+ 'BATI.has("kysely")': {
19
+ db: ReturnType<typeof dbKyselyD1>;
20
+ };
14
21
  "BATI.hasD1": {
15
22
  db: D1Database;
16
23
  };
@@ -1,4 +1,5 @@
1
1
  import type { dbD1, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
2
+ import type { dbKysely, dbKyselyD1 } from "@batijs/kysely/database/kysely/db";
2
3
  import type { db as sqliteDb } from "@batijs/sqlite/database/sqlite/db";
3
4
 
4
5
  //# BATI.hasDatabase
@@ -9,6 +10,8 @@ declare global {
9
10
  'BATI.has("sqlite") && !BATI.hasD1': ReturnType<typeof sqliteDb>;
10
11
  'BATI.has("drizzle") && !BATI.hasD1': ReturnType<typeof dbSqlite>;
11
12
  'BATI.has("drizzle")': ReturnType<typeof dbD1>;
13
+ 'BATI.has("kysely") && !BATI.hasD1': ReturnType<typeof dbKysely>;
14
+ 'BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
12
15
  "BATI.hasD1": D1Database;
13
16
  }>;
14
17
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  import * as d1Queries from "@batijs/d1-sqlite/database/d1/queries/todos";
4
4
  import * as drizzleQueries from "@batijs/drizzle/database/drizzle/queries/todos";
5
+ import * as kyselyQueries from "@batijs/kysely/database/kysely/queries/todos";
5
6
  import * as sqliteQueries from "@batijs/sqlite/database/sqlite/queries/todos";
6
7
  import type { PageContextServer } from "vike/types";
7
8
 
@@ -15,6 +16,10 @@ export async function data(_pageContext: PageContextServer) {
15
16
  } else if (BATI.has("sqlite") && !BATI.hasD1) {
16
17
  const todoItemsInitial = sqliteQueries.getAllTodos(_pageContext.db);
17
18
 
19
+ return { todoItemsInitial };
20
+ } else if (BATI.has("kysely")) {
21
+ const todoItemsInitial = await kyselyQueries.getAllTodos(_pageContext.db);
22
+
18
23
  return { todoItemsInitial };
19
24
  } else if (BATI.hasD1) {
20
25
  const todoItemsInitial = await d1Queries.getAllTodos(_pageContext.db);
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  gSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  ySs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -5,7 +5,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
5
5
  import {
6
6
  TSs,
7
7
  pri
8
- } from "../../../../chunk-QROV3BVS.js";
8
+ } from "../../../../chunk-QHC4GN53.js";
9
9
  import "../../../../chunk-IAWYWZSL.js";
10
10
  import "../../../../chunk-IHX3I5SM.js";
11
11
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  bSs
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10
 
@@ -4,7 +4,7 @@ const require = createRequire_BATI_CLI(import.meta.url);
4
4
 
5
5
  import {
6
6
  r9s
7
- } from "../../../../chunk-QROV3BVS.js";
7
+ } from "../../../../chunk-QHC4GN53.js";
8
8
  import "../../../../chunk-IAWYWZSL.js";
9
9
  import "../../../../chunk-IHX3I5SM.js";
10
10