@batijs/cli 0.0.217 → 0.0.219
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 +3 -3
- 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/eslint/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/express/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/express/files/express-entry.ts +4 -3
- package/dist/boilerplates/@batijs/express/types/express-entry.d.ts +2 -1
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/fastify/files/fastify-entry.ts +27 -5
- package/dist/boilerplates/@batijs/fastify/types/fastify-entry.d.ts +2 -1
- package/dist/boilerplates/@batijs/firebase-auth/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/h3/files/h3-entry.ts +21 -8
- package/dist/boilerplates/@batijs/h3/types/h3-entry.d.ts +3 -1
- package/dist/boilerplates/@batijs/hattip/files/$package.json.js +24 -10
- package/dist/boilerplates/@batijs/hattip/files/hattip-entry.ts +9 -1
- package/dist/boilerplates/@batijs/hattip/types/hattip-entry.d.ts +3 -1
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/hono/files/hono-entry.node.ts +2 -2
- package/dist/boilerplates/@batijs/hono/files/hono-entry.ts +8 -2
- package/dist/boilerplates/@batijs/hono/types/hono-entry.d.ts +4 -2
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +0 -8
- package/dist/boilerplates/@batijs/shared/files/package.json +3 -4
- package/dist/boilerplates/@batijs/shared/files/vite.config.ts +36 -1
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +0 -8
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +3 -1
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/vercel/files/$tsconfig.json.js +10 -0
- package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +5 -1
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +0 -4
- package/dist/index.js +8 -8
- package/package.json +8 -8
- package/dist/boilerplates/@batijs/hattip/files/$vite.config.ts.js +0 -14
- package/dist/boilerplates/@batijs/shared-plain/files/$vite.config.ts.js +0 -13
|
@@ -42,11 +42,11 @@ var require_package = __commonJS({
|
|
|
42
42
|
license: "MIT",
|
|
43
43
|
devDependencies: {
|
|
44
44
|
"@batijs/compile": "workspace:*",
|
|
45
|
-
"@types/node": "^18.19.14",
|
|
46
45
|
"@hattip/adapter-cloudflare-workers": "^0.0.46",
|
|
47
|
-
"
|
|
46
|
+
"@types/node": "^18.19.14",
|
|
47
|
+
"npm-run-all2": "^6.2.2",
|
|
48
48
|
"vike-cloudflare": "^0.0.4",
|
|
49
|
-
wrangler: "^3.
|
|
49
|
+
wrangler: "^3.63.0"
|
|
50
50
|
},
|
|
51
51
|
dependencies: {
|
|
52
52
|
"@batijs/core": "workspace:*"
|
|
@@ -42,12 +42,12 @@ var require_package = __commonJS({
|
|
|
42
42
|
license: "MIT",
|
|
43
43
|
devDependencies: {
|
|
44
44
|
"@batijs/compile": "workspace:*",
|
|
45
|
-
"@types/better-sqlite3": "^7.6.
|
|
45
|
+
"@types/better-sqlite3": "^7.6.11",
|
|
46
46
|
"@types/node": "^18.19.14",
|
|
47
|
-
"better-sqlite3": "^11.1.
|
|
47
|
+
"better-sqlite3": "^11.1.2",
|
|
48
48
|
"drizzle-kit": "^0.22.8",
|
|
49
49
|
"drizzle-orm": "^0.31.2",
|
|
50
|
-
tsx: "^4.16.
|
|
50
|
+
tsx: "^4.16.2"
|
|
51
51
|
},
|
|
52
52
|
dependencies: {
|
|
53
53
|
"@batijs/core": "workspace:*"
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/eslint",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
keywords: [],
|
|
@@ -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.15.0",
|
|
46
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
47
47
|
eslint: "^8.57.0"
|
|
48
48
|
},
|
|
49
49
|
dependencies: {
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/express",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -60,10 +60,10 @@ var require_package = __commonJS({
|
|
|
60
60
|
dotenv: "^16.4.5",
|
|
61
61
|
express: "^4.19.2",
|
|
62
62
|
"express-openid-connect": "^2.17.1",
|
|
63
|
-
telefunc: "^0.1.
|
|
64
|
-
tsx: "^4.16.
|
|
65
|
-
vike: "^0.4.
|
|
66
|
-
vite: "^5.3.
|
|
63
|
+
telefunc: "^0.1.76",
|
|
64
|
+
tsx: "^4.16.2",
|
|
65
|
+
vike: "^0.4.178",
|
|
66
|
+
vite: "^5.3.3"
|
|
67
67
|
},
|
|
68
68
|
dependencies: {
|
|
69
69
|
"@batijs/core": "workspace:*"
|
|
@@ -19,7 +19,6 @@ import express from "express";
|
|
|
19
19
|
|
|
20
20
|
const __filename = fileURLToPath(import.meta.url);
|
|
21
21
|
const __dirname = dirname(__filename);
|
|
22
|
-
const isProduction = process.env.NODE_ENV === "production";
|
|
23
22
|
const root = __dirname;
|
|
24
23
|
const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
|
|
25
24
|
const hmrPort = process.env.HMR_PORT ? parseInt(process.env.HMR_PORT, 10) : 24678;
|
|
@@ -52,12 +51,12 @@ export function handlerAdapter<Context extends Record<string | number | symbol,
|
|
|
52
51
|
);
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
startServer();
|
|
54
|
+
export default (await startServer()) as unknown;
|
|
56
55
|
|
|
57
56
|
async function startServer() {
|
|
58
57
|
const app = express();
|
|
59
58
|
|
|
60
|
-
if (
|
|
59
|
+
if (process.env.NODE_ENV === "production") {
|
|
61
60
|
app.use(express.static(`${root}/dist/client`));
|
|
62
61
|
} else {
|
|
63
62
|
// Instantiate Vite's development server and integrate its middleware to our server.
|
|
@@ -136,4 +135,6 @@ async function startServer() {
|
|
|
136
135
|
app.listen(port, () => {
|
|
137
136
|
console.log(`Server listening on http://localhost:${port}`);
|
|
138
137
|
});
|
|
138
|
+
|
|
139
|
+
return app;
|
|
139
140
|
}
|
|
@@ -3,4 +3,5 @@ interface Middleware<Context extends Record<string | number | symbol, unknown>>
|
|
|
3
3
|
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
4
4
|
}
|
|
5
5
|
export declare function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(handler: Middleware<Context>): import("@universal-middleware/express/native-fetch").NodeMiddleware;
|
|
6
|
-
|
|
6
|
+
declare const _default: unknown;
|
|
7
|
+
export default _default;
|
|
@@ -59,10 +59,10 @@ var require_package = __commonJS({
|
|
|
59
59
|
"cross-env": "^7.0.3",
|
|
60
60
|
dotenv: "^16.4.5",
|
|
61
61
|
fastify: "^4.28.1",
|
|
62
|
-
telefunc: "^0.1.
|
|
63
|
-
tsx: "^4.16.
|
|
64
|
-
vike: "^0.4.
|
|
65
|
-
vite: "^5.3.
|
|
62
|
+
telefunc: "^0.1.76",
|
|
63
|
+
tsx: "^4.16.2",
|
|
64
|
+
vike: "^0.4.178",
|
|
65
|
+
vite: "^5.3.3"
|
|
66
66
|
},
|
|
67
67
|
dependencies: {
|
|
68
68
|
"@batijs/core": "workspace:*"
|
|
@@ -14,8 +14,8 @@ import { telefuncHandler } from "@batijs/telefunc/server/telefunc-handler";
|
|
|
14
14
|
import { appRouter, type AppRouter } from "@batijs/trpc/trpc/server";
|
|
15
15
|
import { tsRestHandler } from "@batijs/ts-rest/server/ts-rest-handler";
|
|
16
16
|
import {
|
|
17
|
-
fastifyTRPCPlugin,
|
|
18
17
|
type CreateFastifyContextOptions,
|
|
18
|
+
fastifyTRPCPlugin,
|
|
19
19
|
type FastifyTRPCPluginOptions,
|
|
20
20
|
} from "@trpc/server/adapters/fastify";
|
|
21
21
|
import { createRequestAdapter } from "@universal-middleware/express";
|
|
@@ -24,7 +24,6 @@ import type { RouteHandlerMethod } from "fastify/types/route";
|
|
|
24
24
|
|
|
25
25
|
const __filename = fileURLToPath(import.meta.url);
|
|
26
26
|
const __dirname = dirname(__filename);
|
|
27
|
-
const isProduction = process.env.NODE_ENV === "production";
|
|
28
27
|
const root = __dirname;
|
|
29
28
|
const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
|
|
30
29
|
const hmrPort = process.env.HMR_PORT ? parseInt(process.env.HMR_PORT, 10) : 24678;
|
|
@@ -62,8 +61,6 @@ export function handlerAdapter<Context extends Record<string | number | symbol,
|
|
|
62
61
|
}) satisfies RouteHandlerMethod;
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
startServer();
|
|
66
|
-
|
|
67
64
|
async function startServer() {
|
|
68
65
|
const app = Fastify();
|
|
69
66
|
|
|
@@ -76,7 +73,7 @@ async function startServer() {
|
|
|
76
73
|
|
|
77
74
|
await app.register(await import("@fastify/middie"));
|
|
78
75
|
|
|
79
|
-
if (
|
|
76
|
+
if (process.env.NODE_ENV === "production") {
|
|
80
77
|
await app.register(await import("@fastify/static"), {
|
|
81
78
|
root: `${root}/dist/client`,
|
|
82
79
|
wildcard: false,
|
|
@@ -159,6 +156,31 @@ async function startServer() {
|
|
|
159
156
|
**/
|
|
160
157
|
app.all("/*", handlerAdapter(vikeHandler));
|
|
161
158
|
|
|
159
|
+
return app;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const app = await startServer();
|
|
163
|
+
|
|
164
|
+
//# BATI.has('vercel')
|
|
165
|
+
// Vercel handler
|
|
166
|
+
export default async (req: Request, res: Response) => {
|
|
167
|
+
await app.ready();
|
|
168
|
+
app.server.emit("request", req, res);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
if (BATI.has("vercel")) {
|
|
172
|
+
// Development listener
|
|
173
|
+
if (process.env.NODE_ENV !== "production") {
|
|
174
|
+
app.listen(
|
|
175
|
+
{
|
|
176
|
+
port: port,
|
|
177
|
+
},
|
|
178
|
+
() => {
|
|
179
|
+
console.log(`Server listening on http://localhost:${port}`);
|
|
180
|
+
},
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
162
184
|
app.listen(
|
|
163
185
|
{
|
|
164
186
|
port: port,
|
|
@@ -3,4 +3,5 @@ interface Middleware<Context extends Record<string | number | symbol, unknown>>
|
|
|
3
3
|
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
4
4
|
}
|
|
5
5
|
export declare function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(handler: Middleware<Context>): (this: import("fastify").FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>, request: import("fastify").FastifyRequest<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown, import("fastify").FastifyBaseLogger, import("fastify/types/type-provider").ResolveFastifyRequestType<import("fastify").FastifyTypeProviderDefault, import("fastify").FastifySchema, import("fastify").RouteGenericInterface>>, reply: import("fastify").FastifyReply<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").RouteGenericInterface, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown>) => Promise<undefined>;
|
|
6
|
-
|
|
6
|
+
declare const _default: (req: Request, res: Response) => Promise<void>;
|
|
7
|
+
export default _default;
|
|
@@ -46,11 +46,11 @@ var require_package = __commonJS({
|
|
|
46
46
|
"@types/node": "^18.19.14",
|
|
47
47
|
cookie: "^0.6.0",
|
|
48
48
|
dotenv: "^16.4.5",
|
|
49
|
-
firebase: "^10.12.
|
|
49
|
+
firebase: "^10.12.3",
|
|
50
50
|
"firebase-admin": "^12.2.0",
|
|
51
51
|
firebaseui: "^6.1.0",
|
|
52
|
-
vike: "^0.4.
|
|
53
|
-
vite: "^5.3.
|
|
52
|
+
vike: "^0.4.178",
|
|
53
|
+
vite: "^5.3.3"
|
|
54
54
|
},
|
|
55
55
|
dependencies: {
|
|
56
56
|
"@batijs/core": "workspace:*"
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/h3",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -59,10 +59,10 @@ var require_package = __commonJS({
|
|
|
59
59
|
dotenv: "^16.4.5",
|
|
60
60
|
h3: "~1.12.0",
|
|
61
61
|
"serve-static": "^1.15.0",
|
|
62
|
-
telefunc: "^0.1.
|
|
63
|
-
tsx: "^4.16.
|
|
64
|
-
vike: "^0.4.
|
|
65
|
-
vite: "^5.3.
|
|
62
|
+
telefunc: "^0.1.76",
|
|
63
|
+
tsx: "^4.16.2",
|
|
64
|
+
vike: "^0.4.178",
|
|
65
|
+
vite: "^5.3.3"
|
|
66
66
|
},
|
|
67
67
|
dependencies: {
|
|
68
68
|
"@batijs/core": "workspace:*"
|
|
@@ -17,7 +17,7 @@ import { tsRestHandler } from "@batijs/ts-rest/server/ts-rest-handler";
|
|
|
17
17
|
import installCrypto from "@hattip/polyfills/crypto";
|
|
18
18
|
import installGetSetCookie from "@hattip/polyfills/get-set-cookie";
|
|
19
19
|
import installWhatwgNodeFetch from "@hattip/polyfills/whatwg-node";
|
|
20
|
-
import {
|
|
20
|
+
import { type NodeHTTPCreateContextFnOptions, nodeHTTPRequestHandler } from "@trpc/server/adapters/node-http";
|
|
21
21
|
import {
|
|
22
22
|
createApp,
|
|
23
23
|
createRouter,
|
|
@@ -35,7 +35,6 @@ installCrypto();
|
|
|
35
35
|
|
|
36
36
|
const __filename = fileURLToPath(import.meta.url);
|
|
37
37
|
const __dirname = dirname(__filename);
|
|
38
|
-
const isProduction = process.env.NODE_ENV === "production";
|
|
39
38
|
const root = __dirname;
|
|
40
39
|
const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
|
|
41
40
|
const hmrPort = process.env.HMR_PORT ? parseInt(process.env.HMR_PORT, 10) : 24678;
|
|
@@ -54,12 +53,12 @@ export function fromWebMiddleware<Context extends Record<string | number | symbo
|
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
startServer();
|
|
56
|
+
export default await startServer();
|
|
58
57
|
|
|
59
58
|
async function startServer() {
|
|
60
59
|
const app = createApp();
|
|
61
60
|
|
|
62
|
-
if (
|
|
61
|
+
if (process.env.NODE_ENV === "production") {
|
|
63
62
|
app.use("/", fromNodeMiddleware(serveStatic(`${root}/dist/client`)));
|
|
64
63
|
} else {
|
|
65
64
|
// Instantiate Vite's development server and integrate its middleware to our server.
|
|
@@ -144,9 +143,23 @@ async function startServer() {
|
|
|
144
143
|
|
|
145
144
|
app.use(router);
|
|
146
145
|
|
|
147
|
-
const server = createServer(toNodeListener(app))
|
|
146
|
+
const server = createServer(toNodeListener(app));
|
|
148
147
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
if (BATI.has("vercel")) {
|
|
149
|
+
if (process.env.NODE_ENV !== "production") {
|
|
150
|
+
server.listen(port);
|
|
151
|
+
|
|
152
|
+
server.on("listening", () => {
|
|
153
|
+
console.log(`Server listening on http://localhost:${port}`);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
server.listen(port);
|
|
158
|
+
|
|
159
|
+
server.on("listening", () => {
|
|
160
|
+
console.log(`Server listening on http://localhost:${port}`);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return server;
|
|
152
165
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
|
+
import { type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
3
|
interface Middleware<Context extends Record<string | number | symbol, unknown>> {
|
|
3
4
|
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
4
5
|
}
|
|
5
6
|
export declare function fromWebMiddleware<Context extends Record<string | number | symbol, unknown>>(handler: Middleware<Context>): import("h3").EventHandler<import("h3").EventHandlerRequest, void | Response | Promise<Response> | Promise<void>>;
|
|
6
|
-
|
|
7
|
+
declare const _default: import("http").Server<typeof IncomingMessage, typeof ServerResponse>;
|
|
8
|
+
export default _default;
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/hattip",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -51,6 +51,7 @@ var require_package = __commonJS({
|
|
|
51
51
|
"@batijs/trpc": "workspace:^",
|
|
52
52
|
"@batijs/ts-rest": "workspace:*",
|
|
53
53
|
"@hattip/adapter-node": "^0.0.46",
|
|
54
|
+
"@hattip/adapter-vercel-edge": "^0.0.46",
|
|
54
55
|
"@hattip/core": "^0.0.46",
|
|
55
56
|
"@hattip/router": "^0.0.46",
|
|
56
57
|
"@hattip/vite": "^0.0.46",
|
|
@@ -59,9 +60,9 @@ var require_package = __commonJS({
|
|
|
59
60
|
"cross-env": "^7.0.3",
|
|
60
61
|
dotenv: "^16.4.5",
|
|
61
62
|
hattip: "^0.0.33",
|
|
62
|
-
telefunc: "^0.1.
|
|
63
|
-
vike: "^0.4.
|
|
64
|
-
vite: "^5.3.
|
|
63
|
+
telefunc: "^0.1.76",
|
|
64
|
+
vike: "^0.4.178",
|
|
65
|
+
vite: "^5.3.3"
|
|
65
66
|
},
|
|
66
67
|
dependencies: {
|
|
67
68
|
"@batijs/core": "workspace:*"
|
|
@@ -99,13 +100,25 @@ async function getPackageJson(props) {
|
|
|
99
100
|
value: "hattip serve ./hattip-entry.ts --client",
|
|
100
101
|
precedence: 20,
|
|
101
102
|
warnIfReplaced: true
|
|
102
|
-
},
|
|
103
|
-
build: {
|
|
104
|
-
value: "cross-env NODE_ENV=production hattip build ./hattip-entry.ts --target es2022 --client",
|
|
105
|
-
precedence: 20,
|
|
106
|
-
warnIfReplaced: true
|
|
107
103
|
}
|
|
108
104
|
});
|
|
105
|
+
if (props.meta.BATI.has("vercel")) {
|
|
106
|
+
setScripts(packageJson, {
|
|
107
|
+
build: {
|
|
108
|
+
value: "cross-env NODE_ENV=production vite build",
|
|
109
|
+
precedence: 20,
|
|
110
|
+
warnIfReplaced: true
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
setScripts(packageJson, {
|
|
115
|
+
build: {
|
|
116
|
+
value: "cross-env NODE_ENV=production hattip build ./hattip-entry.ts --target es2022 --client",
|
|
117
|
+
precedence: 20,
|
|
118
|
+
warnIfReplaced: true
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
109
122
|
if (packageJson.scripts.preview) {
|
|
110
123
|
delete packageJson.scripts.preview;
|
|
111
124
|
}
|
|
@@ -118,7 +131,8 @@ async function getPackageJson(props) {
|
|
|
118
131
|
"hattip",
|
|
119
132
|
"vite",
|
|
120
133
|
"vike",
|
|
121
|
-
...props.meta.BATI.has("authjs") || props.meta.BATI.has("auth0") ? ["@auth/core", "dotenv"] : []
|
|
134
|
+
...props.meta.BATI.has("authjs") || props.meta.BATI.has("auth0") ? ["@auth/core", "dotenv"] : [],
|
|
135
|
+
...props.meta.BATI.has("vercel") ? ["@hattip/adapter-vercel-edge"] : []
|
|
122
136
|
]
|
|
123
137
|
});
|
|
124
138
|
}
|
|
@@ -14,6 +14,7 @@ import { tsRestHandler } from "@batijs/ts-rest/server/ts-rest-handler";
|
|
|
14
14
|
import type { HattipHandler } from "@hattip/core";
|
|
15
15
|
import { createRouter, type RouteHandler } from "@hattip/router";
|
|
16
16
|
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
|
|
17
|
+
import vercelAdapter from "@hattip/adapter-vercel-edge";
|
|
17
18
|
|
|
18
19
|
interface Middleware<Context extends Record<string | number | symbol, unknown>> {
|
|
19
20
|
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
@@ -92,4 +93,11 @@ if (!BATI.has("telefunc") && !BATI.has("trpc") && !BATI.has("ts-rest")) {
|
|
|
92
93
|
**/
|
|
93
94
|
router.use(handlerAdapter(vikeHandler));
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
const handler: HattipHandler = router.buildHandler();
|
|
97
|
+
|
|
98
|
+
//# BATI.has("vercel")
|
|
99
|
+
export const GET = vercelAdapter(handler);
|
|
100
|
+
//# BATI.has("vercel")
|
|
101
|
+
export const POST = vercelAdapter(handler);
|
|
102
|
+
|
|
103
|
+
export default BATI.has("vercel") ? (process.env.NODE_ENV === "production" ? undefined : handler) : handler;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
2
|
import type { HattipHandler } from "@hattip/core";
|
|
3
|
-
declare const
|
|
3
|
+
export declare const GET: import("@hattip/adapter-vercel-edge").VercelEdgeFunction;
|
|
4
|
+
export declare const POST: import("@hattip/adapter-vercel-edge").VercelEdgeFunction;
|
|
5
|
+
declare const _default: HattipHandler | undefined;
|
|
4
6
|
export default _default;
|
|
@@ -50,17 +50,17 @@ var require_package = __commonJS({
|
|
|
50
50
|
"@batijs/telefunc": "workspace:^",
|
|
51
51
|
"@batijs/trpc": "workspace:^",
|
|
52
52
|
"@batijs/ts-rest": "workspace:*",
|
|
53
|
-
"@hono/node-server": "^1.
|
|
53
|
+
"@hono/node-server": "^1.12.0",
|
|
54
54
|
"@hono/vite-dev-server": "^0.12.2",
|
|
55
55
|
"@trpc/server": "^10.45.2",
|
|
56
56
|
"@types/node": "^18.19.14",
|
|
57
57
|
"cross-env": "^7.0.3",
|
|
58
58
|
dotenv: "^16.4.5",
|
|
59
|
-
hono: "^4.4.
|
|
60
|
-
telefunc: "^0.1.
|
|
61
|
-
tsx: "^4.16.
|
|
62
|
-
vike: "^0.4.
|
|
63
|
-
vite: "^5.3.
|
|
59
|
+
hono: "^4.4.11",
|
|
60
|
+
telefunc: "^0.1.76",
|
|
61
|
+
tsx: "^4.16.2",
|
|
62
|
+
vike: "^0.4.178",
|
|
63
|
+
vite: "^5.3.3"
|
|
64
64
|
},
|
|
65
65
|
dependencies: {
|
|
66
66
|
"@batijs/core": "workspace:*"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { serve } from "@hono/node-server";
|
|
2
2
|
import { serveStatic } from "@hono/node-server/serve-static";
|
|
3
|
-
import {
|
|
3
|
+
import { type Context, Hono } from "hono";
|
|
4
4
|
import { env } from "hono/adapter";
|
|
5
5
|
import { compress } from "hono/compress";
|
|
6
6
|
import app from "./hono-entry.js";
|
|
@@ -18,7 +18,7 @@ nodeApp.use(
|
|
|
18
18
|
}),
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
-
nodeApp.route("/", app);
|
|
21
|
+
nodeApp.route("/", app!);
|
|
22
22
|
|
|
23
23
|
const port = envs.PORT ? parseInt(envs.PORT, 10) : 3000;
|
|
24
24
|
|
|
@@ -11,8 +11,9 @@ 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 {
|
|
14
|
+
import { type FetchCreateContextFnOptions, fetchRequestHandler } from "@trpc/server/adapters/fetch";
|
|
15
15
|
import { Hono } from "hono";
|
|
16
|
+
import { handle } from "hono/vercel";
|
|
16
17
|
import { createMiddleware } from "hono/factory";
|
|
17
18
|
|
|
18
19
|
interface Middleware<Context extends Record<string | number | symbol, unknown>> {
|
|
@@ -103,4 +104,9 @@ if (!BATI.has("telefunc") && !BATI.has("trpc") && !BATI.has("ts-rest")) {
|
|
|
103
104
|
**/
|
|
104
105
|
app.all("*", handlerAdapter(vikeHandler));
|
|
105
106
|
|
|
106
|
-
|
|
107
|
+
//# BATI.has("vercel")
|
|
108
|
+
export const GET = handle(app);
|
|
109
|
+
//# BATI.has("vercel")
|
|
110
|
+
export const POST = handle(app);
|
|
111
|
+
|
|
112
|
+
export default BATI.has("vercel") ? (process.env.NODE_ENV === "production" ? undefined : app) : app;
|
|
@@ -4,5 +4,7 @@ interface Middleware<Context extends Record<string | number | symbol, unknown>>
|
|
|
4
4
|
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
|
|
5
5
|
}
|
|
6
6
|
export declare function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(handler: Middleware<Context>): import("hono").MiddlewareHandler<any, any, {}>;
|
|
7
|
-
declare const
|
|
8
|
-
export
|
|
7
|
+
export declare const GET: (req: Request, requestContext: import("hono/types").FetchEventLike) => Response | Promise<Response>;
|
|
8
|
+
export declare const POST: (req: Request, requestContext: import("hono/types").FetchEventLike) => Response | Promise<Response>;
|
|
9
|
+
declare const _default: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/"> | undefined;
|
|
10
|
+
export default _default;
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/react",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -59,10 +59,10 @@ var require_package = __commonJS({
|
|
|
59
59
|
react: "^18.3.1",
|
|
60
60
|
"react-dom": "^18.3.1",
|
|
61
61
|
tailwindcss: "^3.4.4",
|
|
62
|
-
typescript: "^5.5.
|
|
63
|
-
vike: "^0.4.
|
|
64
|
-
"vike-react": "^0.4.
|
|
65
|
-
vite: "^5.3.
|
|
62
|
+
typescript: "^5.5.3",
|
|
63
|
+
vike: "^0.4.178",
|
|
64
|
+
"vike-react": "^0.4.16",
|
|
65
|
+
vite: "^5.3.3",
|
|
66
66
|
"vite-plugin-compiled-react": "^1.1.3"
|
|
67
67
|
},
|
|
68
68
|
dependencies: {
|
|
@@ -2,20 +2,12 @@
|
|
|
2
2
|
import { addVitePlugin, loadAsMagicast } from "@batijs/core";
|
|
3
3
|
async function getViteConfig(props) {
|
|
4
4
|
const mod = await loadAsMagicast(props);
|
|
5
|
-
const vikeOptions = props.meta.BATI.has("vercel") ? {
|
|
6
|
-
prerender: true
|
|
7
|
-
} : {};
|
|
8
5
|
const reactOptions = props.meta.BATI.has("vercel") && props.meta.BATI.has("hattip") ? { jsxRuntime: "classic" } : {};
|
|
9
6
|
addVitePlugin(mod, {
|
|
10
7
|
from: "@vitejs/plugin-react",
|
|
11
8
|
constructor: "react",
|
|
12
9
|
options: reactOptions
|
|
13
10
|
});
|
|
14
|
-
addVitePlugin(mod, {
|
|
15
|
-
from: "vike/plugin",
|
|
16
|
-
constructor: "ssr",
|
|
17
|
-
options: vikeOptions
|
|
18
|
-
});
|
|
19
11
|
return mod.generate().code;
|
|
20
12
|
}
|
|
21
13
|
export {
|
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
"keywords": [],
|
|
12
12
|
"author": "",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"vite": "^5.3.2"
|
|
14
|
+
"typescript": "^5.5.3",
|
|
15
|
+
"vike": "^0.4.178",
|
|
16
|
+
"vite": "^5.3.3"
|
|
18
17
|
},
|
|
19
18
|
"dependencies": {}
|
|
20
19
|
}
|
|
@@ -1,5 +1,40 @@
|
|
|
1
|
+
//# BATI.has("REMOVE-COMMENT") || "remove-comments-only"
|
|
2
|
+
/// <reference types="vite-plugin-vercel/types" />
|
|
3
|
+
/// <reference types="@batijs/core/types" />
|
|
1
4
|
import { defineConfig } from "vite";
|
|
5
|
+
import vike from "vike/plugin";
|
|
6
|
+
import { hattip } from "@hattip/vite";
|
|
2
7
|
|
|
3
8
|
export default defineConfig({
|
|
4
|
-
plugins: [
|
|
9
|
+
plugins: [
|
|
10
|
+
vike({
|
|
11
|
+
//# BATI.has("vercel")
|
|
12
|
+
prerender: true,
|
|
13
|
+
}),
|
|
14
|
+
//# BATI.has("hattip") && BATI.has("vercel")
|
|
15
|
+
process.env.NODE_ENV !== "production" ? hattip() : undefined,
|
|
16
|
+
//# BATI.has("hattip") && !BATI.has("vercel")
|
|
17
|
+
hattip(),
|
|
18
|
+
],
|
|
19
|
+
//# BATI.has("vercel") && (BATI.has("express") || BATI.has("fastify") || BATI.has("hono") || BATI.has("hattip") || BATI.has("h3"))
|
|
20
|
+
vercel: {
|
|
21
|
+
additionalEndpoints: [
|
|
22
|
+
{
|
|
23
|
+
// entry file to the server. Default export must be a node server or a function
|
|
24
|
+
source: BATI.has("fastify")
|
|
25
|
+
? "fastify-entry.ts"
|
|
26
|
+
: BATI.has("hono")
|
|
27
|
+
? "hono-entry.ts"
|
|
28
|
+
: BATI.has("hattip")
|
|
29
|
+
? "hattip-entry.ts"
|
|
30
|
+
: BATI.has("h3")
|
|
31
|
+
? "h3-entry.ts"
|
|
32
|
+
: "express-entry.ts",
|
|
33
|
+
// replaces default Vike target
|
|
34
|
+
destination: "ssr_",
|
|
35
|
+
// already added by default Vike route
|
|
36
|
+
addRoute: false,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
5
40
|
});
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/solid",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -52,10 +52,10 @@ var require_package = __commonJS({
|
|
|
52
52
|
"eslint-plugin-solid": "^0.14.1",
|
|
53
53
|
"solid-js": "^1.8.18",
|
|
54
54
|
tailwindcss: "^3.4.4",
|
|
55
|
-
typescript: "^5.5.
|
|
56
|
-
vike: "^0.4.
|
|
55
|
+
typescript: "^5.5.3",
|
|
56
|
+
vike: "^0.4.178",
|
|
57
57
|
"vike-solid": "^0.6.2",
|
|
58
|
-
vite: "^5.3.
|
|
58
|
+
vite: "^5.3.3",
|
|
59
59
|
"vite-plugin-solid": "^2.10.2"
|
|
60
60
|
},
|
|
61
61
|
dependencies: {
|
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
import { addVitePlugin, loadAsMagicast } from "@batijs/core";
|
|
3
3
|
async function getViteConfig(props) {
|
|
4
4
|
const mod = await loadAsMagicast(props);
|
|
5
|
-
const vikeOptions = props.meta.BATI.has("vercel") ? {
|
|
6
|
-
prerender: true
|
|
7
|
-
} : {};
|
|
8
|
-
addVitePlugin(mod, {
|
|
9
|
-
from: "vike/plugin",
|
|
10
|
-
constructor: "vike",
|
|
11
|
-
options: vikeOptions
|
|
12
|
-
});
|
|
13
5
|
addVitePlugin(mod, {
|
|
14
6
|
from: "vike-solid/vite",
|
|
15
7
|
constructor: "vikeSolid"
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/tailwindcss",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -47,8 +47,8 @@ var require_package = __commonJS({
|
|
|
47
47
|
daisyui: "^4.12.10",
|
|
48
48
|
postcss: "^8.4.39",
|
|
49
49
|
tailwindcss: "^3.4.4",
|
|
50
|
-
vike: "^0.4.
|
|
51
|
-
vite: "^5.3.
|
|
50
|
+
vike: "^0.4.178",
|
|
51
|
+
vite: "^5.3.3"
|
|
52
52
|
},
|
|
53
53
|
dependencies: {
|
|
54
54
|
"@batijs/core": "workspace:*"
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/telefunc",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -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.
|
|
50
|
-
vike: "^0.4.
|
|
51
|
-
vite: "^5.3.
|
|
49
|
+
telefunc: "^0.1.76",
|
|
50
|
+
vike: "^0.4.178",
|
|
51
|
+
vite: "^5.3.3"
|
|
52
52
|
},
|
|
53
53
|
dependencies: {
|
|
54
54
|
"@batijs/core": "workspace:*"
|
|
@@ -91,9 +91,11 @@ var require_package = __commonJS({
|
|
|
91
91
|
import { addDependency, loadAsJson } from "@batijs/core";
|
|
92
92
|
async function getPackageJson(props) {
|
|
93
93
|
const packageJson = await loadAsJson(props);
|
|
94
|
-
|
|
94
|
+
addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
95
95
|
dependencies: ["@ts-rest/core", "@ts-rest/serverless"]
|
|
96
96
|
});
|
|
97
|
+
packageJson.devDependencies.typescript = "~5.4.5";
|
|
98
|
+
return packageJson;
|
|
97
99
|
}
|
|
98
100
|
export {
|
|
99
101
|
getPackageJson as default
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/vercel",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -43,10 +43,10 @@ var require_package = __commonJS({
|
|
|
43
43
|
devDependencies: {
|
|
44
44
|
"@batijs/compile": "workspace:*",
|
|
45
45
|
"@types/node": "^18.19.14",
|
|
46
|
-
"@vite-plugin-vercel/vike": "^7.0.
|
|
47
|
-
vike: "^0.4.
|
|
48
|
-
vite: "^5.3.
|
|
49
|
-
"vite-plugin-vercel": "^7.0.
|
|
46
|
+
"@vite-plugin-vercel/vike": "^7.0.1",
|
|
47
|
+
vike: "^0.4.178",
|
|
48
|
+
vite: "^5.3.3",
|
|
49
|
+
"vite-plugin-vercel": "^7.0.2"
|
|
50
50
|
},
|
|
51
51
|
dependencies: {
|
|
52
52
|
"@batijs/core": "workspace:*"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// files/$tsconfig.json.ts
|
|
2
|
+
import { loadAsJson } from "@batijs/core";
|
|
3
|
+
async function getTsConfig(props) {
|
|
4
|
+
const tsConfig = await loadAsJson(props);
|
|
5
|
+
tsConfig.compilerOptions.types = [...tsConfig.compilerOptions.types ?? [], "vite-plugin-vercel/types"];
|
|
6
|
+
return tsConfig;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
getTsConfig as default
|
|
10
|
+
};
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
import { addVitePlugin, loadAsMagicast } from "@batijs/core";
|
|
3
3
|
async function getViteConfig(props) {
|
|
4
4
|
const mod = await loadAsMagicast(props);
|
|
5
|
+
const options = props.meta.BATI.has("express") || props.meta.BATI.has("fastify") ? {
|
|
6
|
+
source: "/.*"
|
|
7
|
+
} : void 0;
|
|
5
8
|
addVitePlugin(mod, {
|
|
6
9
|
from: "vite-plugin-vercel",
|
|
7
|
-
constructor: "vercel"
|
|
10
|
+
constructor: "vercel",
|
|
11
|
+
options
|
|
8
12
|
});
|
|
9
13
|
return mod.generate().code;
|
|
10
14
|
}
|
|
@@ -30,7 +30,7 @@ var require_package = __commonJS({
|
|
|
30
30
|
module.exports = {
|
|
31
31
|
name: "@batijs/vue",
|
|
32
32
|
private: true,
|
|
33
|
-
version: "0.0.
|
|
33
|
+
version: "0.0.1",
|
|
34
34
|
description: "",
|
|
35
35
|
type: "module",
|
|
36
36
|
scripts: {
|
|
@@ -52,13 +52,13 @@ var require_package = __commonJS({
|
|
|
52
52
|
"@vue/compiler-sfc": "^3.4.31",
|
|
53
53
|
"@vue/server-renderer": "^3.4.31",
|
|
54
54
|
"cross-fetch": "^4.0.0",
|
|
55
|
-
"eslint-plugin-vue": "^9.
|
|
55
|
+
"eslint-plugin-vue": "^9.27.0",
|
|
56
56
|
tailwindcss: "^3.4.4",
|
|
57
|
-
typescript: "^5.5.
|
|
57
|
+
typescript: "^5.5.3",
|
|
58
58
|
"unplugin-vue-markdown": "^0.26.2",
|
|
59
|
-
vike: "^0.4.
|
|
59
|
+
vike: "^0.4.178",
|
|
60
60
|
"vike-vue": "^0.7.6",
|
|
61
|
-
vite: "^5.3.
|
|
61
|
+
vite: "^5.3.3",
|
|
62
62
|
vue: "^3.4.31",
|
|
63
63
|
"vue-gtag": "^2.0.1"
|
|
64
64
|
},
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
import { addVitePlugin, loadAsMagicast } from "@batijs/core";
|
|
3
3
|
async function getViteConfig(props) {
|
|
4
4
|
const mod = await loadAsMagicast(props);
|
|
5
|
-
addVitePlugin(mod, {
|
|
6
|
-
from: "vike/plugin",
|
|
7
|
-
constructor: "ssr"
|
|
8
|
-
});
|
|
9
5
|
addVitePlugin(mod, {
|
|
10
6
|
from: "@vitejs/plugin-vue",
|
|
11
7
|
constructor: "vue",
|
package/dist/index.js
CHANGED
|
@@ -142,7 +142,7 @@ async function importTransformer(p) {
|
|
|
142
142
|
}
|
|
143
143
|
function importToPotentialTargets(imp) {
|
|
144
144
|
let subject = imp;
|
|
145
|
-
const ext = path.
|
|
145
|
+
const ext = path.extname(imp);
|
|
146
146
|
const targets = [];
|
|
147
147
|
if (ext.match(/^\.[jt]sx?$/)) {
|
|
148
148
|
subject = subject.replace(/^\.[jt]sx?$/, "");
|
|
@@ -164,7 +164,7 @@ async function main(options, meta) {
|
|
|
164
164
|
function updateAllImports(target, imports) {
|
|
165
165
|
if (!imports) return;
|
|
166
166
|
for (const imp of imports.values()) {
|
|
167
|
-
const importTarget = path.
|
|
167
|
+
const importTarget = path.resolve(path.dirname(target), imp);
|
|
168
168
|
const importTargets = importToPotentialTargets(importTarget);
|
|
169
169
|
for (const imp2 of importTargets) {
|
|
170
170
|
allImports.add(imp2);
|
|
@@ -174,7 +174,7 @@ async function main(options, meta) {
|
|
|
174
174
|
async function triggerPendingTargets(target, imports) {
|
|
175
175
|
if (!imports) return;
|
|
176
176
|
for (const imp of imports.values()) {
|
|
177
|
-
const importTarget = path.
|
|
177
|
+
const importTarget = path.resolve(path.dirname(target), imp);
|
|
178
178
|
const importTargets = importToPotentialTargets(importTarget);
|
|
179
179
|
for (const imp2 of importTargets) {
|
|
180
180
|
if (includeIfImported.has(imp2)) {
|
|
@@ -189,7 +189,7 @@ async function main(options, meta) {
|
|
|
189
189
|
for (const source of sources) {
|
|
190
190
|
for await (const p of walk(source)) {
|
|
191
191
|
const target = toDist(p, source, options.dist);
|
|
192
|
-
const targetAbsolute = path.resolve(target);
|
|
192
|
+
const targetAbsolute = path.isAbsolute(target) ? target : path.resolve(target);
|
|
193
193
|
const parsed = path.parse(p);
|
|
194
194
|
if (parsed.name.match(reIgnoreFile)) {
|
|
195
195
|
continue;
|
|
@@ -1613,7 +1613,7 @@ var import_which_pm_runs = __toESM(require_which_pm_runs(), 1);
|
|
|
1613
1613
|
// package.json
|
|
1614
1614
|
var package_default = {
|
|
1615
1615
|
name: "@batijs/cli",
|
|
1616
|
-
version: "0.0.
|
|
1616
|
+
version: "0.0.219",
|
|
1617
1617
|
type: "module",
|
|
1618
1618
|
scripts: {
|
|
1619
1619
|
"check-types": "tsc --noEmit",
|
|
@@ -1634,14 +1634,14 @@ var package_default = {
|
|
|
1634
1634
|
"@types/which-pm-runs": "^1.0.2",
|
|
1635
1635
|
citty: "^0.1.6",
|
|
1636
1636
|
colorette: "^2.0.20",
|
|
1637
|
-
esbuild: "^0.
|
|
1637
|
+
esbuild: "^0.23.0",
|
|
1638
1638
|
execa: "^9.3.0",
|
|
1639
1639
|
rimraf: "^5.0.7",
|
|
1640
1640
|
sift: "^17.1.3",
|
|
1641
1641
|
tsup: "^8.1.0",
|
|
1642
|
-
typescript: "^5.5.
|
|
1642
|
+
typescript: "^5.5.3",
|
|
1643
1643
|
"unplugin-purge-polyfills": "^0.0.4",
|
|
1644
|
-
vite: "^5.3.
|
|
1644
|
+
vite: "^5.3.3",
|
|
1645
1645
|
"which-pm-runs": "^1.1.0"
|
|
1646
1646
|
},
|
|
1647
1647
|
dependencies: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.219",
|
|
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",
|
|
@@ -13,21 +13,21 @@
|
|
|
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.23.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
|
-
"typescript": "^5.5.
|
|
21
|
+
"typescript": "^5.5.3",
|
|
22
22
|
"unplugin-purge-polyfills": "^0.0.4",
|
|
23
|
-
"vite": "^5.3.
|
|
23
|
+
"vite": "^5.3.3",
|
|
24
24
|
"which-pm-runs": "^1.1.0",
|
|
25
|
-
"@batijs/build": "0.0.
|
|
26
|
-
"@batijs/compile": "0.0.
|
|
25
|
+
"@batijs/build": "0.0.219",
|
|
26
|
+
"@batijs/compile": "0.0.219"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@batijs/
|
|
30
|
-
"@batijs/
|
|
29
|
+
"@batijs/features": "0.0.219",
|
|
30
|
+
"@batijs/core": "0.0.219"
|
|
31
31
|
},
|
|
32
32
|
"bin": "./dist/index.js",
|
|
33
33
|
"exports": {
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
addVitePlugin(mod, {
|
|
6
|
-
from: "@hattip/vite",
|
|
7
|
-
imported: "hattip",
|
|
8
|
-
constructor: "hattip"
|
|
9
|
-
});
|
|
10
|
-
return mod.generate().code;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
getViteConfig as default
|
|
14
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
addVitePlugin(mod, {
|
|
6
|
-
from: "vike/plugin",
|
|
7
|
-
constructor: "ssr"
|
|
8
|
-
});
|
|
9
|
-
return mod.generate().code;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
getViteConfig as default
|
|
13
|
-
};
|