@batijs/cli 0.0.649 → 0.0.651
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/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/authjs/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/authjs/files/server/authjs-handler.ts +1 -1
- package/dist/boilerplates/@batijs/aws/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/aws/files/cdk/bin/infrastructure.ts +1 -1
- package/dist/boilerplates/@batijs/better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/better-auth/files/database/better-auth/migrate.ts +1 -3
- package/dist/boilerplates/@batijs/better-auth/files/database/drizzle/schema/auth.ts +5 -5
- package/dist/boilerplates/@batijs/better-auth/files/server/better-auth-handler.ts +2 -2
- package/dist/boilerplates/@batijs/better-auth/files/server/better-auth.ts +8 -8
- package/dist/boilerplates/@batijs/biome/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/cloudflare/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/cloudflare/files/$vite.config.ts.js +9 -9
- package/dist/boilerplates/@batijs/compiled/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +9 -9
- package/dist/boilerplates/@batijs/d1/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/d1-kysely/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/d1-sqlite/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/docker-compose/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/docker-compose/files/$Dockerfile.js +5 -44
- package/dist/boilerplates/@batijs/docker-compose/files/docker-compose.yml +6 -6
- package/dist/boilerplates/@batijs/dokploy/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/drizzle/bati.config.mjs +6 -1
- package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/db.ts +3 -3
- package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/queries/todos.ts +10 -10
- package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/schema/todos.ts +2 -2
- package/dist/boilerplates/@batijs/drizzle/files/drizzle.config.ts +3 -3
- package/dist/boilerplates/@batijs/drizzle/types/database/drizzle/queries/todos.d.mts +6 -6
- package/dist/boilerplates/@batijs/edgeone/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/edgeone/files/$vite.config.ts.js +7 -7
- package/dist/boilerplates/@batijs/elysia/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/elysia/files/+server.ts +1 -1
- package/dist/boilerplates/@batijs/elysia/files/server/elysia.ts +9 -9
- package/dist/boilerplates/@batijs/eslint/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/eslint/files/eslint.config.ts +14 -14
- package/dist/boilerplates/@batijs/express/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/express/files/+server.ts +10 -10
- package/dist/boilerplates/@batijs/fastify/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/fastify/files/+server.ts +10 -10
- package/dist/boilerplates/@batijs/google-analytics/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/hono/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/hono/files/+server.ts +2 -2
- package/dist/boilerplates/@batijs/hono/files/entry_aws_lambda.ts +1 -3
- package/dist/boilerplates/@batijs/hono/files/server/hono.ts +9 -9
- package/dist/boilerplates/@batijs/kysely/bati.config.mjs +2 -1
- package/dist/boilerplates/@batijs/kysely/files/$vite.config.ts.js +9 -12
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/db.ts +5 -5
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrate.ts +5 -6
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrations/001_create_todos_table.ts +2 -3
- package/dist/boilerplates/@batijs/kysely/files/database/kysely/queries/todos.ts +8 -8
- package/dist/boilerplates/@batijs/kysely/files/vite-plugin-input.ts +1 -2
- package/dist/boilerplates/@batijs/kysely/types/database/kysely/queries/todos.d.mts +8 -8
- package/dist/boilerplates/@batijs/mantine/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/netlify/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/netlify/files/$vite.config.ts.js +8 -8
- package/dist/boilerplates/@batijs/oxlint/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/plausible.io/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/pnpm/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/postgres/bati.config.mjs +2 -1
- package/dist/boilerplates/@batijs/postgres/files/database/postgres/db.ts +1 -1
- package/dist/boilerplates/@batijs/postgres/files/database/postgres/schema/todos.ts +1 -1
- package/dist/boilerplates/@batijs/prettier/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/prisma/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/react/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +7 -7
- package/dist/boilerplates/@batijs/react/files/pages/+Head.tsx +6 -6
- package/dist/boilerplates/@batijs/react/files/pages/+Layout.tsx +14 -14
- package/dist/boilerplates/@batijs/react/files/pages/+config.ts +3 -3
- package/dist/boilerplates/@batijs/react/files/pages/index/+Page.tsx +1 -1
- package/dist/boilerplates/@batijs/react/files/pages/index/Counter.tsx +3 -3
- package/dist/boilerplates/@batijs/react/files/pages/todo/TodoList.tsx +6 -6
- package/dist/boilerplates/@batijs/react-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/react-better-auth/files/pages/account/+Page.tsx +1 -1
- package/dist/boilerplates/@batijs/react-better-auth/files/pages/login/+Page.tsx +4 -4
- package/dist/boilerplates/@batijs/react-better-auth/files/pages/signup/+Page.tsx +4 -4
- package/dist/boilerplates/@batijs/react-sentry/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/sentry/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +10 -10
- package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +12 -18
- package/dist/boilerplates/@batijs/shadcn-ui/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +5 -27
- package/dist/boilerplates/@batijs/shared/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared/files/vite.config.ts +1 -1
- package/dist/boilerplates/@batijs/shared-db/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-db/files/server/db-middleware.ts +21 -21
- package/dist/boilerplates/@batijs/shared-db/types/server/db-middleware.d.mts +10 -10
- package/dist/boilerplates/@batijs/shared-env/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-env/files/server/env.ts +6 -4
- package/dist/boilerplates/@batijs/shared-env/files/server/load.ts +1 -1
- package/dist/boilerplates/@batijs/shared-env/types/server/env.d.mts +2 -2
- package/dist/boilerplates/@batijs/shared-server/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +16 -16
- package/dist/boilerplates/@batijs/shared-server/types/server/create-todo-handler.d.mts +10 -10
- package/dist/boilerplates/@batijs/shared-todo/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-todo/files/global.d.ts +11 -11
- package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+config.ts +1 -4
- package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +5 -5
- package/dist/boilerplates/@batijs/solid/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +7 -7
- package/dist/boilerplates/@batijs/solid/files/pages/+Head.tsx +3 -4
- package/dist/boilerplates/@batijs/solid/files/pages/+Layout.tsx +10 -10
- package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +3 -3
- package/dist/boilerplates/@batijs/solid/files/pages/index/Counter.tsx +2 -2
- package/dist/boilerplates/@batijs/solid/files/pages/todo/TodoList.tsx +6 -6
- package/dist/boilerplates/@batijs/solid-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/solid-better-auth/files/pages/account/+Page.tsx +1 -1
- package/dist/boilerplates/@batijs/solid-better-auth/files/pages/login/+Page.tsx +4 -4
- package/dist/boilerplates/@batijs/solid-better-auth/files/pages/signup/+Page.tsx +4 -4
- package/dist/boilerplates/@batijs/solid-sentry/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/sqlite/bati.config.mjs +2 -1
- package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/db.ts +1 -1
- package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/schema/todos.ts +1 -1
- package/dist/boilerplates/@batijs/storybook/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +7 -7
- package/dist/boilerplates/@batijs/tailwindcss/files/pages/tailwind.css +2 -2
- package/dist/boilerplates/@batijs/telefunc/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +8 -8
- package/dist/boilerplates/@batijs/telefunc/files/global.d.ts +12 -12
- package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +5 -5
- package/dist/boilerplates/@batijs/telefunc/files/server/telefunc-handler.ts +12 -12
- package/dist/boilerplates/@batijs/trpc/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/trpc/files/server/trpc-handler.ts +4 -4
- package/dist/boilerplates/@batijs/trpc/files/trpc/server.ts +15 -15
- package/dist/boilerplates/@batijs/ts-rest/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +15 -15
- package/dist/boilerplates/@batijs/universal-deploy/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/vercel/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +8 -8
- package/dist/boilerplates/@batijs/vue/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +7 -7
- package/dist/boilerplates/@batijs/vue/files/components/Content.vue +2 -2
- package/dist/boilerplates/@batijs/vue/files/components/Counter.vue +3 -3
- package/dist/boilerplates/@batijs/vue/files/components/Logo.vue +2 -2
- package/dist/boilerplates/@batijs/vue/files/components/Sidebar.vue +2 -2
- package/dist/boilerplates/@batijs/vue/files/pages/+Head.vue +2 -3
- package/dist/boilerplates/@batijs/vue/files/pages/+Layout.vue +3 -3
- package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +3 -3
- package/dist/boilerplates/@batijs/vue/files/pages/+onCreateApp.ts +1 -1
- package/dist/boilerplates/@batijs/vue/files/pages/todo/TodoList.vue +8 -8
- package/dist/boilerplates/@batijs/vue-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/vue-better-auth/files/pages/account/+Page.vue +1 -1
- package/dist/boilerplates/@batijs/vue-better-auth/files/pages/login/+Page.vue +3 -3
- package/dist/boilerplates/@batijs/vue-better-auth/files/pages/signup/+Page.vue +2 -2
- package/dist/boilerplates/@batijs/vue-sentry/bati.config.mjs +1 -1
- package/dist/index.js +49 -47
- package/package.json +5 -5
|
@@ -22,12 +22,12 @@ export function TodoList() {
|
|
|
22
22
|
const text = untrack(newTodo);
|
|
23
23
|
setTodoItems((prev) => [...prev, { text }]);
|
|
24
24
|
setNewTodo("");
|
|
25
|
-
if (BATI.hasServer) {
|
|
26
|
-
if (BATI.has("telefunc")) {
|
|
25
|
+
if ($$.BATI.hasServer) {
|
|
26
|
+
if ($$.BATI.has("telefunc")) {
|
|
27
27
|
await onNewTodo({ text });
|
|
28
|
-
} else if (BATI.has("trpc")) {
|
|
28
|
+
} else if ($$.BATI.has("trpc")) {
|
|
29
29
|
await trpc.onNewTodo.mutate(text);
|
|
30
|
-
} else if (BATI.has("ts-rest")) {
|
|
30
|
+
} else if ($$.BATI.has("ts-rest")) {
|
|
31
31
|
await client.createTodo({ body: { text } });
|
|
32
32
|
} else {
|
|
33
33
|
const response = await fetch("/api/todo/create", {
|
|
@@ -46,14 +46,14 @@ export function TodoList() {
|
|
|
46
46
|
type="text"
|
|
47
47
|
onChange={(ev) => setNewTodo(ev.target.value)}
|
|
48
48
|
value={newTodo()}
|
|
49
|
-
|
|
49
|
+
// $$.BATI.has("tailwindcss")
|
|
50
50
|
class={
|
|
51
51
|
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-auto p-2 mr-1 mb-1"
|
|
52
52
|
}
|
|
53
53
|
/>
|
|
54
54
|
<button
|
|
55
55
|
type="submit"
|
|
56
|
-
|
|
56
|
+
// $$.BATI.has("tailwindcss")
|
|
57
57
|
class={
|
|
58
58
|
"text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-hidden focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto p-2"
|
|
59
59
|
}
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -19,7 +19,7 @@ export default function Page() {
|
|
|
19
19
|
await authClient.signOut();
|
|
20
20
|
await navigate("/");
|
|
21
21
|
}}
|
|
22
|
-
|
|
22
|
+
// $$.BATI.has("tailwindcss")
|
|
23
23
|
class={
|
|
24
24
|
"text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-hidden focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto p-2"
|
|
25
25
|
}
|
|
@@ -32,7 +32,7 @@ export default function Page() {
|
|
|
32
32
|
required
|
|
33
33
|
value={email()}
|
|
34
34
|
onInput={(ev) => setEmail(ev.currentTarget.value)}
|
|
35
|
-
|
|
35
|
+
// $$.BATI.has("tailwindcss")
|
|
36
36
|
class={
|
|
37
37
|
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-auto p-2 mr-1 mb-1"
|
|
38
38
|
}
|
|
@@ -46,7 +46,7 @@ export default function Page() {
|
|
|
46
46
|
required
|
|
47
47
|
value={password()}
|
|
48
48
|
onInput={(ev) => setPassword(ev.currentTarget.value)}
|
|
49
|
-
|
|
49
|
+
// $$.BATI.has("tailwindcss")
|
|
50
50
|
class={
|
|
51
51
|
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-auto p-2 mr-1 mb-1"
|
|
52
52
|
}
|
|
@@ -54,7 +54,7 @@ export default function Page() {
|
|
|
54
54
|
</p>
|
|
55
55
|
<button
|
|
56
56
|
type="submit"
|
|
57
|
-
|
|
57
|
+
// $$.BATI.has("tailwindcss")
|
|
58
58
|
class={
|
|
59
59
|
"text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-hidden focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto p-2"
|
|
60
60
|
}
|
|
@@ -68,7 +68,7 @@ export default function Page() {
|
|
|
68
68
|
onClick={async () => {
|
|
69
69
|
await authClient.signIn.social({ provider: "github" });
|
|
70
70
|
}}
|
|
71
|
-
|
|
71
|
+
// $$.BATI.has("tailwindcss")
|
|
72
72
|
class={
|
|
73
73
|
"text-white bg-gray-800 hover:bg-gray-900 focus:ring-2 focus:outline-hidden focus:ring-gray-300 font-medium rounded-lg text-sm w-full sm:w-auto p-2"
|
|
74
74
|
}
|
|
@@ -33,7 +33,7 @@ export default function Page() {
|
|
|
33
33
|
required
|
|
34
34
|
value={name()}
|
|
35
35
|
onInput={(ev) => setName(ev.currentTarget.value)}
|
|
36
|
-
|
|
36
|
+
// $$.BATI.has("tailwindcss")
|
|
37
37
|
class={
|
|
38
38
|
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-auto p-2 mr-1 mb-1"
|
|
39
39
|
}
|
|
@@ -47,7 +47,7 @@ export default function Page() {
|
|
|
47
47
|
required
|
|
48
48
|
value={email()}
|
|
49
49
|
onInput={(ev) => setEmail(ev.currentTarget.value)}
|
|
50
|
-
|
|
50
|
+
// $$.BATI.has("tailwindcss")
|
|
51
51
|
class={
|
|
52
52
|
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-auto p-2 mr-1 mb-1"
|
|
53
53
|
}
|
|
@@ -62,7 +62,7 @@ export default function Page() {
|
|
|
62
62
|
minLength={8}
|
|
63
63
|
value={password()}
|
|
64
64
|
onInput={(ev) => setPassword(ev.currentTarget.value)}
|
|
65
|
-
|
|
65
|
+
// $$.BATI.has("tailwindcss")
|
|
66
66
|
class={
|
|
67
67
|
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-auto p-2 mr-1 mb-1"
|
|
68
68
|
}
|
|
@@ -70,7 +70,7 @@ export default function Page() {
|
|
|
70
70
|
</p>
|
|
71
71
|
<button
|
|
72
72
|
type="submit"
|
|
73
|
-
|
|
73
|
+
// $$.BATI.has("tailwindcss")
|
|
74
74
|
class={
|
|
75
75
|
"text-white bg-blue-700 hover:bg-blue-800 focus:ring-2 focus:outline-hidden focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto p-2"
|
|
76
76
|
}
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -11,6 +11,7 @@ var bati_config_default = t({
|
|
|
11
11
|
if(meta) {
|
|
12
12
|
return meta.BATI.has("sqlite") && !meta.BATI.hasOrm && !meta.BATI.has("cloudflare");
|
|
13
13
|
},
|
|
14
|
+
deploy: ["database/sqlite", "server/load.ts"],
|
|
14
15
|
nextSteps(_meta, packageManager) {
|
|
15
16
|
return [{
|
|
16
17
|
type: "command",
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { addVitePlugin,
|
|
3
|
+
import { addVitePlugin, transformConfig } from "@batijs/core";
|
|
4
4
|
//#region ../../boilerplates/tailwindcss/dist/files/$vite.config.ts.mjs
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
function getViteConfig(props) {
|
|
6
|
+
return transformConfig(props, (root) => {
|
|
7
|
+
addVitePlugin(root, {
|
|
8
|
+
from: "@tailwindcss/vite",
|
|
9
|
+
constructor: "tailwindcss"
|
|
10
|
+
});
|
|
10
11
|
});
|
|
11
|
-
return mod.generate().code;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
14
|
export { getViteConfig as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { addVitePlugin,
|
|
3
|
+
import { addVitePlugin, transformConfig } from "@batijs/core";
|
|
4
4
|
//#region ../../boilerplates/telefunc/dist/files/$vite.config.ts.mjs
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
function getViteConfig(props) {
|
|
6
|
+
return transformConfig(props, (root) => {
|
|
7
|
+
addVitePlugin(root, {
|
|
8
|
+
from: "telefunc/vite",
|
|
9
|
+
constructor: "telefunc",
|
|
10
|
+
named: true
|
|
11
|
+
});
|
|
11
12
|
});
|
|
12
|
-
return mod.generate().code;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
export { getViteConfig as default };
|
|
@@ -3,25 +3,25 @@ import type { dbKysely, dbKyselyD1, dbKyselyPostgres } from "@batijs/kysely/data
|
|
|
3
3
|
import type { db as pgDb } from "@batijs/postgres/database/postgres/db";
|
|
4
4
|
import type { db as sqliteDb } from "@batijs/sqlite/database/sqlite/db";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// $$.BATI.hasDbDemo
|
|
7
7
|
declare module "telefunc" {
|
|
8
8
|
namespace Telefunc {
|
|
9
9
|
interface Context {
|
|
10
|
-
db:
|
|
11
|
-
'BATI.has("drizzle") && BATI.has("postgres")': ReturnType<typeof dbPostgres>;
|
|
12
|
-
'BATI.has("kysely") && BATI.has("postgres")': ReturnType<typeof dbKyselyPostgres>;
|
|
13
|
-
'BATI.has("postgres") &&
|
|
14
|
-
'BATI.has("sqlite") &&
|
|
15
|
-
'BATI.has("drizzle") &&
|
|
16
|
-
'BATI.has("drizzle")': ReturnType<typeof dbD1>;
|
|
17
|
-
'BATI.has("kysely") &&
|
|
18
|
-
'BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
|
|
19
|
-
"BATI.hasD1 &&
|
|
10
|
+
db: $$.If<{
|
|
11
|
+
'$$.BATI.has("drizzle") && $$.BATI.has("postgres")': ReturnType<typeof dbPostgres>;
|
|
12
|
+
'$$.BATI.has("kysely") && $$.BATI.has("postgres")': ReturnType<typeof dbKyselyPostgres>;
|
|
13
|
+
'$$.BATI.has("postgres") && !$$.BATI.hasOrm': ReturnType<typeof pgDb>;
|
|
14
|
+
'$$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm': ReturnType<typeof sqliteDb>;
|
|
15
|
+
'$$.BATI.has("drizzle") && !$$.BATI.hasD1': ReturnType<typeof dbSqlite>;
|
|
16
|
+
'$$.BATI.has("drizzle")': ReturnType<typeof dbD1>;
|
|
17
|
+
'$$.BATI.has("kysely") && !$$.BATI.hasD1': ReturnType<typeof dbKysely>;
|
|
18
|
+
'$$.BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
|
|
19
|
+
"$$.BATI.hasD1 && !$$.BATI.hasOrm": D1Database;
|
|
20
20
|
}>;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
// $$.keepCommentsIf(false)
|
|
26
26
|
// biome-ignore lint/complexity/noUselessEmptyExport: ensure that the file is considered as a module
|
|
27
27
|
export {};
|
|
@@ -8,19 +8,19 @@ import * as sqliteQueries from "@batijs/sqlite/database/sqlite/queries/todos";
|
|
|
8
8
|
import { getContext } from "telefunc";
|
|
9
9
|
|
|
10
10
|
export async function onNewTodo({ text }: { text: string }) {
|
|
11
|
-
if (BATI.has("drizzle")) {
|
|
11
|
+
if ($$.BATI.has("drizzle")) {
|
|
12
12
|
const context = getContext();
|
|
13
13
|
await drizzleQueries.insertTodo(context.db, text);
|
|
14
|
-
} else if (BATI.has("sqlite") &&
|
|
14
|
+
} else if ($$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm) {
|
|
15
15
|
const context = getContext();
|
|
16
16
|
sqliteQueries.insertTodo(context.db, text);
|
|
17
|
-
} else if (BATI.has("kysely")) {
|
|
17
|
+
} else if ($$.BATI.has("kysely")) {
|
|
18
18
|
const context = getContext();
|
|
19
19
|
await kyselyQueries.insertTodo(context.db, text);
|
|
20
|
-
} else if (BATI.hasD1 &&
|
|
20
|
+
} else if ($$.BATI.hasD1 && !$$.BATI.hasOrm) {
|
|
21
21
|
const context = getContext();
|
|
22
22
|
await d1Queries.insertTodo(context.db, text);
|
|
23
|
-
} else if (BATI.has("postgres") &&
|
|
23
|
+
} else if ($$.BATI.has("postgres") && !$$.BATI.hasOrm) {
|
|
24
24
|
const context = getContext();
|
|
25
25
|
await pgQueries.insertTodo(context.db, text);
|
|
26
26
|
} else {
|
|
@@ -11,20 +11,20 @@ export const telefuncHandler: UniversalHandler = enhance(
|
|
|
11
11
|
const httpResponse = await telefunc({
|
|
12
12
|
request,
|
|
13
13
|
context: {
|
|
14
|
-
...(context as
|
|
15
|
-
'BATI.has("drizzle") && BATI.has("postgres")': { db: ReturnType<typeof dbPostgres> };
|
|
16
|
-
'BATI.has("kysely") && BATI.has("postgres")': { db: ReturnType<typeof dbKyselyPostgres> };
|
|
17
|
-
'BATI.has("postgres") &&
|
|
18
|
-
'BATI.has("sqlite") &&
|
|
19
|
-
'BATI.has("drizzle") &&
|
|
20
|
-
'BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
|
|
21
|
-
'BATI.has("kysely") &&
|
|
22
|
-
'BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
|
|
23
|
-
"BATI.hasD1 &&
|
|
14
|
+
...(context as $$.If<{
|
|
15
|
+
'$$.BATI.has("drizzle") && $$.BATI.has("postgres")': { db: ReturnType<typeof dbPostgres> };
|
|
16
|
+
'$$.BATI.has("kysely") && $$.BATI.has("postgres")': { db: ReturnType<typeof dbKyselyPostgres> };
|
|
17
|
+
'$$.BATI.has("postgres") && !$$.BATI.hasOrm': { db: ReturnType<typeof pgDb> };
|
|
18
|
+
'$$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm': { db: ReturnType<typeof sqliteDb> };
|
|
19
|
+
'$$.BATI.has("drizzle") && !$$.BATI.hasD1': { db: ReturnType<typeof dbSqlite> };
|
|
20
|
+
'$$.BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
|
|
21
|
+
'$$.BATI.has("kysely") && !$$.BATI.hasD1': { db: ReturnType<typeof dbKysely> };
|
|
22
|
+
'$$.BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
|
|
23
|
+
"$$.BATI.hasD1 && !$$.BATI.hasOrm": { db: D1Database };
|
|
24
24
|
_: object;
|
|
25
25
|
}>),
|
|
26
|
-
...(runtime as
|
|
27
|
-
"BATI.hasD1": { runtime: "workerd"; env?: { DB: D1Database } };
|
|
26
|
+
...(runtime as $$.If<{
|
|
27
|
+
"$$.BATI.hasD1": { runtime: "workerd"; env?: { DB: D1Database } };
|
|
28
28
|
}>),
|
|
29
29
|
},
|
|
30
30
|
});
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/* $$.keepFileIfImported */
|
|
2
2
|
|
|
3
3
|
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
|
|
4
4
|
import { enhance, type Get, type UniversalHandler } from "@universal-middleware/core";
|
|
@@ -14,9 +14,9 @@ export const trpcHandler = ((endpoint) =>
|
|
|
14
14
|
router: appRouter,
|
|
15
15
|
createContext({ req, resHeaders }) {
|
|
16
16
|
return {
|
|
17
|
-
...(context as
|
|
18
|
-
...(runtime as
|
|
19
|
-
"BATI.hasD1": { runtime: "workerd"; env?: { DB: D1Database } };
|
|
17
|
+
...(context as $$.Any),
|
|
18
|
+
...(runtime as $$.If<{
|
|
19
|
+
"$$.BATI.hasD1": { runtime: "workerd"; env?: { DB: D1Database } };
|
|
20
20
|
}>),
|
|
21
21
|
req,
|
|
22
22
|
resHeaders,
|
|
@@ -15,16 +15,16 @@ import { initTRPC } from "@trpc/server";
|
|
|
15
15
|
*/
|
|
16
16
|
const t = initTRPC
|
|
17
17
|
.context<
|
|
18
|
-
|
|
19
|
-
'BATI.has("drizzle") && BATI.has("postgres")': { db: ReturnType<typeof dbPostgres> };
|
|
20
|
-
'BATI.has("kysely") && BATI.has("postgres")': { db: ReturnType<typeof dbKyselyPostgres> };
|
|
21
|
-
'BATI.has("postgres") &&
|
|
22
|
-
'BATI.has("sqlite") &&
|
|
23
|
-
'BATI.has("drizzle") &&
|
|
24
|
-
'BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
|
|
25
|
-
'BATI.has("kysely") &&
|
|
26
|
-
'BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
|
|
27
|
-
"BATI.hasD1 &&
|
|
18
|
+
$$.If<{
|
|
19
|
+
'$$.BATI.has("drizzle") && $$.BATI.has("postgres")': { db: ReturnType<typeof dbPostgres> };
|
|
20
|
+
'$$.BATI.has("kysely") && $$.BATI.has("postgres")': { db: ReturnType<typeof dbKyselyPostgres> };
|
|
21
|
+
'$$.BATI.has("postgres") && !$$.BATI.hasOrm': { db: ReturnType<typeof pgDb> };
|
|
22
|
+
'$$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm': { db: ReturnType<typeof sqliteDb> };
|
|
23
|
+
'$$.BATI.has("drizzle") && !$$.BATI.hasD1': { db: ReturnType<typeof dbSqlite> };
|
|
24
|
+
'$$.BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
|
|
25
|
+
'$$.BATI.has("kysely") && !$$.BATI.hasD1': { db: ReturnType<typeof dbKysely> };
|
|
26
|
+
'$$.BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
|
|
27
|
+
"$$.BATI.hasD1 && !$$.BATI.hasOrm": { db: D1Database };
|
|
28
28
|
_: object;
|
|
29
29
|
}>
|
|
30
30
|
>()
|
|
@@ -49,15 +49,15 @@ export const appRouter = router({
|
|
|
49
49
|
throw new Error("Input is not a string");
|
|
50
50
|
})
|
|
51
51
|
.mutation(async (opts) => {
|
|
52
|
-
if (BATI.has("drizzle")) {
|
|
52
|
+
if ($$.BATI.has("drizzle")) {
|
|
53
53
|
await drizzleQueries.insertTodo(opts.ctx.db, opts.input);
|
|
54
|
-
} else if (BATI.has("sqlite") &&
|
|
54
|
+
} else if ($$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm) {
|
|
55
55
|
sqliteQueries.insertTodo(opts.ctx.db, opts.input);
|
|
56
|
-
} else if (BATI.has("kysely")) {
|
|
56
|
+
} else if ($$.BATI.has("kysely")) {
|
|
57
57
|
await kyselyQueries.insertTodo(opts.ctx.db, opts.input);
|
|
58
|
-
} else if (BATI.hasD1 &&
|
|
58
|
+
} else if ($$.BATI.hasD1 && !$$.BATI.hasOrm) {
|
|
59
59
|
await d1Queries.insertTodo(opts.ctx.db, opts.input);
|
|
60
|
-
} else if (BATI.has("postgres") &&
|
|
60
|
+
} else if ($$.BATI.has("postgres") && !$$.BATI.hasOrm) {
|
|
61
61
|
await pgQueries.insertTodo(opts.ctx.db, opts.input);
|
|
62
62
|
} else {
|
|
63
63
|
// This is where you'd persist the data
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -19,16 +19,16 @@ import { contract } from "../ts-rest/contract";
|
|
|
19
19
|
**/
|
|
20
20
|
const router = tsr
|
|
21
21
|
.platformContext<
|
|
22
|
-
|
|
23
|
-
'BATI.has("drizzle") && BATI.has("postgres")': { db: ReturnType<typeof dbPostgres> };
|
|
24
|
-
'BATI.has("kysely") && BATI.has("postgres")': { db: ReturnType<typeof dbKyselyPostgres> };
|
|
25
|
-
'BATI.has("postgres") &&
|
|
26
|
-
'BATI.has("sqlite") &&
|
|
27
|
-
'BATI.has("drizzle") &&
|
|
28
|
-
'BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
|
|
29
|
-
'BATI.has("kysely") &&
|
|
30
|
-
'BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
|
|
31
|
-
"BATI.hasD1 &&
|
|
22
|
+
$$.If<{
|
|
23
|
+
'$$.BATI.has("drizzle") && $$.BATI.has("postgres")': { db: ReturnType<typeof dbPostgres> };
|
|
24
|
+
'$$.BATI.has("kysely") && $$.BATI.has("postgres")': { db: ReturnType<typeof dbKyselyPostgres> };
|
|
25
|
+
'$$.BATI.has("postgres") && !$$.BATI.hasOrm': { db: ReturnType<typeof pgDb> };
|
|
26
|
+
'$$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm': { db: ReturnType<typeof sqliteDb> };
|
|
27
|
+
'$$.BATI.has("drizzle") && !$$.BATI.hasD1': { db: ReturnType<typeof dbSqlite> };
|
|
28
|
+
'$$.BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
|
|
29
|
+
'$$.BATI.has("kysely") && !$$.BATI.hasD1': { db: ReturnType<typeof dbKysely> };
|
|
30
|
+
'$$.BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
|
|
31
|
+
"$$.BATI.hasD1 && !$$.BATI.hasOrm": { db: D1Database };
|
|
32
32
|
_: object;
|
|
33
33
|
}>
|
|
34
34
|
>()
|
|
@@ -42,15 +42,15 @@ const router = tsr
|
|
|
42
42
|
};
|
|
43
43
|
},
|
|
44
44
|
createTodo: async ({ body }, _ctx) => {
|
|
45
|
-
if (BATI.has("drizzle")) {
|
|
45
|
+
if ($$.BATI.has("drizzle")) {
|
|
46
46
|
await drizzleQueries.insertTodo(_ctx.db, body.text);
|
|
47
|
-
} else if (BATI.has("sqlite") &&
|
|
47
|
+
} else if ($$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm) {
|
|
48
48
|
sqliteQueries.insertTodo(_ctx.db, body.text);
|
|
49
|
-
} else if (BATI.has("kysely")) {
|
|
49
|
+
} else if ($$.BATI.has("kysely")) {
|
|
50
50
|
await kyselyQueries.insertTodo(_ctx.db, body.text);
|
|
51
|
-
} else if (BATI.hasD1 &&
|
|
51
|
+
} else if ($$.BATI.hasD1 && !$$.BATI.hasOrm) {
|
|
52
52
|
await d1Queries.insertTodo(_ctx.db, body.text);
|
|
53
|
-
} else if (BATI.has("postgres") &&
|
|
53
|
+
} else if ($$.BATI.has("postgres") && !$$.BATI.hasOrm) {
|
|
54
54
|
await pgQueries.insertTodo(_ctx.db, body.text);
|
|
55
55
|
} else {
|
|
56
56
|
// This is where you'd persist the data
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { addVitePlugin,
|
|
3
|
+
import { addVitePlugin, transformConfig } from "@batijs/core";
|
|
4
4
|
//#region ../../boilerplates/vercel/dist/files/$vite.config.ts.mjs
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
function getViteConfig(props) {
|
|
6
|
+
return transformConfig(props, (root) => {
|
|
7
|
+
addVitePlugin(root, {
|
|
8
|
+
from: "vite-plugin-vercel/vite",
|
|
9
|
+
constructor: "vercel",
|
|
10
|
+
named: true
|
|
11
|
+
});
|
|
11
12
|
});
|
|
12
|
-
return mod.generate().code;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
export { getViteConfig as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { addVitePlugin,
|
|
3
|
+
import { addVitePlugin, transformConfig } from "@batijs/core";
|
|
4
4
|
//#region ../../boilerplates/vue/dist/files/$vite.config.ts.mjs
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
function getViteConfig(props) {
|
|
6
|
+
return transformConfig(props, (root) => {
|
|
7
|
+
addVitePlugin(root, {
|
|
8
|
+
from: "@vitejs/plugin-vue",
|
|
9
|
+
constructor: "vue"
|
|
10
|
+
});
|
|
10
11
|
});
|
|
11
|
-
return mod.generate().code;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
14
|
export { getViteConfig as default };
|