@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.
- package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/edgedb/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/files/$package.json.js +6 -4
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +7 -5
- package/dist/boilerplates/@batijs/firebase-auth/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/firebase-auth/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/firebase-auth/files/pages/{+firebaseApp.ts → +client.ts} +0 -3
- package/dist/boilerplates/@batijs/firebase-auth/files/server/firebase-auth-middleware.ts +1 -1
- package/dist/boilerplates/@batijs/firebase-auth/files/vike.d.ts +0 -4
- package/dist/boilerplates/@batijs/firebase-auth/types/pages/+client.d.ts +1 -0
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +6 -4
- package/dist/boilerplates/@batijs/hattip/files/$package.json.js +5 -3
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +13 -5
- package/dist/boilerplates/@batijs/hono/files/hono-entry.node.ts +29 -0
- package/dist/boilerplates/@batijs/hono/files/hono-entry.ts +1 -29
- package/dist/boilerplates/@batijs/hono/types/hono-entry.node.d.ts +1 -0
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/react/files/pages/+config.ts +0 -11
- package/dist/boilerplates/@batijs/react/types/pages/+config.d.ts +0 -8
- package/dist/boilerplates/@batijs/shared/files/package.json +1 -1
- package/dist/boilerplates/@batijs/shared-no-db/files/$package.json.js +2 -3
- package/dist/boilerplates/@batijs/shared-no-db/files/database/todoItems.ts +3 -6
- package/dist/boilerplates/@batijs/shared-no-db/types/database/todoItems.d.ts +6 -5
- package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +2 -2
- package/dist/boilerplates/@batijs/shared-todo/files/pages/todo/+data.ts +2 -3
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +1 -12
- package/dist/boilerplates/@batijs/solid/types/pages/+config.d.ts +0 -8
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/telefunc/files/pages/todo/TodoList.telefunc.ts +2 -2
- package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/trpc/files/trpc/server.ts +2 -2
- package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +2 -2
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +1 -12
- package/dist/boilerplates/@batijs/vue/types/pages/+config.d.ts +0 -8
- package/dist/index.js +4 -4
- package/package.json +8 -8
- package/dist/boilerplates/@batijs/firebase-auth/types/pages/+firebaseApp.d.ts +0 -3
|
@@ -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.
|
|
48
|
-
"drizzle-kit": "^0.22.
|
|
47
|
+
"better-sqlite3": "^11.1.1",
|
|
48
|
+
"drizzle-kit": "^0.22.8",
|
|
49
49
|
"drizzle-orm": "^0.31.2",
|
|
50
|
-
tsx: "^4.
|
|
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.
|
|
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.
|
|
63
|
-
tsx: "^4.
|
|
63
|
+
telefunc: "^0.1.75",
|
|
64
|
+
tsx: "^4.16.0",
|
|
64
65
|
vike: "^0.4.177",
|
|
65
|
-
vite: "^5.3.
|
|
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.
|
|
61
|
-
telefunc: "^0.1.
|
|
62
|
-
tsx: "^4.
|
|
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.
|
|
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/+
|
|
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.
|
|
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/+
|
|
74
|
-
types: "./dist/types/pages/+
|
|
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/+
|
|
95
|
-
"./dist/types/pages/+
|
|
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
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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.
|
|
62
|
-
tsx: "^4.
|
|
62
|
+
telefunc: "^0.1.75",
|
|
63
|
+
tsx: "^4.16.0",
|
|
63
64
|
vike: "^0.4.177",
|
|
64
|
-
vite: "^5.3.
|
|
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.
|
|
62
|
+
telefunc: "^0.1.75",
|
|
62
63
|
vike: "^0.4.177",
|
|
63
|
-
vite: "^5.3.
|
|
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.
|
|
59
|
-
telefunc: "^0.1.
|
|
60
|
-
tsx: "^4.
|
|
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.
|
|
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
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -42,10 +42,10 @@ var require_package = __commonJS({
|
|
|
42
42
|
license: "MIT",
|
|
43
43
|
devDependencies: {
|
|
44
44
|
"@batijs/compile": "workspace:*",
|
|
45
|
-
"@prisma/client": "^5.
|
|
45
|
+
"@prisma/client": "^5.16.1",
|
|
46
46
|
"@types/node": "^18.19.14",
|
|
47
47
|
colorette: "^2.0.20",
|
|
48
|
-
prisma: "^5.
|
|
48
|
+
prisma: "^5.16.1"
|
|
49
49
|
},
|
|
50
50
|
dependencies: {
|
|
51
51
|
"@batijs/core": "workspace:*"
|
|
@@ -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;
|
|
@@ -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: [
|
|
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
|
|
5
|
+
const todos = {
|
|
9
6
|
todo: [{ text: "Buy milk" }, { text: "Buy strawberries" }],
|
|
10
|
-
}
|
|
7
|
+
};
|
|
11
8
|
|
|
12
|
-
export {
|
|
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
|
|
6
|
-
todo:
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
48
|
-
postcss: "^8.4.
|
|
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.
|
|
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.
|
|
49
|
+
telefunc: "^0.1.75",
|
|
50
50
|
vike: "^0.4.177",
|
|
51
|
-
vite: "^5.3.
|
|
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
|
-
|
|
8
|
+
// This is where you'd persist the data
|
|
9
|
+
console.log("Received new todo", { text });
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -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.
|
|
53
|
-
"@vue/server-renderer": "^3.4.
|
|
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.
|
|
62
|
-
vue: "^3.4.
|
|
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;
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
22
|
+
"vite": "^5.3.2",
|
|
23
23
|
"which-pm-runs": "^1.1.0",
|
|
24
|
-
"@batijs/
|
|
25
|
-
"@batijs/
|
|
24
|
+
"@batijs/build": "0.0.212",
|
|
25
|
+
"@batijs/compile": "0.0.212"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@batijs/core": "0.0.
|
|
29
|
-
"@batijs/features": "0.0.
|
|
28
|
+
"@batijs/core": "0.0.212",
|
|
29
|
+
"@batijs/features": "0.0.212"
|
|
30
30
|
},
|
|
31
31
|
"bin": "./dist/index.js",
|
|
32
32
|
"exports": {
|