@batijs/cli 0.0.211 → 0.0.213

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 (43) hide show
  1. package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
  2. package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +114 -0
  3. package/dist/boilerplates/@batijs/cloudflare/files/$vite.config.ts.js +24 -0
  4. package/dist/boilerplates/@batijs/cloudflare/files/wrangler.toml +4 -0
  5. package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
  6. package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +3 -3
  7. package/dist/boilerplates/@batijs/edgedb/files/$package.json.js +1 -1
  8. package/dist/boilerplates/@batijs/express/files/$package.json.js +6 -4
  9. package/dist/boilerplates/@batijs/fastify/files/$package.json.js +7 -5
  10. package/dist/boilerplates/@batijs/firebase-auth/files/$package.json.js +1 -1
  11. package/dist/boilerplates/@batijs/h3/files/$package.json.js +6 -4
  12. package/dist/boilerplates/@batijs/hattip/files/$package.json.js +5 -3
  13. package/dist/boilerplates/@batijs/hono/files/$package.json.js +13 -5
  14. package/dist/boilerplates/@batijs/hono/files/hono-entry.node.ts +29 -0
  15. package/dist/boilerplates/@batijs/hono/files/hono-entry.ts +1 -29
  16. package/dist/boilerplates/@batijs/hono/types/hono-entry.node.d.ts +1 -0
  17. package/dist/boilerplates/@batijs/prettier/files/.prettierignore +3 -0
  18. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +2 -2
  19. package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
  20. package/dist/boilerplates/@batijs/react/files/pages/+config.ts +0 -4
  21. package/dist/boilerplates/@batijs/react/types/pages/+config.d.ts +0 -1
  22. package/dist/boilerplates/@batijs/shared/files/package.json +1 -1
  23. package/dist/boilerplates/@batijs/shared-no-db/files/$package.json.js +2 -3
  24. package/dist/boilerplates/@batijs/shared-no-db/files/database/todoItems.ts +3 -6
  25. package/dist/boilerplates/@batijs/shared-no-db/types/database/todoItems.d.ts +6 -5
  26. package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +2 -2
  27. package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +2 -3
  28. package/dist/boilerplates/@batijs/solid/files/$package.json.js +2 -2
  29. package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +1 -5
  30. package/dist/boilerplates/@batijs/solid/types/pages/+config.d.ts +0 -1
  31. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +3 -3
  32. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +2 -2
  33. package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +2 -2
  34. package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
  35. package/dist/boilerplates/@batijs/trpc/files/trpc/server.ts +2 -2
  36. package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +2 -2
  37. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
  38. package/dist/boilerplates/@batijs/vue/files/$package.json.js +4 -4
  39. package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +1 -5
  40. package/dist/boilerplates/@batijs/vue/types/pages/+config.d.ts +0 -1
  41. package/dist/boilerplates/boilerplates.json +11 -0
  42. package/dist/index.js +13 -9
  43. package/package.json +9 -9
@@ -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: {
@@ -0,0 +1,114 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // package.json
28
+ var require_package = __commonJS({
29
+ "package.json"(exports, module) {
30
+ module.exports = {
31
+ name: "@batijs/cloudflare",
32
+ private: true,
33
+ version: "0.0.1",
34
+ description: "",
35
+ type: "module",
36
+ scripts: {
37
+ "check-types": "tsc --noEmit",
38
+ build: "bati-compile-boilerplate"
39
+ },
40
+ keywords: [],
41
+ author: "",
42
+ license: "MIT",
43
+ devDependencies: {
44
+ "@batijs/compile": "workspace:*",
45
+ "@types/node": "^18.19.14",
46
+ "@hattip/adapter-cloudflare-workers": "^0.0.46",
47
+ "npm-run-all2": "^6.2.0",
48
+ "vike-cloudflare": "^0.0.4",
49
+ wrangler: "^3.62.0"
50
+ },
51
+ dependencies: {
52
+ "@batijs/core": "workspace:*"
53
+ },
54
+ files: [
55
+ "dist/"
56
+ ],
57
+ bati: {
58
+ if: {
59
+ flag: "cloudflare"
60
+ }
61
+ },
62
+ exports: {
63
+ "./test": {
64
+ types: "./dist/types/test.d.ts"
65
+ }
66
+ },
67
+ typesVersions: {
68
+ "*": {
69
+ test: [
70
+ "./dist/types/test.d.ts"
71
+ ]
72
+ }
73
+ }
74
+ };
75
+ }
76
+ });
77
+
78
+ // files/$package.json.ts
79
+ import { addDependency, loadAsJson, setScripts } from "@batijs/core";
80
+ async function getPackageJson(props) {
81
+ const packageJson = await loadAsJson(props);
82
+ setScripts(packageJson, {
83
+ "preview:wrangler": {
84
+ value: "wrangler pages dev",
85
+ precedence: 20,
86
+ warnIfReplaced: true
87
+ },
88
+ preview: {
89
+ value: "run-s build preview:wrangler",
90
+ precedence: 20,
91
+ warnIfReplaced: true
92
+ },
93
+ "deploy:wrangler": {
94
+ value: "wrangler pages deploy",
95
+ precedence: 20,
96
+ warnIfReplaced: true
97
+ },
98
+ deploy: {
99
+ value: "run-s build deploy:wrangler",
100
+ precedence: 20,
101
+ warnIfReplaced: true
102
+ }
103
+ });
104
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
105
+ devDependencies: ["wrangler", "npm-run-all2"],
106
+ dependencies: [
107
+ "vike-cloudflare",
108
+ ...props.meta.BATI.has("hattip") ? ["@hattip/adapter-cloudflare-workers"] : []
109
+ ]
110
+ });
111
+ }
112
+ export {
113
+ getPackageJson as default
114
+ };
@@ -0,0 +1,24 @@
1
+ // files/$vite.config.ts.ts
2
+ import { addVitePlugin, loadAsMagicast } from "@batijs/core";
3
+ async function getViteConfig(props) {
4
+ const mod = await loadAsMagicast(props);
5
+ let options = void 0;
6
+ if (props.meta.BATI.has("hattip") || props.meta.BATI.has("hono")) {
7
+ options = {
8
+ server: {
9
+ kind: props.meta.BATI.has("hono") ? "hono" : "hattip",
10
+ entry: props.meta.BATI.has("hono") ? "hono-entry.ts" : "hattip-entry.ts"
11
+ }
12
+ };
13
+ }
14
+ addVitePlugin(mod, {
15
+ from: "vike-cloudflare",
16
+ constructor: "pages",
17
+ imported: "pages",
18
+ options
19
+ });
20
+ return mod.generate().code;
21
+ }
22
+ export {
23
+ getViteConfig as default
24
+ };
@@ -0,0 +1,4 @@
1
+ name = "my-app"
2
+ compatibility_date = "2024-07-01"
3
+ pages_build_output_dir = "./dist/cloudflare"
4
+ compatibility_flags = [ "nodejs_compat" ]
@@ -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",
@@ -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:*"
@@ -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;
@@ -130,3 +130,6 @@ dist
130
130
  .yarn/build-state.yml
131
131
  .yarn/install-state.gz
132
132
  .pnp.*
133
+
134
+ # Cloudflare
135
+ .wrangler/
@@ -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,9 +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
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: {
@@ -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,13 +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
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: {
@@ -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,13 +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
15
  } satisfies Config;
@@ -108,6 +108,5 @@ declare const _default: {
108
108
  };
109
109
  };
110
110
  };
111
- stream: true | "web";
112
111
  };
113
112
  export default _default;
@@ -37,6 +37,17 @@
37
37
  "files"
38
38
  ]
39
39
  },
40
+ {
41
+ "config": {
42
+ "if": {
43
+ "flag": "cloudflare"
44
+ }
45
+ },
46
+ "folder": "@batijs/cloudflare",
47
+ "subfolders": [
48
+ "files"
49
+ ]
50
+ },
40
51
  {
41
52
  "config": {
42
53
  "if": {
package/dist/index.js CHANGED
@@ -1559,17 +1559,17 @@ 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.211",
1562
+ version: "0.0.213",
1563
1563
  type: "module",
1564
1564
  scripts: {
1565
1565
  "check-types": "tsc --noEmit",
1566
1566
  prerelease: "rimraf ./dist",
1567
- prepublishOnly: "pnpm run build-cli",
1568
- "build-cli": "rimraf ./dist && tsup"
1567
+ prepublishOnly: "pnpm run build",
1568
+ build: "rimraf ./dist && tsup"
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: {
@@ -1623,14 +1623,18 @@ var rulesMessages = {
1623
1623
  )}. Check https://vike.dev/integration#server-side-tools for details and https://batijs.dev for available servers`
1624
1624
  ),
1625
1625
  [RulesMessage.ERROR_COMPILED_R_REACT]: error(
1626
- `${inverse(bold("React"))} is required when using ${inverse(bold("Compiled"))}.`
1626
+ `${inverse(bold("React"))} is required when using ${inverse(bold("Compiled"))}`
1627
1627
  ),
1628
1628
  [RulesMessage.INFO_HATTIP]: info(`${inverse(bold("HatTip"))} is an experimental project`),
1629
1629
  [RulesMessage.ERROR_DRIZZLE_R_SERVER]: error(
1630
- `A ${inverse(bold("Server"))} is required when using ${inverse(bold("Drizzle"))}.`
1630
+ `A ${inverse(bold("Server"))} is required when using ${inverse(bold("Drizzle"))}`
1631
1631
  ),
1632
1632
  [RulesMessage.ERROR_DATA_R_SERVER]: error(
1633
- `A ${inverse(bold("Server"))} is required when using ${inverse(bold("Data fetching"))}.`
1633
+ `A ${inverse(bold("Server"))} is required when using ${inverse(bold("Data fetching"))}`
1634
+ ),
1635
+ [RulesMessage.ERROR_CLOUDFLARE_R_COMPAT_SERVER]: error(
1636
+ `${inverse(bold("Cloudflare"))} is only compatible with ${inverse(bold("Hono"))} or ${inverse(bold("HatTip"))}.
1637
+ Choose one of them, or simply remove selected Server`
1634
1638
  )
1635
1639
  };
1636
1640
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@batijs/cli",
3
- "version": "0.0.211",
3
+ "version": "0.0.213",
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/build": "0.0.211",
25
- "@batijs/compile": "0.0.211"
24
+ "@batijs/build": "0.0.213",
25
+ "@batijs/compile": "0.0.213"
26
26
  },
27
27
  "dependencies": {
28
- "@batijs/core": "0.0.211",
29
- "@batijs/features": "0.0.211"
28
+ "@batijs/core": "0.0.213",
29
+ "@batijs/features": "0.0.213"
30
30
  },
31
31
  "bin": "./dist/index.js",
32
32
  "exports": {
@@ -38,6 +38,6 @@
38
38
  "scripts": {
39
39
  "check-types": "tsc --noEmit",
40
40
  "prerelease": "rimraf ./dist",
41
- "build-cli": "rimraf ./dist && tsup"
41
+ "build": "rimraf ./dist && tsup"
42
42
  }
43
43
  }