@batijs/cli 0.0.218 → 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/edgedb/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
- 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/h3/files/$package.json.js +1 -1
- 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 +21 -7
- 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/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 +1 -1
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +0 -3
- package/dist/boilerplates/@batijs/shared/files/vite.config.ts +19 -5
- package/dist/boilerplates/@batijs/shared/types/vite.config.d.ts +1 -10
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/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 +1 -1
- package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/boilerplates/@batijs/hattip/files/$vite.config.ts.js +0 -14
|
@@ -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;
|
|
@@ -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",
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -2,9 +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
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",
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
//# BATI.has("REMOVE-COMMENT") || "remove-comments-only"
|
|
2
2
|
/// <reference types="vite-plugin-vercel/types" />
|
|
3
|
-
|
|
3
|
+
/// <reference types="@batijs/core/types" />
|
|
4
|
+
import { defineConfig } from "vite";
|
|
4
5
|
import vike from "vike/plugin";
|
|
6
|
+
import { hattip } from "@hattip/vite";
|
|
5
7
|
|
|
6
|
-
export default {
|
|
8
|
+
export default defineConfig({
|
|
7
9
|
plugins: [
|
|
8
10
|
vike({
|
|
9
11
|
//# BATI.has("vercel")
|
|
10
12
|
prerender: true,
|
|
11
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(),
|
|
12
18
|
],
|
|
13
|
-
//# BATI.has("vercel") && BATI.has("express")
|
|
19
|
+
//# BATI.has("vercel") && (BATI.has("express") || BATI.has("fastify") || BATI.has("hono") || BATI.has("hattip") || BATI.has("h3"))
|
|
14
20
|
vercel: {
|
|
15
21
|
additionalEndpoints: [
|
|
16
22
|
{
|
|
17
23
|
// entry file to the server. Default export must be a node server or a function
|
|
18
|
-
source:
|
|
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",
|
|
19
33
|
// replaces default Vike target
|
|
20
34
|
destination: "ssr_",
|
|
21
35
|
// already added by default Vike route
|
|
@@ -23,4 +37,4 @@ export default {
|
|
|
23
37
|
},
|
|
24
38
|
],
|
|
25
39
|
},
|
|
26
|
-
}
|
|
40
|
+
});
|
|
@@ -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
|
|
@@ -2,7 +2,7 @@
|
|
|
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") ? {
|
|
5
|
+
const options = props.meta.BATI.has("express") || props.meta.BATI.has("fastify") ? {
|
|
6
6
|
source: "/.*"
|
|
7
7
|
} : void 0;
|
|
8
8
|
addVitePlugin(mod, {
|
package/dist/index.js
CHANGED
|
@@ -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",
|
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",
|
|
@@ -22,12 +22,12 @@
|
|
|
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.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
|
-
};
|