@batijs/cli 0.0.210 → 0.0.212

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 (44) hide show
  1. package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
  2. package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
  3. package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +3 -3
  4. package/dist/boilerplates/@batijs/edgedb/files/$package.json.js +1 -1
  5. package/dist/boilerplates/@batijs/express/files/$package.json.js +6 -4
  6. package/dist/boilerplates/@batijs/fastify/files/$package.json.js +7 -5
  7. package/dist/boilerplates/@batijs/firebase-auth/files/$README.md.js +1 -1
  8. package/dist/boilerplates/@batijs/firebase-auth/files/$package.json.js +5 -5
  9. package/dist/boilerplates/@batijs/firebase-auth/files/pages/{+firebaseApp.ts → +client.ts} +0 -3
  10. package/dist/boilerplates/@batijs/firebase-auth/files/server/firebase-auth-middleware.ts +1 -1
  11. package/dist/boilerplates/@batijs/firebase-auth/files/vike.d.ts +0 -4
  12. package/dist/boilerplates/@batijs/firebase-auth/types/pages/+client.d.ts +1 -0
  13. package/dist/boilerplates/@batijs/h3/files/$package.json.js +6 -4
  14. package/dist/boilerplates/@batijs/hattip/files/$package.json.js +5 -3
  15. package/dist/boilerplates/@batijs/hono/files/$package.json.js +13 -5
  16. package/dist/boilerplates/@batijs/hono/files/hono-entry.node.ts +29 -0
  17. package/dist/boilerplates/@batijs/hono/files/hono-entry.ts +1 -29
  18. package/dist/boilerplates/@batijs/hono/types/hono-entry.node.d.ts +1 -0
  19. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +2 -2
  20. package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
  21. package/dist/boilerplates/@batijs/react/files/pages/+config.ts +0 -11
  22. package/dist/boilerplates/@batijs/react/types/pages/+config.d.ts +0 -8
  23. package/dist/boilerplates/@batijs/shared/files/package.json +1 -1
  24. package/dist/boilerplates/@batijs/shared-no-db/files/$package.json.js +2 -3
  25. package/dist/boilerplates/@batijs/shared-no-db/files/database/todoItems.ts +3 -6
  26. package/dist/boilerplates/@batijs/shared-no-db/types/database/todoItems.d.ts +6 -5
  27. package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +2 -2
  28. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +2 -3
  29. package/dist/boilerplates/@batijs/solid/files/$package.json.js +2 -2
  30. package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +1 -12
  31. package/dist/boilerplates/@batijs/solid/types/pages/+config.d.ts +0 -8
  32. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +3 -3
  33. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +2 -2
  34. package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +2 -2
  35. package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
  36. package/dist/boilerplates/@batijs/trpc/files/trpc/server.ts +2 -2
  37. package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +2 -2
  38. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
  39. package/dist/boilerplates/@batijs/vue/files/$package.json.js +4 -4
  40. package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +1 -12
  41. package/dist/boilerplates/@batijs/vue/types/pages/+config.d.ts +0 -8
  42. package/dist/index.js +4 -4
  43. package/package.json +8 -8
  44. package/dist/boilerplates/@batijs/firebase-auth/types/pages/+firebaseApp.d.ts +0 -3
@@ -42,7 +42,7 @@ var require_package = __commonJS({
42
42
  license: "MIT",
43
43
  devDependencies: {
44
44
  "@batijs/compile": "workspace:*",
45
- "@biomejs/biome": "1.8.2",
45
+ "@biomejs/biome": "1.8.3",
46
46
  "@types/node": "^18.19.14"
47
47
  },
48
48
  dependencies: {
@@ -43,7 +43,7 @@ var require_package = __commonJS({
43
43
  devDependencies: {
44
44
  "@batijs/compile": "workspace:*",
45
45
  "@types/node": "^18.19.14",
46
- vite: "^5.3.1",
46
+ vite: "^5.3.2",
47
47
  "vite-plugin-compiled-react": "^1.1.3"
48
48
  },
49
49
  dependencies: {
@@ -44,10 +44,10 @@ var require_package = __commonJS({
44
44
  "@batijs/compile": "workspace:*",
45
45
  "@types/better-sqlite3": "^7.6.10",
46
46
  "@types/node": "^18.19.14",
47
- "better-sqlite3": "^11.0.0",
48
- "drizzle-kit": "^0.22.7",
47
+ "better-sqlite3": "^11.1.1",
48
+ "drizzle-kit": "^0.22.8",
49
49
  "drizzle-orm": "^0.31.2",
50
- tsx: "^4.15.7"
50
+ tsx: "^4.16.0"
51
51
  },
52
52
  dependencies: {
53
53
  "@batijs/core": "workspace:*"
@@ -43,7 +43,7 @@ var require_package = __commonJS({
43
43
  devDependencies: {
44
44
  "@batijs/compile": "workspace:*",
45
45
  "@edgedb/generate": "^0.5.3",
46
- "@prisma/client": "^5.15.1",
46
+ "@prisma/client": "^5.16.1",
47
47
  "@types/node": "^18.19.14",
48
48
  colorette: "^2.0.20",
49
49
  edgedb: "^1.5.7"
@@ -56,13 +56,14 @@ var require_package = __commonJS({
56
56
  "@types/node": "^18.19.14",
57
57
  "@universal-middleware/express": "^0.0.2",
58
58
  "cookie-parser": "^1.4.6",
59
+ "cross-env": "^7.0.3",
59
60
  dotenv: "^16.4.5",
60
61
  express: "^4.19.2",
61
62
  "express-openid-connect": "^2.17.1",
62
- telefunc: "^0.1.74",
63
- tsx: "^4.15.7",
63
+ telefunc: "^0.1.75",
64
+ tsx: "^4.16.0",
64
65
  vike: "^0.4.177",
65
- vite: "^5.3.1"
66
+ vite: "^5.3.2"
66
67
  },
67
68
  dependencies: {
68
69
  "@batijs/core": "workspace:*"
@@ -107,7 +108,7 @@ async function getPackageJson(props) {
107
108
  warnIfReplaced: true
108
109
  },
109
110
  preview: {
110
- value: "NODE_ENV=production tsx ./express-entry.ts",
111
+ value: "cross-env NODE_ENV=production tsx ./express-entry.ts",
111
112
  precedence: 20
112
113
  }
113
114
  });
@@ -118,6 +119,7 @@ async function getPackageJson(props) {
118
119
  ],
119
120
  dependencies: [
120
121
  "@universal-middleware/express",
122
+ "cross-env",
121
123
  "express",
122
124
  "tsx",
123
125
  "vite",
@@ -56,12 +56,13 @@ var require_package = __commonJS({
56
56
  "@types/express": "^4.17.21",
57
57
  "@types/node": "^18.19.14",
58
58
  "@universal-middleware/express": "^0.0.2",
59
+ "cross-env": "^7.0.3",
59
60
  dotenv: "^16.4.5",
60
- fastify: "^4.28.0",
61
- telefunc: "^0.1.74",
62
- tsx: "^4.15.7",
61
+ fastify: "^4.28.1",
62
+ telefunc: "^0.1.75",
63
+ tsx: "^4.16.0",
63
64
  vike: "^0.4.177",
64
- vite: "^5.3.1"
65
+ vite: "^5.3.2"
65
66
  },
66
67
  dependencies: {
67
68
  "@batijs/core": "workspace:*"
@@ -106,7 +107,7 @@ async function getPackageJson(props) {
106
107
  warnIfReplaced: true
107
108
  },
108
109
  preview: {
109
- value: "NODE_ENV=production tsx ./fastify-entry.ts",
110
+ value: "cross-env NODE_ENV=production tsx ./fastify-entry.ts",
110
111
  precedence: 20
111
112
  }
112
113
  });
@@ -116,6 +117,7 @@ async function getPackageJson(props) {
116
117
  "@fastify/middie",
117
118
  "@fastify/static",
118
119
  "@universal-middleware/express",
120
+ "cross-env",
119
121
  "fastify",
120
122
  "tsx",
121
123
  "vike",
@@ -6,7 +6,7 @@ async function getReadme(props) {
6
6
  ## *Firebase*
7
7
  - You first need to **[Create a Firebase project](https://firebase.google.com/docs/web/setup#create-project)**.
8
8
  - Then register your app in the firebase console. **[Register your app](https://firebase.google.com/docs/web/setup#register-app)**
9
- - Copy Your web app's Firebase configuration and paste in \`/pages/+firebaseApp.ts\` Example :
9
+ - Copy Your web app's Firebase configuration and paste in \`/pages/+client.ts\` Example :
10
10
  \`\`\`ts
11
11
  const firebaseConfig = {
12
12
  apiKey: "",
@@ -50,7 +50,7 @@ var require_package = __commonJS({
50
50
  "firebase-admin": "^12.2.0",
51
51
  firebaseui: "^6.1.0",
52
52
  vike: "^0.4.177",
53
- vite: "^5.3.1"
53
+ vite: "^5.3.2"
54
54
  },
55
55
  dependencies: {
56
56
  "@batijs/core": "workspace:*"
@@ -70,8 +70,8 @@ var require_package = __commonJS({
70
70
  "./libs/firebaseUI": {
71
71
  types: "./dist/types/libs/firebaseUI.d.ts"
72
72
  },
73
- "./pages/+firebaseApp": {
74
- types: "./dist/types/pages/+firebaseApp.d.ts"
73
+ "./pages/+client": {
74
+ types: "./dist/types/pages/+client.d.ts"
75
75
  },
76
76
  "./pages/login/+config": {
77
77
  types: "./dist/types/pages/login/+config.d.ts"
@@ -91,8 +91,8 @@ var require_package = __commonJS({
91
91
  "libs/firebaseUI": [
92
92
  "./dist/types/libs/firebaseUI.d.ts"
93
93
  ],
94
- "pages/+firebaseApp": [
95
- "./dist/types/pages/+firebaseApp.d.ts"
94
+ "pages/+client": [
95
+ "./dist/types/pages/+client.d.ts"
96
96
  ],
97
97
  "pages/login/+config": [
98
98
  "./dist/types/pages/login/+config.d.ts"
@@ -28,6 +28,3 @@ const auth = getAuth(firebaseApp);
28
28
  // As httpOnly cookies are to be used, do not persist any state client side.
29
29
  // `inMemoryPersistence` is an implementation of Persistence of type 'NONE'.
30
30
  auth.setPersistence(inMemoryPersistence);
31
-
32
- // export the firebaseApp
33
- export default firebaseApp;
@@ -34,7 +34,7 @@ export async function firebaseAuthLoginHandler<Context extends Record<string | n
34
34
  try {
35
35
  const sessionCookie = await getAuth(firebaseAdmin).createSessionCookie(idToken, { expiresIn });
36
36
 
37
- const options = { maxAge: expiresIn / 1000, httpOnly: true, secure: true };
37
+ const options = { maxAge: expiresIn / 1000, httpOnly: true, secure: true, path: "/" };
38
38
 
39
39
  return new Response(JSON.stringify({ status: "success" }), {
40
40
  status: 200,
@@ -1,5 +1,4 @@
1
1
  import type { UserRecord } from "firebase-admin/auth";
2
- import type { FirebaseApp } from "firebase/app";
3
2
 
4
3
  declare global {
5
4
  // eslint-disable-next-line
@@ -7,9 +6,6 @@ declare global {
7
6
  interface PageContext {
8
7
  user?: UserRecord | null;
9
8
  }
10
- interface Config {
11
- firebaseApp?: FirebaseApp;
12
- }
13
9
  }
14
10
  }
15
11
 
@@ -55,13 +55,14 @@ var require_package = __commonJS({
55
55
  "@types/express": "^4.17.21",
56
56
  "@types/node": "^18.19.14",
57
57
  "@types/serve-static": "^1.15.7",
58
+ "cross-env": "^7.0.3",
58
59
  dotenv: "^16.4.5",
59
60
  h3: "~1.12.0",
60
61
  "serve-static": "^1.15.0",
61
- telefunc: "^0.1.74",
62
- tsx: "^4.15.7",
62
+ telefunc: "^0.1.75",
63
+ tsx: "^4.16.0",
63
64
  vike: "^0.4.177",
64
- vite: "^5.3.1"
65
+ vite: "^5.3.2"
65
66
  },
66
67
  dependencies: {
67
68
  "@batijs/core": "workspace:*"
@@ -106,7 +107,7 @@ async function getPackageJson(props) {
106
107
  warnIfReplaced: true
107
108
  },
108
109
  preview: {
109
- value: "NODE_ENV=production tsx ./h3-entry.ts",
110
+ value: "cross-env NODE_ENV=production tsx ./h3-entry.ts",
110
111
  precedence: 20
111
112
  }
112
113
  });
@@ -117,6 +118,7 @@ async function getPackageJson(props) {
117
118
  ],
118
119
  dependencies: [
119
120
  "@hattip/polyfills",
121
+ "cross-env",
120
122
  "h3",
121
123
  "serve-static",
122
124
  "tsx",
@@ -56,11 +56,12 @@ var require_package = __commonJS({
56
56
  "@hattip/vite": "^0.0.46",
57
57
  "@trpc/server": "^10.45.2",
58
58
  "@types/node": "^18.19.14",
59
+ "cross-env": "^7.0.3",
59
60
  dotenv: "^16.4.5",
60
61
  hattip: "^0.0.33",
61
- telefunc: "^0.1.74",
62
+ telefunc: "^0.1.75",
62
63
  vike: "^0.4.177",
63
- vite: "^5.3.1"
64
+ vite: "^5.3.2"
64
65
  },
65
66
  dependencies: {
66
67
  "@batijs/core": "workspace:*"
@@ -100,7 +101,7 @@ async function getPackageJson(props) {
100
101
  warnIfReplaced: true
101
102
  },
102
103
  build: {
103
- value: "NODE_ENV=production hattip build ./hattip-entry.ts --target es2022 --client",
104
+ value: "cross-env NODE_ENV=production hattip build ./hattip-entry.ts --target es2022 --client",
104
105
  precedence: 20,
105
106
  warnIfReplaced: true
106
107
  }
@@ -113,6 +114,7 @@ async function getPackageJson(props) {
113
114
  dependencies: [
114
115
  "@hattip/core",
115
116
  "@hattip/router",
117
+ "cross-env",
116
118
  "hattip",
117
119
  "vite",
118
120
  "vike",
@@ -54,12 +54,13 @@ var require_package = __commonJS({
54
54
  "@hono/vite-dev-server": "^0.12.2",
55
55
  "@trpc/server": "^10.45.2",
56
56
  "@types/node": "^18.19.14",
57
+ "cross-env": "^7.0.3",
57
58
  dotenv: "^16.4.5",
58
- hono: "^4.4.8",
59
- telefunc: "^0.1.74",
60
- tsx: "^4.15.7",
59
+ hono: "^4.4.10",
60
+ telefunc: "^0.1.75",
61
+ tsx: "^4.16.0",
61
62
  vike: "^0.4.177",
62
- vite: "^5.3.1"
63
+ vite: "^5.3.2"
63
64
  },
64
65
  dependencies: {
65
66
  "@batijs/core": "workspace:*"
@@ -75,12 +76,18 @@ var require_package = __commonJS({
75
76
  exports: {
76
77
  "./hono-entry": {
77
78
  types: "./dist/types/hono-entry.d.ts"
79
+ },
80
+ "./hono-entry.node": {
81
+ types: "./dist/types/hono-entry.node.d.ts"
78
82
  }
79
83
  },
80
84
  typesVersions: {
81
85
  "*": {
82
86
  "hono-entry": [
83
87
  "./dist/types/hono-entry.d.ts"
88
+ ],
89
+ "hono-entry.node": [
90
+ "./dist/types/hono-entry.node.d.ts"
84
91
  ]
85
92
  }
86
93
  }
@@ -104,7 +111,7 @@ async function getPackageJson(props) {
104
111
  warnIfReplaced: true
105
112
  },
106
113
  preview: {
107
- value: "NODE_ENV=production tsx ./hono-entry.ts",
114
+ value: "cross-env NODE_ENV=production tsx ./hono-entry.node.ts",
108
115
  precedence: 20
109
116
  }
110
117
  });
@@ -112,6 +119,7 @@ async function getPackageJson(props) {
112
119
  devDependencies: ["@hono/vite-dev-server", "@types/node"],
113
120
  dependencies: [
114
121
  "@hono/node-server",
122
+ "cross-env",
115
123
  "hono",
116
124
  "tsx",
117
125
  "vite",
@@ -0,0 +1,29 @@
1
+ import { serve } from "@hono/node-server";
2
+ import { serveStatic } from "@hono/node-server/serve-static";
3
+ import { Hono, type Context } from "hono";
4
+ import { env } from "hono/adapter";
5
+ import { compress } from "hono/compress";
6
+ import app from "./hono-entry.js";
7
+
8
+ const envs = env<{ NODE_ENV: string; PORT: string }>({ env: {} } as unknown as Context<object>);
9
+
10
+ const nodeApp = new Hono();
11
+
12
+ nodeApp.use(compress());
13
+
14
+ nodeApp.use(
15
+ "/assets/*",
16
+ serveStatic({
17
+ root: `./dist/client/`,
18
+ }),
19
+ );
20
+
21
+ nodeApp.mount("/", app.fetch);
22
+
23
+ const port = envs.PORT ? parseInt(envs.PORT, 10) : 3000;
24
+
25
+ console.log(`Server listening on http://localhost:${port}`);
26
+ serve({
27
+ fetch: nodeApp.fetch,
28
+ port: port,
29
+ });
@@ -11,17 +11,10 @@ import { vikeHandler } from "@batijs/shared-server/server/vike-handler";
11
11
  import { telefuncHandler } from "@batijs/telefunc/server/telefunc-handler";
12
12
  import { appRouter } from "@batijs/trpc/trpc/server";
13
13
  import { tsRestHandler } from "@batijs/ts-rest/server/ts-rest-handler";
14
- import { serve } from "@hono/node-server";
15
- import { serveStatic } from "@hono/node-server/serve-static";
16
14
  import { fetchRequestHandler, type FetchCreateContextFnOptions } from "@trpc/server/adapters/fetch";
17
- import { Hono, type Context } from "hono";
18
- import { env } from "hono/adapter";
19
- import { compress } from "hono/compress";
15
+ import { Hono } from "hono";
20
16
  import { createMiddleware } from "hono/factory";
21
17
 
22
- const envs = env<{ NODE_ENV: string; PORT: string }>({ env: {} } as unknown as Context<object>);
23
- const isProduction = envs.NODE_ENV === "production";
24
-
25
18
  interface Middleware<Context extends Record<string | number | symbol, unknown>> {
26
19
  (request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
27
20
  }
@@ -49,17 +42,6 @@ export function handlerAdapter<Context extends Record<string | number | symbol,
49
42
 
50
43
  const app = new Hono();
51
44
 
52
- app.use(compress());
53
-
54
- if (isProduction) {
55
- app.use(
56
- "/*",
57
- serveStatic({
58
- root: `dist/client/`,
59
- }),
60
- );
61
- }
62
-
63
45
  if (BATI.has("authjs") || BATI.has("auth0")) {
64
46
  /**
65
47
  * Append Auth.js session to context
@@ -121,14 +103,4 @@ if (!BATI.has("telefunc") && !BATI.has("trpc") && !BATI.has("ts-rest")) {
121
103
  **/
122
104
  app.all("*", handlerAdapter(vikeHandler));
123
105
 
124
- if (isProduction) {
125
- const port = envs.PORT ? parseInt(envs.PORT, 10) : 3000;
126
-
127
- console.log(`Server listening on http://localhost:${port}`);
128
- serve({
129
- fetch: app.fetch,
130
- port: port,
131
- });
132
- }
133
-
134
106
  export default app;
@@ -42,10 +42,10 @@ var require_package = __commonJS({
42
42
  license: "MIT",
43
43
  devDependencies: {
44
44
  "@batijs/compile": "workspace:*",
45
- "@prisma/client": "^5.15.1",
45
+ "@prisma/client": "^5.16.1",
46
46
  "@types/node": "^18.19.14",
47
47
  colorette: "^2.0.20",
48
- prisma: "^5.15.1"
48
+ prisma: "^5.16.1"
49
49
  },
50
50
  dependencies: {
51
51
  "@batijs/core": "workspace:*"
@@ -62,7 +62,7 @@ var require_package = __commonJS({
62
62
  typescript: "^5.5.2",
63
63
  vike: "^0.4.177",
64
64
  "vike-react": "^0.4.15",
65
- vite: "^5.3.1",
65
+ vite: "^5.3.2",
66
66
  "vite-plugin-compiled-react": "^1.1.3"
67
67
  },
68
68
  dependencies: {
@@ -11,16 +11,5 @@ export default {
11
11
  passToClient: ["user"],
12
12
  // <title>
13
13
  title: "My Vike App",
14
- stream:
15
- BATI.has("express") || BATI.has("fastify") || BATI.has("h3") || BATI.has("hattip") || BATI.has("hono")
16
- ? "web"
17
- : true,
18
14
  extends: vikeReact,
19
- //# BATI.has("firebase-auth")
20
- meta: {
21
- // Temporary workaround until +client.js is implemented: https://github.com/vikejs/vike/issues/1468
22
- firebaseApp: {
23
- env: { client: true },
24
- },
25
- },
26
15
  } satisfies Config;
@@ -5,7 +5,6 @@ declare const _default: {
5
5
  Head: typeof Head;
6
6
  passToClient: string[];
7
7
  title: string;
8
- stream: true | "web";
9
8
  extends: {
10
9
  name: string;
11
10
  require: {
@@ -98,12 +97,5 @@ declare const _default: {
98
97
  };
99
98
  };
100
99
  };
101
- meta: {
102
- firebaseApp: {
103
- env: {
104
- client: true;
105
- };
106
- };
107
- };
108
100
  };
109
101
  export default _default;
@@ -14,7 +14,7 @@
14
14
  "@auth/core": "^0.34.1",
15
15
  "typescript": "^5.5.2",
16
16
  "vike": "^0.4.177",
17
- "vite": "^5.3.1"
17
+ "vite": "^5.3.2"
18
18
  },
19
19
  "dependencies": {}
20
20
  }
@@ -42,8 +42,7 @@ var require_package = __commonJS({
42
42
  license: "MIT",
43
43
  devDependencies: {
44
44
  "@batijs/compile": "workspace:*",
45
- "@types/node": "^18.19.14",
46
- lowdb: "^7.0.1"
45
+ "@types/node": "^18.19.14"
47
46
  },
48
47
  dependencies: {
49
48
  "@batijs/core": "workspace:*"
@@ -83,7 +82,7 @@ import { addDependency, loadAsJson } from "@batijs/core";
83
82
  async function getPackageJson(props) {
84
83
  const packageJson = await loadAsJson(props);
85
84
  return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
86
- dependencies: ["lowdb"]
85
+ dependencies: []
87
86
  });
88
87
  }
89
88
  export {
@@ -1,13 +1,10 @@
1
- import type { LowSync } from "lowdb";
2
- import { JSONFileSyncPreset } from "lowdb/node";
3
-
4
1
  interface TodoItem {
5
2
  text: string;
6
3
  }
7
4
 
8
- const lowDb: LowSync<{ todo: TodoItem[] }> = JSONFileSyncPreset<{ todo: TodoItem[] }>("db.json", {
5
+ const todos = {
9
6
  todo: [{ text: "Buy milk" }, { text: "Buy strawberries" }],
10
- });
7
+ };
11
8
 
12
- export { lowDb };
9
+ export { todos };
13
10
  export type { TodoItem };
@@ -1,9 +1,10 @@
1
- import type { LowSync } from "lowdb";
2
1
  interface TodoItem {
3
2
  text: string;
4
3
  }
5
- declare const lowDb: LowSync<{
6
- todo: TodoItem[];
7
- }>;
8
- export { lowDb };
4
+ declare const todos: {
5
+ todo: {
6
+ text: string;
7
+ }[];
8
+ };
9
+ export { todos };
9
10
  export type { TodoItem };
@@ -1,6 +1,5 @@
1
1
  import { db } from "@batijs/drizzle/database/db";
2
2
  import { todoTable } from "@batijs/drizzle/database/schema";
3
- import { lowDb } from "@batijs/shared-no-db/database/todoItems";
4
3
 
5
4
  export async function createTodoHandler<Context extends Record<string | number | symbol, unknown>>(
6
5
  request: Request,
@@ -12,7 +11,8 @@ export async function createTodoHandler<Context extends Record<string | number |
12
11
  if (BATI.has("drizzle")) {
13
12
  await db.insert(todoTable).values({ text: newTodo.text });
14
13
  } else {
15
- lowDb.update(({ todo }) => todo.push({ text: newTodo.text }));
14
+ // This is where you'd persist the data
15
+ console.log("Received new todo", newTodo);
16
16
  }
17
17
 
18
18
  return new Response(JSON.stringify({ status: "OK" }), {
@@ -1,7 +1,7 @@
1
1
  // https://vike.dev/data
2
2
  import { db } from "@batijs/drizzle/database/db";
3
3
  import { todoTable } from "@batijs/drizzle/database/schema";
4
- import { lowDb } from "@batijs/shared-no-db/database/todoItems";
4
+ import { todos } from "@batijs/shared-no-db/database/todoItems";
5
5
 
6
6
  export type Data = {
7
7
  todo: { text: string }[];
@@ -13,7 +13,6 @@ export default async function data(): Promise<Data> {
13
13
 
14
14
  return { todo };
15
15
  } else {
16
- lowDb.read();
17
- return lowDb.data;
16
+ return todos;
18
17
  }
19
18
  }
@@ -50,12 +50,12 @@ var require_package = __commonJS({
50
50
  "@types/node": "^18.19.14",
51
51
  "cross-fetch": "^4.0.0",
52
52
  "eslint-plugin-solid": "^0.14.1",
53
- "solid-js": "^1.8.17",
53
+ "solid-js": "^1.8.18",
54
54
  tailwindcss: "^3.4.4",
55
55
  typescript: "^5.5.2",
56
56
  vike: "^0.4.177",
57
57
  "vike-solid": "^0.6.2",
58
- vite: "^5.3.1",
58
+ vite: "^5.3.2",
59
59
  "vite-plugin-solid": "^2.10.2"
60
60
  },
61
61
  dependencies: {
@@ -7,20 +7,9 @@ import Layout from "../layouts/LayoutDefault.js";
7
7
  export default {
8
8
  Layout,
9
9
  Head,
10
- // <title>
11
10
  //# BATI.has("auth0") || BATI.has("firebase-auth") || BATI.has("authjs")
12
11
  passToClient: ["user"],
12
+ // <title>
13
13
  title: "My Vike App",
14
- stream:
15
- BATI.has("express") || BATI.has("fastify") || BATI.has("h3") || BATI.has("hattip") || BATI.has("hono")
16
- ? "web"
17
- : true,
18
14
  extends: vikeSolid,
19
- //# BATI.has("firebase-auth")
20
- meta: {
21
- // Temporary workaround until +client.js is implemented: https://github.com/vikejs/vike/issues/1468
22
- firebaseApp: {
23
- env: { client: true },
24
- },
25
- },
26
15
  } satisfies Config;
@@ -5,7 +5,6 @@ declare const _default: {
5
5
  Head: typeof Head;
6
6
  passToClient: string[];
7
7
  title: string;
8
- stream: true | "web";
9
8
  extends: {
10
9
  name: string;
11
10
  require: {
@@ -69,12 +68,5 @@ declare const _default: {
69
68
  };
70
69
  };
71
70
  };
72
- meta: {
73
- firebaseApp: {
74
- env: {
75
- client: true;
76
- };
77
- };
78
- };
79
71
  };
80
72
  export default _default;
@@ -44,11 +44,11 @@ var require_package = __commonJS({
44
44
  "@batijs/compile": "workspace:*",
45
45
  "@types/node": "^18.19.14",
46
46
  autoprefixer: "^10.4.19",
47
- daisyui: "^4.12.8",
48
- postcss: "^8.4.38",
47
+ daisyui: "^4.12.10",
48
+ postcss: "^8.4.39",
49
49
  tailwindcss: "^3.4.4",
50
50
  vike: "^0.4.177",
51
- vite: "^5.3.1"
51
+ vite: "^5.3.2"
52
52
  },
53
53
  dependencies: {
54
54
  "@batijs/core": "workspace:*"
@@ -46,9 +46,9 @@ var require_package = __commonJS({
46
46
  "@batijs/shared-no-db": "workspace:*",
47
47
  "@batijs/shared-todo": "workspace:*",
48
48
  "@types/node": "^18.19.14",
49
- telefunc: "^0.1.74",
49
+ telefunc: "^0.1.75",
50
50
  vike: "^0.4.177",
51
- vite: "^5.3.1"
51
+ vite: "^5.3.2"
52
52
  },
53
53
  dependencies: {
54
54
  "@batijs/core": "workspace:*"
@@ -1,11 +1,11 @@
1
1
  import { db } from "@batijs/drizzle/database/db";
2
2
  import { todoTable } from "@batijs/drizzle/database/schema";
3
- import { lowDb } from "@batijs/shared-no-db/database/todoItems";
4
3
 
5
4
  export async function onNewTodo({ text }: { text: string }) {
6
5
  if (BATI.has("drizzle")) {
7
6
  await db.insert(todoTable).values({ text });
8
7
  } else {
9
- await lowDb.update(({ todo }) => todo.push({ text }));
8
+ // This is where you'd persist the data
9
+ console.log("Received new todo", { text });
10
10
  }
11
11
  }
@@ -48,7 +48,7 @@ var require_package = __commonJS({
48
48
  "@trpc/client": "^10.45.2",
49
49
  "@trpc/server": "^10.45.2",
50
50
  "@types/node": "^18.19.14",
51
- vite: "^5.3.1"
51
+ vite: "^5.3.2"
52
52
  },
53
53
  dependencies: {
54
54
  "@batijs/core": "workspace:*"
@@ -1,6 +1,5 @@
1
1
  import { db } from "@batijs/drizzle/database/db";
2
2
  import { todoTable } from "@batijs/drizzle/database/schema";
3
- import { lowDb } from "@batijs/shared-no-db/database/todoItems";
4
3
  import { initTRPC } from "@trpc/server";
5
4
 
6
5
  /**
@@ -31,7 +30,8 @@ export const appRouter = router({
31
30
  if (BATI.has("drizzle")) {
32
31
  await db.insert(todoTable).values({ text: opts.input });
33
32
  } else {
34
- await lowDb.update(({ todo }) => todo.push({ text: opts.input }));
33
+ // This is where you'd persist the data
34
+ console.log("Received new todo", { text: opts.input });
35
35
  }
36
36
  }),
37
37
  });
@@ -1,6 +1,5 @@
1
1
  import { db } from "@batijs/drizzle/database/db";
2
2
  import { todoTable } from "@batijs/drizzle/database/schema";
3
- import { lowDb } from "@batijs/shared-no-db/database/todoItems";
4
3
  import { fetchRequestHandler, tsr } from "@ts-rest/serverless/fetch";
5
4
  import { contract } from "../ts-rest/contract";
6
5
 
@@ -22,7 +21,8 @@ const router = tsr.router(contract, {
22
21
  if (BATI.has("drizzle")) {
23
22
  await db.insert(todoTable).values({ text: body.text });
24
23
  } else {
25
- lowDb.update(({ todo }) => todo.push({ text: body.text }));
24
+ // This is where you'd persist the data
25
+ console.log("Received new todo", { text: body.text });
26
26
  }
27
27
  return {
28
28
  status: 200,
@@ -45,7 +45,7 @@ var require_package = __commonJS({
45
45
  "@types/node": "^18.19.14",
46
46
  "@vite-plugin-vercel/vike": "^7.0.0",
47
47
  vike: "^0.4.177",
48
- vite: "^5.3.1",
48
+ vite: "^5.3.2",
49
49
  "vite-plugin-vercel": "^7.0.0"
50
50
  },
51
51
  dependencies: {
@@ -49,8 +49,8 @@ var require_package = __commonJS({
49
49
  "@batijs/ts-rest": "workspace:*",
50
50
  "@types/node": "^18.19.14",
51
51
  "@vitejs/plugin-vue": "^5.0.5",
52
- "@vue/compiler-sfc": "^3.4.30",
53
- "@vue/server-renderer": "^3.4.30",
52
+ "@vue/compiler-sfc": "^3.4.31",
53
+ "@vue/server-renderer": "^3.4.31",
54
54
  "cross-fetch": "^4.0.0",
55
55
  "eslint-plugin-vue": "^9.26.0",
56
56
  tailwindcss: "^3.4.4",
@@ -58,8 +58,8 @@ var require_package = __commonJS({
58
58
  "unplugin-vue-markdown": "^0.26.2",
59
59
  vike: "^0.4.177",
60
60
  "vike-vue": "^0.7.6",
61
- vite: "^5.3.1",
62
- vue: "^3.4.30",
61
+ vite: "^5.3.2",
62
+ vue: "^3.4.31",
63
63
  "vue-gtag": "^2.0.1"
64
64
  },
65
65
  dependencies: {
@@ -7,20 +7,9 @@ import Layout from "../layouts/LayoutDefault.vue";
7
7
  export default {
8
8
  Layout,
9
9
  Head,
10
- // <title>
11
10
  //# BATI.has("auth0") || BATI.has("firebase-auth") || BATI.has("authjs")
12
11
  passToClient: ["user"],
12
+ // <title>
13
13
  title: "My Vike App",
14
14
  extends: vikeVue,
15
- stream:
16
- BATI.has("express") || BATI.has("fastify") || BATI.has("h3") || BATI.has("hattip") || BATI.has("hono")
17
- ? "web"
18
- : true,
19
- //# BATI.has("firebase-auth")
20
- meta: {
21
- // Temporary workaround until +client.js is implemented: https://github.com/vikejs/vike/issues/1468
22
- firebaseApp: {
23
- env: { client: true },
24
- },
25
- },
26
15
  } satisfies Config;
@@ -108,13 +108,5 @@ declare const _default: {
108
108
  };
109
109
  };
110
110
  };
111
- stream: true | "web";
112
- meta: {
113
- firebaseApp: {
114
- env: {
115
- client: true;
116
- };
117
- };
118
- };
119
111
  };
120
112
  export default _default;
package/dist/index.js CHANGED
@@ -1559,7 +1559,7 @@ var import_which_pm_runs = __toESM(require_which_pm_runs(), 1);
1559
1559
  // package.json
1560
1560
  var package_default = {
1561
1561
  name: "@batijs/cli",
1562
- version: "0.0.210",
1562
+ version: "0.0.212",
1563
1563
  type: "module",
1564
1564
  scripts: {
1565
1565
  "check-types": "tsc --noEmit",
@@ -1569,7 +1569,7 @@ var package_default = {
1569
1569
  },
1570
1570
  keywords: [],
1571
1571
  description: "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
1572
- author: "Jo\xEBl Charles",
1572
+ author: "Jo\xEBl Charles <joel.charles91@gmail.com>es",
1573
1573
  repository: "https://github.com/batijs/bati",
1574
1574
  license: "MIT",
1575
1575
  devDependencies: {
@@ -1580,13 +1580,13 @@ var package_default = {
1580
1580
  "@types/which-pm-runs": "^1.0.2",
1581
1581
  citty: "^0.1.6",
1582
1582
  colorette: "^2.0.20",
1583
- esbuild: "^0.21.5",
1583
+ esbuild: "^0.22.0",
1584
1584
  execa: "^9.3.0",
1585
1585
  rimraf: "^5.0.7",
1586
1586
  sift: "^17.1.3",
1587
1587
  tsup: "^8.1.0",
1588
1588
  typescript: "^5.5.2",
1589
- vite: "^5.3.1",
1589
+ vite: "^5.3.2",
1590
1590
  "which-pm-runs": "^1.1.0"
1591
1591
  },
1592
1592
  dependencies: {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@batijs/cli",
3
- "version": "0.0.210",
3
+ "version": "0.0.212",
4
4
  "type": "module",
5
5
  "keywords": [],
6
6
  "description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
7
- "author": "Joël Charles",
7
+ "author": "Joël Charles <joel.charles91@gmail.com>es",
8
8
  "repository": "https://github.com/batijs/bati",
9
9
  "license": "MIT",
10
10
  "devDependencies": {
@@ -13,20 +13,20 @@
13
13
  "@types/which-pm-runs": "^1.0.2",
14
14
  "citty": "^0.1.6",
15
15
  "colorette": "^2.0.20",
16
- "esbuild": "^0.21.5",
16
+ "esbuild": "^0.22.0",
17
17
  "execa": "^9.3.0",
18
18
  "rimraf": "^5.0.7",
19
19
  "sift": "^17.1.3",
20
20
  "tsup": "^8.1.0",
21
21
  "typescript": "^5.5.2",
22
- "vite": "^5.3.1",
22
+ "vite": "^5.3.2",
23
23
  "which-pm-runs": "^1.1.0",
24
- "@batijs/compile": "0.0.210",
25
- "@batijs/build": "0.0.210"
24
+ "@batijs/build": "0.0.212",
25
+ "@batijs/compile": "0.0.212"
26
26
  },
27
27
  "dependencies": {
28
- "@batijs/core": "0.0.210",
29
- "@batijs/features": "0.0.210"
28
+ "@batijs/core": "0.0.212",
29
+ "@batijs/features": "0.0.212"
30
30
  },
31
31
  "bin": "./dist/index.js",
32
32
  "exports": {
@@ -1,3 +0,0 @@
1
- import { type FirebaseApp } from "firebase/app";
2
- declare let firebaseApp: FirebaseApp | undefined;
3
- export default firebaseApp;