@batijs/cli 0.0.542 → 0.0.544
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.
- package/dist/boilerplates/@batijs/auth0/files/$.env.js +5 -5
- package/dist/boilerplates/@batijs/auth0/files/$TODO.md.js +3 -3
- package/dist/boilerplates/@batijs/auth0/files/$wrangler.jsonc.js +3 -3
- package/dist/boilerplates/@batijs/authjs/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/aws/files/$README.md.js +5 -5
- package/dist/boilerplates/@batijs/aws/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/aws/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/aws/files/cdk/bin/infrastructure.ts +1 -1
- package/dist/boilerplates/@batijs/biome/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/cloudflare/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/cloudflare/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/d1/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/d1/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/d1/files/$wrangler.jsonc.js +3 -3
- package/dist/boilerplates/@batijs/d1-kysely/bati.config.js +17 -0
- package/dist/boilerplates/@batijs/d1-kysely/files/$package.json.js +77 -0
- package/dist/boilerplates/@batijs/d1-kysely/files/database/migrations/todos.sql +4 -0
- package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/drizzle/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/drizzle/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/express/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/kysely/bati.config.js +35 -0
- package/dist/boilerplates/@batijs/kysely/files/$.env.js +19 -0
- package/dist/boilerplates/@batijs/kysely/files/$TODO.md.js +30 -0
- package/dist/boilerplates/@batijs/kysely/files/$package.json.js +120 -0
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/db.ts +25 -0
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrate.ts +45 -0
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrations/001_create_todos_table.ts +16 -0
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/queries/todos.ts +20 -0
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/types.ts +13 -0
- package/dist/boilerplates/@batijs/kysely/types/database/kysely/db.d.ts +5 -0
- package/dist/boilerplates/@batijs/kysely/types/database/kysely/migrate.d.ts +1 -0
- package/dist/boilerplates/@batijs/kysely/types/database/kysely/migrations/001_create_todos_table.d.ts +4 -0
- package/dist/boilerplates/@batijs/kysely/types/database/kysely/queries/todos.d.ts +15 -0
- package/dist/boilerplates/@batijs/kysely/types/database/kysely/types.d.ts +10 -0
- package/dist/boilerplates/@batijs/mantine/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/mantine/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/oxlint/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/photon/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/photon/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/plausible.io/files/$TODO.md.js +3 -3
- package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +3 -3
- package/dist/boilerplates/@batijs/prettier/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/prisma/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/prisma/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/react/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/react/files/$package.json.js +8 -8
- package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/sentry/files/$.env.js +4 -4
- package/dist/boilerplates/@batijs/sentry/files/$README.md.js +5 -5
- package/dist/boilerplates/@batijs/sentry/files/$TODO.md.js +3 -3
- package/dist/boilerplates/@batijs/sentry/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +7 -7
- package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +9 -9
- package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +5 -5
- package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/shared/files/$README.md.js +7 -7
- package/dist/boilerplates/@batijs/shared/files/$TODO.md.js +3 -3
- package/dist/boilerplates/@batijs/shared/files/package.json +1 -1
- package/dist/boilerplates/@batijs/shared-db/files/server/db-middleware.ts +10 -3
- package/dist/boilerplates/@batijs/shared-db/types/server/db-middleware.d.ts +3 -0
- package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +6 -0
- package/dist/boilerplates/@batijs/shared-server/types/server/create-todo-handler.d.ts +7 -0
- package/dist/boilerplates/@batijs/shared-todo/files/global.d.ts +3 -0
- package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +5 -0
- package/dist/boilerplates/@batijs/solid/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/sqlite/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/sqlite/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/telefunc/files/global.d.ts +3 -0
- package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +4 -0
- package/dist/boilerplates/@batijs/telefunc/files/server/telefunc-handler.ts +3 -0
- package/dist/boilerplates/@batijs/trpc/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/trpc/files/trpc/server.ts +6 -0
- package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +7 -3
- package/dist/boilerplates/@batijs/trpc/types/trpc/server.d.ts +13 -0
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +6 -0
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +5 -5
- package/dist/boilerplates/boilerplates.json +12 -0
- package/dist/{chunk-X4G6MHMH.js → chunk-CIBJZ5MN.js} +75803 -75758
- package/dist/index.js +87 -67
- package/dist/{jiti-ZW3ADF2F-2SLKRUEN.js → jiti-PKZMRTZN-BIHN3GUM.js} +2 -3
- package/dist/{prompt-YBELZKBA.js → prompt-424IOCOV.js} +2 -2
- package/package.json +8 -8
|
@@ -3,8 +3,8 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../../../chunk-
|
|
6
|
+
NEs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-IHX3I5SM.js";
|
|
10
10
|
|
|
@@ -52,15 +52,15 @@ var require_package = __commonJS({
|
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@auth/core": "^0.41.1",
|
|
54
54
|
"@batijs/compile": "workspace:*",
|
|
55
|
-
"@photonjs/express": "^0.1.
|
|
55
|
+
"@photonjs/express": "^0.1.11",
|
|
56
56
|
"@trpc/server": "^11.7.2",
|
|
57
|
-
"@types/express": "^5.0.
|
|
57
|
+
"@types/express": "^5.0.6",
|
|
58
58
|
"@types/node": "^20.19.25",
|
|
59
59
|
dotenv: "^17.2.3",
|
|
60
|
-
express: "^5.1
|
|
60
|
+
express: "^5.2.1",
|
|
61
61
|
telefunc: "^0.2.17",
|
|
62
62
|
vike: "^0.4.247",
|
|
63
|
-
vite: "^7.2.
|
|
63
|
+
vite: "^7.2.7"
|
|
64
64
|
},
|
|
65
65
|
dependencies: {
|
|
66
66
|
"@batijs/core": "workspace:*"
|
|
@@ -84,7 +84,7 @@ var require_package = __commonJS({
|
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
async function getPackageJson(props) {
|
|
87
|
-
const packageJson = await
|
|
87
|
+
const packageJson = await NEs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
88
88
|
return packageJson.addDevDependencies(["@types/express"]).addDependencies(["@photonjs/express", "express", "vite", "vike"]).addDependencies(["dotenv"], props.meta.BATI.has("auth0") || props.meta.BATI.hasDatabase);
|
|
89
89
|
}
|
|
90
90
|
export {
|
|
@@ -3,8 +3,8 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../../../chunk-
|
|
6
|
+
NEs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-IHX3I5SM.js";
|
|
10
10
|
|
|
@@ -52,16 +52,16 @@ var require_package = __commonJS({
|
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@auth/core": "^0.41.1",
|
|
54
54
|
"@batijs/compile": "workspace:*",
|
|
55
|
-
"@photonjs/fastify": "^0.1.
|
|
55
|
+
"@photonjs/fastify": "^0.1.10",
|
|
56
56
|
"@trpc/server": "^11.7.2",
|
|
57
|
-
"@types/express": "^5.0.
|
|
57
|
+
"@types/express": "^5.0.6",
|
|
58
58
|
"@types/node": "^20.19.25",
|
|
59
59
|
dotenv: "^17.2.3",
|
|
60
60
|
fastify: "^5.6.2",
|
|
61
61
|
"fastify-raw-body": "^5.0.0",
|
|
62
62
|
telefunc: "^0.2.17",
|
|
63
63
|
vike: "^0.4.247",
|
|
64
|
-
vite: "^7.2.
|
|
64
|
+
vite: "^7.2.7"
|
|
65
65
|
},
|
|
66
66
|
dependencies: {
|
|
67
67
|
"@batijs/core": "workspace:*"
|
|
@@ -85,7 +85,7 @@ var require_package = __commonJS({
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
async function getPackageJson(props) {
|
|
88
|
-
const packageJson = await
|
|
88
|
+
const packageJson = await NEs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
89
89
|
return packageJson.addDevDependencies(["@types/node"]).addDependencies(["@photonjs/fastify", "fastify", "fastify-raw-body", "vike", "vite"]).addDependencies(["dotenv"], props.meta.BATI.has("auth0") || props.meta.BATI.hasDatabase);
|
|
90
90
|
}
|
|
91
91
|
export {
|
|
@@ -3,15 +3,15 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../../../chunk-
|
|
6
|
+
mjs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-IHX3I5SM.js";
|
|
10
10
|
|
|
11
11
|
// ../../boilerplates/google-analytics/dist/files/$.env.js
|
|
12
12
|
async function getEnv(props) {
|
|
13
13
|
const envContent = await props.readfile?.();
|
|
14
|
-
return
|
|
14
|
+
return mjs(
|
|
15
15
|
envContent,
|
|
16
16
|
"PUBLIC_ENV__GOOGLE_ANALYTICS",
|
|
17
17
|
"G-XXXXXXXXXX",
|
|
@@ -3,8 +3,8 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../../../chunk-
|
|
6
|
+
NEs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-IHX3I5SM.js";
|
|
10
10
|
|
|
@@ -52,17 +52,17 @@ var require_package = __commonJS({
|
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@auth/core": "^0.41.1",
|
|
54
54
|
"@batijs/compile": "workspace:*",
|
|
55
|
-
"@photonjs/h3": "^0.1.
|
|
55
|
+
"@photonjs/h3": "^0.1.10",
|
|
56
56
|
"@trpc/server": "^11.7.2",
|
|
57
|
-
"@types/express": "^5.0.
|
|
57
|
+
"@types/express": "^5.0.6",
|
|
58
58
|
"@types/node": "^20.19.25",
|
|
59
59
|
"@universal-middleware/core": "^0.4.13",
|
|
60
60
|
dotenv: "^17.2.3",
|
|
61
61
|
h3: "~1.15.4",
|
|
62
62
|
telefunc: "^0.2.17",
|
|
63
63
|
vike: "^0.4.247",
|
|
64
|
-
"vike-photon": "^0.1.
|
|
65
|
-
vite: "^7.2.
|
|
64
|
+
"vike-photon": "^0.1.22",
|
|
65
|
+
vite: "^7.2.7"
|
|
66
66
|
},
|
|
67
67
|
dependencies: {
|
|
68
68
|
"@batijs/core": "workspace:*"
|
|
@@ -86,7 +86,7 @@ var require_package = __commonJS({
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
async function getPackageJson(props) {
|
|
89
|
-
const packageJson = await
|
|
89
|
+
const packageJson = await NEs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
90
90
|
return packageJson.addDependencies(["h3", "vike", "vite", "@photonjs/h3", "@universal-middleware/core"]).addDependencies(["@auth/core"], props.meta.BATI.has("authjs") || props.meta.BATI.has("auth0")).addDependencies(
|
|
91
91
|
["dotenv"],
|
|
92
92
|
(props.meta.BATI.has("auth0") || props.meta.BATI.hasDatabase) && !props.meta.BATI.has("cloudflare")
|
|
@@ -3,8 +3,8 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../../../chunk-
|
|
6
|
+
NEs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-IHX3I5SM.js";
|
|
10
10
|
|
|
@@ -52,7 +52,7 @@ var require_package = __commonJS({
|
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@auth/core": "^0.41.1",
|
|
54
54
|
"@batijs/compile": "workspace:*",
|
|
55
|
-
"@photonjs/hono": "^0.1.
|
|
55
|
+
"@photonjs/hono": "^0.1.10",
|
|
56
56
|
"@trpc/server": "^11.7.2",
|
|
57
57
|
"@types/aws-lambda": "^8.10.159",
|
|
58
58
|
"@types/node": "^20.19.25",
|
|
@@ -60,8 +60,8 @@ var require_package = __commonJS({
|
|
|
60
60
|
hono: "^4.10.7",
|
|
61
61
|
telefunc: "^0.2.17",
|
|
62
62
|
vike: "^0.4.247",
|
|
63
|
-
"vike-photon": "^0.1.
|
|
64
|
-
vite: "^7.2.
|
|
63
|
+
"vike-photon": "^0.1.22",
|
|
64
|
+
vite: "^7.2.7"
|
|
65
65
|
},
|
|
66
66
|
dependencies: {
|
|
67
67
|
"@batijs/core": "workspace:*"
|
|
@@ -91,7 +91,7 @@ var require_package = __commonJS({
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
async function getPackageJson(props) {
|
|
94
|
-
const packageJson = await
|
|
94
|
+
const packageJson = await NEs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
95
95
|
return packageJson.addDevDependencies(["@types/node"]).addDevDependencies(["@types/aws-lambda", "vike-photon"], props.meta.BATI.has("aws")).addDependencies(["@photonjs/hono", "hono", "vite", "vike"]).addDependencies(
|
|
96
96
|
["dotenv"],
|
|
97
97
|
(props.meta.BATI.has("auth0") || props.meta.BATI.hasDatabase) && !props.meta.BATI.has("cloudflare")
|
|
@@ -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
|
+
mjs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.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 mjs(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
|
+
PEs,
|
|
7
|
+
Yps
|
|
8
|
+
} from "../../../../chunk-CIBJZ5MN.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 PEs(props);
|
|
16
|
+
const pmCmd = Yps().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
|
+
NEs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.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.20251205.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.8",
|
|
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 NEs(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
|
+
}
|
|
@@ -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 }*/
|
package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrations/001_create_todos_table.ts
ADDED
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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>;
|
|
@@ -3,14 +3,14 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../../../chunk-
|
|
6
|
+
PEs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-IHX3I5SM.js";
|
|
10
10
|
|
|
11
11
|
// ../../boilerplates/mantine/dist/files/$README.md.js
|
|
12
12
|
async function getReadme(props) {
|
|
13
|
-
const content = await
|
|
13
|
+
const content = await PEs(props);
|
|
14
14
|
const about = `
|
|
15
15
|
## Mantine
|
|
16
16
|
|
|
@@ -3,8 +3,8 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../../../chunk-
|
|
6
|
+
NEs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-IHX3I5SM.js";
|
|
10
10
|
|
|
@@ -59,10 +59,10 @@ var require_package = __commonJS({
|
|
|
59
59
|
postcss: "^8.5.6",
|
|
60
60
|
"postcss-preset-mantine": "^1.18.0",
|
|
61
61
|
"postcss-simple-vars": "^7.0.1",
|
|
62
|
-
react: "^19.2.
|
|
63
|
-
"react-dom": "^19.2.
|
|
62
|
+
react: "^19.2.1",
|
|
63
|
+
"react-dom": "^19.2.1",
|
|
64
64
|
"vike-react": "^0.6.13",
|
|
65
|
-
vite: "^7.2.
|
|
65
|
+
vite: "^7.2.7",
|
|
66
66
|
"vite-plugin-compiled-react": "^1.3.1"
|
|
67
67
|
},
|
|
68
68
|
dependencies: {
|
|
@@ -93,7 +93,7 @@ var require_package = __commonJS({
|
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
async function getPackageJson(props) {
|
|
96
|
-
const packageJson = await
|
|
96
|
+
const packageJson = await NEs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
97
97
|
return packageJson.addDevDependencies(["postcss", "postcss-preset-mantine", "postcss-simple-vars"]).addDependencies(["@mantine/core", "@mantine/hooks"]);
|
|
98
98
|
}
|
|
99
99
|
export {
|
|
@@ -3,8 +3,8 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../../../chunk-
|
|
6
|
+
NEs
|
|
7
|
+
} from "../../../../chunk-CIBJZ5MN.js";
|
|
8
8
|
import "../../../../chunk-IAWYWZSL.js";
|
|
9
9
|
import "../../../../chunk-IHX3I5SM.js";
|
|
10
10
|
|
|
@@ -51,8 +51,8 @@ var require_package = __commonJS({
|
|
|
51
51
|
license: "MIT",
|
|
52
52
|
devDependencies: {
|
|
53
53
|
"@batijs/compile": "workspace:*",
|
|
54
|
-
oxlint: "^1.
|
|
55
|
-
"oxlint-tsgolint": "^0.8.
|
|
54
|
+
oxlint: "^1.31.0",
|
|
55
|
+
"oxlint-tsgolint": "^0.8.4",
|
|
56
56
|
"@types/node": "^20.19.25"
|
|
57
57
|
},
|
|
58
58
|
dependencies: {
|
|
@@ -65,7 +65,7 @@ var require_package = __commonJS({
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
async function getPackageJson(props) {
|
|
68
|
-
const packageJson = await
|
|
68
|
+
const packageJson = await NEs(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
69
69
|
const gitIgnore = props.meta.BATI_IS_CI || props.meta.BATI_SKIP_GIT ? "--ignore-path .gitignore " : "";
|
|
70
70
|
const CWD = ".";
|
|
71
71
|
return packageJson.setScript("lint", {
|