@batijs/cli 0.0.222 → 0.0.224
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/cloudflare/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/drizzle/types/database/schema.d.ts +8 -0
- package/dist/boilerplates/@batijs/edgedb/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/files/express-entry.ts +10 -38
- package/dist/boilerplates/@batijs/express/types/express-entry.d.ts +0 -4
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/fastify/files/fastify-entry.ts +1 -1
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +3 -1
- package/dist/boilerplates/@batijs/hono/files/hono-entry.ts +10 -35
- package/dist/boilerplates/@batijs/hono/types/hono-entry.d.ts +0 -4
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +2 -2
- package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +6 -6
|
@@ -45,8 +45,8 @@ var require_package = __commonJS({
|
|
|
45
45
|
"@types/better-sqlite3": "^7.6.11",
|
|
46
46
|
"@types/node": "^18.19.14",
|
|
47
47
|
"better-sqlite3": "^11.1.2",
|
|
48
|
-
"drizzle-kit": "^0.
|
|
49
|
-
"drizzle-orm": "^0.
|
|
48
|
+
"drizzle-kit": "^0.23.0",
|
|
49
|
+
"drizzle-orm": "^0.32.0",
|
|
50
50
|
tsx: "^4.16.2"
|
|
51
51
|
},
|
|
52
52
|
dependencies: {
|
|
@@ -11,8 +11,12 @@ export declare const todoTable: import("drizzle-orm/sqlite-core").SQLiteTableWit
|
|
|
11
11
|
driverParam: number;
|
|
12
12
|
notNull: true;
|
|
13
13
|
hasDefault: true;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
14
17
|
enumValues: undefined;
|
|
15
18
|
baseColumn: never;
|
|
19
|
+
generated: undefined;
|
|
16
20
|
}, object>;
|
|
17
21
|
text: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
18
22
|
name: "text";
|
|
@@ -23,8 +27,12 @@ export declare const todoTable: import("drizzle-orm/sqlite-core").SQLiteTableWit
|
|
|
23
27
|
driverParam: string;
|
|
24
28
|
notNull: true;
|
|
25
29
|
hasDefault: false;
|
|
30
|
+
isPrimaryKey: false;
|
|
31
|
+
isAutoincrement: false;
|
|
32
|
+
hasRuntimeDefault: false;
|
|
26
33
|
enumValues: [string, ...string[]];
|
|
27
34
|
baseColumn: never;
|
|
35
|
+
generated: undefined;
|
|
28
36
|
}, object>;
|
|
29
37
|
};
|
|
30
38
|
dialect: "sqlite";
|
|
@@ -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.16.
|
|
46
|
+
"@prisma/client": "^5.16.2",
|
|
47
47
|
"@types/node": "^18.19.14",
|
|
48
48
|
colorette: "^2.0.20",
|
|
49
49
|
edgedb: "^1.5.7"
|
|
@@ -42,8 +42,8 @@ var require_package = __commonJS({
|
|
|
42
42
|
},
|
|
43
43
|
devDependencies: {
|
|
44
44
|
"@batijs/compile": "workspace:^",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
46
|
-
"@typescript-eslint/parser": "^7.
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
46
|
+
"@typescript-eslint/parser": "^7.16.0",
|
|
47
47
|
eslint: "^8.57.0"
|
|
48
48
|
},
|
|
49
49
|
dependencies: {
|
|
@@ -54,7 +54,7 @@ var require_package = __commonJS({
|
|
|
54
54
|
"@types/cookie-parser": "^1.4.7",
|
|
55
55
|
"@types/express": "^4.17.21",
|
|
56
56
|
"@types/node": "^18.19.14",
|
|
57
|
-
"@universal-middleware/express": "^0.0
|
|
57
|
+
"@universal-middleware/express": "^0.1.0",
|
|
58
58
|
"cookie-parser": "^1.4.6",
|
|
59
59
|
"cross-env": "^7.0.3",
|
|
60
60
|
dotenv: "^16.4.5",
|
|
@@ -14,7 +14,7 @@ import { telefuncHandler } from "@batijs/telefunc/server/telefunc-handler";
|
|
|
14
14
|
import { appRouter } from "@batijs/trpc/trpc/server";
|
|
15
15
|
import { tsRestHandler } from "@batijs/ts-rest/server/ts-rest-handler";
|
|
16
16
|
import * as trpcExpress from "@trpc/server/adapters/express";
|
|
17
|
-
import { createMiddleware } from "@universal-middleware/express";
|
|
17
|
+
import { createHandler, createMiddleware } from "@universal-middleware/express";
|
|
18
18
|
import express from "express";
|
|
19
19
|
|
|
20
20
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -23,34 +23,6 @@ const root = __dirname;
|
|
|
23
23
|
const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
|
|
24
24
|
const hmrPort = process.env.HMR_PORT ? parseInt(process.env.HMR_PORT, 10) : 24678;
|
|
25
25
|
|
|
26
|
-
interface Middleware<Context extends Record<string | number | symbol, unknown>> {
|
|
27
|
-
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(
|
|
31
|
-
handler: Middleware<Context>,
|
|
32
|
-
) {
|
|
33
|
-
return createMiddleware(
|
|
34
|
-
async (context) => {
|
|
35
|
-
const rawRequest = context.platform.request as unknown as Record<string, unknown>;
|
|
36
|
-
rawRequest.context ??= {};
|
|
37
|
-
const response = await handler(context.request, rawRequest.context as Context);
|
|
38
|
-
|
|
39
|
-
if (!response) {
|
|
40
|
-
context.passThrough();
|
|
41
|
-
return new Response("", {
|
|
42
|
-
status: 404,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return response;
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
alwaysCallNext: false,
|
|
50
|
-
},
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
26
|
export default (await startServer()) as unknown;
|
|
55
27
|
|
|
56
28
|
async function startServer() {
|
|
@@ -76,19 +48,19 @@ async function startServer() {
|
|
|
76
48
|
/**
|
|
77
49
|
* Append Auth.js session to context
|
|
78
50
|
**/
|
|
79
|
-
app.use(
|
|
51
|
+
app.use(createMiddleware(authjsSessionMiddleware));
|
|
80
52
|
|
|
81
53
|
/**
|
|
82
54
|
* Auth.js route
|
|
83
55
|
* @link {@see https://authjs.dev/getting-started/installation}
|
|
84
56
|
**/
|
|
85
|
-
app.all("/api/auth/*",
|
|
57
|
+
app.all("/api/auth/*", createHandler(authjsHandler));
|
|
86
58
|
}
|
|
87
59
|
|
|
88
60
|
if (BATI.has("firebase-auth")) {
|
|
89
|
-
app.use(
|
|
90
|
-
app.post("/api/sessionLogin",
|
|
91
|
-
app.post("/api/sessionLogout",
|
|
61
|
+
app.use(createMiddleware(firebaseAuthMiddleware));
|
|
62
|
+
app.post("/api/sessionLogin", createHandler(firebaseAuthLoginHandler));
|
|
63
|
+
app.post("/api/sessionLogout", createHandler(firebaseAuthLogoutHandler));
|
|
92
64
|
}
|
|
93
65
|
|
|
94
66
|
if (BATI.has("trpc")) {
|
|
@@ -114,15 +86,15 @@ async function startServer() {
|
|
|
114
86
|
*
|
|
115
87
|
* @link {@see https://telefunc.com}
|
|
116
88
|
**/
|
|
117
|
-
app.post("/_telefunc",
|
|
89
|
+
app.post("/_telefunc", createHandler(telefuncHandler));
|
|
118
90
|
}
|
|
119
91
|
|
|
120
92
|
if (BATI.has("ts-rest")) {
|
|
121
|
-
app.all("/api/*",
|
|
93
|
+
app.all("/api/*", createHandler(tsRestHandler));
|
|
122
94
|
}
|
|
123
95
|
|
|
124
96
|
if (!BATI.has("telefunc") && !BATI.has("trpc") && !BATI.has("ts-rest")) {
|
|
125
|
-
app.post("/api/todo/create",
|
|
97
|
+
app.post("/api/todo/create", createHandler(createTodoHandler));
|
|
126
98
|
}
|
|
127
99
|
|
|
128
100
|
/**
|
|
@@ -130,7 +102,7 @@ async function startServer() {
|
|
|
130
102
|
*
|
|
131
103
|
* @link {@see https://vike.dev}
|
|
132
104
|
**/
|
|
133
|
-
app.all("*",
|
|
105
|
+
app.all("*", createHandler(vikeHandler));
|
|
134
106
|
|
|
135
107
|
app.listen(port, () => {
|
|
136
108
|
console.log(`Server listening on http://localhost:${port}`);
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
|
-
interface Middleware<Context extends Record<string | number | symbol, unknown>> {
|
|
3
|
-
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export declare function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(handler: Middleware<Context>): import("@universal-middleware/express/native-fetch").NodeMiddleware;
|
|
6
2
|
declare const _default: unknown;
|
|
7
3
|
export default _default;
|
|
@@ -55,7 +55,7 @@ var require_package = __commonJS({
|
|
|
55
55
|
"@trpc/server": "^10.45.2",
|
|
56
56
|
"@types/express": "^4.17.21",
|
|
57
57
|
"@types/node": "^18.19.14",
|
|
58
|
-
"@universal-middleware/express": "^0.0
|
|
58
|
+
"@universal-middleware/express": "^0.1.0",
|
|
59
59
|
"cross-env": "^7.0.3",
|
|
60
60
|
dotenv: "^16.4.5",
|
|
61
61
|
fastify: "^4.28.1",
|
|
@@ -39,7 +39,7 @@ export function handlerAdapter<Context extends Record<string | number | symbol,
|
|
|
39
39
|
return (async (request, reply) => {
|
|
40
40
|
const config = request.routeOptions.config as unknown as Record<string, unknown>;
|
|
41
41
|
config.context ??= {};
|
|
42
|
-
const response = await handler(requestAdapter(request.raw)
|
|
42
|
+
const response = await handler(requestAdapter(request.raw), config.context as Context);
|
|
43
43
|
|
|
44
44
|
if (response) {
|
|
45
45
|
if (!response.body) {
|
|
@@ -54,9 +54,10 @@ var require_package = __commonJS({
|
|
|
54
54
|
"@hono/vite-dev-server": "^0.13.0",
|
|
55
55
|
"@trpc/server": "^10.45.2",
|
|
56
56
|
"@types/node": "^18.19.14",
|
|
57
|
+
"@universal-middleware/hono": "^0.1.1",
|
|
57
58
|
"cross-env": "^7.0.3",
|
|
58
59
|
dotenv: "^16.4.5",
|
|
59
|
-
hono: "^4.4.
|
|
60
|
+
hono: "^4.4.13",
|
|
60
61
|
telefunc: "^0.1.76",
|
|
61
62
|
tsx: "^4.16.2",
|
|
62
63
|
vike: "^0.4.179",
|
|
@@ -119,6 +120,7 @@ async function getPackageJson(props) {
|
|
|
119
120
|
devDependencies: ["@hono/vite-dev-server", "@types/node"],
|
|
120
121
|
dependencies: [
|
|
121
122
|
"@hono/node-server",
|
|
123
|
+
"@universal-middleware/hono",
|
|
122
124
|
"cross-env",
|
|
123
125
|
"hono",
|
|
124
126
|
"tsx",
|
|
@@ -14,32 +14,7 @@ import { tsRestHandler } from "@batijs/ts-rest/server/ts-rest-handler";
|
|
|
14
14
|
import { type FetchCreateContextFnOptions, fetchRequestHandler } from "@trpc/server/adapters/fetch";
|
|
15
15
|
import { Hono } from "hono";
|
|
16
16
|
import { handle } from "hono/vercel";
|
|
17
|
-
import { createMiddleware } from "hono
|
|
18
|
-
|
|
19
|
-
interface Middleware<Context extends Record<string | number | symbol, unknown>> {
|
|
20
|
-
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(
|
|
24
|
-
handler: Middleware<Context>,
|
|
25
|
-
) {
|
|
26
|
-
return createMiddleware(async (context, next) => {
|
|
27
|
-
let ctx = context.get("context");
|
|
28
|
-
if (!ctx) {
|
|
29
|
-
ctx = {};
|
|
30
|
-
context.set("context", ctx);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const res = await handler(context.req.raw, ctx as Context);
|
|
34
|
-
context.set("context", ctx);
|
|
35
|
-
|
|
36
|
-
if (!res) {
|
|
37
|
-
await next();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return res;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
17
|
+
import { createHandler, createMiddleware } from "@universal-middleware/hono";
|
|
43
18
|
|
|
44
19
|
const app = new Hono();
|
|
45
20
|
|
|
@@ -47,19 +22,19 @@ if (BATI.has("authjs") || BATI.has("auth0")) {
|
|
|
47
22
|
/**
|
|
48
23
|
* Append Auth.js session to context
|
|
49
24
|
**/
|
|
50
|
-
app.use(
|
|
25
|
+
app.use(createMiddleware(authjsSessionMiddleware));
|
|
51
26
|
|
|
52
27
|
/**
|
|
53
28
|
* Auth.js route
|
|
54
29
|
* @link {@see https://authjs.dev/getting-started/installation}
|
|
55
30
|
**/
|
|
56
|
-
app.use("/api/auth/**",
|
|
31
|
+
app.use("/api/auth/**", createHandler(authjsHandler));
|
|
57
32
|
}
|
|
58
33
|
|
|
59
34
|
if (BATI.has("firebase-auth")) {
|
|
60
|
-
app.use(
|
|
61
|
-
app.post("/api/sessionLogin",
|
|
62
|
-
app.post("/api/sessionLogout",
|
|
35
|
+
app.use(createMiddleware(firebaseAuthMiddleware));
|
|
36
|
+
app.post("/api/sessionLogin", createHandler(firebaseAuthLoginHandler));
|
|
37
|
+
app.post("/api/sessionLogout", createHandler(firebaseAuthLogoutHandler));
|
|
63
38
|
}
|
|
64
39
|
|
|
65
40
|
if (BATI.has("trpc")) {
|
|
@@ -86,15 +61,15 @@ if (BATI.has("telefunc")) {
|
|
|
86
61
|
*
|
|
87
62
|
* @link {@see https://telefunc.com}
|
|
88
63
|
**/
|
|
89
|
-
app.post("/_telefunc",
|
|
64
|
+
app.post("/_telefunc", createHandler(telefuncHandler));
|
|
90
65
|
}
|
|
91
66
|
|
|
92
67
|
if (BATI.has("ts-rest")) {
|
|
93
|
-
app.all("/api/*",
|
|
68
|
+
app.all("/api/*", createHandler(tsRestHandler));
|
|
94
69
|
}
|
|
95
70
|
|
|
96
71
|
if (!BATI.has("telefunc") && !BATI.has("trpc") && !BATI.has("ts-rest")) {
|
|
97
|
-
app.post("/api/todo/create",
|
|
72
|
+
app.post("/api/todo/create", createHandler(createTodoHandler));
|
|
98
73
|
}
|
|
99
74
|
|
|
100
75
|
/**
|
|
@@ -102,7 +77,7 @@ if (!BATI.has("telefunc") && !BATI.has("trpc") && !BATI.has("ts-rest")) {
|
|
|
102
77
|
*
|
|
103
78
|
* @link {@see https://vike.dev}
|
|
104
79
|
**/
|
|
105
|
-
app.all("*",
|
|
80
|
+
app.all("*", createHandler(vikeHandler));
|
|
106
81
|
|
|
107
82
|
//# BATI.has("vercel")
|
|
108
83
|
export const GET = handle(app);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
interface Middleware<Context extends Record<string | number | symbol, unknown>> {
|
|
4
|
-
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
5
|
-
}
|
|
6
|
-
export declare function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(handler: Middleware<Context>): import("hono").MiddlewareHandler<any, any, {}>;
|
|
7
3
|
export declare const GET: (req: Request, requestContext: import("hono/types").FetchEventLike) => Response | Promise<Response>;
|
|
8
4
|
export declare const POST: (req: Request, requestContext: import("hono/types").FetchEventLike) => Response | Promise<Response>;
|
|
9
5
|
declare const _default: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/"> | undefined;
|
|
@@ -42,10 +42,10 @@ var require_package = __commonJS({
|
|
|
42
42
|
license: "MIT",
|
|
43
43
|
devDependencies: {
|
|
44
44
|
"@batijs/compile": "workspace:*",
|
|
45
|
-
"@prisma/client": "^5.16.
|
|
45
|
+
"@prisma/client": "^5.16.2",
|
|
46
46
|
"@types/node": "^18.19.14",
|
|
47
47
|
colorette: "^2.0.20",
|
|
48
|
-
prisma: "^5.16.
|
|
48
|
+
prisma: "^5.16.2"
|
|
49
49
|
},
|
|
50
50
|
dependencies: {
|
|
51
51
|
"@batijs/core": "workspace:*"
|
|
@@ -41,7 +41,7 @@ var require_package = __commonJS({
|
|
|
41
41
|
author: "",
|
|
42
42
|
license: "MIT",
|
|
43
43
|
devDependencies: {
|
|
44
|
-
"@babel/core": "^7.24.
|
|
44
|
+
"@babel/core": "^7.24.8",
|
|
45
45
|
"@babel/plugin-syntax-flow": "^7.24.7",
|
|
46
46
|
"@babel/plugin-transform-react-jsx": "^7.24.7",
|
|
47
47
|
"@batijs/compile": "workspace:^",
|
package/dist/index.js
CHANGED
|
@@ -1614,7 +1614,7 @@ var import_which_pm_runs = __toESM(require_which_pm_runs(), 1);
|
|
|
1614
1614
|
// package.json
|
|
1615
1615
|
var package_default = {
|
|
1616
1616
|
name: "@batijs/cli",
|
|
1617
|
-
version: "0.0.
|
|
1617
|
+
version: "0.0.224",
|
|
1618
1618
|
type: "module",
|
|
1619
1619
|
scripts: {
|
|
1620
1620
|
"check-types": "tsc --noEmit",
|
|
@@ -1637,7 +1637,7 @@ var package_default = {
|
|
|
1637
1637
|
colorette: "^2.0.20",
|
|
1638
1638
|
esbuild: "^0.23.0",
|
|
1639
1639
|
execa: "^9.3.0",
|
|
1640
|
-
rimraf: "^
|
|
1640
|
+
rimraf: "^6.0.1",
|
|
1641
1641
|
sift: "^17.1.3",
|
|
1642
1642
|
tsup: "^8.1.0",
|
|
1643
1643
|
typescript: "^5.5.3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.224",
|
|
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",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"colorette": "^2.0.20",
|
|
16
16
|
"esbuild": "^0.23.0",
|
|
17
17
|
"execa": "^9.3.0",
|
|
18
|
-
"rimraf": "^
|
|
18
|
+
"rimraf": "^6.0.1",
|
|
19
19
|
"sift": "^17.1.3",
|
|
20
20
|
"tsup": "^8.1.0",
|
|
21
21
|
"typescript": "^5.5.3",
|
|
22
22
|
"unplugin-purge-polyfills": "^0.0.4",
|
|
23
23
|
"vite": "^5.3.3",
|
|
24
24
|
"which-pm-runs": "^1.1.0",
|
|
25
|
-
"@batijs/
|
|
26
|
-
"@batijs/
|
|
25
|
+
"@batijs/build": "0.0.224",
|
|
26
|
+
"@batijs/compile": "0.0.224"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@batijs/
|
|
30
|
-
"@batijs/
|
|
29
|
+
"@batijs/features": "0.0.224",
|
|
30
|
+
"@batijs/core": "0.0.224"
|
|
31
31
|
},
|
|
32
32
|
"bin": "./dist/index.js",
|
|
33
33
|
"exports": {
|