@batijs/cli 0.0.650 → 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 (93) hide show
  1. package/dist/boilerplates/@batijs/authjs/files/server/authjs-handler.ts +1 -1
  2. package/dist/boilerplates/@batijs/aws/files/cdk/bin/infrastructure.ts +1 -1
  3. package/dist/boilerplates/@batijs/better-auth/files/database/better-auth/migrate.ts +1 -3
  4. package/dist/boilerplates/@batijs/better-auth/files/database/drizzle/schema/auth.ts +5 -5
  5. package/dist/boilerplates/@batijs/better-auth/files/server/better-auth-handler.ts +2 -2
  6. package/dist/boilerplates/@batijs/better-auth/files/server/better-auth.ts +8 -8
  7. package/dist/boilerplates/@batijs/cloudflare/files/$vite.config.ts.js +9 -9
  8. package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +9 -9
  9. package/dist/boilerplates/@batijs/docker-compose/files/docker-compose.yml +6 -6
  10. package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/db.ts +3 -3
  11. package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/queries/todos.ts +10 -10
  12. package/dist/boilerplates/@batijs/drizzle/files/database/drizzle/schema/todos.ts +2 -2
  13. package/dist/boilerplates/@batijs/drizzle/files/drizzle.config.ts +3 -3
  14. package/dist/boilerplates/@batijs/drizzle/types/database/drizzle/queries/todos.d.mts +6 -6
  15. package/dist/boilerplates/@batijs/edgeone/files/$vite.config.ts.js +7 -7
  16. package/dist/boilerplates/@batijs/elysia/files/+server.ts +1 -1
  17. package/dist/boilerplates/@batijs/elysia/files/server/elysia.ts +9 -9
  18. package/dist/boilerplates/@batijs/eslint/files/eslint.config.ts +14 -14
  19. package/dist/boilerplates/@batijs/express/files/+server.ts +10 -10
  20. package/dist/boilerplates/@batijs/fastify/files/+server.ts +10 -10
  21. package/dist/boilerplates/@batijs/hono/files/+server.ts +2 -2
  22. package/dist/boilerplates/@batijs/hono/files/entry_aws_lambda.ts +1 -3
  23. package/dist/boilerplates/@batijs/hono/files/server/hono.ts +9 -9
  24. package/dist/boilerplates/@batijs/kysely/files/$vite.config.ts.js +9 -12
  25. package/dist/boilerplates/@batijs/kysely/files/database/kysely/db.ts +5 -5
  26. package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrate.ts +2 -4
  27. package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrations/001_create_todos_table.ts +2 -3
  28. package/dist/boilerplates/@batijs/kysely/files/database/kysely/queries/todos.ts +8 -8
  29. package/dist/boilerplates/@batijs/kysely/files/vite-plugin-input.ts +1 -2
  30. package/dist/boilerplates/@batijs/kysely/types/database/kysely/queries/todos.d.mts +8 -8
  31. package/dist/boilerplates/@batijs/netlify/files/$vite.config.ts.js +8 -8
  32. package/dist/boilerplates/@batijs/postgres/files/database/postgres/db.ts +1 -1
  33. package/dist/boilerplates/@batijs/postgres/files/database/postgres/schema/todos.ts +1 -1
  34. package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +7 -7
  35. package/dist/boilerplates/@batijs/react/files/pages/+Head.tsx +6 -6
  36. package/dist/boilerplates/@batijs/react/files/pages/+Layout.tsx +14 -14
  37. package/dist/boilerplates/@batijs/react/files/pages/+config.ts +3 -3
  38. package/dist/boilerplates/@batijs/react/files/pages/index/+Page.tsx +1 -1
  39. package/dist/boilerplates/@batijs/react/files/pages/index/Counter.tsx +3 -3
  40. package/dist/boilerplates/@batijs/react/files/pages/todo/TodoList.tsx +6 -6
  41. package/dist/boilerplates/@batijs/react-better-auth/files/pages/account/+Page.tsx +1 -1
  42. package/dist/boilerplates/@batijs/react-better-auth/files/pages/login/+Page.tsx +4 -4
  43. package/dist/boilerplates/@batijs/react-better-auth/files/pages/signup/+Page.tsx +4 -4
  44. package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +10 -10
  45. package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +12 -18
  46. package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +5 -27
  47. package/dist/boilerplates/@batijs/shared/files/vite.config.ts +1 -1
  48. package/dist/boilerplates/@batijs/shared-db/files/server/db-middleware.ts +21 -21
  49. package/dist/boilerplates/@batijs/shared-db/types/server/db-middleware.d.mts +10 -10
  50. package/dist/boilerplates/@batijs/shared-env/files/server/env.ts +6 -4
  51. package/dist/boilerplates/@batijs/shared-env/files/server/load.ts +1 -1
  52. package/dist/boilerplates/@batijs/shared-env/types/server/env.d.mts +2 -2
  53. package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +16 -16
  54. package/dist/boilerplates/@batijs/shared-server/types/server/create-todo-handler.d.mts +10 -10
  55. package/dist/boilerplates/@batijs/shared-todo/files/global.d.ts +11 -11
  56. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+config.ts +1 -4
  57. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +5 -5
  58. package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +7 -7
  59. package/dist/boilerplates/@batijs/solid/files/pages/+Head.tsx +3 -4
  60. package/dist/boilerplates/@batijs/solid/files/pages/+Layout.tsx +10 -10
  61. package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +3 -3
  62. package/dist/boilerplates/@batijs/solid/files/pages/index/Counter.tsx +2 -2
  63. package/dist/boilerplates/@batijs/solid/files/pages/todo/TodoList.tsx +6 -6
  64. package/dist/boilerplates/@batijs/solid-better-auth/files/pages/account/+Page.tsx +1 -1
  65. package/dist/boilerplates/@batijs/solid-better-auth/files/pages/login/+Page.tsx +4 -4
  66. package/dist/boilerplates/@batijs/solid-better-auth/files/pages/signup/+Page.tsx +4 -4
  67. package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/db.ts +1 -1
  68. package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/schema/todos.ts +1 -1
  69. package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +7 -7
  70. package/dist/boilerplates/@batijs/tailwindcss/files/pages/tailwind.css +2 -2
  71. package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +8 -8
  72. package/dist/boilerplates/@batijs/telefunc/files/global.d.ts +12 -12
  73. package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +5 -5
  74. package/dist/boilerplates/@batijs/telefunc/files/server/telefunc-handler.ts +12 -12
  75. package/dist/boilerplates/@batijs/trpc/files/server/trpc-handler.ts +4 -4
  76. package/dist/boilerplates/@batijs/trpc/files/trpc/server.ts +15 -15
  77. package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +15 -15
  78. package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +8 -8
  79. package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +7 -7
  80. package/dist/boilerplates/@batijs/vue/files/components/Content.vue +2 -2
  81. package/dist/boilerplates/@batijs/vue/files/components/Counter.vue +3 -3
  82. package/dist/boilerplates/@batijs/vue/files/components/Logo.vue +2 -2
  83. package/dist/boilerplates/@batijs/vue/files/components/Sidebar.vue +2 -2
  84. package/dist/boilerplates/@batijs/vue/files/pages/+Head.vue +2 -3
  85. package/dist/boilerplates/@batijs/vue/files/pages/+Layout.vue +3 -3
  86. package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +3 -3
  87. package/dist/boilerplates/@batijs/vue/files/pages/+onCreateApp.ts +1 -1
  88. package/dist/boilerplates/@batijs/vue/files/pages/todo/TodoList.vue +8 -8
  89. package/dist/boilerplates/@batijs/vue-better-auth/files/pages/account/+Page.vue +1 -1
  90. package/dist/boilerplates/@batijs/vue-better-auth/files/pages/login/+Page.vue +3 -3
  91. package/dist/boilerplates/@batijs/vue-better-auth/files/pages/signup/+Page.vue +2 -2
  92. package/dist/index.js +40 -43
  93. package/package.json +5 -5
@@ -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
 
@@ -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 {
@@ -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
  });
@@ -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
@@ -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
@@ -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 };
@@ -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 };
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div id="page-container">
3
- <!-- BATI.has("tailwindcss") -->
3
+ <!-- $$.BATI.has("tailwindcss") -->
4
4
  <div id="page-content" class="p-5 pb-12 min-h-screen">
5
5
  <slot />
6
6
  </div>
7
- <!-- !BATI.has("tailwindcss") -->
7
+ <!-- !$$.BATI.has("tailwindcss") -->
8
8
  <div id="page-content" style="padding: 20px; padding-bottom: 50px; min-height: 100vh">
9
9
  <slot />
10
10
  </div>
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <!-- BATI.has("daisyui") -->
2
+ <!-- $$.BATI.has("daisyui") -->
3
3
  <button type="button" class="btn" @click="state.count++">Counter {{ state.count }}</button>
4
- <!-- BATI.has("tailwindcss") && !BATI.has("daisyui") -->
4
+ <!-- $$.BATI.has("tailwindcss") && !$$.BATI.has("daisyui") -->
5
5
  <button
6
6
  type="button"
7
7
  class="inline-block border border-black rounded bg-gray-200 px-2 py-1 text-xs font-medium uppercase leading-normal"
@@ -9,7 +9,7 @@
9
9
  >
10
10
  Counter {{ state.count }}
11
11
  </button>
12
- <!-- !BATI.has("tailwindcss") -->
12
+ <!-- !$$.BATI.has("tailwindcss") -->
13
13
  <button type="button" @click="state.count++">Counter {{ state.count }}</button>
14
14
  </template>
15
15
 
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <!-- BATI.has("tailwindcss") -->
2
+ <!-- $$.BATI.has("tailwindcss") -->
3
3
  <div class="p-5 mb-2">
4
4
  <a href="/">
5
5
  <img src="../assets/logo.svg" height="64" width="64" />
6
6
  </a>
7
7
  </div>
8
- <!-- !BATI.has("tailwindcss") -->
8
+ <!-- !$$.BATI.has("tailwindcss") -->
9
9
  <div style="margin-top: 20px; margin-bottom: 10px">
10
10
  <a href="/">
11
11
  <img src="../assets/logo.svg" height="64" width="64" />
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <!-- BATI.has("tailwindcss") -->
2
+ <!-- $$.BATI.has("tailwindcss") -->
3
3
  <div id="sidebar" class="p-5 flex flex-col shrink-0 border-r-2 border-r-gray-200">
4
4
  <slot />
5
5
  </div>
6
- <!-- !BATI.has("tailwindcss") -->
6
+ <!-- !$$.BATI.has("tailwindcss") -->
7
7
  <div
8
8
  id="sidebar"
9
9
  style="
@@ -2,15 +2,14 @@
2
2
 
3
3
  <template>
4
4
  <link rel="icon" :href="logoUrl" />
5
-
6
- <!-- BATI.has("plausible.io") -->
5
+ <!-- $$.BATI.has("plausible.io") -->
7
6
  <!-- See https://plausible.io/docs/plausible-script -->
8
7
  <!-- TODO: update data-domain -->
9
8
  <component :is="'script'" defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js" />
10
9
  </template>
11
10
 
12
11
  <script setup lang="ts">
13
- //# BATI.has("tailwindcss")
12
+ // $$.BATI.has("tailwindcss")
14
13
  import "@batijs/tailwindcss/pages/tailwind.css";
15
14
  import logoUrl from "../assets/logo.svg";
16
15
  </script>
@@ -7,7 +7,7 @@
7
7
  <Link href="/"> Welcome </Link>
8
8
  <Link href="/todo"> Todo </Link>
9
9
  <Link href="/star-wars"> Data Fetching </Link>
10
- <!-- BATI.has("better-auth") -->
10
+ <!-- $$.BATI.has("better-auth") -->
11
11
  <AuthNav />
12
12
  </Sidebar>
13
13
  <Content><slot /></Content>
@@ -15,7 +15,7 @@
15
15
  </template>
16
16
 
17
17
  <script lang="ts" setup>
18
- //# BATI.has("better-auth")
18
+ // $$.BATI.has("better-auth")
19
19
  import AuthNav from "../components/AuthNav.vue";
20
20
  import Content from "../components/Content.vue";
21
21
  import Link from "../components/Link.vue";
@@ -23,7 +23,7 @@ import Logo from "../components/Logo.vue";
23
23
  import Sidebar from "../components/Sidebar.vue";
24
24
  import { sentryBrowserConfig } from "../sentry.browser.config";
25
25
 
26
- //# BATI.has("sentry")
26
+ // $$.BATI.has("sentry")
27
27
  sentryBrowserConfig();
28
28
  </script>
29
29
 
@@ -9,14 +9,14 @@ const config: Config = {
9
9
  title: "My Vike App",
10
10
  description: "Demo showcasing Vike",
11
11
 
12
- //# BATI.has("auth0") || BATI.has("authjs") || BATI.has("better-auth")
12
+ // $$.BATI.has("auth0") || $$.BATI.has("authjs") || $$.BATI.has("better-auth")
13
13
  passToClient: ["user"],
14
14
  extends: [vikeVue],
15
15
 
16
- //# BATI.has("vercel")
16
+ // $$.BATI.has("vercel")
17
17
  prerender: true,
18
18
 
19
- //# BATI.hasUD && !BATI.hasServer
19
+ // $$.BATI.hasUD && !$$.BATI.hasServer
20
20
  // https://vike.dev/server
21
21
  server: true,
22
22
  };
@@ -1,7 +1,7 @@
1
1
  import type { OnCreateAppSync } from "vike-vue/types";
2
2
  import { createGtag } from "vue-gtag";
3
3
 
4
- // BATI.has("google-analytics")
4
+ // $$.BATI.has("google-analytics")
5
5
  export const onCreateApp: OnCreateAppSync = (pageContext): ReturnType<OnCreateAppSync> => {
6
6
  const { app } = pageContext;
7
7
 
@@ -5,13 +5,13 @@
5
5
  </li>
6
6
  <li>
7
7
  <form @submit.prevent="submitNewTodo()">
8
- <!-- BATI.has("tailwindcss") -->
8
+ <!-- $$.BATI.has("tailwindcss") -->
9
9
  <input v-model="newTodo" type="text" class="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" />
10
- <!-- !BATI.has("tailwindcss") -->
10
+ <!-- !$$.BATI.has("tailwindcss") -->
11
11
  <input v-model="newTodo" type="text" />
12
- <!-- BATI.has("tailwindcss") -->
12
+ <!-- $$.BATI.has("tailwindcss") -->
13
13
  <button type="submit" class="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">Add to-do</button>
14
- <!-- !BATI.has("tailwindcss") -->
14
+ <!-- !$$.BATI.has("tailwindcss") -->
15
15
  <button type="submit">Add to-do</button>
16
16
  </form>
17
17
  </li>
@@ -34,12 +34,12 @@ const submitNewTodo = async () => {
34
34
  const text = newTodo.value;
35
35
  todoItems.value.push({ text });
36
36
  newTodo.value = "";
37
- if (BATI.hasServer) {
38
- if (BATI.has("telefunc")) {
37
+ if ($$.BATI.hasServer) {
38
+ if ($$.BATI.has("telefunc")) {
39
39
  await onNewTodo({ text });
40
- } else if (BATI.has("trpc")) {
40
+ } else if ($$.BATI.has("trpc")) {
41
41
  await trpc.onNewTodo.mutate(text);
42
- } else if (BATI.has("ts-rest")) {
42
+ } else if ($$.BATI.has("ts-rest")) {
43
43
  await client.createTodo({ body: { text } });
44
44
  } else {
45
45
  const response = await fetch("/api/todo/create", {
@@ -15,7 +15,7 @@ import { usePageContext } from "vike-vue/usePageContext";
15
15
  const authClient = createAuthClient();
16
16
  const pageContext = usePageContext();
17
17
 
18
- const buttonClass = BATI.has("tailwindcss")
18
+ const buttonClass = $$.BATI.has("tailwindcss")
19
19
  ? "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"
20
20
  : "";
21
21
 
@@ -39,13 +39,13 @@ const email = ref("");
39
39
  const password = ref("");
40
40
  const error = ref<string | null>(null);
41
41
 
42
- const inputClass = BATI.has("tailwindcss")
42
+ const inputClass = $$.BATI.has("tailwindcss")
43
43
  ? "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"
44
44
  : "";
45
- const buttonClass = BATI.has("tailwindcss")
45
+ const buttonClass = $$.BATI.has("tailwindcss")
46
46
  ? "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"
47
47
  : "";
48
- const githubButtonClass = BATI.has("tailwindcss")
48
+ const githubButtonClass = $$.BATI.has("tailwindcss")
49
49
  ? "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"
50
50
  : "";
51
51
 
@@ -35,10 +35,10 @@ const email = ref("");
35
35
  const password = ref("");
36
36
  const error = ref<string | null>(null);
37
37
 
38
- const inputClass = BATI.has("tailwindcss")
38
+ const inputClass = $$.BATI.has("tailwindcss")
39
39
  ? "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"
40
40
  : "";
41
- const buttonClass = BATI.has("tailwindcss")
41
+ const buttonClass = $$.BATI.has("tailwindcss")
42
42
  ? "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"
43
43
  : "";
44
44