@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
@@ -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/netlify/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- addVitePlugin(mod, {
8
- from: "@netlify/vite-plugin",
9
- constructor: "netlify",
10
- options: { build: { enabled: true } }
5
+ function getViteConfig(props) {
6
+ return transformConfig(props, (root) => {
7
+ addVitePlugin(root, {
8
+ from: "@netlify/vite-plugin",
9
+ constructor: "netlify",
10
+ options: `{ build: { enabled: 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
@@ -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
@@ -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("postgres") && !meta.BATI.hasOrm;
13
13
  },
14
+ deploy: ["database/postgres", "server/load.ts"],
14
15
  nextSteps(_meta, packageManager, { bold }) {
15
16
  return [{
16
17
  type: "text",
@@ -1,4 +1,4 @@
1
- /*# BATI include-if-imported #*/
1
+ /* $$.keepFileIfImported */
2
2
  import postgres from "postgres";
3
3
 
4
4
  let singleton: postgres.Sql | 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
@@ -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/react/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- addVitePlugin(mod, {
8
- from: "@vitejs/plugin-react",
9
- constructor: "react"
5
+ function getViteConfig(props) {
6
+ return transformConfig(props, (root) => {
7
+ addVitePlugin(root, {
8
+ from: "@vitejs/plugin-react",
9
+ constructor: "react"
10
+ });
10
11
  });
11
- return mod.generate().code;
12
12
  }
13
13
  //#endregion
14
14
  export { getViteConfig as default };
@@ -4,21 +4,21 @@ import { ColorSchemeScript } from "@mantine/core";
4
4
  import logoUrl from "../assets/logo.svg";
5
5
 
6
6
  export function Head() {
7
- if (BATI.has("plausible.io")) {
7
+ if ($$.BATI.has("plausible.io")) {
8
8
  return (
9
9
  <>
10
10
  <link rel="icon" href={logoUrl} />
11
- {BATI.has("mantine") ? <ColorSchemeScript /> : null}
11
+ {$$.BATI.has("mantine") ? <ColorSchemeScript /> : null}
12
12
  {/* See https://plausible.io/docs/plausible-script */}
13
13
  {/* TODO: update data-domain */}
14
14
  <script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js"></script>
15
15
  </>
16
16
  );
17
- } else if (BATI.has("google-analytics")) {
17
+ } else if ($$.BATI.has("google-analytics")) {
18
18
  return (
19
19
  <>
20
20
  <link rel="icon" href={logoUrl} />
21
- {BATI.has("mantine") ? <ColorSchemeScript /> : null}
21
+ {$$.BATI.has("mantine") ? <ColorSchemeScript /> : null}
22
22
  <script
23
23
  async
24
24
  src={`https://www.googletagmanager.com/gtag/js?id=${import.meta.env.PUBLIC_ENV__GOOGLE_ANALYTICS}`}
@@ -36,11 +36,11 @@ export function Head() {
36
36
  </>
37
37
  );
38
38
  } else {
39
- if (BATI.has("mantine")) {
39
+ if ($$.BATI.has("mantine")) {
40
40
  return (
41
41
  <>
42
42
  <link rel="icon" href={logoUrl} />
43
- {BATI.has("mantine") ? <ColorSchemeScript /> : null}
43
+ {$$.BATI.has("mantine") ? <ColorSchemeScript /> : null}
44
44
  </>
45
45
  );
46
46
  } else {
@@ -1,5 +1,5 @@
1
1
  import "./Layout.css";
2
- //# BATI.has("tailwindcss")
2
+ // $$.BATI.has("tailwindcss")
3
3
  import "./tailwind.css";
4
4
  import { AuthNav } from "@batijs/react-better-auth/components/AuthNav";
5
5
  import logoUrl from "../assets/logo.svg";
@@ -8,15 +8,15 @@ import { Link } from "../components/Link";
8
8
  export default function Layout({ children }: { children: React.ReactNode }) {
9
9
  return (
10
10
  <div
11
- //# BATI.has("tailwindcss")
11
+ // $$.BATI.has("tailwindcss")
12
12
  className={"flex max-w-5xl m-auto"}
13
- //# BATI.has("compiled-css")
13
+ // $$.BATI.has("compiled-css")
14
14
  css={{
15
15
  display: "flex",
16
16
  maxWidth: 1024,
17
17
  margin: "auto",
18
18
  }}
19
- //# !BATI.has("tailwindcss") && !BATI.has("compiled-css")
19
+ // !$$.BATI.has("tailwindcss") && !$$.BATI.has("compiled-css")
20
20
  style={{
21
21
  display: "flex",
22
22
  maxWidth: 900,
@@ -28,7 +28,7 @@ export default function Layout({ children }: { children: React.ReactNode }) {
28
28
  <Link href="/">Welcome</Link>
29
29
  <Link href="/todo">Todo</Link>
30
30
  <Link href="/star-wars">Data Fetching</Link>
31
- {BATI.has("better-auth") ? <AuthNav /> : null}
31
+ {$$.BATI.has("better-auth") ? <AuthNav /> : null}
32
32
  </Sidebar>
33
33
  <Content>{children}</Content>
34
34
  </div>
@@ -39,9 +39,9 @@ function Sidebar({ children }: { children: React.ReactNode }) {
39
39
  return (
40
40
  <div
41
41
  id="sidebar"
42
- //# BATI.has("tailwindcss")
42
+ // $$.BATI.has("tailwindcss")
43
43
  className={"p-5 flex flex-col shrink-0 border-r-2 border-r-gray-200"}
44
- //# BATI.has("compiled-css")
44
+ // $$.BATI.has("compiled-css")
45
45
  css={{
46
46
  padding: 20,
47
47
  display: "flex",
@@ -50,7 +50,7 @@ function Sidebar({ children }: { children: React.ReactNode }) {
50
50
  lineHeight: "1.8em",
51
51
  borderRight: "2px solid #eee",
52
52
  }}
53
- //# !BATI.has("tailwindcss") && !BATI.has("compiled-css")
53
+ // !$$.BATI.has("tailwindcss") && !$$.BATI.has("compiled-css")
54
54
  style={{
55
55
  padding: 20,
56
56
  flexShrink: 0,
@@ -70,15 +70,15 @@ function Content({ children }: { children: React.ReactNode }) {
70
70
  <div id="page-container">
71
71
  <div
72
72
  id="page-content"
73
- //# BATI.has("tailwindcss")
73
+ // $$.BATI.has("tailwindcss")
74
74
  className={"p-5 pb-12 min-h-screen"}
75
- //# BATI.has("compiled-css")
75
+ // $$.BATI.has("compiled-css")
76
76
  css={{
77
77
  padding: 20,
78
78
  paddingBottom: 48,
79
79
  minHeight: "100vh",
80
80
  }}
81
- //# !BATI.has("tailwindcss") && !BATI.has("compiled-css")
81
+ // !$$.BATI.has("tailwindcss") && !$$.BATI.has("compiled-css")
82
82
  style={{
83
83
  padding: 20,
84
84
  paddingBottom: 50,
@@ -94,14 +94,14 @@ function Content({ children }: { children: React.ReactNode }) {
94
94
  function Logo() {
95
95
  return (
96
96
  <div
97
- //# BATI.has("tailwindcss")
97
+ // $$.BATI.has("tailwindcss")
98
98
  className={"p-5 mb-2"}
99
- //# BATI.has("compiled-css")
99
+ // $$.BATI.has("compiled-css")
100
100
  css={{
101
101
  padding: 20,
102
102
  marginBottom: 8,
103
103
  }}
104
- //# !BATI.has("tailwindcss") && !BATI.has("compiled-css")
104
+ // !$$.BATI.has("tailwindcss") && !$$.BATI.has("compiled-css")
105
105
  style={{
106
106
  marginTop: 20,
107
107
  marginBottom: 10,
@@ -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: [vikeReact],
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
  };
@@ -4,7 +4,7 @@ export default function Page() {
4
4
  return (
5
5
  <>
6
6
  <h1
7
- //# BATI.has("compiled-css")
7
+ // $$.BATI.has("compiled-css")
8
8
  css={{ fontWeight: "700", fontSize: "1.875rem", paddingBottom: "1rem" }}
9
9
  >
10
10
  My Vike app
@@ -6,13 +6,13 @@ export function Counter() {
6
6
  return (
7
7
  <button
8
8
  type="button"
9
- //# BATI.has("tailwindcss")
9
+ // $$.BATI.has("tailwindcss")
10
10
  className={
11
- BATI.has("daisyui")
11
+ $$.BATI.has("daisyui")
12
12
  ? "btn"
13
13
  : "inline-block border border-black rounded bg-gray-200 px-2 py-1 text-xs font-medium uppercase leading-normal"
14
14
  }
15
- //# BATI.has("compiled-css")
15
+ // $$.BATI.has("compiled-css")
16
16
  css={{
17
17
  display: "inline-block",
18
18
  border: "1px solid black",
@@ -25,12 +25,12 @@ export function TodoList() {
25
25
  const text = newTodo;
26
26
  setTodoItems((prev) => [...prev, { text }]);
27
27
  setNewTodo("");
28
- if (BATI.hasServer) {
29
- if (BATI.has("telefunc")) {
28
+ if ($$.BATI.hasServer) {
29
+ if ($$.BATI.has("telefunc")) {
30
30
  await onNewTodo({ text });
31
- } else if (BATI.has("trpc")) {
31
+ } else if ($$.BATI.has("trpc")) {
32
32
  await trpc.onNewTodo.mutate(text);
33
- } else if (BATI.has("ts-rest")) {
33
+ } else if ($$.BATI.has("ts-rest")) {
34
34
  await client.createTodo({ body: { text } });
35
35
  } else {
36
36
  const response = await fetch("/api/todo/create", {
@@ -50,14 +50,14 @@ export function TodoList() {
50
50
  aria-label="New to-do"
51
51
  onChange={(ev) => setNewTodo(ev.target.value)}
52
52
  value={newTodo}
53
- //# BATI.has("tailwindcss")
53
+ // $$.BATI.has("tailwindcss")
54
54
  className={
55
55
  "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"
56
56
  }
57
57
  />
58
58
  <button
59
59
  type="submit"
60
- //# BATI.has("tailwindcss")
60
+ // $$.BATI.has("tailwindcss")
61
61
  className={
62
62
  "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"
63
63
  }
@@ -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
@@ -20,7 +20,7 @@ export default function Page() {
20
20
  await authClient.signOut();
21
21
  await navigate("/");
22
22
  }}
23
- //# BATI.has("tailwindcss")
23
+ // $$.BATI.has("tailwindcss")
24
24
  className={
25
25
  "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"
26
26
  }
@@ -32,7 +32,7 @@ export default function Page() {
32
32
  required
33
33
  value={email}
34
34
  onChange={(ev) => setEmail(ev.target.value)}
35
- //# BATI.has("tailwindcss")
35
+ // $$.BATI.has("tailwindcss")
36
36
  className={
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
  onChange={(ev) => setPassword(ev.target.value)}
49
- //# BATI.has("tailwindcss")
49
+ // $$.BATI.has("tailwindcss")
50
50
  className={
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
  className={
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
  className={
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
  onChange={(ev) => setName(ev.target.value)}
36
- //# BATI.has("tailwindcss")
36
+ // $$.BATI.has("tailwindcss")
37
37
  className={
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
  onChange={(ev) => setEmail(ev.target.value)}
50
- //# BATI.has("tailwindcss")
50
+ // $$.BATI.has("tailwindcss")
51
51
  className={
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
  onChange={(ev) => setPassword(ev.target.value)}
65
- //# BATI.has("tailwindcss")
65
+ // $$.BATI.has("tailwindcss")
66
66
  className={
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
  className={
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
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { addVitePlugin, deepMergeObject, loadAsMagicast } from "@batijs/core";
3
+ import { addVitePlugin, defineConfigArg, mergeObject, transformConfig } from "@batijs/core";
4
4
  //#region ../../boilerplates/sentry/dist/files/$vite.config.ts.mjs
5
- async function getViteConfig(props) {
6
- const mod = await loadAsMagicast(props);
7
- addVitePlugin(mod, {
8
- from: "@sentry/vite-plugin",
9
- constructor: "sentryVitePlugin",
10
- imported: "sentryVitePlugin",
11
- options: { sourcemaps: { disable: false } }
5
+ function getViteConfig(props) {
6
+ return transformConfig(props, (root) => {
7
+ addVitePlugin(root, {
8
+ from: "@sentry/vite-plugin",
9
+ constructor: "sentryVitePlugin",
10
+ named: true,
11
+ options: `{ sourcemaps: { disable: false } }`
12
+ });
13
+ mergeObject(defineConfigArg(root), { build: { sourcemap: "true" } });
12
14
  });
13
- deepMergeObject(mod.exports.default.$args[0], { build: { sourcemap: true } });
14
- return mod.generate().code;
15
15
  }
16
16
  //#endregion
17
17
  export { getViteConfig as default };
@@ -1,23 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { builders, generateCode, loadAsMagicast, parseModule } from "@batijs/core";
3
+ import { transformConfig } from "@batijs/core";
4
4
  //#region ../../boilerplates/sentry/dist/files/pages/$+client.ts.mjs
5
- async function getViteConfig(props) {
6
- let mod;
7
- try {
8
- mod = await loadAsMagicast(props);
9
- } catch {
10
- mod = parseModule("");
11
- }
12
- if (!props.meta.BATI.has("vue")) {
13
- mod.imports.$prepend({
14
- from: "../sentry.browser.config",
15
- imported: "sentryBrowserConfig"
16
- });
17
- const c = generateCode(builders.functionCall("sentryBrowserConfig")).code;
18
- mod.$ast.body.splice(mod.$ast.body.length - 1, 0, c);
19
- }
20
- return mod.generate().code;
5
+ const IMPORT = `import { sentryBrowserConfig } from "../sentry.browser.config";`;
6
+ const CALL = `sentryBrowserConfig();`;
7
+ async function getClientEntry(props) {
8
+ if (props.meta.BATI.has("vue")) return void 0;
9
+ if ((await props.readfile?.() ?? "").trim() === "") return `${IMPORT}\n\n${CALL}\n`;
10
+ return transformConfig(props, (root) => {
11
+ root.ensureImport(IMPORT);
12
+ const exp = root.find("export_statement").first();
13
+ if (exp.size() > 0) exp.insertBefore(`${CALL}\n\n`);
14
+ });
21
15
  }
22
16
  //#endregion
23
- export { getViteConfig as default };
17
+ export { getClientEntry 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