@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.
Files changed (147) hide show
  1. package/dist/boilerplates/@batijs/auth0/bati.config.mjs +1 -1
  2. package/dist/boilerplates/@batijs/authjs/bati.config.mjs +1 -1
  3. package/dist/boilerplates/@batijs/authjs/files/server/authjs-handler.ts +1 -1
  4. package/dist/boilerplates/@batijs/aws/bati.config.mjs +1 -1
  5. package/dist/boilerplates/@batijs/aws/files/cdk/bin/infrastructure.ts +1 -1
  6. package/dist/boilerplates/@batijs/better-auth/bati.config.mjs +1 -1
  7. package/dist/boilerplates/@batijs/better-auth/files/database/better-auth/migrate.ts +1 -3
  8. package/dist/boilerplates/@batijs/better-auth/files/database/drizzle/schema/auth.ts +5 -5
  9. package/dist/boilerplates/@batijs/better-auth/files/server/better-auth-handler.ts +2 -2
  10. package/dist/boilerplates/@batijs/better-auth/files/server/better-auth.ts +8 -8
  11. package/dist/boilerplates/@batijs/biome/bati.config.mjs +1 -1
  12. package/dist/boilerplates/@batijs/cloudflare/bati.config.mjs +1 -1
  13. package/dist/boilerplates/@batijs/cloudflare/files/$vite.config.ts.js +9 -9
  14. package/dist/boilerplates/@batijs/compiled/bati.config.mjs +1 -1
  15. package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +9 -9
  16. package/dist/boilerplates/@batijs/d1/bati.config.mjs +1 -1
  17. package/dist/boilerplates/@batijs/d1-kysely/bati.config.mjs +1 -1
  18. package/dist/boilerplates/@batijs/d1-sqlite/bati.config.mjs +1 -1
  19. package/dist/boilerplates/@batijs/docker-compose/bati.config.mjs +1 -1
  20. package/dist/boilerplates/@batijs/docker-compose/files/$Dockerfile.js +5 -44
  21. package/dist/boilerplates/@batijs/docker-compose/files/docker-compose.yml +6 -6
  22. package/dist/boilerplates/@batijs/dokploy/bati.config.mjs +1 -1
  23. package/dist/boilerplates/@batijs/drizzle/bati.config.mjs +6 -1
  24. package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/db.ts +3 -3
  25. package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/queries/todos.ts +10 -10
  26. package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/schema/todos.ts +2 -2
  27. package/dist/boilerplates/@batijs/drizzle/files/drizzle.config.ts +3 -3
  28. package/dist/boilerplates/@batijs/drizzle/types/database/drizzle/queries/todos.d.mts +6 -6
  29. package/dist/boilerplates/@batijs/edgeone/bati.config.mjs +1 -1
  30. package/dist/boilerplates/@batijs/edgeone/files/$vite.config.ts.js +7 -7
  31. package/dist/boilerplates/@batijs/elysia/bati.config.mjs +1 -1
  32. package/dist/boilerplates/@batijs/elysia/files/+server.ts +1 -1
  33. package/dist/boilerplates/@batijs/elysia/files/server/elysia.ts +9 -9
  34. package/dist/boilerplates/@batijs/eslint/bati.config.mjs +1 -1
  35. package/dist/boilerplates/@batijs/eslint/files/eslint.config.ts +14 -14
  36. package/dist/boilerplates/@batijs/express/bati.config.mjs +1 -1
  37. package/dist/boilerplates/@batijs/express/files/+server.ts +10 -10
  38. package/dist/boilerplates/@batijs/fastify/bati.config.mjs +1 -1
  39. package/dist/boilerplates/@batijs/fastify/files/+server.ts +10 -10
  40. package/dist/boilerplates/@batijs/google-analytics/bati.config.mjs +1 -1
  41. package/dist/boilerplates/@batijs/hono/bati.config.mjs +1 -1
  42. package/dist/boilerplates/@batijs/hono/files/+server.ts +2 -2
  43. package/dist/boilerplates/@batijs/hono/files/entry_aws_lambda.ts +1 -3
  44. package/dist/boilerplates/@batijs/hono/files/server/hono.ts +9 -9
  45. package/dist/boilerplates/@batijs/kysely/bati.config.mjs +2 -1
  46. package/dist/boilerplates/@batijs/kysely/files/$vite.config.ts.js +9 -12
  47. package/dist/boilerplates/@batijs/kysely/files/database/kysely/db.ts +5 -5
  48. package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrate.ts +5 -6
  49. package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrations/001_create_todos_table.ts +2 -3
  50. package/dist/boilerplates/@batijs/kysely/files/database/kysely/queries/todos.ts +8 -8
  51. package/dist/boilerplates/@batijs/kysely/files/vite-plugin-input.ts +1 -2
  52. package/dist/boilerplates/@batijs/kysely/types/database/kysely/queries/todos.d.mts +8 -8
  53. package/dist/boilerplates/@batijs/mantine/bati.config.mjs +1 -1
  54. package/dist/boilerplates/@batijs/netlify/bati.config.mjs +1 -1
  55. package/dist/boilerplates/@batijs/netlify/files/$vite.config.ts.js +8 -8
  56. package/dist/boilerplates/@batijs/oxlint/bati.config.mjs +1 -1
  57. package/dist/boilerplates/@batijs/plausible.io/bati.config.mjs +1 -1
  58. package/dist/boilerplates/@batijs/pnpm/bati.config.mjs +1 -1
  59. package/dist/boilerplates/@batijs/postgres/bati.config.mjs +2 -1
  60. package/dist/boilerplates/@batijs/postgres/files/database/postgres/db.ts +1 -1
  61. package/dist/boilerplates/@batijs/postgres/files/database/postgres/schema/todos.ts +1 -1
  62. package/dist/boilerplates/@batijs/prettier/bati.config.mjs +1 -1
  63. package/dist/boilerplates/@batijs/prisma/bati.config.mjs +1 -1
  64. package/dist/boilerplates/@batijs/react/bati.config.mjs +1 -1
  65. package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +7 -7
  66. package/dist/boilerplates/@batijs/react/files/pages/+Head.tsx +6 -6
  67. package/dist/boilerplates/@batijs/react/files/pages/+Layout.tsx +14 -14
  68. package/dist/boilerplates/@batijs/react/files/pages/+config.ts +3 -3
  69. package/dist/boilerplates/@batijs/react/files/pages/index/+Page.tsx +1 -1
  70. package/dist/boilerplates/@batijs/react/files/pages/index/Counter.tsx +3 -3
  71. package/dist/boilerplates/@batijs/react/files/pages/todo/TodoList.tsx +6 -6
  72. package/dist/boilerplates/@batijs/react-better-auth/bati.config.mjs +1 -1
  73. package/dist/boilerplates/@batijs/react-better-auth/files/pages/account/+Page.tsx +1 -1
  74. package/dist/boilerplates/@batijs/react-better-auth/files/pages/login/+Page.tsx +4 -4
  75. package/dist/boilerplates/@batijs/react-better-auth/files/pages/signup/+Page.tsx +4 -4
  76. package/dist/boilerplates/@batijs/react-sentry/bati.config.mjs +1 -1
  77. package/dist/boilerplates/@batijs/sentry/bati.config.mjs +1 -1
  78. package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +10 -10
  79. package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +12 -18
  80. package/dist/boilerplates/@batijs/shadcn-ui/bati.config.mjs +1 -1
  81. package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +5 -27
  82. package/dist/boilerplates/@batijs/shared/bati.config.mjs +1 -1
  83. package/dist/boilerplates/@batijs/shared/files/vite.config.ts +1 -1
  84. package/dist/boilerplates/@batijs/shared-db/bati.config.mjs +1 -1
  85. package/dist/boilerplates/@batijs/shared-db/files/server/db-middleware.ts +21 -21
  86. package/dist/boilerplates/@batijs/shared-db/types/server/db-middleware.d.mts +10 -10
  87. package/dist/boilerplates/@batijs/shared-env/bati.config.mjs +1 -1
  88. package/dist/boilerplates/@batijs/shared-env/files/server/env.ts +6 -4
  89. package/dist/boilerplates/@batijs/shared-env/files/server/load.ts +1 -1
  90. package/dist/boilerplates/@batijs/shared-env/types/server/env.d.mts +2 -2
  91. package/dist/boilerplates/@batijs/shared-server/bati.config.mjs +1 -1
  92. package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +16 -16
  93. package/dist/boilerplates/@batijs/shared-server/types/server/create-todo-handler.d.mts +10 -10
  94. package/dist/boilerplates/@batijs/shared-todo/bati.config.mjs +1 -1
  95. package/dist/boilerplates/@batijs/shared-todo/files/global.d.ts +11 -11
  96. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+config.ts +1 -4
  97. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +5 -5
  98. package/dist/boilerplates/@batijs/solid/bati.config.mjs +1 -1
  99. package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +7 -7
  100. package/dist/boilerplates/@batijs/solid/files/pages/+Head.tsx +3 -4
  101. package/dist/boilerplates/@batijs/solid/files/pages/+Layout.tsx +10 -10
  102. package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +3 -3
  103. package/dist/boilerplates/@batijs/solid/files/pages/index/Counter.tsx +2 -2
  104. package/dist/boilerplates/@batijs/solid/files/pages/todo/TodoList.tsx +6 -6
  105. package/dist/boilerplates/@batijs/solid-better-auth/bati.config.mjs +1 -1
  106. package/dist/boilerplates/@batijs/solid-better-auth/files/pages/account/+Page.tsx +1 -1
  107. package/dist/boilerplates/@batijs/solid-better-auth/files/pages/login/+Page.tsx +4 -4
  108. package/dist/boilerplates/@batijs/solid-better-auth/files/pages/signup/+Page.tsx +4 -4
  109. package/dist/boilerplates/@batijs/solid-sentry/bati.config.mjs +1 -1
  110. package/dist/boilerplates/@batijs/sqlite/bati.config.mjs +2 -1
  111. package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/db.ts +1 -1
  112. package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/schema/todos.ts +1 -1
  113. package/dist/boilerplates/@batijs/storybook/bati.config.mjs +1 -1
  114. package/dist/boilerplates/@batijs/tailwindcss/bati.config.mjs +1 -1
  115. package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +7 -7
  116. package/dist/boilerplates/@batijs/tailwindcss/files/pages/tailwind.css +2 -2
  117. package/dist/boilerplates/@batijs/telefunc/bati.config.mjs +1 -1
  118. package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +8 -8
  119. package/dist/boilerplates/@batijs/telefunc/files/global.d.ts +12 -12
  120. package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +5 -5
  121. package/dist/boilerplates/@batijs/telefunc/files/server/telefunc-handler.ts +12 -12
  122. package/dist/boilerplates/@batijs/trpc/bati.config.mjs +1 -1
  123. package/dist/boilerplates/@batijs/trpc/files/server/trpc-handler.ts +4 -4
  124. package/dist/boilerplates/@batijs/trpc/files/trpc/server.ts +15 -15
  125. package/dist/boilerplates/@batijs/ts-rest/bati.config.mjs +1 -1
  126. package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +15 -15
  127. package/dist/boilerplates/@batijs/universal-deploy/bati.config.mjs +1 -1
  128. package/dist/boilerplates/@batijs/vercel/bati.config.mjs +1 -1
  129. package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +8 -8
  130. package/dist/boilerplates/@batijs/vue/bati.config.mjs +1 -1
  131. package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +7 -7
  132. package/dist/boilerplates/@batijs/vue/files/components/Content.vue +2 -2
  133. package/dist/boilerplates/@batijs/vue/files/components/Counter.vue +3 -3
  134. package/dist/boilerplates/@batijs/vue/files/components/Logo.vue +2 -2
  135. package/dist/boilerplates/@batijs/vue/files/components/Sidebar.vue +2 -2
  136. package/dist/boilerplates/@batijs/vue/files/pages/+Head.vue +2 -3
  137. package/dist/boilerplates/@batijs/vue/files/pages/+Layout.vue +3 -3
  138. package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +3 -3
  139. package/dist/boilerplates/@batijs/vue/files/pages/+onCreateApp.ts +1 -1
  140. package/dist/boilerplates/@batijs/vue/files/pages/todo/TodoList.vue +8 -8
  141. package/dist/boilerplates/@batijs/vue-better-auth/bati.config.mjs +1 -1
  142. package/dist/boilerplates/@batijs/vue-better-auth/files/pages/account/+Page.vue +1 -1
  143. package/dist/boilerplates/@batijs/vue-better-auth/files/pages/login/+Page.vue +3 -3
  144. package/dist/boilerplates/@batijs/vue-better-auth/files/pages/signup/+Page.vue +2 -2
  145. package/dist/boilerplates/@batijs/vue-sentry/bati.config.mjs +1 -1
  146. package/dist/index.js +49 -47
  147. 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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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
- //# BATI.has("tailwindcss")
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",
@@ -1,4 +1,4 @@
1
- /*# BATI include-if-imported #*/
1
+ /* $$.keepFileIfImported */
2
2
  import sqlite, { type Database } from "better-sqlite3";
3
3
 
4
4
  let singleton: Database | undefined;
@@ -1,4 +1,4 @@
1
- /*# BATI include-if-imported #*/
1
+ /* $$.keepFileIfImported */
2
2
  import "@batijs/shared-env/server/load";
3
3
  import { db } from "../db";
4
4
 
@@ -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, loadAsMagicast } from "@batijs/core";
3
+ import { addVitePlugin, transformConfig } from "@batijs/core";
4
4
  //#region ../../boilerplates/tailwindcss/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- addVitePlugin(mod, {
8
- from: "@tailwindcss/vite",
9
- constructor: "tailwindcss"
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 };
@@ -1,7 +1,7 @@
1
1
  @import "tailwindcss";
2
- /*{ @if (it.BATI.has("daisyui")) }*/
2
+ /* $$.if($$.BATI.has("daisyui")) */
3
3
  @plugin "daisyui";
4
- /*{ /if }*/
4
+ /* $$.endif */
5
5
 
6
6
  @layer base {
7
7
  h1 {
@@ -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, loadAsMagicast } from "@batijs/core";
3
+ import { addVitePlugin, transformConfig } from "@batijs/core";
4
4
  //#region ../../boilerplates/telefunc/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- addVitePlugin(mod, {
8
- from: "telefunc/vite",
9
- constructor: "telefunc",
10
- imported: "telefunc"
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
- //# BATI.hasDbDemo
6
+ // $$.BATI.hasDbDemo
7
7
  declare module "telefunc" {
8
8
  namespace Telefunc {
9
9
  interface Context {
10
- db: BATI.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;
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
- //# BATI.has("REMOVE-COMMENT") || "remove-comments-only"
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") && !BATI.hasD1 && !BATI.hasOrm) {
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 && !BATI.hasOrm) {
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") && !BATI.hasOrm) {
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 BATI.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 };
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 BATI.If<{
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
- /*# BATI include-if-imported #*/
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 BATI.Any),
18
- ...(runtime as BATI.If<{
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
- BATI.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 };
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") && !BATI.hasD1 && !BATI.hasOrm) {
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 && !BATI.hasOrm) {
58
+ } else if ($$.BATI.hasD1 && !$$.BATI.hasOrm) {
59
59
  await d1Queries.insertTodo(opts.ctx.db, opts.input);
60
- } else if (BATI.has("postgres") && !BATI.hasOrm) {
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
- BATI.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 };
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") && !BATI.hasD1 && !BATI.hasOrm) {
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 && !BATI.hasOrm) {
51
+ } else if ($$.BATI.hasD1 && !$$.BATI.hasOrm) {
52
52
  await d1Queries.insertTodo(_ctx.db, body.text);
53
- } else if (BATI.has("postgres") && !BATI.hasOrm) {
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, loadAsMagicast } from "@batijs/core";
3
+ import { addVitePlugin, transformConfig } from "@batijs/core";
4
4
  //#region ../../boilerplates/vercel/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- addVitePlugin(mod, {
8
- from: "vite-plugin-vercel/vite",
9
- constructor: "vercel",
10
- imported: "vercel"
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, loadAsMagicast } from "@batijs/core";
3
+ import { addVitePlugin, transformConfig } from "@batijs/core";
4
4
  //#region ../../boilerplates/vue/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- addVitePlugin(mod, {
8
- from: "@vitejs/plugin-vue",
9
- constructor: "vue"
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 };