@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
@@ -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
 
@@ -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
  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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -80,5 +80,5 @@ function loadCertificate(stack: cdk.Stack, stackConfig: CustomStackProps): certi
80
80
  domainName: siteDomainName,
81
81
  //subjectAlternativeNames: props.domainAliases,
82
82
  validation: certificatemanager.CertificateValidation.fromDns(hostedZone),
83
- });
83
+ }) as certificatemanager.ICertificate;
84
84
  }
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -0,0 +1,17 @@
1
+ // ../../packages/core/dist/config.js
2
+ function t(e, n) {
3
+ if (!e) throw new Error(n);
4
+ }
5
+ function p(e) {
6
+ return "enforce" in e && t(e.enforce === "pre" || e.enforce === "post", `'enforce' must be 'pre' or 'post', was ${e.enforce}`), "if" in e && t(typeof e.if == "function", "'if' must be a function"), "nextSteps" in e && t(typeof e.nextSteps == "function", "'nextSteps' must be a function"), "knip" in e && (t(typeof e.knip == "object" && e.knip !== null, "'knip' must be an object"), "entry" in e.knip && t(Array.isArray(e.knip.entry), "'knip.entry' must be an array"), "ignoreDependencies" in e.knip && t(Array.isArray(e.knip.ignoreDependencies), "'knip.ignoreDependencies' must be an array"), "ignore" in e.knip && t(Array.isArray(e.knip.ignore), "'knip.ignore' must be an array"), "vite" in e.knip && t(typeof e.knip.vite == "boolean", "'knip.vite' must be a boolean")), e;
7
+ }
8
+
9
+ // bati.config.ts
10
+ var bati_config_default = p({
11
+ if(meta) {
12
+ return meta.BATI.hasD1 && meta.BATI.has("kysely");
13
+ }
14
+ });
15
+ export {
16
+ bati_config_default as default
17
+ };
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as createRequire_BATI_CLI } from 'module';
3
+ const require = createRequire_BATI_CLI(import.meta.url);
4
+
5
+ import {
6
+ bSs
7
+ } from "../../../../chunk-QHC4GN53.js";
8
+ import "../../../../chunk-IAWYWZSL.js";
9
+ import "../../../../chunk-IHX3I5SM.js";
10
+
11
+ // ../../boilerplates/d1-kysely/dist/files/$package.json.js
12
+ var __create = Object.create;
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __getProtoOf = Object.getPrototypeOf;
17
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
18
+ var __commonJS = (cb, mod) => function __require() {
19
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
+ // If the importer is in node compatibility mode or this is not an ESM
31
+ // file that has been converted to a CommonJS file using a Babel-
32
+ // compatible transform (i.e. "__esModule" has not been set), then set
33
+ // "default" to the CommonJS "module.exports" for node compatibility.
34
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
+ mod
36
+ ));
37
+ var require_package = __commonJS({
38
+ "package.json"(exports, module) {
39
+ module.exports = {
40
+ name: "@batijs/d1-kysely",
41
+ private: true,
42
+ version: "0.0.1",
43
+ description: "",
44
+ type: "module",
45
+ scripts: {
46
+ "check-types": "tsc --noEmit",
47
+ build: "bati-compile-boilerplate"
48
+ },
49
+ keywords: [],
50
+ author: "",
51
+ license: "MIT",
52
+ devDependencies: {
53
+ "@batijs/compile": "workspace:*",
54
+ "@types/node": "^20.19.25"
55
+ },
56
+ dependencies: {
57
+ "@batijs/core": "workspace:*"
58
+ },
59
+ files: [
60
+ "dist/"
61
+ ]
62
+ };
63
+ }
64
+ });
65
+ async function getPackageJson(props) {
66
+ const packageJson = await bSs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
67
+ return packageJson.setScript("d1:migrate", {
68
+ value: "wrangler d1 migrations apply MY_VIKE_DEMO_DATABASE --local",
69
+ precedence: 0
70
+ }).setScript("d1:deploy", {
71
+ value: "wrangler d1 migrations apply MY_VIKE_DEMO_DATABASE --remote",
72
+ precedence: 0
73
+ });
74
+ }
75
+ export {
76
+ getPackageJson as default
77
+ };
@@ -0,0 +1,4 @@
1
+ CREATE TABLE IF NOT EXISTS todos (
2
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
3
+ text TEXT NOT NULL
4
+ );
@@ -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
  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
  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
 
@@ -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
 
@@ -0,0 +1,35 @@
1
+ // ../../packages/core/dist/config.js
2
+ function t(e, n) {
3
+ if (!e) throw new Error(n);
4
+ }
5
+ function p(e) {
6
+ return "enforce" in e && t(e.enforce === "pre" || e.enforce === "post", `'enforce' must be 'pre' or 'post', was ${e.enforce}`), "if" in e && t(typeof e.if == "function", "'if' must be a function"), "nextSteps" in e && t(typeof e.nextSteps == "function", "'nextSteps' must be a function"), "knip" in e && (t(typeof e.knip == "object" && e.knip !== null, "'knip' must be an object"), "entry" in e.knip && t(Array.isArray(e.knip.entry), "'knip.entry' must be an array"), "ignoreDependencies" in e.knip && t(Array.isArray(e.knip.ignoreDependencies), "'knip.ignoreDependencies' must be an array"), "ignore" in e.knip && t(Array.isArray(e.knip.ignore), "'knip.ignore' must be an array"), "vite" in e.knip && t(typeof e.knip.vite == "boolean", "'knip.vite' must be a boolean")), e;
7
+ }
8
+
9
+ // bati.config.ts
10
+ var bati_config_default = p({
11
+ if(meta) {
12
+ return meta.BATI.has("kysely");
13
+ },
14
+ nextSteps(meta, packageManager, { bold }) {
15
+ if (meta.BATI.hasD1) {
16
+ return [];
17
+ }
18
+ return [
19
+ {
20
+ type: "text",
21
+ step: `Add your ${bold("DATABASE_URL")} to the .env file. Check ${bold("TODO.md")} for details`
22
+ },
23
+ {
24
+ type: "command",
25
+ step: `${packageManager} kysely:migrate`
26
+ }
27
+ ];
28
+ },
29
+ knip: {
30
+ entry: ["database/kysely/migrations/*.ts"]
31
+ }
32
+ });
33
+ export {
34
+ bati_config_default as default
35
+ };
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as createRequire_BATI_CLI } from 'module';
3
+ const require = createRequire_BATI_CLI(import.meta.url);
4
+
5
+ import {
6
+ r9s
7
+ } from "../../../../chunk-QHC4GN53.js";
8
+ import "../../../../chunk-IAWYWZSL.js";
9
+ import "../../../../chunk-IHX3I5SM.js";
10
+
11
+ // ../../boilerplates/kysely/dist/files/$.env.js
12
+ async function getEnv(props) {
13
+ if (props.meta.BATI.hasD1) return;
14
+ const envContent = await props.readfile?.();
15
+ return r9s(envContent, "DATABASE_URL", "sqlite.db", "Path to the sqlite database");
16
+ }
17
+ export {
18
+ getEnv as default
19
+ };
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as createRequire_BATI_CLI } from 'module';
3
+ const require = createRequire_BATI_CLI(import.meta.url);
4
+
5
+ import {
6
+ Nus,
7
+ gSs
8
+ } from "../../../../chunk-QHC4GN53.js";
9
+ import "../../../../chunk-IAWYWZSL.js";
10
+ import "../../../../chunk-IHX3I5SM.js";
11
+
12
+ // ../../boilerplates/kysely/dist/files/$TODO.md.js
13
+ async function getTodo(props) {
14
+ if (props.meta.BATI.hasD1) return;
15
+ const content = await gSs(props);
16
+ const pmCmd = Nus().run;
17
+ const todo = `
18
+ ## Kysely
19
+
20
+ Ensure that \`DATABASE_URL\` is configured as desired in \`.env\` file, then create the database:
21
+ \`\`\`bash
22
+ ${pmCmd} kysely:migrate # creates kysely tables
23
+ \`\`\`
24
+ `;
25
+ content.addMarkdownFeature(todo, "kysely");
26
+ return content;
27
+ }
28
+ export {
29
+ getTodo as default
30
+ };
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as createRequire_BATI_CLI } from 'module';
3
+ const require = createRequire_BATI_CLI(import.meta.url);
4
+
5
+ import {
6
+ bSs
7
+ } from "../../../../chunk-QHC4GN53.js";
8
+ import "../../../../chunk-IAWYWZSL.js";
9
+ import "../../../../chunk-IHX3I5SM.js";
10
+
11
+ // ../../boilerplates/kysely/dist/files/$package.json.js
12
+ var __create = Object.create;
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __getProtoOf = Object.getPrototypeOf;
17
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
18
+ var __commonJS = (cb, mod) => function __require() {
19
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
+ // If the importer is in node compatibility mode or this is not an ESM
31
+ // file that has been converted to a CommonJS file using a Babel-
32
+ // compatible transform (i.e. "__esModule" has not been set), then set
33
+ // "default" to the CommonJS "module.exports" for node compatibility.
34
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
+ mod
36
+ ));
37
+ var require_package = __commonJS({
38
+ "package.json"(exports, module) {
39
+ module.exports = {
40
+ name: "@batijs/kysely",
41
+ private: true,
42
+ version: "0.0.1",
43
+ description: "",
44
+ type: "module",
45
+ scripts: {
46
+ "check-types": "tsc --noEmit",
47
+ build: "bati-compile-boilerplate"
48
+ },
49
+ keywords: [],
50
+ author: "",
51
+ license: "MIT",
52
+ devDependencies: {
53
+ "@batijs/compile": "workspace:*",
54
+ "@cloudflare/workers-types": "^4.20250605.0",
55
+ "@types/better-sqlite3": "^7.6.13",
56
+ "@types/node": "^20.19.25",
57
+ "better-sqlite3": "^12.5.0",
58
+ dotenv: "^17.2.3",
59
+ kysely: "^0.28.2",
60
+ "kysely-d1": "^0.4.0",
61
+ tsx: "^4.21.0"
62
+ },
63
+ dependencies: {
64
+ "@batijs/core": "workspace:*"
65
+ },
66
+ files: [
67
+ "dist/"
68
+ ],
69
+ exports: {
70
+ "./database/kysely/types": {
71
+ types: "./dist/types/database/kysely/types.d.ts"
72
+ },
73
+ "./database/kysely/db": {
74
+ types: "./dist/types/database/kysely/db.d.ts"
75
+ },
76
+ "./database/kysely/migrate": {
77
+ types: "./dist/types/database/kysely/migrate.d.ts"
78
+ },
79
+ "./database/kysely/migrations/001_create_todos_table": {
80
+ types: "./dist/types/database/kysely/migrations/001_create_todos_table.d.ts"
81
+ },
82
+ "./database/kysely/queries/todos": {
83
+ types: "./dist/types/database/kysely/queries/todos.d.ts"
84
+ }
85
+ },
86
+ typesVersions: {
87
+ "*": {
88
+ "database/kysely/types": [
89
+ "./dist/types/database/kysely/types.d.ts"
90
+ ],
91
+ "database/kysely/db": [
92
+ "./dist/types/database/kysely/db.d.ts"
93
+ ],
94
+ "database/kysely/migrate": [
95
+ "./dist/types/database/kysely/migrate.d.ts"
96
+ ],
97
+ "database/kysely/migrations/001_create_todos_table": [
98
+ "./dist/types/database/kysely/migrations/001_create_todos_table.d.ts"
99
+ ],
100
+ "database/kysely/queries/todos": [
101
+ "./dist/types/database/kysely/queries/todos.d.ts"
102
+ ]
103
+ }
104
+ }
105
+ };
106
+ }
107
+ });
108
+ async function getPackageJson(props) {
109
+ const packageJson = await bSs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
110
+ if (props.meta.BATI.hasD1) {
111
+ return packageJson.addDependencies(["kysely", "kysely-d1"]);
112
+ }
113
+ return packageJson.setScript("kysely:migrate", {
114
+ value: "tsx ./database/kysely/migrate.ts",
115
+ precedence: 20
116
+ }).addDevDependencies(["@types/better-sqlite3"]).addDevDependencies(["tsx"], ["kysely:migrate"]).addDependencies(["better-sqlite3", "dotenv", "kysely"]);
117
+ }
118
+ export {
119
+ getPackageJson as default
120
+ };
@@ -0,0 +1,25 @@
1
+ /*# BATI include-if-imported #*/
2
+
3
+ //# !BATI.hasD1
4
+ import "dotenv/config";
5
+ import type { Database } from "./types";
6
+ import SQLite from "better-sqlite3";
7
+ import { D1Dialect } from "kysely-d1";
8
+ import { Kysely, SqliteDialect } from "kysely";
9
+
10
+ //# !BATI.hasD1
11
+ export function dbKysely() {
12
+ const dialect = new SqliteDialect({
13
+ database: new SQLite(process.env.DATABASE_URL),
14
+ });
15
+ return new Kysely<Database>({
16
+ dialect,
17
+ });
18
+ }
19
+
20
+ //# BATI.hasD1
21
+ export function dbKyselyD1(d1: D1Database) {
22
+ return new Kysely<Database>({
23
+ dialect: new D1Dialect({ database: d1 }),
24
+ });
25
+ }