@batijs/cli 0.0.648 → 0.0.650

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 (103) hide show
  1. package/dist/{asset-package.json-wG-7DxN0.js → asset-package.json-2qBJNO7t.js} +1 -0
  2. package/dist/{asset-package.json-C2F4isEr.js → asset-package.json-9qjIK96w.js} +1 -1
  3. package/dist/{asset-package.json-CtCTaN5n.js → asset-package.json-CAXFrLbi.js} +1 -1
  4. package/dist/{asset-package.json-45oDzgS0.js → asset-package.json-CK8Focys.js} +1 -1
  5. package/dist/{asset-package.json-CDq-96lS.js → asset-package.json-Cr9kL--9.js} +1 -1
  6. package/dist/{asset-package.json-C4csvBBQ.js → asset-package.json-Dp8_jZlq.js} +1 -1
  7. package/dist/{asset-package.json-D0EjbpfM.js → asset-package.json-JX4l_iJo.js} +1 -1
  8. package/dist/{asset-package.json-DRdzE2Je.js → asset-package.json-Si0Lg6sw.js} +1 -1
  9. package/dist/{asset-package.json-DYpf4_Bg.js → asset-package.json-Wd5j3EKB.js} +1 -1
  10. package/dist/{asset-package.json-CJ6IZoCo.js → asset-package.json-sQTpc26W.js} +1 -1
  11. package/dist/boilerplates/@batijs/auth0/bati.config.mjs +1 -1
  12. package/dist/boilerplates/@batijs/authjs/bati.config.mjs +1 -1
  13. package/dist/boilerplates/@batijs/authjs/files/$package.json.js +1 -1
  14. package/dist/boilerplates/@batijs/authjs/files/asset-package.json.mjs +1 -0
  15. package/dist/boilerplates/@batijs/authjs/files/server/authjs-handler.ts +1 -8
  16. package/dist/boilerplates/@batijs/aws/bati.config.mjs +1 -1
  17. package/dist/boilerplates/@batijs/better-auth/bati.config.mjs +1 -1
  18. package/dist/boilerplates/@batijs/better-auth/files/$package.json.js +2 -2
  19. package/dist/boilerplates/@batijs/better-auth/files/asset-package.json.mjs +1 -1
  20. package/dist/boilerplates/@batijs/better-auth/files/database/better-auth/migrate.ts +1 -1
  21. package/dist/boilerplates/@batijs/better-auth/files/server/better-auth.ts +1 -7
  22. package/dist/boilerplates/@batijs/biome/bati.config.mjs +1 -1
  23. package/dist/boilerplates/@batijs/cloudflare/bati.config.mjs +1 -1
  24. package/dist/boilerplates/@batijs/compiled/bati.config.mjs +1 -1
  25. package/dist/boilerplates/@batijs/d1/bati.config.mjs +1 -1
  26. package/dist/boilerplates/@batijs/d1-kysely/bati.config.mjs +1 -1
  27. package/dist/boilerplates/@batijs/d1-sqlite/bati.config.mjs +1 -1
  28. package/dist/boilerplates/@batijs/docker-compose/bati.config.mjs +1 -1
  29. package/dist/boilerplates/@batijs/docker-compose/files/$Dockerfile.js +5 -39
  30. package/dist/boilerplates/@batijs/dokploy/bati.config.mjs +1 -1
  31. package/dist/boilerplates/@batijs/drizzle/bati.config.mjs +6 -1
  32. package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +2 -6
  33. package/dist/boilerplates/@batijs/drizzle/files/asset-package.json.mjs +1 -1
  34. package/dist/boilerplates/@batijs/drizzle/files/drizzle.config.ts +1 -1
  35. package/dist/boilerplates/@batijs/edgeone/bati.config.mjs +1 -1
  36. package/dist/boilerplates/@batijs/elysia/bati.config.mjs +1 -1
  37. package/dist/boilerplates/@batijs/elysia/files/$package.json.js +2 -2
  38. package/dist/boilerplates/@batijs/elysia/files/+server.ts +1 -1
  39. package/dist/boilerplates/@batijs/elysia/files/asset-package.json.mjs +1 -1
  40. package/dist/boilerplates/@batijs/eslint/bati.config.mjs +1 -1
  41. package/dist/boilerplates/@batijs/express/bati.config.mjs +1 -1
  42. package/dist/boilerplates/@batijs/express/files/$package.json.js +2 -2
  43. package/dist/boilerplates/@batijs/express/files/+server.ts +1 -1
  44. package/dist/boilerplates/@batijs/express/files/asset-package.json.mjs +1 -1
  45. package/dist/boilerplates/@batijs/fastify/bati.config.mjs +1 -1
  46. package/dist/boilerplates/@batijs/fastify/files/$package.json.js +2 -2
  47. package/dist/boilerplates/@batijs/fastify/files/+server.ts +1 -1
  48. package/dist/boilerplates/@batijs/fastify/files/asset-package.json.mjs +1 -1
  49. package/dist/boilerplates/@batijs/google-analytics/bati.config.mjs +1 -1
  50. package/dist/boilerplates/@batijs/hono/bati.config.mjs +1 -1
  51. package/dist/boilerplates/@batijs/hono/files/$package.json.js +2 -2
  52. package/dist/boilerplates/@batijs/hono/files/+server.ts +1 -1
  53. package/dist/boilerplates/@batijs/hono/files/asset-package.json.mjs +1 -1
  54. package/dist/boilerplates/@batijs/kysely/bati.config.mjs +2 -1
  55. package/dist/boilerplates/@batijs/kysely/files/$package.json.js +2 -2
  56. package/dist/boilerplates/@batijs/kysely/files/asset-package.json.mjs +1 -1
  57. package/dist/boilerplates/@batijs/kysely/files/database/kysely/db.ts +1 -1
  58. package/dist/boilerplates/@batijs/kysely/files/database/kysely/migrate.ts +3 -2
  59. package/dist/boilerplates/@batijs/mantine/bati.config.mjs +1 -1
  60. package/dist/boilerplates/@batijs/netlify/bati.config.mjs +1 -1
  61. package/dist/boilerplates/@batijs/oxlint/bati.config.mjs +1 -1
  62. package/dist/boilerplates/@batijs/plausible.io/bati.config.mjs +1 -1
  63. package/dist/boilerplates/@batijs/pnpm/bati.config.mjs +1 -1
  64. package/dist/boilerplates/@batijs/postgres/bati.config.mjs +2 -1
  65. package/dist/boilerplates/@batijs/postgres/files/$package.json.js +2 -2
  66. package/dist/boilerplates/@batijs/postgres/files/asset-package.json.mjs +1 -1
  67. package/dist/boilerplates/@batijs/postgres/files/database/postgres/schema/todos.ts +1 -1
  68. package/dist/boilerplates/@batijs/prettier/bati.config.mjs +1 -1
  69. package/dist/boilerplates/@batijs/prisma/bati.config.mjs +1 -1
  70. package/dist/boilerplates/@batijs/react/bati.config.mjs +1 -1
  71. package/dist/boilerplates/@batijs/react-better-auth/bati.config.mjs +1 -1
  72. package/dist/boilerplates/@batijs/react-sentry/bati.config.mjs +1 -1
  73. package/dist/boilerplates/@batijs/sentry/bati.config.mjs +1 -1
  74. package/dist/boilerplates/@batijs/shadcn-ui/bati.config.mjs +1 -1
  75. package/dist/boilerplates/@batijs/shared/bati.config.mjs +1 -1
  76. package/dist/boilerplates/@batijs/shared-db/bati.config.mjs +1 -1
  77. package/dist/boilerplates/@batijs/shared-env/bati.config.mjs +12 -0
  78. package/dist/boilerplates/@batijs/shared-env/files/server/env.ts +10 -0
  79. package/dist/boilerplates/@batijs/shared-env/files/server/load.ts +29 -0
  80. package/dist/boilerplates/@batijs/shared-env/types/server/env.d.mts +6 -0
  81. package/dist/boilerplates/@batijs/shared-env/types/server/load.d.mts +13 -0
  82. package/dist/boilerplates/@batijs/shared-server/bati.config.mjs +1 -1
  83. package/dist/boilerplates/@batijs/shared-todo/bati.config.mjs +1 -1
  84. package/dist/boilerplates/@batijs/solid/bati.config.mjs +1 -1
  85. package/dist/boilerplates/@batijs/solid-better-auth/bati.config.mjs +1 -1
  86. package/dist/boilerplates/@batijs/solid-sentry/bati.config.mjs +1 -1
  87. package/dist/boilerplates/@batijs/sqlite/bati.config.mjs +2 -1
  88. package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +2 -2
  89. package/dist/boilerplates/@batijs/sqlite/files/asset-package.json.mjs +1 -1
  90. package/dist/boilerplates/@batijs/sqlite/files/database/sqlite/schema/todos.ts +1 -1
  91. package/dist/boilerplates/@batijs/storybook/bati.config.mjs +1 -1
  92. package/dist/boilerplates/@batijs/tailwindcss/bati.config.mjs +1 -1
  93. package/dist/boilerplates/@batijs/telefunc/bati.config.mjs +1 -1
  94. package/dist/boilerplates/@batijs/trpc/bati.config.mjs +1 -1
  95. package/dist/boilerplates/@batijs/ts-rest/bati.config.mjs +1 -1
  96. package/dist/boilerplates/@batijs/universal-deploy/bati.config.mjs +1 -1
  97. package/dist/boilerplates/@batijs/vercel/bati.config.mjs +1 -1
  98. package/dist/boilerplates/@batijs/vue/bati.config.mjs +1 -1
  99. package/dist/boilerplates/@batijs/vue-better-auth/bati.config.mjs +1 -1
  100. package/dist/boilerplates/@batijs/vue-sentry/bati.config.mjs +1 -1
  101. package/dist/boilerplates/boilerplates.json +6 -0
  102. package/dist/index.js +10 -5
  103. package/package.json +5 -5
@@ -17,6 +17,7 @@ var package_default = {
17
17
  devDependencies: {
18
18
  "@batijs/compile": "workspace:*",
19
19
  "@batijs/core": "workspace:*",
20
+ "@batijs/shared-env": "workspace:*",
20
21
  "@types/node": "^20.19.37",
21
22
  "@universal-middleware/core": "^0.4.17"
22
23
  },
@@ -17,10 +17,10 @@ var package_default = {
17
17
  devDependencies: {
18
18
  "@batijs/compile": "workspace:*",
19
19
  "@batijs/core": "workspace:*",
20
+ "@batijs/shared-env": "workspace:*",
20
21
  "@types/better-sqlite3": "^7.6.13",
21
22
  "@types/node": "^20.19.37",
22
23
  "better-sqlite3": "^12.10.0",
23
- "dotenv": "^17.4.2",
24
24
  "drizzle-kit": "^0.31.10",
25
25
  "drizzle-orm": "^0.45.2",
26
26
  "postgres": "^3.4.9"
@@ -17,11 +17,11 @@ var package_default = {
17
17
  devDependencies: {
18
18
  "@batijs/compile": "workspace:*",
19
19
  "@batijs/core": "workspace:*",
20
+ "@batijs/shared-env": "workspace:*",
20
21
  "@cloudflare/workers-types": "^4.20260608.1",
21
22
  "@types/better-sqlite3": "^7.6.13",
22
23
  "@types/node": "^20.19.37",
23
24
  "better-sqlite3": "^12.10.0",
24
- "dotenv": "^17.4.2",
25
25
  "kysely": "^0.29.2",
26
26
  "kysely-d1": "^0.4.0",
27
27
  "kysely-postgres-js": "^3.0.0",
@@ -21,6 +21,7 @@ var package_default = {
21
21
  "@batijs/compile": "workspace:*",
22
22
  "@batijs/core": "workspace:*",
23
23
  "@batijs/shared-db": "workspace:*",
24
+ "@batijs/shared-env": "workspace:*",
24
25
  "@batijs/shared-server": "workspace:*",
25
26
  "@batijs/telefunc": "workspace:*",
26
27
  "@batijs/trpc": "workspace:*",
@@ -28,7 +29,6 @@ var package_default = {
28
29
  "@trpc/server": "^11.17.0",
29
30
  "@types/node": "^20.19.37",
30
31
  "@vikejs/elysia": "^0.2.0",
31
- "dotenv": "^17.4.2",
32
32
  "elysia": "^1.4.28",
33
33
  "telefunc": "^0.2.20",
34
34
  "vike": "0.4.259",
@@ -21,6 +21,7 @@ var package_default = {
21
21
  "@batijs/compile": "workspace:*",
22
22
  "@batijs/core": "workspace:*",
23
23
  "@batijs/shared-db": "workspace:*",
24
+ "@batijs/shared-env": "workspace:*",
24
25
  "@batijs/shared-server": "workspace:*",
25
26
  "@batijs/telefunc": "workspace:*",
26
27
  "@batijs/trpc": "workspace:*",
@@ -29,7 +30,6 @@ var package_default = {
29
30
  "@types/express": "^5.0.6",
30
31
  "@types/node": "^20.19.37",
31
32
  "@vikejs/express": "^0.2.2",
32
- "dotenv": "^17.4.2",
33
33
  "express": "^5.2.1",
34
34
  "telefunc": "^0.2.20",
35
35
  "vike": "0.4.259",
@@ -21,6 +21,7 @@ var package_default = {
21
21
  "@batijs/compile": "workspace:*",
22
22
  "@batijs/core": "workspace:*",
23
23
  "@batijs/shared-db": "workspace:*",
24
+ "@batijs/shared-env": "workspace:*",
24
25
  "@batijs/shared-server": "workspace:*",
25
26
  "@batijs/telefunc": "workspace:*",
26
27
  "@batijs/trpc": "workspace:*",
@@ -29,7 +30,6 @@ var package_default = {
29
30
  "@types/aws-lambda": "^8.10.162",
30
31
  "@types/node": "^20.19.37",
31
32
  "@vikejs/hono": "^0.2.0",
32
- "dotenv": "^17.4.2",
33
33
  "hono": "^4.12.23",
34
34
  "telefunc": "^0.2.20",
35
35
  "vike": "0.4.259",
@@ -18,12 +18,12 @@ var package_default = {
18
18
  "@batijs/compile": "workspace:*",
19
19
  "@batijs/core": "workspace:*",
20
20
  "@batijs/drizzle": "workspace:*",
21
+ "@batijs/shared-env": "workspace:*",
21
22
  "@types/better-sqlite3": "^7.6.13",
22
23
  "@types/node": "^20.19.37",
23
24
  "@universal-middleware/core": "^0.4.17",
24
25
  "better-sqlite3": "^12.10.0",
25
26
  "drizzle-orm": "^0.45.2",
26
- "dotenv": "^17.4.2",
27
27
  "kysely": "^0.29.2",
28
28
  "kysely-d1": "^0.4.0",
29
29
  "kysely-postgres-js": "^3.0.0",
@@ -21,6 +21,7 @@ var package_default = {
21
21
  "@batijs/compile": "workspace:*",
22
22
  "@batijs/core": "workspace:*",
23
23
  "@batijs/shared-db": "workspace:*",
24
+ "@batijs/shared-env": "workspace:*",
24
25
  "@batijs/shared-server": "workspace:*",
25
26
  "@batijs/telefunc": "workspace:*",
26
27
  "@batijs/trpc": "workspace:*",
@@ -29,7 +30,6 @@ var package_default = {
29
30
  "@types/express": "^5.0.6",
30
31
  "@types/node": "^20.19.37",
31
32
  "@vikejs/fastify": "^0.2.4",
32
- "dotenv": "^17.4.2",
33
33
  "fastify": "^5.8.5",
34
34
  "fastify-raw-body": "^5.0.0",
35
35
  "telefunc": "^0.2.20",
@@ -17,10 +17,10 @@ var package_default = {
17
17
  devDependencies: {
18
18
  "@batijs/compile": "workspace:*",
19
19
  "@batijs/core": "workspace:*",
20
+ "@batijs/shared-env": "workspace:*",
20
21
  "@types/better-sqlite3": "^7.6.13",
21
22
  "@types/node": "^20.19.37",
22
23
  "better-sqlite3": "^12.10.0",
23
- "dotenv": "^17.4.2",
24
24
  "tsx": "^4.22.4"
25
25
  },
26
26
  files: ["dist/"],
@@ -17,8 +17,8 @@ var package_default = {
17
17
  devDependencies: {
18
18
  "@batijs/compile": "workspace:*",
19
19
  "@batijs/core": "workspace:*",
20
+ "@batijs/shared-env": "workspace:*",
20
21
  "@types/node": "^20.19.37",
21
- "dotenv": "^17.4.2",
22
22
  "postgres": "^3.4.9",
23
23
  "tsx": "^4.22.4"
24
24
  },
@@ -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 @@
3
3
  import { loadPackageJson } from "@batijs/core";
4
4
  //#region ../../boilerplates/authjs/dist/files/$package.json.mjs
5
5
  async function getPackageJson(props) {
6
- return (await loadPackageJson(props, await import("../../../../asset-package.json-wG-7DxN0.js").then((x) => x.default))).addDependencies(["@auth/core", "@universal-middleware/core"]);
6
+ return (await loadPackageJson(props, await import("../../../../asset-package.json-2qBJNO7t.js").then((x) => x.default))).addDependencies(["@auth/core", "@universal-middleware/core"]);
7
7
  }
8
8
  //#endregion
9
9
  export { getPackageJson as default };
@@ -15,6 +15,7 @@ var package_default = {
15
15
  devDependencies: {
16
16
  "@batijs/compile": "workspace:*",
17
17
  "@batijs/core": "workspace:*",
18
+ "@batijs/shared-env": "workspace:*",
18
19
  "@types/node": "^20.19.37",
19
20
  "@universal-middleware/core": "^0.4.17"
20
21
  },
@@ -1,17 +1,10 @@
1
- import { env as cloudflareEnv } from "cloudflare:workers";
2
1
  import { Auth, type AuthConfig, createActionURL, setEnvDefaults } from "@auth/core";
3
2
  import Auth0 from "@auth/core/providers/auth0";
4
3
  import CredentialsProvider from "@auth/core/providers/credentials";
5
4
  import type { Session } from "@auth/core/types";
5
+ import { env } from "@batijs/shared-env/server/env";
6
6
  import { enhance, type UniversalHandler, type UniversalMiddleware } from "@universal-middleware/core";
7
7
 
8
- //# BATI.has("auth0")
9
- const env: BATI.If<{ '!BATI.has("cloudflare")': Record<string, string | undefined> }> = BATI.has("cloudflare")
10
- ? (cloudflareEnv as BATI.Any)
11
- : typeof process?.env !== "undefined"
12
- ? process.env
13
- : {};
14
-
15
8
  const authjsConfig = {
16
9
  basePath: "/api/auth",
17
10
  trustHost: true,
@@ -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 @@
3
3
  import { loadPackageJson, packageManager } from "@batijs/core";
4
4
  //#region ../../boilerplates/better-auth/dist/files/$package.json.mjs
5
5
  async function getPackageJson(props) {
6
- const packageJson = await loadPackageJson(props, await import("../../../../asset-package.json-D0EjbpfM.js").then((x) => x.default));
6
+ const packageJson = await loadPackageJson(props, await import("../../../../asset-package.json-JX4l_iJo.js").then((x) => x.default));
7
7
  const { BATI } = props.meta;
8
8
  packageJson.addDependencies(["better-auth", "@universal-middleware/core"]);
9
9
  if (BATI.has("drizzle")) return packageJson;
@@ -13,7 +13,7 @@ async function getPackageJson(props) {
13
13
  return packageJson.setScript("better-auth:migrate", {
14
14
  value: `${bunDirect ? "bun" : "tsx"} ./database/better-auth/migrate.ts`,
15
15
  precedence: 20
16
- }).addDevDependencies(["tsx"], ["better-auth:migrate"], !bunDirect).addDependencies(["dotenv"]).addDependencies([
16
+ }).addDevDependencies(["tsx"], ["better-auth:migrate"], !bunDirect).addDependencies([
17
17
  "postgres",
18
18
  "kysely",
19
19
  "kysely-postgres-js"
@@ -16,12 +16,12 @@ var package_default = {
16
16
  "@batijs/compile": "workspace:*",
17
17
  "@batijs/core": "workspace:*",
18
18
  "@batijs/drizzle": "workspace:*",
19
+ "@batijs/shared-env": "workspace:*",
19
20
  "@types/better-sqlite3": "^7.6.13",
20
21
  "@types/node": "^20.19.37",
21
22
  "@universal-middleware/core": "^0.4.17",
22
23
  "better-sqlite3": "^12.10.0",
23
24
  "drizzle-orm": "^0.45.2",
24
- "dotenv": "^17.4.2",
25
25
  "kysely": "^0.29.2",
26
26
  "kysely-d1": "^0.4.0",
27
27
  "kysely-postgres-js": "^3.0.0",
@@ -1,6 +1,6 @@
1
1
  /*{ @if (!it.BATI.hasD1 && !it.BATI.has("drizzle")) }*/
2
2
 
3
- import "dotenv/config";
3
+ import "@batijs/shared-env/server/load";
4
4
  import { getMigrations } from "better-auth/db/migration";
5
5
  import { getAuthConfig } from "../../server/better-auth";
6
6
 
@@ -1,5 +1,5 @@
1
- import { env as cloudflareEnv } from "cloudflare:workers";
2
1
  import { dbD1, dbPostgres, dbSqlite } from "@batijs/drizzle/database/drizzle/db";
2
+ import { env } from "@batijs/shared-env/server/env";
3
3
  import type { RuntimeAdapter } from "@universal-middleware/core";
4
4
  import type { BetterAuthOptions } from "better-auth";
5
5
  import { drizzleAdapter } from "better-auth/adapters/drizzle";
@@ -10,12 +10,6 @@ import { PostgresJSDialect } from "kysely-postgres-js";
10
10
  import postgres from "postgres";
11
11
  import * as authSchema from "../database/drizzle/schema/auth";
12
12
 
13
- const env: BATI.If<{ '!BATI.has("cloudflare")': Record<string, string | undefined> }> = BATI.has("cloudflare")
14
- ? (cloudflareEnv as BATI.Any)
15
- : typeof process?.env !== "undefined"
16
- ? process.env
17
- : {};
18
-
19
13
  //# BATI.hasD1
20
14
  function getD1(runtime?: RuntimeAdapter): D1Database {
21
15
  if (runtime?.runtime === "workerd" && runtime.env) {
@@ -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
@@ -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
@@ -19,44 +19,10 @@ async function getDockerfile(props) {
19
19
  const run = pm.run;
20
20
  const config = dockerPackageManager(pm.name, { frozenLockfile: !meta.BATI_TEST });
21
21
  const startupMigrations = [];
22
- const migrationCopies = [];
23
- if (meta.BATI.has("drizzle")) {
24
- startupMigrations.push(`${run} drizzle:migrate`);
25
- migrationCopies.push({
26
- sources: ["/app/database/migrations"],
27
- dest: "./database/migrations",
28
- from: "deps-dev"
29
- });
30
- migrationCopies.push({
31
- sources: ["/app/drizzle.config.ts"],
32
- dest: "./drizzle.config.ts",
33
- from: "builder"
34
- });
35
- }
36
- if (meta.BATI.has("kysely")) {
37
- startupMigrations.push(`${nodeCli} ./dist/server/migrate.mjs`);
38
- migrationCopies.push({
39
- sources: ["/app/database/kysely/migrations"],
40
- dest: "./dist/server/migrations",
41
- from: "builder"
42
- });
43
- }
44
- if (meta.BATI.has("sqlite") && !meta.BATI.hasOrm) {
45
- startupMigrations.push(`${run} sqlite:migrate`);
46
- migrationCopies.push({
47
- sources: ["/app/database/sqlite"],
48
- dest: "./database/sqlite",
49
- from: "builder"
50
- });
51
- }
52
- if (meta.BATI.has("postgres") && !meta.BATI.hasOrm) {
53
- startupMigrations.push(`${run} postgres:migrate`);
54
- migrationCopies.push({
55
- sources: ["/app/database/postgres"],
56
- dest: "./database/postgres",
57
- from: "builder"
58
- });
59
- }
22
+ if (meta.BATI.has("drizzle")) startupMigrations.push(`${run} drizzle:migrate`);
23
+ if (meta.BATI.has("kysely")) startupMigrations.push(`${nodeCli} ./dist/server/migrate.mjs`);
24
+ if (meta.BATI.has("sqlite") && !meta.BATI.hasOrm) startupMigrations.push(`${run} sqlite:migrate`);
25
+ if (meta.BATI.has("postgres") && !meta.BATI.hasOrm) startupMigrations.push(`${run} postgres:migrate`);
60
26
  const startCmd = startupMigrations.length > 0 ? [
61
27
  "sh",
62
28
  "-c",
@@ -81,7 +47,7 @@ async function getDockerfile(props) {
81
47
  }).pipe((b) => {
82
48
  for (const group of serverEnvDefaults(props.env)) b.env(group.vars, { comment: group.comment });
83
49
  }).when(config.corepack, (b) => b.run("corepack enable")).copy(installSources, "./").copy(["/app/node_modules"], "./node_modules", { from: "deps-prod" }).copy(["/app/dist"], "./dist", { from: "builder" }).pipe((b) => {
84
- for (const { sources, dest, from } of migrationCopies) b.copy(sources, dest, { from });
50
+ for (const file of props.deploy) b.copy([`/app/${file}`], `./${file}`, { from: "deps-dev" });
85
51
  }).expose(3e3).cmd(startCmd).build()}\n`;
86
52
  }
87
53
  //#endregion
@@ -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,11 @@ var bati_config_default = t({
11
11
  if(meta) {
12
12
  return meta.BATI.has("drizzle");
13
13
  },
14
+ deploy: [
15
+ "database/migrations",
16
+ "drizzle.config.ts",
17
+ "server/load.ts"
18
+ ],
14
19
  nextSteps(_meta, packageManager, { bold }) {
15
20
  return [
16
21
  {
@@ -3,7 +3,7 @@
3
3
  import { loadPackageJson } from "@batijs/core";
4
4
  //#region ../../boilerplates/drizzle/dist/files/$package.json.mjs
5
5
  async function getPackageJson(props) {
6
- const packageJson = await loadPackageJson(props, await import("../../../../asset-package.json-C2F4isEr.js").then((x) => x.default));
6
+ const packageJson = await loadPackageJson(props, await import("../../../../asset-package.json-9qjIK96w.js").then((x) => x.default));
7
7
  const hasPostgres = props.meta.BATI.has("postgres");
8
8
  const hasSqliteEngine = !props.meta.BATI.hasD1 && !hasPostgres;
9
9
  return packageJson.setScript("drizzle:generate", {
@@ -15,11 +15,7 @@ async function getPackageJson(props) {
15
15
  }).setScript("drizzle:studio", {
16
16
  value: "drizzle-kit studio",
17
17
  precedence: 20
18
- }).addDependencies([
19
- "drizzle-kit",
20
- "drizzle-orm",
21
- "dotenv"
22
- ]).addDevDependencies(["@types/better-sqlite3"], hasSqliteEngine).addDependencies(["better-sqlite3"], hasSqliteEngine).addDependencies(["postgres"], hasPostgres);
18
+ }).addDependencies(["drizzle-kit", "drizzle-orm"]).addDevDependencies(["@types/better-sqlite3"], hasSqliteEngine).addDependencies(["better-sqlite3"], hasSqliteEngine).addDependencies(["postgres"], hasPostgres);
23
19
  }
24
20
  //#endregion
25
21
  export { getPackageJson as default };
@@ -15,10 +15,10 @@ var package_default = {
15
15
  devDependencies: {
16
16
  "@batijs/compile": "workspace:*",
17
17
  "@batijs/core": "workspace:*",
18
+ "@batijs/shared-env": "workspace:*",
18
19
  "@types/better-sqlite3": "^7.6.13",
19
20
  "@types/node": "^20.19.37",
20
21
  "better-sqlite3": "^12.10.0",
21
- "dotenv": "^17.4.2",
22
22
  "drizzle-kit": "^0.31.10",
23
23
  "drizzle-orm": "^0.45.2",
24
24
  "postgres": "^3.4.9"
@@ -1,4 +1,4 @@
1
- import "dotenv/config";
1
+ import "@batijs/shared-env/server/load";
2
2
  import { defineConfig } from "drizzle-kit";
3
3
 
4
4
  if (!BATI.hasD1) {
@@ -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,11 +3,11 @@
3
3
  import { loadPackageJson } from "@batijs/core";
4
4
  //#region ../../boilerplates/elysia/dist/files/$package.json.mjs
5
5
  async function getPackageJson(props) {
6
- return (await loadPackageJson(props, await import("../../../../asset-package.json-45oDzgS0.js").then((x) => x.default))).addDevDependencies(["@types/node", "vite"]).addDependencies([
6
+ return (await loadPackageJson(props, await import("../../../../asset-package.json-CK8Focys.js").then((x) => x.default))).addDevDependencies(["@types/node", "vite"]).addDependencies([
7
7
  "@vikejs/elysia",
8
8
  "elysia",
9
9
  "vike"
10
- ]).addDependencies(["dotenv"], (props.meta.BATI.has("auth0") || props.meta.BATI.hasDatabase) && !props.meta.BATI.has("cloudflare"));
10
+ ]);
11
11
  }
12
12
  //#endregion
13
13
  export { getPackageJson as default };
@@ -1,5 +1,5 @@
1
1
  // (BATI.has("auth0") || BATI.hasDatabase) && !BATI.has("cloudflare")
2
- import "dotenv/config";
2
+ import "@batijs/shared-env/server/load";
3
3
  import type { Server } from "vike/types";
4
4
  import { app } from "./server/elysia";
5
5
 
@@ -19,6 +19,7 @@ var package_default = {
19
19
  "@batijs/compile": "workspace:*",
20
20
  "@batijs/core": "workspace:*",
21
21
  "@batijs/shared-db": "workspace:*",
22
+ "@batijs/shared-env": "workspace:*",
22
23
  "@batijs/shared-server": "workspace:*",
23
24
  "@batijs/telefunc": "workspace:*",
24
25
  "@batijs/trpc": "workspace:*",
@@ -26,7 +27,6 @@ var package_default = {
26
27
  "@trpc/server": "^11.17.0",
27
28
  "@types/node": "^20.19.37",
28
29
  "@vikejs/elysia": "^0.2.0",
29
- "dotenv": "^17.4.2",
30
30
  "elysia": "^1.4.28",
31
31
  "telefunc": "^0.2.20",
32
32
  "vike": "0.4.259",