@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,33 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { loadAsMagicast, yellow } from "@batijs/core";
3
+ import { defineConfigArg, mergeObject, transformConfig } from "@batijs/core";
4
4
  //#region ../../boilerplates/shadcn-ui/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- const replacement = `new URL("./", import.meta.url).pathname`;
8
- addResolveAlias(mod, "@", replacement);
9
- return mod.generate().code.replace(`"{{PLACEHOLDER_ALIAS}}"`, replacement);
10
- }
11
- function addResolveAlias(mod, find, replacement) {
12
- const alias = mod.exports.default.$args[0]?.resolve?.alias ?? {};
13
- const warnMsg = `${yellow("WARN")}: new resolve.alias: \`"${find}":${replacement}\` replaced existing in vite.config.ts.`;
14
- if (alias?.length === void 0) {
15
- if (alias[find]) console.warn(warnMsg);
16
- alias[find] = "{{PLACEHOLDER_ALIAS}}";
17
- } else {
18
- const newAlias = {
19
- find,
20
- replacement: "{{PLACEHOLDER_ALIAS}}"
21
- };
22
- const index = alias.findIndex((a) => a?.find === find);
23
- if (index >= 0) {
24
- console.warn(warnMsg);
25
- alias.splice(index, 1);
26
- }
27
- alias.push(newAlias);
28
- }
29
- if (!mod.exports.default.$args[0]?.resolve) mod.exports.default.$args[0].resolve = {};
30
- mod.exports.default.$args[0].resolve.alias = alias;
5
+ function getViteConfig(props) {
6
+ return transformConfig(props, (root) => {
7
+ mergeObject(defineConfigArg(root), { resolve: { alias: { "@": `new URL("./", import.meta.url).pathname` } } });
8
+ });
31
9
  }
32
10
  //#endregion
33
11
  export { getViteConfig as default };
@@ -3,7 +3,7 @@ import { defineConfig } from "vite";
3
3
 
4
4
  export default defineConfig({
5
5
  plugins: [vike()],
6
- //# BATI.hasD1
6
+ // $$.BATI.hasD1
7
7
  build: {
8
8
  rollupOptions: {
9
9
  external: ["wrangler"],
@@ -1,4 +1,4 @@
1
- /*# BATI include-if-imported #*/
1
+ /* $$.keepFileIfImported */
2
2
 
3
3
  import { getDbFromRuntime } from "@batijs/d1/database/d1/helpers";
4
4
  import { dbD1, dbPostgres, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
@@ -7,20 +7,20 @@ import { db as pgDb } from "@batijs/postgres/database/postgres/db";
7
7
  import { db as sqliteDb } from "@batijs/sqlite/database/sqlite/db";
8
8
  import { enhance, type UniversalMiddleware } from "@universal-middleware/core";
9
9
 
10
- //# BATI.hasDatabase
10
+ // $$.BATI.hasDatabase
11
11
  declare global {
12
12
  namespace Universal {
13
13
  interface Context {
14
- db: BATI.If<{
15
- 'BATI.has("drizzle") && BATI.has("postgres")': ReturnType<typeof dbPostgres>;
16
- 'BATI.has("kysely") && BATI.has("postgres")': ReturnType<typeof dbKyselyPostgres>;
17
- 'BATI.has("postgres") && !BATI.hasOrm': ReturnType<typeof pgDb>;
18
- 'BATI.has("sqlite") && !BATI.hasD1 && !BATI.hasOrm': ReturnType<typeof sqliteDb>;
19
- 'BATI.has("drizzle") && !BATI.hasD1': ReturnType<typeof dbSqlite>;
20
- 'BATI.has("drizzle")': ReturnType<typeof dbD1>;
21
- 'BATI.has("kysely") && !BATI.hasD1': ReturnType<typeof dbKysely>;
22
- 'BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
23
- "BATI.hasD1 && !BATI.hasOrm": D1Database;
14
+ db: $$.If<{
15
+ '$$.BATI.has("drizzle") && $$.BATI.has("postgres")': ReturnType<typeof dbPostgres>;
16
+ '$$.BATI.has("kysely") && $$.BATI.has("postgres")': ReturnType<typeof dbKyselyPostgres>;
17
+ '$$.BATI.has("postgres") && !$$.BATI.hasOrm': ReturnType<typeof pgDb>;
18
+ '$$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm': ReturnType<typeof sqliteDb>;
19
+ '$$.BATI.has("drizzle") && !$$.BATI.hasD1': ReturnType<typeof dbSqlite>;
20
+ '$$.BATI.has("drizzle")': ReturnType<typeof dbD1>;
21
+ '$$.BATI.has("kysely") && !$$.BATI.hasD1': ReturnType<typeof dbKysely>;
22
+ '$$.BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
23
+ "$$.BATI.hasD1 && !$$.BATI.hasOrm": D1Database;
24
24
  }>;
25
25
  }
26
26
  }
@@ -34,28 +34,28 @@ export const dbMiddleware: UniversalMiddleware = enhance(
34
34
  // The context we add here is automatically merged into pageContext
35
35
  async (_request, context, _runtime) => {
36
36
  const db =
37
- BATI.has("drizzle") && BATI.has("postgres")
37
+ $$.BATI.has("drizzle") && $$.BATI.has("postgres")
38
38
  ? dbPostgres()
39
- : BATI.has("kysely") && BATI.has("postgres")
39
+ : $$.BATI.has("kysely") && $$.BATI.has("postgres")
40
40
  ? dbKyselyPostgres()
41
- : BATI.has("postgres") && !BATI.hasOrm
41
+ : $$.BATI.has("postgres") && !$$.BATI.hasOrm
42
42
  ? pgDb()
43
- : BATI.has("sqlite") && !BATI.hasD1 && !BATI.hasOrm
43
+ : $$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm
44
44
  ? sqliteDb()
45
- : BATI.has("drizzle") && !BATI.hasD1
45
+ : $$.BATI.has("drizzle") && !$$.BATI.hasD1
46
46
  ? dbSqlite()
47
- : BATI.has("kysely") && !BATI.hasD1
47
+ : $$.BATI.has("kysely") && !$$.BATI.hasD1
48
48
  ? dbKysely()
49
- : BATI.has("kysely")
49
+ : $$.BATI.has("kysely")
50
50
  ? dbKyselyD1(await getDbFromRuntime(_runtime))
51
- : BATI.has("drizzle")
51
+ : $$.BATI.has("drizzle")
52
52
  ? dbD1(await getDbFromRuntime(_runtime))
53
53
  : await getDbFromRuntime(_runtime);
54
54
 
55
55
  return {
56
56
  ...context,
57
57
  // Sets pageContext.db
58
- db: db as BATI.Any,
58
+ db: db as $$.Any,
59
59
  };
60
60
  },
61
61
  {
@@ -8,16 +8,16 @@ import { UniversalMiddleware } from "@universal-middleware/core";
8
8
  declare global {
9
9
  namespace Universal {
10
10
  interface Context {
11
- db: BATI.If<{
12
- 'BATI.has("drizzle") && BATI.has("postgres")': ReturnType<typeof dbPostgres>;
13
- 'BATI.has("kysely") && BATI.has("postgres")': ReturnType<typeof dbKyselyPostgres>;
14
- 'BATI.has("postgres") && !BATI.hasOrm': ReturnType<typeof db>;
15
- 'BATI.has("sqlite") && !BATI.hasD1 && !BATI.hasOrm': ReturnType<typeof db$1>;
16
- 'BATI.has("drizzle") && !BATI.hasD1': ReturnType<typeof dbSqlite>;
17
- 'BATI.has("drizzle")': ReturnType<typeof dbD1>;
18
- 'BATI.has("kysely") && !BATI.hasD1': ReturnType<typeof dbKysely>;
19
- 'BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
20
- "BATI.hasD1 && !BATI.hasOrm": D1Database;
11
+ db: $$.If<{
12
+ '$$.BATI.has("drizzle") && $$.BATI.has("postgres")': ReturnType<typeof dbPostgres>;
13
+ '$$.BATI.has("kysely") && $$.BATI.has("postgres")': ReturnType<typeof dbKyselyPostgres>;
14
+ '$$.BATI.has("postgres") && !$$.BATI.hasOrm': ReturnType<typeof db>;
15
+ '$$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm': ReturnType<typeof db$1>;
16
+ '$$.BATI.has("drizzle") && !$$.BATI.hasD1': ReturnType<typeof dbSqlite>;
17
+ '$$.BATI.has("drizzle")': ReturnType<typeof dbD1>;
18
+ '$$.BATI.has("kysely") && !$$.BATI.hasD1': ReturnType<typeof dbKysely>;
19
+ '$$.BATI.has("kysely")': ReturnType<typeof dbKyselyD1>;
20
+ "$$.BATI.hasD1 && !$$.BATI.hasOrm": D1Database;
21
21
  }>;
22
22
  }
23
23
  }
@@ -1,10 +1,12 @@
1
- /*# BATI include-if-imported #*/
1
+ /* $$.keepFileIfImported */
2
2
  import { env as cloudflareEnv } from "cloudflare:workers";
3
- //# !BATI.has("cloudflare")
3
+ // !$$.BATI.has("cloudflare")
4
4
  import "./load.js";
5
5
 
6
- export const env: BATI.If<{ '!BATI.has("cloudflare")': Record<string, string | undefined> }> = BATI.has("cloudflare")
7
- ? (cloudflareEnv as BATI.Any)
6
+ export const env: $$.If<{ '!$$.BATI.has("cloudflare")': Record<string, string | undefined> }> = $$.BATI.has(
7
+ "cloudflare",
8
+ )
9
+ ? (cloudflareEnv as $$.Any)
8
10
  : typeof process?.env !== "undefined"
9
11
  ? process.env
10
12
  : {};
@@ -1,4 +1,4 @@
1
- /*# BATI include-if-imported #*/
1
+ /* $$.keepFileIfImported */
2
2
  import { readFileSync } from "node:fs";
3
3
  import process from "node:process";
4
4
  import { parseEnv } from "node:util";
@@ -1,6 +1,6 @@
1
1
  //#region files/server/env.d.ts
2
- declare const env: BATI.If<{
3
- '!BATI.has("cloudflare")': Record<string, string | undefined>;
2
+ declare const env: $$.If<{
3
+ '!$$.BATI.has("cloudflare")': Record<string, string | undefined>;
4
4
  }>;
5
5
  //#endregion
6
6
  export { env };
@@ -1,4 +1,4 @@
1
- /*# BATI include-if-imported #*/
1
+ /* $$.keepFileIfImported */
2
2
 
3
3
  import * as d1Queries from "@batijs/d1-sqlite/database/d1/queries/todos";
4
4
  import type { dbD1, dbPostgres, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
@@ -14,16 +14,16 @@ import { enhance, type UniversalHandler } from "@universal-middleware/core";
14
14
  // Note: You can directly define a server middleware instead of defining a Universal Middleware. (You can remove @universal-middleware/* — Vike's scaffolder uses it only to simplify its internal logic, see https://github.com/vikejs/vike/discussions/3116)
15
15
  export const createTodoHandler: UniversalHandler<
16
16
  Universal.Context &
17
- BATI.If<{
18
- 'BATI.has("drizzle") && BATI.has("postgres")': { db: ReturnType<typeof dbPostgres> };
19
- 'BATI.has("kysely") && BATI.has("postgres")': { db: ReturnType<typeof dbKyselyPostgres> };
20
- 'BATI.has("postgres") && !BATI.hasOrm': { db: ReturnType<typeof pgDb> };
21
- 'BATI.has("sqlite") && !BATI.hasD1 && !BATI.hasOrm': { db: ReturnType<typeof sqliteDb> };
22
- 'BATI.has("drizzle") && !BATI.hasD1': { db: ReturnType<typeof dbSqlite> };
23
- 'BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
24
- 'BATI.has("kysely") && !BATI.hasD1': { db: ReturnType<typeof dbKysely> };
25
- 'BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
26
- "BATI.hasD1 && !BATI.hasOrm": { db: D1Database };
17
+ $$.If<{
18
+ '$$.BATI.has("drizzle") && $$.BATI.has("postgres")': { db: ReturnType<typeof dbPostgres> };
19
+ '$$.BATI.has("kysely") && $$.BATI.has("postgres")': { db: ReturnType<typeof dbKyselyPostgres> };
20
+ '$$.BATI.has("postgres") && !$$.BATI.hasOrm': { db: ReturnType<typeof pgDb> };
21
+ '$$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm': { db: ReturnType<typeof sqliteDb> };
22
+ '$$.BATI.has("drizzle") && !$$.BATI.hasD1': { db: ReturnType<typeof dbSqlite> };
23
+ '$$.BATI.has("drizzle")': { db: ReturnType<typeof dbD1> };
24
+ '$$.BATI.has("kysely") && !$$.BATI.hasD1': { db: ReturnType<typeof dbKysely> };
25
+ '$$.BATI.has("kysely")': { db: ReturnType<typeof dbKyselyD1> };
26
+ "$$.BATI.hasD1 && !$$.BATI.hasOrm": { db: D1Database };
27
27
  _: object;
28
28
  }>
29
29
  > = enhance(
@@ -31,15 +31,15 @@ export const createTodoHandler: UniversalHandler<
31
31
  // In a real case, user-provided data should ALWAYS be validated with tools like zod
32
32
  const newTodo = (await request.json()) as { text: string };
33
33
 
34
- if (BATI.has("drizzle")) {
34
+ if ($$.BATI.has("drizzle")) {
35
35
  await drizzleQueries.insertTodo(_context.db, newTodo.text);
36
- } else if (BATI.has("sqlite") && !BATI.hasD1 && !BATI.hasOrm) {
36
+ } else if ($$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm) {
37
37
  sqliteQueries.insertTodo(_context.db, newTodo.text);
38
- } else if (BATI.has("kysely")) {
38
+ } else if ($$.BATI.has("kysely")) {
39
39
  await kyselyQueries.insertTodo(_context.db, newTodo.text);
40
- } else if (BATI.hasD1 && !BATI.hasOrm) {
40
+ } else if ($$.BATI.hasD1 && !$$.BATI.hasOrm) {
41
41
  await d1Queries.insertTodo(_context.db, newTodo.text);
42
- } else if (BATI.has("postgres") && !BATI.hasOrm) {
42
+ } else if ($$.BATI.has("postgres") && !$$.BATI.hasOrm) {
43
43
  await pgQueries.insertTodo(_context.db, newTodo.text);
44
44
  } else {
45
45
  // This is where you'd persist the data
@@ -5,32 +5,32 @@ import { db as db$1 } from "@batijs/sqlite/database/sqlite/db";
5
5
  import { UniversalHandler } from "@universal-middleware/core";
6
6
 
7
7
  //#region files/server/create-todo-handler.d.ts
8
- declare const createTodoHandler: UniversalHandler<Universal.Context & BATI.If<{
9
- 'BATI.has("drizzle") && BATI.has("postgres")': {
8
+ declare const createTodoHandler: UniversalHandler<Universal.Context & $$.If<{
9
+ '$$.BATI.has("drizzle") && $$.BATI.has("postgres")': {
10
10
  db: ReturnType<typeof dbPostgres>;
11
11
  };
12
- 'BATI.has("kysely") && BATI.has("postgres")': {
12
+ '$$.BATI.has("kysely") && $$.BATI.has("postgres")': {
13
13
  db: ReturnType<typeof dbKyselyPostgres>;
14
14
  };
15
- 'BATI.has("postgres") && !BATI.hasOrm': {
15
+ '$$.BATI.has("postgres") && !$$.BATI.hasOrm': {
16
16
  db: ReturnType<typeof db>;
17
17
  };
18
- 'BATI.has("sqlite") && !BATI.hasD1 && !BATI.hasOrm': {
18
+ '$$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm': {
19
19
  db: ReturnType<typeof db$1>;
20
20
  };
21
- 'BATI.has("drizzle") && !BATI.hasD1': {
21
+ '$$.BATI.has("drizzle") && !$$.BATI.hasD1': {
22
22
  db: ReturnType<typeof dbSqlite>;
23
23
  };
24
- 'BATI.has("drizzle")': {
24
+ '$$.BATI.has("drizzle")': {
25
25
  db: ReturnType<typeof dbD1>;
26
26
  };
27
- 'BATI.has("kysely") && !BATI.hasD1': {
27
+ '$$.BATI.has("kysely") && !$$.BATI.hasD1': {
28
28
  db: ReturnType<typeof dbKysely>;
29
29
  };
30
- 'BATI.has("kysely")': {
30
+ '$$.BATI.has("kysely")': {
31
31
  db: ReturnType<typeof dbKyselyD1>;
32
32
  };
33
- "BATI.hasD1 && !BATI.hasOrm": {
33
+ "$$.BATI.hasD1 && !$$.BATI.hasOrm": {
34
34
  db: D1Database;
35
35
  };
36
36
  _: object;
@@ -3,20 +3,20 @@ 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 global {
8
8
  namespace Vike {
9
9
  interface PageContextServer {
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
  }
@@ -1,7 +1,4 @@
1
- /*{ @if (it.BATI.has("drizzle") || it.BATI.has("sqlite") || it.BATI.hasD1) }*/
2
-
1
+ // $$.keepFileIf($$.BATI.has("drizzle") || $$.BATI.has("sqlite") || $$.BATI.hasD1)
3
2
  export const config = {
4
3
  prerender: false,
5
4
  };
6
-
7
- /*{ /if }*/
@@ -10,23 +10,23 @@ import type { PageContextServer } from "vike/types";
10
10
  export type Data = Awaited<ReturnType<typeof data>>;
11
11
 
12
12
  export async function data(_pageContext: PageContextServer) {
13
- if (BATI.has("drizzle")) {
13
+ if ($$.BATI.has("drizzle")) {
14
14
  const todoItemsInitial = await drizzleQueries.getAllTodos(_pageContext.db);
15
15
 
16
16
  return { todoItemsInitial };
17
- } else if (BATI.has("sqlite") && !BATI.hasD1 && !BATI.hasOrm) {
17
+ } else if ($$.BATI.has("sqlite") && !$$.BATI.hasD1 && !$$.BATI.hasOrm) {
18
18
  const todoItemsInitial = sqliteQueries.getAllTodos(_pageContext.db);
19
19
 
20
20
  return { todoItemsInitial };
21
- } else if (BATI.has("kysely")) {
21
+ } else if ($$.BATI.has("kysely")) {
22
22
  const todoItemsInitial = await kyselyQueries.getAllTodos(_pageContext.db);
23
23
 
24
24
  return { todoItemsInitial };
25
- } else if (BATI.hasD1 && !BATI.hasOrm) {
25
+ } else if ($$.BATI.hasD1 && !$$.BATI.hasOrm) {
26
26
  const todoItemsInitial = await d1Queries.getAllTodos(_pageContext.db);
27
27
 
28
28
  return { todoItemsInitial };
29
- } else if (BATI.has("postgres") && !BATI.hasOrm) {
29
+ } else if ($$.BATI.has("postgres") && !$$.BATI.hasOrm) {
30
30
  const todoItemsInitial = await pgQueries.getAllTodos(_pageContext.db);
31
31
 
32
32
  return { todoItemsInitial };
@@ -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/solid/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- addVitePlugin(mod, {
8
- from: "vike-solid/vite",
9
- constructor: "vikeSolid"
5
+ function getViteConfig(props) {
6
+ return transformConfig(props, (root) => {
7
+ addVitePlugin(root, {
8
+ from: "vike-solid/vite",
9
+ constructor: "vikeSolid"
10
+ });
10
11
  });
11
- return mod.generate().code;
12
12
  }
13
13
  //#endregion
14
14
  export { getViteConfig as default };
@@ -1,11 +1,9 @@
1
- /* eslint-disable solid/no-innerhtml */
2
-
3
1
  // https://vike.dev/Head
4
2
 
5
3
  import logoUrl from "../assets/logo.svg";
6
4
 
7
5
  export function Head() {
8
- if (BATI.has("plausible.io")) {
6
+ if ($$.BATI.has("plausible.io")) {
9
7
  return (
10
8
  <>
11
9
  <link rel="icon" href={logoUrl} />
@@ -14,7 +12,7 @@ export function Head() {
14
12
  <script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js" />
15
13
  </>
16
14
  );
17
- } else if (BATI.has("google-analytics")) {
15
+ } else if ($$.BATI.has("google-analytics")) {
18
16
  return (
19
17
  <>
20
18
  <script
@@ -22,6 +20,7 @@ export function Head() {
22
20
  src={`https://www.googletagmanager.com/gtag/js?id=${import.meta.env.PUBLIC_ENV__GOOGLE_ANALYTICS}`}
23
21
  />
24
22
  <script
23
+ // eslint-disable-next-line solid/no-innerhtml
25
24
  innerHTML={`window.dataLayer = window.dataLayer || [];
26
25
  function gtag(){dataLayer.push(arguments);}
27
26
  gtag('js', new Date());
@@ -1,7 +1,7 @@
1
1
  // https://vike.dev/Layout
2
2
 
3
3
  import "./Layout.css";
4
- //# BATI.has("tailwindcss")
4
+ // $$.BATI.has("tailwindcss")
5
5
  import "./tailwind.css";
6
6
  import { AuthNav } from "@batijs/solid-better-auth/components/AuthNav";
7
7
  import type { JSX } from "solid-js";
@@ -11,9 +11,9 @@ import { Link } from "../components/Link";
11
11
  export default function Layout(props: { children?: JSX.Element }) {
12
12
  return (
13
13
  <div
14
- //# BATI.has("tailwindcss")
14
+ // $$.BATI.has("tailwindcss")
15
15
  class={"flex max-w-5xl m-auto"}
16
- //# !BATI.has("tailwindcss")
16
+ // !$$.BATI.has("tailwindcss")
17
17
  style={{
18
18
  display: "flex",
19
19
  "max-width": "900px",
@@ -25,7 +25,7 @@ export default function Layout(props: { children?: JSX.Element }) {
25
25
  <Link href="/">Welcome</Link>
26
26
  <Link href="/todo">Todo</Link>
27
27
  <Link href="/star-wars">Data Fetching</Link>
28
- {BATI.has("better-auth") ? <AuthNav /> : null}
28
+ {$$.BATI.has("better-auth") ? <AuthNav /> : null}
29
29
  </Sidebar>
30
30
  <Content>{props.children}</Content>
31
31
  </div>
@@ -36,9 +36,9 @@ function Sidebar(props: { children: JSX.Element }) {
36
36
  return (
37
37
  <div
38
38
  id="sidebar"
39
- //# BATI.has("tailwindcss")
39
+ // $$.BATI.has("tailwindcss")
40
40
  class={"p-5 flex flex-col shrink-0 border-r-2 border-r-gray-200"}
41
- //# !BATI.has("tailwindcss")
41
+ // !$$.BATI.has("tailwindcss")
42
42
  style={{
43
43
  padding: "20px",
44
44
  "flex-shrink": 0,
@@ -58,9 +58,9 @@ function Content(props: { children: JSX.Element }) {
58
58
  <div id="page-container">
59
59
  <div
60
60
  id="page-content"
61
- //# BATI.has("tailwindcss")
61
+ // $$.BATI.has("tailwindcss")
62
62
  class={"p-5 pb-12 min-h-screen"}
63
- //# !BATI.has("tailwindcss")
63
+ // !$$.BATI.has("tailwindcss")
64
64
  style={{
65
65
  padding: "20px",
66
66
  "padding-bottom": "50px",
@@ -76,9 +76,9 @@ function Content(props: { children: JSX.Element }) {
76
76
  function Logo() {
77
77
  return (
78
78
  <div
79
- //# BATI.has("tailwindcss")
79
+ // $$.BATI.has("tailwindcss")
80
80
  class={"p-5 mb-2"}
81
- //# !BATI.has("tailwindcss")
81
+ // !$$.BATI.has("tailwindcss")
82
82
  style={{
83
83
  "margin-top": "20px",
84
84
  "margin-bottom": "10px",
@@ -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: [vikeSolid],
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
  };
@@ -8,9 +8,9 @@ function Counter() {
8
8
  return (
9
9
  <button
10
10
  type="button"
11
- //# BATI.has("tailwindcss")
11
+ // $$.BATI.has("tailwindcss")
12
12
  class={
13
- BATI.has("daisyui")
13
+ $$.BATI.has("daisyui")
14
14
  ? "btn"
15
15
  : "inline-block border border-black rounded bg-gray-200 px-2 py-1 text-xs font-medium uppercase leading-normal"
16
16
  }
@@ -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
  }
@@ -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
  }