create-better-t-stack 3.37.0 → 3.38.0
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/cli.d.mts +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +31 -36
- package/dist/index.mjs +1 -1
- package/dist/{src-IZv104V2.mjs → src-Cbu9a6bq.mjs} +455 -107
- package/package.json +14 -14
- /package/dist/{chunk-BtN16TXe.mjs → rolldown-runtime-yhw22V8Z.mjs} +0 -0
package/dist/cli.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as types_exports, i as SchemaNameSchema, l as create, m as getSchemaResult, s as add, u as createBtsCli, v as getLatestCLIVersion } from "./src-
|
|
2
|
+
import { _ as types_exports, i as SchemaNameSchema, l as create, m as getSchemaResult, s as add, u as createBtsCli, v as getLatestCLIVersion } from "./src-Cbu9a6bq.mjs";
|
|
3
3
|
import z from "zod";
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import * as _$_trpc_server0 from "@trpc/server";
|
|
3
|
-
import * as _$better_result0 from "better-result";
|
|
4
2
|
import { Result, Result as Result$1 } from "better-result";
|
|
5
3
|
import { TrpcCliMeta, createCli } from "trpc-cli";
|
|
6
4
|
import z from "zod";
|
|
7
5
|
import { EMBEDDED_TEMPLATES, GeneratorError, GeneratorError as GeneratorError$1, GeneratorOptions, TEMPLATE_COUNT, VirtualDirectory, VirtualFile, VirtualFileSystem, VirtualFileTree, VirtualFileTree as VirtualFileTree$1, VirtualNode, generate } from "@better-t-stack/template-generator";
|
|
8
|
-
|
|
9
|
-
//#region src/types.d.ts
|
|
10
|
-
|
|
11
6
|
import * as import__better_t_stack_types from "@better-t-stack/types";
|
|
12
7
|
//#endregion
|
|
13
8
|
//#region src/helpers/core/command-handlers.d.ts
|
|
@@ -36,7 +31,7 @@ interface AddResult {
|
|
|
36
31
|
}
|
|
37
32
|
//#endregion
|
|
38
33
|
//#region src/utils/errors.d.ts
|
|
39
|
-
declare const UserCancelledError_base:
|
|
34
|
+
declare const UserCancelledError_base: import("better-result").TaggedErrorClass<"UserCancelledError", {
|
|
40
35
|
message: string;
|
|
41
36
|
}>;
|
|
42
37
|
/**
|
|
@@ -47,7 +42,7 @@ declare class UserCancelledError extends UserCancelledError_base {
|
|
|
47
42
|
message?: string;
|
|
48
43
|
});
|
|
49
44
|
}
|
|
50
|
-
declare const CLIError_base:
|
|
45
|
+
declare const CLIError_base: import("better-result").TaggedErrorClass<"CLIError", {
|
|
51
46
|
message: string;
|
|
52
47
|
cause?: unknown;
|
|
53
48
|
}>;
|
|
@@ -55,7 +50,7 @@ declare const CLIError_base: _$better_result0.TaggedErrorClass<"CLIError", {
|
|
|
55
50
|
* General CLI error for validation failures, invalid flags, etc.
|
|
56
51
|
*/
|
|
57
52
|
declare class CLIError extends CLIError_base {}
|
|
58
|
-
declare const ValidationError_base:
|
|
53
|
+
declare const ValidationError_base: import("better-result").TaggedErrorClass<"ValidationError", {
|
|
59
54
|
field?: string;
|
|
60
55
|
value?: unknown;
|
|
61
56
|
message: string;
|
|
@@ -70,7 +65,7 @@ declare class ValidationError extends ValidationError_base {
|
|
|
70
65
|
message: string;
|
|
71
66
|
});
|
|
72
67
|
}
|
|
73
|
-
declare const CompatibilityError_base:
|
|
68
|
+
declare const CompatibilityError_base: import("better-result").TaggedErrorClass<"CompatibilityError", {
|
|
74
69
|
options: string[];
|
|
75
70
|
message: string;
|
|
76
71
|
}>;
|
|
@@ -83,7 +78,7 @@ declare class CompatibilityError extends CompatibilityError_base {
|
|
|
83
78
|
message: string;
|
|
84
79
|
});
|
|
85
80
|
}
|
|
86
|
-
declare const DirectoryConflictError_base:
|
|
81
|
+
declare const DirectoryConflictError_base: import("better-result").TaggedErrorClass<"DirectoryConflictError", {
|
|
87
82
|
directory: string;
|
|
88
83
|
message: string;
|
|
89
84
|
}>;
|
|
@@ -95,7 +90,7 @@ declare class DirectoryConflictError extends DirectoryConflictError_base {
|
|
|
95
90
|
directory: string;
|
|
96
91
|
});
|
|
97
92
|
}
|
|
98
|
-
declare const ProjectCreationError_base:
|
|
93
|
+
declare const ProjectCreationError_base: import("better-result").TaggedErrorClass<"ProjectCreationError", {
|
|
99
94
|
phase: string;
|
|
100
95
|
message: string;
|
|
101
96
|
cause?: unknown;
|
|
@@ -110,7 +105,7 @@ declare class ProjectCreationError extends ProjectCreationError_base {
|
|
|
110
105
|
cause?: unknown;
|
|
111
106
|
});
|
|
112
107
|
}
|
|
113
|
-
declare const DatabaseSetupError_base:
|
|
108
|
+
declare const DatabaseSetupError_base: import("better-result").TaggedErrorClass<"DatabaseSetupError", {
|
|
114
109
|
provider: string;
|
|
115
110
|
message: string;
|
|
116
111
|
cause?: unknown;
|
|
@@ -157,13 +152,13 @@ declare const SchemaNameSchema: z.ZodDefault<z.ZodEnum<{
|
|
|
157
152
|
}>>;
|
|
158
153
|
type SchemaName = z.infer<typeof SchemaNameSchema>;
|
|
159
154
|
declare function getSchemaResult(name: SchemaName): unknown;
|
|
160
|
-
declare const router:
|
|
155
|
+
declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
161
156
|
ctx: object;
|
|
162
157
|
meta: TrpcCliMeta;
|
|
163
|
-
errorShape:
|
|
158
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
164
159
|
transformer: false;
|
|
165
|
-
},
|
|
166
|
-
create:
|
|
160
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
161
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
167
162
|
input: [string | undefined, {
|
|
168
163
|
template?: "none" | "mern" | "pern" | "t3" | "uniwind" | undefined;
|
|
169
164
|
yes?: boolean | undefined;
|
|
@@ -193,7 +188,7 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
193
188
|
dbSetupOptions?: {
|
|
194
189
|
mode?: "manual" | "auto" | undefined;
|
|
195
190
|
neon?: {
|
|
196
|
-
method?: "neondb" | "neonctl" | undefined;
|
|
191
|
+
method?: "neon" | "neon-new" | "neondb" | "neonctl" | undefined;
|
|
197
192
|
projectName?: string | undefined;
|
|
198
193
|
regionId?: string | undefined;
|
|
199
194
|
} | undefined;
|
|
@@ -210,7 +205,7 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
210
205
|
output: CreateProjectResult | undefined;
|
|
211
206
|
meta: TrpcCliMeta;
|
|
212
207
|
}>;
|
|
213
|
-
createJson:
|
|
208
|
+
createJson: import("@trpc/server").TRPCMutationProcedure<{
|
|
214
209
|
input: {
|
|
215
210
|
projectName?: string | undefined;
|
|
216
211
|
template?: "none" | "mern" | "pern" | "t3" | "uniwind" | undefined;
|
|
@@ -224,7 +219,7 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
224
219
|
devPort?: number | undefined;
|
|
225
220
|
} | undefined;
|
|
226
221
|
fumadocs?: {
|
|
227
|
-
template: "react-router" | "tanstack-start" | "next-mdx" | "next-mdx-static" | "waku" | "react-router-spa" | "tanstack-start-spa";
|
|
222
|
+
template: "react-router" | "tanstack-start" | "astro" | "next-mdx" | "next-mdx-static" | "waku" | "react-router-spa" | "tanstack-start-spa";
|
|
228
223
|
devPort?: number | undefined;
|
|
229
224
|
search?: "orama" | "orama-cloud" | undefined;
|
|
230
225
|
ogImage?: "next-og" | "takumi" | undefined;
|
|
@@ -236,11 +231,11 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
236
231
|
mcp?: {
|
|
237
232
|
scope?: "project" | "global" | undefined;
|
|
238
233
|
servers?: ("nx" | "better-auth" | "clerk" | "polar" | "neon" | "planetscale" | "supabase" | "convex" | "better-t-stack" | "context7" | "cloudflare-docs" | "shadcn" | "next-devtools" | "nuxt-docs" | "nuxt-ui-docs" | "svelte-docs" | "astro-docs" | "expo")[] | undefined;
|
|
239
|
-
agents?: ("antigravity" | "cline" | "cline-cli" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "github-copilot-cli" | "mcporter" | "vscode" | "zed" | "claude-desktop" | "goose")[] | undefined;
|
|
234
|
+
agents?: ("antigravity" | "cline" | "cline-cli" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "github-copilot-cli" | "grok-build" | "mcporter" | "vscode" | "windsurf" | "zed" | "claude-desktop" | "goose")[] | undefined;
|
|
240
235
|
} | undefined;
|
|
241
236
|
skills?: {
|
|
242
237
|
scope?: "project" | "global" | undefined;
|
|
243
|
-
agents?: ("antigravity" | "cline" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "goose" | "github-copilot" | "
|
|
238
|
+
agents?: ("antigravity" | "cline" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "windsurf" | "zed" | "goose" | "universal" | "adal" | "aider-desk" | "amp" | "antigravity-cli" | "astrbot" | "augment" | "autohand-code" | "bob" | "codearts-agent" | "codebuddy" | "codemaker" | "codestudio" | "command-code" | "continue" | "cortex" | "crush" | "deepagents" | "devin" | "dexto" | "droid" | "eve" | "firebender" | "forgecode" | "github-copilot" | "grok" | "hermes-agent" | "iflow-cli" | "inference-sh" | "jazz" | "junie" | "kilo" | "kimchi" | "kimi-code-cli" | "kiro-cli" | "kode" | "lingma" | "loaf" | "mcpjam" | "mistral-vibe" | "moxby" | "mux" | "neovate" | "ona" | "clawdbot" | "openclaw" | "openhands" | "pi" | "pochi" | "promptscript" | "qoder" | "qoder-cn" | "qwen-code" | "reasonix" | "replit" | "roo" | "rovodev" | "tabnine-cli" | "terramind" | "tinycloud" | "trae" | "trae-cn" | "warp" | "zcode" | "zencoder" | "zenflow")[] | undefined;
|
|
244
239
|
selections?: {
|
|
245
240
|
source: "vercel-labs/agent-skills" | "vercel/ai" | "vercel/turborepo" | "yusukebe/hono-skill" | "vercel-labs/next-skills" | "nuxt/ui" | "heroui-inc/heroui" | "shadcn/ui" | "better-auth/skills" | "clerk/skills" | "neondatabase/agent-skills" | "supabase/agent-skills" | "planetscale/database-skills" | "expo/skills" | "prisma/skills" | "elysiajs/skills" | "waynesutton/convexskills" | "msmps/opentui-skill" | "haydenbleasel/ultracite" | "https://www.evlog.dev";
|
|
246
241
|
skills: string[];
|
|
@@ -248,15 +243,15 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
248
243
|
} | undefined;
|
|
249
244
|
ultracite?: {
|
|
250
245
|
linter?: "biome" | "oxlint" | undefined;
|
|
251
|
-
editors?: ("void" | "antigravity" | "cursor" | "vscode" | "
|
|
252
|
-
agents?: ("vercel" | "cline" | "codex" | "opencode" | "goose" | "
|
|
246
|
+
editors?: ("void" | "antigravity" | "cursor" | "vscode" | "windsurf" | "zed" | "bob" | "codebuddy" | "trae" | "kiro")[] | undefined;
|
|
247
|
+
agents?: ("vercel" | "cline" | "codex" | "opencode" | "goose" | "universal" | "adal" | "amp" | "bob" | "continue" | "crush" | "deepagents" | "devin" | "droid" | "firebender" | "junie" | "mcpjam" | "mistral-vibe" | "mux" | "ona" | "openclaw" | "pi" | "qoder" | "replit" | "warp" | "zencoder" | "claude" | "jules" | "lovable" | "snowflake-cortex" | "kimi-cli" | "copilot" | "aider" | "firebase-studio" | "open-hands" | "gemini" | "augmentcode" | "kilo-code" | "roo-code" | "qwen" | "amazon-q-cli" | "cursor-cli")[] | undefined;
|
|
253
248
|
hooks?: ("cursor" | "windsurf" | "codebuddy" | "claude" | "copilot")[] | undefined;
|
|
254
249
|
} | undefined;
|
|
255
250
|
} | undefined;
|
|
256
251
|
dbSetupOptions?: {
|
|
257
252
|
mode?: "manual" | "auto" | undefined;
|
|
258
253
|
neon?: {
|
|
259
|
-
method?: "neondb" | "neonctl" | undefined;
|
|
254
|
+
method?: "neon" | "neon-new" | "neondb" | "neonctl" | undefined;
|
|
260
255
|
projectName?: string | undefined;
|
|
261
256
|
regionId?: string | undefined;
|
|
262
257
|
} | undefined;
|
|
@@ -293,29 +288,29 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
293
288
|
output: CreateProjectResult;
|
|
294
289
|
meta: TrpcCliMeta;
|
|
295
290
|
}>;
|
|
296
|
-
schema:
|
|
291
|
+
schema: import("@trpc/server").TRPCQueryProcedure<{
|
|
297
292
|
input: {
|
|
298
293
|
name?: "all" | "cli" | "database" | "orm" | "backend" | "runtime" | "frontend" | "addons" | "examples" | "packageManager" | "databaseSetup" | "api" | "auth" | "payments" | "webDeploy" | "serverDeploy" | "directoryConflict" | "template" | "addonOptions" | "dbSetupOptions" | "createInput" | "addInput" | "projectConfig" | "betterTStackConfig" | "betterTStackConfigFile" | "initResult" | undefined;
|
|
299
294
|
};
|
|
300
295
|
output: unknown;
|
|
301
296
|
meta: TrpcCliMeta;
|
|
302
297
|
}>;
|
|
303
|
-
sponsors:
|
|
298
|
+
sponsors: import("@trpc/server").TRPCMutationProcedure<{
|
|
304
299
|
input: void;
|
|
305
300
|
output: void;
|
|
306
301
|
meta: TrpcCliMeta;
|
|
307
302
|
}>;
|
|
308
|
-
docs:
|
|
303
|
+
docs: import("@trpc/server").TRPCMutationProcedure<{
|
|
309
304
|
input: void;
|
|
310
305
|
output: void;
|
|
311
306
|
meta: TrpcCliMeta;
|
|
312
307
|
}>;
|
|
313
|
-
builder:
|
|
308
|
+
builder: import("@trpc/server").TRPCMutationProcedure<{
|
|
314
309
|
input: void;
|
|
315
310
|
output: void;
|
|
316
311
|
meta: TrpcCliMeta;
|
|
317
312
|
}>;
|
|
318
|
-
add:
|
|
313
|
+
add: import("@trpc/server").TRPCMutationProcedure<{
|
|
319
314
|
input: {
|
|
320
315
|
addons?: ("none" | "pwa" | "tauri" | "electrobun" | "starlight" | "biome" | "lefthook" | "husky" | "mcp" | "turborepo" | "nx" | "vite-plus" | "fumadocs" | "ultracite" | "oxlint" | "opentui" | "wxt" | "skills" | "evlog")[] | undefined;
|
|
321
316
|
install?: boolean | undefined;
|
|
@@ -326,7 +321,7 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
326
321
|
output: void;
|
|
327
322
|
meta: TrpcCliMeta;
|
|
328
323
|
}>;
|
|
329
|
-
addJson:
|
|
324
|
+
addJson: import("@trpc/server").TRPCMutationProcedure<{
|
|
330
325
|
input: {
|
|
331
326
|
addons?: ("none" | "pwa" | "tauri" | "electrobun" | "starlight" | "biome" | "lefthook" | "husky" | "mcp" | "turborepo" | "nx" | "vite-plus" | "fumadocs" | "ultracite" | "oxlint" | "opentui" | "wxt" | "skills" | "evlog")[] | undefined;
|
|
332
327
|
addonOptions?: {
|
|
@@ -335,7 +330,7 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
335
330
|
devPort?: number | undefined;
|
|
336
331
|
} | undefined;
|
|
337
332
|
fumadocs?: {
|
|
338
|
-
template: "react-router" | "tanstack-start" | "next-mdx" | "next-mdx-static" | "waku" | "react-router-spa" | "tanstack-start-spa";
|
|
333
|
+
template: "react-router" | "tanstack-start" | "astro" | "next-mdx" | "next-mdx-static" | "waku" | "react-router-spa" | "tanstack-start-spa";
|
|
339
334
|
devPort?: number | undefined;
|
|
340
335
|
search?: "orama" | "orama-cloud" | undefined;
|
|
341
336
|
ogImage?: "next-og" | "takumi" | undefined;
|
|
@@ -347,11 +342,11 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
347
342
|
mcp?: {
|
|
348
343
|
scope?: "project" | "global" | undefined;
|
|
349
344
|
servers?: ("nx" | "better-auth" | "clerk" | "polar" | "neon" | "planetscale" | "supabase" | "convex" | "better-t-stack" | "context7" | "cloudflare-docs" | "shadcn" | "next-devtools" | "nuxt-docs" | "nuxt-ui-docs" | "svelte-docs" | "astro-docs" | "expo")[] | undefined;
|
|
350
|
-
agents?: ("antigravity" | "cline" | "cline-cli" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "github-copilot-cli" | "mcporter" | "vscode" | "zed" | "claude-desktop" | "goose")[] | undefined;
|
|
345
|
+
agents?: ("antigravity" | "cline" | "cline-cli" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "github-copilot-cli" | "grok-build" | "mcporter" | "vscode" | "windsurf" | "zed" | "claude-desktop" | "goose")[] | undefined;
|
|
351
346
|
} | undefined;
|
|
352
347
|
skills?: {
|
|
353
348
|
scope?: "project" | "global" | undefined;
|
|
354
|
-
agents?: ("antigravity" | "cline" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "goose" | "github-copilot" | "
|
|
349
|
+
agents?: ("antigravity" | "cline" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "windsurf" | "zed" | "goose" | "universal" | "adal" | "aider-desk" | "amp" | "antigravity-cli" | "astrbot" | "augment" | "autohand-code" | "bob" | "codearts-agent" | "codebuddy" | "codemaker" | "codestudio" | "command-code" | "continue" | "cortex" | "crush" | "deepagents" | "devin" | "dexto" | "droid" | "eve" | "firebender" | "forgecode" | "github-copilot" | "grok" | "hermes-agent" | "iflow-cli" | "inference-sh" | "jazz" | "junie" | "kilo" | "kimchi" | "kimi-code-cli" | "kiro-cli" | "kode" | "lingma" | "loaf" | "mcpjam" | "mistral-vibe" | "moxby" | "mux" | "neovate" | "ona" | "clawdbot" | "openclaw" | "openhands" | "pi" | "pochi" | "promptscript" | "qoder" | "qoder-cn" | "qwen-code" | "reasonix" | "replit" | "roo" | "rovodev" | "tabnine-cli" | "terramind" | "tinycloud" | "trae" | "trae-cn" | "warp" | "zcode" | "zencoder" | "zenflow")[] | undefined;
|
|
355
350
|
selections?: {
|
|
356
351
|
source: "vercel-labs/agent-skills" | "vercel/ai" | "vercel/turborepo" | "yusukebe/hono-skill" | "vercel-labs/next-skills" | "nuxt/ui" | "heroui-inc/heroui" | "shadcn/ui" | "better-auth/skills" | "clerk/skills" | "neondatabase/agent-skills" | "supabase/agent-skills" | "planetscale/database-skills" | "expo/skills" | "prisma/skills" | "elysiajs/skills" | "waynesutton/convexskills" | "msmps/opentui-skill" | "haydenbleasel/ultracite" | "https://www.evlog.dev";
|
|
357
352
|
skills: string[];
|
|
@@ -359,8 +354,8 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
359
354
|
} | undefined;
|
|
360
355
|
ultracite?: {
|
|
361
356
|
linter?: "biome" | "oxlint" | undefined;
|
|
362
|
-
editors?: ("void" | "antigravity" | "cursor" | "vscode" | "
|
|
363
|
-
agents?: ("vercel" | "cline" | "codex" | "opencode" | "goose" | "
|
|
357
|
+
editors?: ("void" | "antigravity" | "cursor" | "vscode" | "windsurf" | "zed" | "bob" | "codebuddy" | "trae" | "kiro")[] | undefined;
|
|
358
|
+
agents?: ("vercel" | "cline" | "codex" | "opencode" | "goose" | "universal" | "adal" | "amp" | "bob" | "continue" | "crush" | "deepagents" | "devin" | "droid" | "firebender" | "junie" | "mcpjam" | "mistral-vibe" | "mux" | "ona" | "openclaw" | "pi" | "qoder" | "replit" | "warp" | "zencoder" | "claude" | "jules" | "lovable" | "snowflake-cortex" | "kimi-cli" | "copilot" | "aider" | "firebase-studio" | "open-hands" | "gemini" | "augmentcode" | "kilo-code" | "roo-code" | "qwen" | "amazon-q-cli" | "cursor-cli")[] | undefined;
|
|
364
359
|
hooks?: ("cursor" | "windsurf" | "codebuddy" | "claude" | "copilot")[] | undefined;
|
|
365
360
|
} | undefined;
|
|
366
361
|
} | undefined;
|
|
@@ -374,7 +369,7 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
|
|
|
374
369
|
output: AddResult;
|
|
375
370
|
meta: TrpcCliMeta;
|
|
376
371
|
}>;
|
|
377
|
-
history:
|
|
372
|
+
history: import("@trpc/server").TRPCMutationProcedure<{
|
|
378
373
|
input: {
|
|
379
374
|
limit?: number | undefined;
|
|
380
375
|
clear?: boolean | undefined;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as ProjectCreationError, S as DirectoryConflictError, T as ValidationError, a as TEMPLATE_COUNT, b as CompatibilityError, c as builder, d as createVirtual, f as docs, g as sponsors, h as router, i as SchemaNameSchema, l as create, m as getSchemaResult, n as GeneratorError, o as VirtualFileSystem, p as generate, r as Result, s as add, t as EMBEDDED_TEMPLATES, u as createBtsCli, w as UserCancelledError, x as DatabaseSetupError, y as CLIError } from "./src-
|
|
2
|
+
import { C as ProjectCreationError, S as DirectoryConflictError, T as ValidationError, a as TEMPLATE_COUNT, b as CompatibilityError, c as builder, d as createVirtual, f as docs, g as sponsors, h as router, i as SchemaNameSchema, l as create, m as getSchemaResult, n as GeneratorError, o as VirtualFileSystem, p as generate, r as Result, s as add, t as EMBEDDED_TEMPLATES, u as createBtsCli, w as UserCancelledError, x as DatabaseSetupError, y as CLIError } from "./src-Cbu9a6bq.mjs";
|
|
3
3
|
export { CLIError, CompatibilityError, DatabaseSetupError, DirectoryConflictError, EMBEDDED_TEMPLATES, GeneratorError, ProjectCreationError, Result, SchemaNameSchema, TEMPLATE_COUNT, UserCancelledError, ValidationError, VirtualFileSystem, add, builder, create, createBtsCli, createVirtual, docs, generate, getSchemaResult, router, sponsors };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as __reExport, t as __exportAll } from "./
|
|
2
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-yhw22V8Z.mjs";
|
|
3
3
|
import { getAllJsonSchemas } from "@better-t-stack/types/json-schema";
|
|
4
4
|
import { initTRPC } from "@trpc/server";
|
|
5
5
|
import { Result, Result as Result$1, TaggedError } from "better-result";
|
|
@@ -1701,15 +1701,37 @@ const evlogWebFrontends = [
|
|
|
1701
1701
|
"tanstack-start",
|
|
1702
1702
|
"astro"
|
|
1703
1703
|
];
|
|
1704
|
+
const NODE_DEV_FS_DRAIN_EXPRESSION = "process.env.NODE_ENV === \"production\" ? undefined : createFsDrain()";
|
|
1705
|
+
const SVELTE_DEV_FS_DRAIN_EXPRESSION = "dev ? createFsDrain() : undefined";
|
|
1706
|
+
const ASTRO_DEV_FS_DRAIN_EXPRESSION = "import.meta.env.DEV ? createFsDrain() : undefined";
|
|
1704
1707
|
function isEvlogBackend(backend) {
|
|
1705
1708
|
return evlogBackends.includes(backend);
|
|
1706
1709
|
}
|
|
1707
1710
|
function getEvlogWebFrontend(frontends) {
|
|
1708
1711
|
return frontends.find((frontend) => evlogWebFrontends.includes(frontend));
|
|
1709
1712
|
}
|
|
1713
|
+
function shouldWireEvlogServerFsDrain(config) {
|
|
1714
|
+
return isEvlogBackend(config.backend) && config.runtime !== "workers" && config.serverDeploy !== "cloudflare";
|
|
1715
|
+
}
|
|
1716
|
+
function shouldWireEvlogWebFsDrain(config) {
|
|
1717
|
+
return getEvlogWebFrontend(config.frontend) !== void 0 && config.webDeploy !== "cloudflare";
|
|
1718
|
+
}
|
|
1719
|
+
function supportsEvlogLocalLogs(config) {
|
|
1720
|
+
return shouldWireEvlogServerFsDrain(config) || shouldWireEvlogWebFsDrain(config);
|
|
1721
|
+
}
|
|
1710
1722
|
function shouldIdentifyWebAuth(config) {
|
|
1711
1723
|
return config.auth === "better-auth" && config.backend === "self";
|
|
1712
1724
|
}
|
|
1725
|
+
function getEvlogServerMiddlewareMarker(backend, fsDrain) {
|
|
1726
|
+
const options = fsDrain ? `{ drain: ${NODE_DEV_FS_DRAIN_EXPRESSION} }` : "";
|
|
1727
|
+
if (backend === "hono" || backend === "express") return `app.use(evlog(${options}));`;
|
|
1728
|
+
if (backend === "fastify") return `fastify.register(evlog${options ? `, ${options}` : ""});`;
|
|
1729
|
+
return `.use(evlog(${options}))`;
|
|
1730
|
+
}
|
|
1731
|
+
function findEvlogServerMiddlewareMarker(content, backend) {
|
|
1732
|
+
const fsDrainMarker = getEvlogServerMiddlewareMarker(backend, true);
|
|
1733
|
+
return content.includes(fsDrainMarker) ? fsDrainMarker : getEvlogServerMiddlewareMarker(backend, false);
|
|
1734
|
+
}
|
|
1713
1735
|
function prependMissingImports(content, imports) {
|
|
1714
1736
|
const missingImports = imports.filter((line) => !content.includes(line));
|
|
1715
1737
|
if (missingImports.length === 0) return content;
|
|
@@ -1771,46 +1793,72 @@ function addEvlogBetterAuthServerSetup(content, backend, authExpression) {
|
|
|
1771
1793
|
const identifySnippet = usesAuthFactory ? "" : `const identifyUser = createAuthMiddleware(${evlogAuthExpression}, ${authOptions});\n\n`;
|
|
1772
1794
|
const identifyUserSetup = usesAuthFactory ? `\n\tconst identifyUser = createAuthMiddleware(${evlogAuthExpression}, ${authOptions});` : "";
|
|
1773
1795
|
if (backend === "hono") {
|
|
1796
|
+
const evlogMarker = findEvlogServerMiddlewareMarker(nextContent, backend);
|
|
1774
1797
|
nextContent = insertBeforeOnce(nextContent, "const app = new Hono", identifySnippet, "createAuthMiddleware(");
|
|
1775
|
-
return insertAfterOnce(nextContent,
|
|
1798
|
+
return insertAfterOnce(nextContent, evlogMarker, `\napp.use("*", async (c, next) => {${identifyUserSetup}\n\tawait identifyUser(c.get("log"), c.req.raw.headers, c.req.path);\n\tawait next();\n});`, "identifyUser(c.get(\"log\")");
|
|
1776
1799
|
}
|
|
1777
1800
|
if (backend === "express") {
|
|
1801
|
+
const evlogMarker = findEvlogServerMiddlewareMarker(nextContent, backend);
|
|
1778
1802
|
nextContent = addNamedImport(nextContent, "evlog/express", ["useLogger"]);
|
|
1779
1803
|
nextContent = insertBeforeOnce(nextContent, "const app = express();", identifySnippet, "createAuthMiddleware(");
|
|
1780
|
-
return insertAfterOnce(nextContent,
|
|
1804
|
+
return insertAfterOnce(nextContent, evlogMarker, `\napp.use(async (req, _res, next) => {${identifyUserSetup}\n\tawait identifyUser(useLogger(), req.headers, req.path);\n\tnext();\n});`, "identifyUser(useLogger()");
|
|
1781
1805
|
}
|
|
1782
1806
|
if (backend === "fastify") {
|
|
1807
|
+
const evlogMarker = findEvlogServerMiddlewareMarker(nextContent, backend);
|
|
1783
1808
|
nextContent = addNamedImport(nextContent, "evlog/fastify", ["useLogger"]);
|
|
1784
1809
|
nextContent = insertBeforeOnce(nextContent, "const fastify = Fastify", identifySnippet, "createAuthMiddleware(");
|
|
1785
|
-
return insertAfterOnce(nextContent,
|
|
1810
|
+
return insertAfterOnce(nextContent, evlogMarker, `\nfastify.addHook("preHandler", async (request) => {${identifyUserSetup}\n\tawait identifyUser(useLogger(), request.headers, request.url);\n});`, "identifyUser(useLogger()");
|
|
1786
1811
|
}
|
|
1787
1812
|
const elysiaMarker = nextContent.includes("const app = new Elysia") ? "const app = new Elysia" : "new Elysia";
|
|
1788
1813
|
nextContent = insertBeforeOnce(nextContent, elysiaMarker, identifySnippet, "createAuthMiddleware(");
|
|
1789
|
-
|
|
1814
|
+
const evlogMarker = findEvlogServerMiddlewareMarker(nextContent, backend);
|
|
1815
|
+
return insertAfterOnce(nextContent, evlogMarker, `\n\t.derive(async ({ request, log }) => {${identifyUserSetup.replace(/\n\t/g, "\n ")}\n\t\tawait identifyUser(log, request.headers, new URL(request.url).pathname);\n\t\treturn {};\n\t})`, "identifyUser(log");
|
|
1790
1816
|
}
|
|
1791
|
-
function addEvlogServerSetup(content, backend, serviceName) {
|
|
1817
|
+
function addEvlogServerSetup(content, backend, serviceName, fsDrain) {
|
|
1792
1818
|
const initSnippet = `initLogger({\n\tenv: { service: "${serviceName}" },\n});\n\n`;
|
|
1819
|
+
const evlogMarker = getEvlogServerMiddlewareMarker(backend, fsDrain);
|
|
1820
|
+
const legacyEvlogMarker = getEvlogServerMiddlewareMarker(backend, false);
|
|
1793
1821
|
if (backend === "hono") {
|
|
1794
|
-
let nextContent = prependMissingImports(content, [
|
|
1822
|
+
let nextContent = prependMissingImports(content, [
|
|
1823
|
+
"import { initLogger } from \"evlog\";",
|
|
1824
|
+
"import { evlog, type EvlogVariables } from \"evlog/hono\";",
|
|
1825
|
+
...fsDrain ? ["import { createFsDrain } from \"evlog/fs\";"] : []
|
|
1826
|
+
]);
|
|
1795
1827
|
nextContent = insertBeforeOnce(nextContent, "const app = new Hono", initSnippet, "initLogger({");
|
|
1796
1828
|
nextContent = nextContent.replace("const app = new Hono();", "const app = new Hono<EvlogVariables>();");
|
|
1797
1829
|
nextContent = nextContent.replace("import { logger } from \"hono/logger\";\n", "").replace(/\napp\.use\(logger\(\)\);/, "");
|
|
1798
|
-
|
|
1830
|
+
if (fsDrain) nextContent = nextContent.replace(legacyEvlogMarker, evlogMarker);
|
|
1831
|
+
return insertAfterOnce(nextContent, "const app = new Hono<EvlogVariables>();", `\n\n${evlogMarker}`, evlogMarker);
|
|
1799
1832
|
}
|
|
1800
1833
|
if (backend === "express") {
|
|
1801
|
-
let nextContent = prependMissingImports(content, [
|
|
1834
|
+
let nextContent = prependMissingImports(content, [
|
|
1835
|
+
"import { initLogger } from \"evlog\";",
|
|
1836
|
+
"import { evlog } from \"evlog/express\";",
|
|
1837
|
+
...fsDrain ? ["import { createFsDrain } from \"evlog/fs\";"] : []
|
|
1838
|
+
]);
|
|
1802
1839
|
nextContent = insertBeforeOnce(nextContent, "const app = express();", initSnippet, "initLogger({");
|
|
1803
|
-
|
|
1840
|
+
if (fsDrain) nextContent = nextContent.replace(legacyEvlogMarker, evlogMarker);
|
|
1841
|
+
return insertAfterOnce(nextContent, "const app = express();", `\n\n${evlogMarker}`, evlogMarker);
|
|
1804
1842
|
}
|
|
1805
1843
|
if (backend === "fastify") {
|
|
1806
|
-
let nextContent = prependMissingImports(content, [
|
|
1844
|
+
let nextContent = prependMissingImports(content, [
|
|
1845
|
+
"import { initLogger } from \"evlog\";",
|
|
1846
|
+
"import { evlog } from \"evlog/fastify\";",
|
|
1847
|
+
...fsDrain ? ["import { createFsDrain } from \"evlog/fs\";"] : []
|
|
1848
|
+
]);
|
|
1807
1849
|
nextContent = insertBeforeOnce(nextContent, "const fastify = Fastify", initSnippet, "initLogger({");
|
|
1808
|
-
|
|
1850
|
+
if (fsDrain) nextContent = nextContent.replace(legacyEvlogMarker, evlogMarker);
|
|
1851
|
+
return insertBeforeOnce(nextContent, "fastify.register(fastifyCors", `${evlogMarker}\n`, evlogMarker);
|
|
1809
1852
|
}
|
|
1810
|
-
let nextContent = prependMissingImports(content, [
|
|
1853
|
+
let nextContent = prependMissingImports(content, [
|
|
1854
|
+
"import { initLogger } from \"evlog\";",
|
|
1855
|
+
"import { evlog } from \"evlog/elysia\";",
|
|
1856
|
+
...fsDrain ? ["import { createFsDrain } from \"evlog/fs\";"] : []
|
|
1857
|
+
]);
|
|
1811
1858
|
const elysiaMarker = nextContent.includes("const app = new Elysia") ? "const app = new Elysia" : "new Elysia";
|
|
1812
1859
|
nextContent = insertBeforeOnce(nextContent, elysiaMarker, initSnippet, "initLogger({");
|
|
1813
|
-
|
|
1860
|
+
if (fsDrain) nextContent = nextContent.replace(legacyEvlogMarker, evlogMarker);
|
|
1861
|
+
for (const marker of ["new Elysia({ adapter: node() })", "new Elysia()"]) nextContent = insertAfterOnce(nextContent, marker, `\n\t${evlogMarker}`, evlogMarker);
|
|
1814
1862
|
return nextContent;
|
|
1815
1863
|
}
|
|
1816
1864
|
function addNuxtEvlogSetup(content, serviceName) {
|
|
@@ -1827,14 +1875,20 @@ function addSvelteViteEvlogSetup(content, serviceName) {
|
|
|
1827
1875
|
if (nextContent.includes("evlog({")) return nextContent;
|
|
1828
1876
|
return nextContent.replace("plugins: [tailwindcss(), sveltekit()],", `plugins: [\n tailwindcss(),\n sveltekit(),\n evlog({ service: "${serviceName}" }),\n ],`);
|
|
1829
1877
|
}
|
|
1830
|
-
function
|
|
1831
|
-
|
|
1878
|
+
function getSvelteEvlogHooksCall(fsDrain) {
|
|
1879
|
+
return fsDrain ? `createEvlogHooks({ drain: ${SVELTE_DEV_FS_DRAIN_EXPRESSION} })` : "createEvlogHooks()";
|
|
1880
|
+
}
|
|
1881
|
+
function addSvelteHooksEvlogSetup(content, fsDrain) {
|
|
1882
|
+
let nextContent = prependMissingImports(content, ["import { createEvlogHooks } from \"evlog/sveltekit\";", ...fsDrain ? ["import { createFsDrain } from \"evlog/fs\";"] : []]);
|
|
1883
|
+
if (fsDrain) nextContent = addNamedImport(nextContent, "$app/environment", ["dev"]);
|
|
1884
|
+
const hooksCall = getSvelteEvlogHooksCall(fsDrain);
|
|
1885
|
+
if (fsDrain) nextContent = nextContent.replaceAll("createEvlogHooks()", hooksCall);
|
|
1832
1886
|
if (!nextContent.includes("export const handle") && !nextContent.includes("const authHandle")) {
|
|
1833
|
-
if (!nextContent.includes("createEvlogHooks(
|
|
1887
|
+
if (!nextContent.includes("createEvlogHooks(")) nextContent = `${nextContent.trimEnd()}\n\nexport const { handle, handleError } = ${hooksCall};\n`;
|
|
1834
1888
|
return nextContent;
|
|
1835
1889
|
}
|
|
1836
1890
|
nextContent = prependMissingImports(nextContent, ["import { sequence } from \"@sveltejs/kit/hooks\";"]);
|
|
1837
|
-
if (!nextContent.includes("const { handle: evlogHandle, handleError }")) nextContent = nextContent.replace(/((?:import .+\n)+)/, `$1\nconst { handle: evlogHandle, handleError } =
|
|
1891
|
+
if (!nextContent.includes("const { handle: evlogHandle, handleError }")) nextContent = nextContent.replace(/((?:import .+\n)+)/, `$1\nconst { handle: evlogHandle, handleError } = ${hooksCall};\n\n`);
|
|
1838
1892
|
nextContent = nextContent.replace(/export const handle(:\s*Handle)?\s*=\s*async/, (_match, typeAnnotation) => `const authHandle${typeAnnotation ?? ""} = async`);
|
|
1839
1893
|
if (!nextContent.includes("sequence(evlogHandle, authHandle)")) nextContent = `${nextContent.trimEnd()}\n\nexport const handle = sequence(evlogHandle as Handle, authHandle);\nexport { handleError };\n`;
|
|
1840
1894
|
return nextContent;
|
|
@@ -1853,10 +1907,14 @@ function addTanstackStartRootEvlogSetup(content) {
|
|
|
1853
1907
|
if (/server:\s*{/.test(nextContent)) return nextContent.replace(/server:\s*{\n/, `server: {\n middleware: [${middlewareEntry}],\n`);
|
|
1854
1908
|
return nextContent.replace("head: () => ({", `server: {\n middleware: [${middlewareEntry}],\n },\n\n head: () => ({`);
|
|
1855
1909
|
}
|
|
1856
|
-
function
|
|
1857
|
-
|
|
1858
|
-
|
|
1910
|
+
function getInitLoggerSnippet(serviceName, fsDrain, indent) {
|
|
1911
|
+
return `initLogger({\n${indent}env: { service: "${serviceName}" },${fsDrain ? `\n${indent}drain: ${ASTRO_DEV_FS_DRAIN_EXPRESSION},` : ""}\n});\n\n`;
|
|
1912
|
+
}
|
|
1913
|
+
function addAstroMiddlewareEvlogSetup(content, serviceName, fsDrain) {
|
|
1914
|
+
let nextContent = prependMissingImports(content, ["import { createRequestLogger, initLogger } from \"evlog\";", ...fsDrain ? ["import { createFsDrain } from \"evlog/fs\";"] : []]);
|
|
1915
|
+
const initSnippet = getInitLoggerSnippet(serviceName, fsDrain, " ");
|
|
1859
1916
|
nextContent = insertBeforeOnce(nextContent, "export const onRequest", initSnippet, "initLogger({");
|
|
1917
|
+
if (fsDrain && !nextContent.includes("drain:")) nextContent = nextContent.replace(/initLogger\(\{\n(\s+env: \{ service: "[^"]+" \},)/, `initLogger({\n$1\n drain: ${ASTRO_DEV_FS_DRAIN_EXPRESSION},`);
|
|
1860
1918
|
if (nextContent.includes("createRequestLogger({")) return nextContent;
|
|
1861
1919
|
const contextMarker = "export const onRequest = defineMiddleware(async (context, next) => {";
|
|
1862
1920
|
if (nextContent.includes(contextMarker)) {
|
|
@@ -1931,7 +1989,8 @@ function addSvelteBetterAuthEvlogSetup(content, config) {
|
|
|
1931
1989
|
const authExpression = getAuthExpression(config);
|
|
1932
1990
|
const authOptions = "{ exclude: [\"/api/auth/**\"], maskEmail: true }";
|
|
1933
1991
|
const authHandleSnippet = usesCreateAuthFactory(config) && config.webDeploy === "cloudflare" ? `const evlogAuthHandle: Handle = async ({ event, resolve }) => {\n\tif (building) {\n\t\treturn resolve(event);\n\t}\n\n\tconst authEnv = event.platform?.env ?? localEnv;\n\tconst identifyUser = createAuthMiddleware(createAuth(authEnv) as BetterAuthInstance, ${authOptions});\n\tawait identifyUser(event.locals.log, event.request.headers, event.url.pathname);\n\treturn resolve(event);\n};\n\n` : `const identifyUser = createAuthMiddleware(${authExpression} as BetterAuthInstance, ${authOptions});\n\nconst evlogAuthHandle: Handle = async ({ event, resolve }) => {\n\tawait identifyUser(event.locals.log, event.request.headers, event.url.pathname);\n\treturn resolve(event);\n};\n\n`;
|
|
1934
|
-
|
|
1992
|
+
const evlogHandleDeclaration = nextContent.match(/const \{ handle: evlogHandle, handleError \} = createEvlogHooks\([\s\S]*?\);\n\n/)?.[0];
|
|
1993
|
+
if (evlogHandleDeclaration) nextContent = insertAfterOnce(nextContent, evlogHandleDeclaration, authHandleSnippet, "evlogAuthHandle");
|
|
1935
1994
|
return nextContent.replace("sequence(evlogHandle as Handle, authHandle)", "sequence(evlogHandle as Handle, evlogAuthHandle, authHandle)").replace("sequence(evlogHandle, authHandle)", "sequence(evlogHandle as Handle, evlogAuthHandle, authHandle)");
|
|
1936
1995
|
}
|
|
1937
1996
|
function addAstroBetterAuthEvlogSetup(content, config) {
|
|
@@ -1950,19 +2009,29 @@ function addAstroBetterAuthEvlogSetup(content, config) {
|
|
|
1950
2009
|
}
|
|
1951
2010
|
return nextContent;
|
|
1952
2011
|
}
|
|
1953
|
-
function getNextEvlogFile(serviceName) {
|
|
2012
|
+
function getNextEvlogFile(serviceName, fsDrain) {
|
|
1954
2013
|
return `import { createEvlog } from "evlog/next";
|
|
1955
2014
|
import { createInstrumentation } from "evlog/next/instrumentation/create";
|
|
2015
|
+
${fsDrain ? "import { createFsDrain } from \"evlog/fs\";\n" : ""}
|
|
1956
2016
|
|
|
1957
2017
|
export const { withEvlog, useLogger, log, createError } = createEvlog({
|
|
1958
2018
|
service: "${serviceName}",
|
|
1959
|
-
});
|
|
2019
|
+
${fsDrain ? ` drain: ${NODE_DEV_FS_DRAIN_EXPRESSION},\n` : ""}});
|
|
1960
2020
|
|
|
1961
2021
|
export const { register, onRequestError } = createInstrumentation({
|
|
1962
2022
|
service: "${serviceName}",
|
|
1963
2023
|
});
|
|
1964
2024
|
`;
|
|
1965
2025
|
}
|
|
2026
|
+
function getNitroEvlogDrainFile() {
|
|
2027
|
+
return `import { createFsDrain } from "evlog/fs";
|
|
2028
|
+
|
|
2029
|
+
export default defineNitroPlugin((nitroApp) => {
|
|
2030
|
+
if (!import.meta.dev) return;
|
|
2031
|
+
nitroApp.hooks.hook("evlog:drain", createFsDrain());
|
|
2032
|
+
});
|
|
2033
|
+
`;
|
|
2034
|
+
}
|
|
1966
2035
|
function getNextInstrumentationFile() {
|
|
1967
2036
|
return `import { defineNodeInstrumentation } from "evlog/next/instrumentation";
|
|
1968
2037
|
|
|
@@ -2077,13 +2146,12 @@ export default defineConfig({
|
|
|
2077
2146
|
});
|
|
2078
2147
|
`;
|
|
2079
2148
|
}
|
|
2080
|
-
function getAstroMiddlewareFile(serviceName) {
|
|
2149
|
+
function getAstroMiddlewareFile(serviceName, fsDrain) {
|
|
2081
2150
|
return `import { defineMiddleware } from "astro:middleware";
|
|
2082
2151
|
import { createRequestLogger, initLogger } from "evlog";
|
|
2152
|
+
${fsDrain ? "import { createFsDrain } from \"evlog/fs\";\n" : ""}
|
|
2083
2153
|
|
|
2084
|
-
|
|
2085
|
-
env: { service: "${serviceName}" },
|
|
2086
|
-
});
|
|
2154
|
+
${getInitLoggerSnippet(serviceName, fsDrain, " ").trimEnd()}
|
|
2087
2155
|
|
|
2088
2156
|
export const onRequest = defineMiddleware(async ({ request, locals }, next) => {
|
|
2089
2157
|
const url = new URL(request.url);
|
|
@@ -2120,8 +2188,9 @@ declare namespace App {
|
|
|
2120
2188
|
}
|
|
2121
2189
|
async function setupNextEvlog(config, serviceName) {
|
|
2122
2190
|
const webDir = path.join(config.projectDir, "apps/web");
|
|
2191
|
+
const fsDrain = shouldWireEvlogWebFsDrain(config);
|
|
2123
2192
|
const evlogPath = path.join(webDir, "src/lib/evlog.ts");
|
|
2124
|
-
if (!await fs.pathExists(evlogPath)) await writeFileIfChanged(evlogPath, getNextEvlogFile(serviceName));
|
|
2193
|
+
if (!await fs.pathExists(evlogPath)) await writeFileIfChanged(evlogPath, getNextEvlogFile(serviceName, fsDrain));
|
|
2125
2194
|
const identifyWebAuth = shouldIdentifyWebAuth(config);
|
|
2126
2195
|
if (identifyWebAuth) {
|
|
2127
2196
|
const evlogAuthPath = path.join(webDir, "src/lib/evlog-auth.ts");
|
|
@@ -2147,7 +2216,12 @@ async function setupNextEvlog(config, serviceName) {
|
|
|
2147
2216
|
}
|
|
2148
2217
|
async function setupNuxtEvlog(config, serviceName) {
|
|
2149
2218
|
const webDir = path.join(config.projectDir, "apps/web");
|
|
2219
|
+
const fsDrain = shouldWireEvlogWebFsDrain(config);
|
|
2150
2220
|
await updateFileIfExists(path.join(webDir, "nuxt.config.ts"), (content) => addNuxtEvlogSetup(content, serviceName));
|
|
2221
|
+
if (fsDrain) {
|
|
2222
|
+
const drainPath = path.join(webDir, "server/plugins/evlog-drain.ts");
|
|
2223
|
+
if (!await fs.pathExists(drainPath)) await writeFileIfChanged(drainPath, getNitroEvlogDrainFile());
|
|
2224
|
+
}
|
|
2151
2225
|
if (shouldIdentifyWebAuth(config)) {
|
|
2152
2226
|
const oldAuthPluginPath = path.join(webDir, "server/plugins/evlog-auth.ts");
|
|
2153
2227
|
if (await fs.pathExists(oldAuthPluginPath)) {
|
|
@@ -2160,12 +2234,15 @@ async function setupNuxtEvlog(config, serviceName) {
|
|
|
2160
2234
|
}
|
|
2161
2235
|
async function setupSvelteEvlog(config, serviceName) {
|
|
2162
2236
|
const webDir = path.join(config.projectDir, "apps/web");
|
|
2237
|
+
const fsDrain = shouldWireEvlogWebFsDrain(config);
|
|
2163
2238
|
await updateFileIfExists(path.join(webDir, "vite.config.ts"), (content) => addSvelteViteEvlogSetup(content, serviceName));
|
|
2164
2239
|
const hooksPath = path.join(webDir, "src/hooks.server.ts");
|
|
2165
|
-
if (await fs.pathExists(hooksPath)) await updateFileIfExists(hooksPath, addSvelteHooksEvlogSetup);
|
|
2240
|
+
if (await fs.pathExists(hooksPath)) await updateFileIfExists(hooksPath, (content) => addSvelteHooksEvlogSetup(content, fsDrain));
|
|
2166
2241
|
else await writeFileIfChanged(hooksPath, `import { createEvlogHooks } from "evlog/sveltekit";
|
|
2242
|
+
${fsDrain ? "import { createFsDrain } from \"evlog/fs\";\n" : ""}
|
|
2243
|
+
${fsDrain ? "import { dev } from \"$app/environment\";\n" : ""}
|
|
2167
2244
|
|
|
2168
|
-
export const { handle, handleError } =
|
|
2245
|
+
export const { handle, handleError } = ${getSvelteEvlogHooksCall(fsDrain)};
|
|
2169
2246
|
`);
|
|
2170
2247
|
await updateFileIfExists(path.join(webDir, "src/app.d.ts"), addSvelteLocalsType);
|
|
2171
2248
|
if (shouldIdentifyWebAuth(config)) await updateFileIfExists(path.join(webDir, "src/hooks.server.ts"), (content) => addSvelteBetterAuthEvlogSetup(content, config));
|
|
@@ -2173,9 +2250,14 @@ export const { handle, handleError } = createEvlogHooks();
|
|
|
2173
2250
|
}
|
|
2174
2251
|
async function setupTanstackStartEvlog(config, serviceName) {
|
|
2175
2252
|
const webDir = path.join(config.projectDir, "apps/web");
|
|
2253
|
+
const fsDrain = shouldWireEvlogWebFsDrain(config);
|
|
2176
2254
|
const nitroConfigPath = path.join(webDir, "nitro.config.ts");
|
|
2177
2255
|
if (!await fs.pathExists(nitroConfigPath)) await writeFileIfChanged(nitroConfigPath, getTanstackNitroConfigFile(serviceName));
|
|
2178
2256
|
await updateFileIfExists(path.join(webDir, "src/routes/__root.tsx"), addTanstackStartRootEvlogSetup);
|
|
2257
|
+
if (fsDrain) {
|
|
2258
|
+
const drainPath = path.join(webDir, "server/plugins/evlog-drain.ts");
|
|
2259
|
+
if (!await fs.pathExists(drainPath)) await writeFileIfChanged(drainPath, getNitroEvlogDrainFile());
|
|
2260
|
+
}
|
|
2179
2261
|
if (shouldIdentifyWebAuth(config)) {
|
|
2180
2262
|
const authPluginPath = path.join(webDir, "server/plugins/evlog-auth.ts");
|
|
2181
2263
|
if (!await fs.pathExists(authPluginPath)) await writeFileIfChanged(authPluginPath, getNitroEvlogAuthPluginFile(config));
|
|
@@ -2184,9 +2266,10 @@ async function setupTanstackStartEvlog(config, serviceName) {
|
|
|
2184
2266
|
}
|
|
2185
2267
|
async function setupAstroEvlog(config, serviceName) {
|
|
2186
2268
|
const webDir = path.join(config.projectDir, "apps/web");
|
|
2269
|
+
const fsDrain = shouldWireEvlogWebFsDrain(config);
|
|
2187
2270
|
const middlewarePath = path.join(webDir, "src/middleware.ts");
|
|
2188
|
-
if (!await fs.pathExists(middlewarePath)) await writeFileIfChanged(middlewarePath, getAstroMiddlewareFile(serviceName));
|
|
2189
|
-
else await updateFileIfExists(middlewarePath, (content) => addAstroMiddlewareEvlogSetup(content, serviceName));
|
|
2271
|
+
if (!await fs.pathExists(middlewarePath)) await writeFileIfChanged(middlewarePath, getAstroMiddlewareFile(serviceName, fsDrain));
|
|
2272
|
+
else await updateFileIfExists(middlewarePath, (content) => addAstroMiddlewareEvlogSetup(content, serviceName, fsDrain));
|
|
2190
2273
|
const envPath = path.join(webDir, "src/env.d.ts");
|
|
2191
2274
|
if (!await fs.pathExists(envPath)) await writeFileIfChanged(envPath, getAstroEnvFile());
|
|
2192
2275
|
else await updateFileIfExists(envPath, addAstroLocalsType);
|
|
@@ -2209,7 +2292,7 @@ async function setupEvlog(config) {
|
|
|
2209
2292
|
const serverIndexPath = path.join(config.projectDir, "apps/server/src/index.ts");
|
|
2210
2293
|
if (await fs.pathExists(serverIndexPath)) {
|
|
2211
2294
|
const content = await fs.readFile(serverIndexPath, "utf-8");
|
|
2212
|
-
let nextContent = addEvlogServerSetup(content, config.backend, `${config.projectName}-server
|
|
2295
|
+
let nextContent = addEvlogServerSetup(content, config.backend, `${config.projectName}-server`, shouldWireEvlogServerFsDrain(config));
|
|
2213
2296
|
if (config.auth === "better-auth") nextContent = addEvlogBetterAuthServerSetup(nextContent, config.backend, getAuthExpression(config));
|
|
2214
2297
|
if (config.examples.includes("ai")) nextContent = addBackendAiEvlogSetup(nextContent, config.backend);
|
|
2215
2298
|
if (nextContent !== content) await fs.writeFile(serverIndexPath, nextContent);
|
|
@@ -2431,6 +2514,10 @@ const TEMPLATES$2 = {
|
|
|
2431
2514
|
label: "Tanstack Start SPA: Fumadocs MDX (not RSC)",
|
|
2432
2515
|
hint: "SPA mode allows you to host the site statically, compatible with a CDN.",
|
|
2433
2516
|
value: "tanstack-start-spa"
|
|
2517
|
+
},
|
|
2518
|
+
astro: {
|
|
2519
|
+
label: "Astro: Fumadocs MDX",
|
|
2520
|
+
value: "astro"
|
|
2434
2521
|
}
|
|
2435
2522
|
};
|
|
2436
2523
|
const DEFAULT_TEMPLATE$2 = "next-mdx";
|
|
@@ -2444,7 +2531,7 @@ function getFumadocsLinter(addons) {
|
|
|
2444
2531
|
if (addons.includes("vite-plus")) return "oxlint";
|
|
2445
2532
|
}
|
|
2446
2533
|
function getFumadocsAddonContext(currentAddons, persistedAddons) {
|
|
2447
|
-
return Array.from(new Set([...persistedAddons ?? [], ...currentAddons]));
|
|
2534
|
+
return Array.from(/* @__PURE__ */ new Set([...persistedAddons ?? [], ...currentAddons]));
|
|
2448
2535
|
}
|
|
2449
2536
|
async function setupFumadocs(config) {
|
|
2450
2537
|
if (shouldSkipExternalCommands()) return Result.ok(void 0);
|
|
@@ -2646,6 +2733,11 @@ const MCP_AGENTS = [
|
|
|
2646
2733
|
label: "GitHub Copilot CLI",
|
|
2647
2734
|
scope: "both"
|
|
2648
2735
|
},
|
|
2736
|
+
{
|
|
2737
|
+
value: "grok-build",
|
|
2738
|
+
label: "Grok Build",
|
|
2739
|
+
scope: "both"
|
|
2740
|
+
},
|
|
2649
2741
|
{
|
|
2650
2742
|
value: "mcporter",
|
|
2651
2743
|
label: "MCPorter",
|
|
@@ -2656,6 +2748,11 @@ const MCP_AGENTS = [
|
|
|
2656
2748
|
label: "VS Code (GitHub Copilot)",
|
|
2657
2749
|
scope: "both"
|
|
2658
2750
|
},
|
|
2751
|
+
{
|
|
2752
|
+
value: "windsurf",
|
|
2753
|
+
label: "Windsurf",
|
|
2754
|
+
scope: "global"
|
|
2755
|
+
},
|
|
2659
2756
|
{
|
|
2660
2757
|
value: "zed",
|
|
2661
2758
|
label: "Zed",
|
|
@@ -3029,10 +3126,42 @@ const SKILL_SOURCES = {
|
|
|
3029
3126
|
"haydenbleasel/ultracite": { label: "Ultracite" },
|
|
3030
3127
|
"https://www.evlog.dev": { label: "evlog" }
|
|
3031
3128
|
};
|
|
3032
|
-
const
|
|
3129
|
+
const SKILLS_CLI_AGENT_OPTIONS = [
|
|
3033
3130
|
{
|
|
3034
|
-
value: "
|
|
3035
|
-
label: "
|
|
3131
|
+
value: "adal",
|
|
3132
|
+
label: "AdaL"
|
|
3133
|
+
},
|
|
3134
|
+
{
|
|
3135
|
+
value: "aider-desk",
|
|
3136
|
+
label: "AiderDesk"
|
|
3137
|
+
},
|
|
3138
|
+
{
|
|
3139
|
+
value: "amp",
|
|
3140
|
+
label: "Amp"
|
|
3141
|
+
},
|
|
3142
|
+
{
|
|
3143
|
+
value: "antigravity",
|
|
3144
|
+
label: "Antigravity"
|
|
3145
|
+
},
|
|
3146
|
+
{
|
|
3147
|
+
value: "antigravity-cli",
|
|
3148
|
+
label: "Antigravity CLI"
|
|
3149
|
+
},
|
|
3150
|
+
{
|
|
3151
|
+
value: "astrbot",
|
|
3152
|
+
label: "AstrBot"
|
|
3153
|
+
},
|
|
3154
|
+
{
|
|
3155
|
+
value: "augment",
|
|
3156
|
+
label: "Augment"
|
|
3157
|
+
},
|
|
3158
|
+
{
|
|
3159
|
+
value: "autohand-code",
|
|
3160
|
+
label: "Autohand Code CLI"
|
|
3161
|
+
},
|
|
3162
|
+
{
|
|
3163
|
+
value: "bob",
|
|
3164
|
+
label: "IBM Bob"
|
|
3036
3165
|
},
|
|
3037
3166
|
{
|
|
3038
3167
|
value: "claude-code",
|
|
@@ -3043,100 +3172,306 @@ const AVAILABLE_AGENTS = [
|
|
|
3043
3172
|
label: "Cline"
|
|
3044
3173
|
},
|
|
3045
3174
|
{
|
|
3046
|
-
value: "
|
|
3047
|
-
label: "
|
|
3175
|
+
value: "codearts-agent",
|
|
3176
|
+
label: "CodeArts Agent"
|
|
3177
|
+
},
|
|
3178
|
+
{
|
|
3179
|
+
value: "codebuddy",
|
|
3180
|
+
label: "CodeBuddy"
|
|
3181
|
+
},
|
|
3182
|
+
{
|
|
3183
|
+
value: "codemaker",
|
|
3184
|
+
label: "Codemaker"
|
|
3185
|
+
},
|
|
3186
|
+
{
|
|
3187
|
+
value: "codestudio",
|
|
3188
|
+
label: "Code Studio"
|
|
3048
3189
|
},
|
|
3049
3190
|
{
|
|
3050
3191
|
value: "codex",
|
|
3051
3192
|
label: "Codex"
|
|
3052
3193
|
},
|
|
3053
3194
|
{
|
|
3054
|
-
value: "
|
|
3055
|
-
label: "
|
|
3195
|
+
value: "command-code",
|
|
3196
|
+
label: "Command Code"
|
|
3056
3197
|
},
|
|
3057
3198
|
{
|
|
3058
|
-
value: "
|
|
3059
|
-
label: "
|
|
3199
|
+
value: "continue",
|
|
3200
|
+
label: "Continue"
|
|
3201
|
+
},
|
|
3202
|
+
{
|
|
3203
|
+
value: "cortex",
|
|
3204
|
+
label: "Cortex Code"
|
|
3205
|
+
},
|
|
3206
|
+
{
|
|
3207
|
+
value: "crush",
|
|
3208
|
+
label: "Crush"
|
|
3209
|
+
},
|
|
3210
|
+
{
|
|
3211
|
+
value: "cursor",
|
|
3212
|
+
label: "Cursor"
|
|
3213
|
+
},
|
|
3214
|
+
{
|
|
3215
|
+
value: "deepagents",
|
|
3216
|
+
label: "Deep Agents"
|
|
3217
|
+
},
|
|
3218
|
+
{
|
|
3219
|
+
value: "devin",
|
|
3220
|
+
label: "Devin for Terminal"
|
|
3221
|
+
},
|
|
3222
|
+
{
|
|
3223
|
+
value: "dexto",
|
|
3224
|
+
label: "Dexto"
|
|
3225
|
+
},
|
|
3226
|
+
{
|
|
3227
|
+
value: "droid",
|
|
3228
|
+
label: "Droid"
|
|
3229
|
+
},
|
|
3230
|
+
{
|
|
3231
|
+
value: "eve",
|
|
3232
|
+
label: "Eve"
|
|
3233
|
+
},
|
|
3234
|
+
{
|
|
3235
|
+
value: "firebender",
|
|
3236
|
+
label: "Firebender"
|
|
3237
|
+
},
|
|
3238
|
+
{
|
|
3239
|
+
value: "forgecode",
|
|
3240
|
+
label: "ForgeCode"
|
|
3241
|
+
},
|
|
3242
|
+
{
|
|
3243
|
+
value: "gemini-cli",
|
|
3244
|
+
label: "Gemini CLI"
|
|
3245
|
+
},
|
|
3246
|
+
{
|
|
3247
|
+
value: "github-copilot",
|
|
3248
|
+
label: "GitHub Copilot"
|
|
3060
3249
|
},
|
|
3061
3250
|
{
|
|
3062
3251
|
value: "goose",
|
|
3063
3252
|
label: "Goose"
|
|
3064
3253
|
},
|
|
3065
3254
|
{
|
|
3066
|
-
value: "
|
|
3067
|
-
label: "
|
|
3255
|
+
value: "grok",
|
|
3256
|
+
label: "Grok Build"
|
|
3257
|
+
},
|
|
3258
|
+
{
|
|
3259
|
+
value: "hermes-agent",
|
|
3260
|
+
label: "Hermes Agent"
|
|
3261
|
+
},
|
|
3262
|
+
{
|
|
3263
|
+
value: "iflow-cli",
|
|
3264
|
+
label: "iFlow CLI"
|
|
3265
|
+
},
|
|
3266
|
+
{
|
|
3267
|
+
value: "inference-sh",
|
|
3268
|
+
label: "inference.sh"
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
value: "jazz",
|
|
3272
|
+
label: "Jazz"
|
|
3273
|
+
},
|
|
3274
|
+
{
|
|
3275
|
+
value: "junie",
|
|
3276
|
+
label: "Junie"
|
|
3068
3277
|
},
|
|
3069
3278
|
{
|
|
3070
3279
|
value: "kilo",
|
|
3071
3280
|
label: "Kilo Code"
|
|
3072
3281
|
},
|
|
3073
3282
|
{
|
|
3074
|
-
value: "
|
|
3075
|
-
label: "
|
|
3283
|
+
value: "kimchi",
|
|
3284
|
+
label: "Kimchi"
|
|
3076
3285
|
},
|
|
3077
3286
|
{
|
|
3078
|
-
value: "
|
|
3079
|
-
label: "
|
|
3287
|
+
value: "kimi-code-cli",
|
|
3288
|
+
label: "Kimi Code CLI"
|
|
3080
3289
|
},
|
|
3081
3290
|
{
|
|
3082
|
-
value: "
|
|
3083
|
-
label: "
|
|
3291
|
+
value: "kiro-cli",
|
|
3292
|
+
label: "Kiro CLI"
|
|
3084
3293
|
},
|
|
3085
3294
|
{
|
|
3086
|
-
value: "
|
|
3087
|
-
label: "
|
|
3295
|
+
value: "kode",
|
|
3296
|
+
label: "Kode"
|
|
3088
3297
|
},
|
|
3089
3298
|
{
|
|
3090
|
-
value: "
|
|
3091
|
-
label: "
|
|
3299
|
+
value: "lingma",
|
|
3300
|
+
label: "Lingma"
|
|
3301
|
+
},
|
|
3302
|
+
{
|
|
3303
|
+
value: "loaf",
|
|
3304
|
+
label: "Loaf"
|
|
3305
|
+
},
|
|
3306
|
+
{
|
|
3307
|
+
value: "mcpjam",
|
|
3308
|
+
label: "MCPJam"
|
|
3309
|
+
},
|
|
3310
|
+
{
|
|
3311
|
+
value: "mistral-vibe",
|
|
3312
|
+
label: "Mistral Vibe"
|
|
3313
|
+
},
|
|
3314
|
+
{
|
|
3315
|
+
value: "moxby",
|
|
3316
|
+
label: "Moxby"
|
|
3317
|
+
},
|
|
3318
|
+
{
|
|
3319
|
+
value: "mux",
|
|
3320
|
+
label: "Mux"
|
|
3321
|
+
},
|
|
3322
|
+
{
|
|
3323
|
+
value: "neovate",
|
|
3324
|
+
label: "Neovate"
|
|
3325
|
+
},
|
|
3326
|
+
{
|
|
3327
|
+
value: "ona",
|
|
3328
|
+
label: "Ona"
|
|
3329
|
+
},
|
|
3330
|
+
{
|
|
3331
|
+
value: "openclaw",
|
|
3332
|
+
label: "OpenClaw"
|
|
3333
|
+
},
|
|
3334
|
+
{
|
|
3335
|
+
value: "opencode",
|
|
3336
|
+
label: "OpenCode"
|
|
3337
|
+
},
|
|
3338
|
+
{
|
|
3339
|
+
value: "openhands",
|
|
3340
|
+
label: "OpenHands"
|
|
3092
3341
|
},
|
|
3093
3342
|
{
|
|
3094
3343
|
value: "pi",
|
|
3095
3344
|
label: "Pi"
|
|
3096
3345
|
},
|
|
3346
|
+
{
|
|
3347
|
+
value: "pochi",
|
|
3348
|
+
label: "Pochi"
|
|
3349
|
+
},
|
|
3350
|
+
{
|
|
3351
|
+
value: "promptscript",
|
|
3352
|
+
label: "PromptScript"
|
|
3353
|
+
},
|
|
3097
3354
|
{
|
|
3098
3355
|
value: "qoder",
|
|
3099
3356
|
label: "Qoder"
|
|
3100
3357
|
},
|
|
3358
|
+
{
|
|
3359
|
+
value: "qoder-cn",
|
|
3360
|
+
label: "Qoder CN"
|
|
3361
|
+
},
|
|
3101
3362
|
{
|
|
3102
3363
|
value: "qwen-code",
|
|
3103
3364
|
label: "Qwen Code"
|
|
3104
3365
|
},
|
|
3105
3366
|
{
|
|
3106
|
-
value: "
|
|
3107
|
-
label: "
|
|
3367
|
+
value: "reasonix",
|
|
3368
|
+
label: "Reasonix"
|
|
3108
3369
|
},
|
|
3109
3370
|
{
|
|
3110
|
-
value: "
|
|
3111
|
-
label: "
|
|
3371
|
+
value: "replit",
|
|
3372
|
+
label: "Replit"
|
|
3112
3373
|
},
|
|
3113
3374
|
{
|
|
3114
|
-
value: "
|
|
3115
|
-
label: "
|
|
3375
|
+
value: "roo",
|
|
3376
|
+
label: "Roo Code"
|
|
3116
3377
|
},
|
|
3117
3378
|
{
|
|
3118
|
-
value: "
|
|
3119
|
-
label: "
|
|
3379
|
+
value: "rovodev",
|
|
3380
|
+
label: "Rovo Dev"
|
|
3120
3381
|
},
|
|
3121
3382
|
{
|
|
3122
|
-
value: "
|
|
3123
|
-
label: "
|
|
3383
|
+
value: "tabnine-cli",
|
|
3384
|
+
label: "Tabnine CLI"
|
|
3124
3385
|
},
|
|
3125
3386
|
{
|
|
3126
|
-
value: "
|
|
3127
|
-
label: "
|
|
3387
|
+
value: "terramind",
|
|
3388
|
+
label: "Terramind"
|
|
3128
3389
|
},
|
|
3129
3390
|
{
|
|
3130
|
-
value: "
|
|
3131
|
-
label: "
|
|
3391
|
+
value: "tinycloud",
|
|
3392
|
+
label: "Tinycloud"
|
|
3393
|
+
},
|
|
3394
|
+
{
|
|
3395
|
+
value: "trae",
|
|
3396
|
+
label: "Trae"
|
|
3397
|
+
},
|
|
3398
|
+
{
|
|
3399
|
+
value: "trae-cn",
|
|
3400
|
+
label: "Trae CN"
|
|
3401
|
+
},
|
|
3402
|
+
{
|
|
3403
|
+
value: "universal",
|
|
3404
|
+
label: "Universal"
|
|
3405
|
+
},
|
|
3406
|
+
{
|
|
3407
|
+
value: "warp",
|
|
3408
|
+
label: "Warp"
|
|
3409
|
+
},
|
|
3410
|
+
{
|
|
3411
|
+
value: "windsurf",
|
|
3412
|
+
label: "Windsurf"
|
|
3413
|
+
},
|
|
3414
|
+
{
|
|
3415
|
+
value: "zcode",
|
|
3416
|
+
label: "ZCode"
|
|
3417
|
+
},
|
|
3418
|
+
{
|
|
3419
|
+
value: "zed",
|
|
3420
|
+
label: "Zed"
|
|
3421
|
+
},
|
|
3422
|
+
{
|
|
3423
|
+
value: "zencoder",
|
|
3424
|
+
label: "Zencoder"
|
|
3425
|
+
},
|
|
3426
|
+
{
|
|
3427
|
+
value: "zenflow",
|
|
3428
|
+
label: "Zenflow"
|
|
3132
3429
|
}
|
|
3133
3430
|
];
|
|
3134
|
-
const
|
|
3135
|
-
|
|
3431
|
+
const UNIVERSAL_SKILLS_AGENTS = [
|
|
3432
|
+
"amp",
|
|
3433
|
+
"antigravity",
|
|
3434
|
+
"antigravity-cli",
|
|
3435
|
+
"cline",
|
|
3436
|
+
"codex",
|
|
3136
3437
|
"cursor",
|
|
3137
|
-
"
|
|
3138
|
-
"
|
|
3438
|
+
"deepagents",
|
|
3439
|
+
"dexto",
|
|
3440
|
+
"firebender",
|
|
3441
|
+
"gemini-cli",
|
|
3442
|
+
"github-copilot",
|
|
3443
|
+
"kimi-code-cli",
|
|
3444
|
+
"loaf",
|
|
3445
|
+
"opencode",
|
|
3446
|
+
"promptscript",
|
|
3447
|
+
"warp",
|
|
3448
|
+
"zed"
|
|
3139
3449
|
];
|
|
3450
|
+
const PROMPT_HIDDEN_AGENTS = /* @__PURE__ */ new Set([
|
|
3451
|
+
...UNIVERSAL_SKILLS_AGENTS,
|
|
3452
|
+
"universal",
|
|
3453
|
+
"eve",
|
|
3454
|
+
"replit"
|
|
3455
|
+
]);
|
|
3456
|
+
const SKILLS_AGENT_PROMPT_OPTIONS = [
|
|
3457
|
+
{
|
|
3458
|
+
value: "universal",
|
|
3459
|
+
label: "Universal (.agents/skills)",
|
|
3460
|
+
hint: "17 agents including Amp, Antigravity, Cline, Codex, Cursor, Gemini CLI, Copilot, OpenCode, Warp, and Zed"
|
|
3461
|
+
},
|
|
3462
|
+
...SKILLS_CLI_AGENT_OPTIONS.filter(({ value }) => value === "claude-code"),
|
|
3463
|
+
...SKILLS_CLI_AGENT_OPTIONS.filter(({ value }) => value !== "claude-code" && !PROMPT_HIDDEN_AGENTS.has(value))
|
|
3464
|
+
];
|
|
3465
|
+
function expandSkillsAgentTargets(agents) {
|
|
3466
|
+
const expanded = agents.flatMap((agent) => {
|
|
3467
|
+
if (agent === "universal") return [...UNIVERSAL_SKILLS_AGENTS];
|
|
3468
|
+
if (agent === "clawdbot") return ["openclaw"];
|
|
3469
|
+
return [agent];
|
|
3470
|
+
});
|
|
3471
|
+
return Array.from(new Set(expanded));
|
|
3472
|
+
}
|
|
3473
|
+
const DEFAULT_SCOPE = "project";
|
|
3474
|
+
const DEFAULT_AGENTS$1 = ["universal", "claude-code"];
|
|
3140
3475
|
function hasReactBasedFrontend(frontend) {
|
|
3141
3476
|
return frontend.includes("react-router") || frontend.includes("tanstack-router") || frontend.includes("tanstack-start") || frontend.includes("next");
|
|
3142
3477
|
}
|
|
@@ -3238,7 +3573,11 @@ const CURATED_SKILLS_BY_SOURCE = {
|
|
|
3238
3573
|
],
|
|
3239
3574
|
"msmps/opentui-skill": () => ["opentui"],
|
|
3240
3575
|
"haydenbleasel/ultracite": () => ["ultracite"],
|
|
3241
|
-
"https://www.evlog.dev": () => [
|
|
3576
|
+
"https://www.evlog.dev": (config) => [
|
|
3577
|
+
"review-logging-patterns",
|
|
3578
|
+
"build-audit-logs",
|
|
3579
|
+
...supportsEvlogLocalLogs(config) ? ["analyze-logs"] : []
|
|
3580
|
+
]
|
|
3242
3581
|
};
|
|
3243
3582
|
function getCuratedSkillNamesForSourceKey(sourceKey, config) {
|
|
3244
3583
|
return CURATED_SKILLS_BY_SOURCE[sourceKey](config);
|
|
@@ -3315,9 +3654,10 @@ async function setupSkills(config) {
|
|
|
3315
3654
|
if (configuredAgents !== void 0) return [...configuredAgents];
|
|
3316
3655
|
return navigableMultiselect({
|
|
3317
3656
|
message: "Select agents to install skills to",
|
|
3318
|
-
options:
|
|
3657
|
+
options: SKILLS_AGENT_PROMPT_OPTIONS,
|
|
3319
3658
|
required: false,
|
|
3320
|
-
initialValues: [...DEFAULT_AGENTS$1]
|
|
3659
|
+
initialValues: [...DEFAULT_AGENTS$1],
|
|
3660
|
+
maxItems: 10
|
|
3321
3661
|
});
|
|
3322
3662
|
}
|
|
3323
3663
|
});
|
|
@@ -3337,6 +3677,7 @@ async function setupSkills(config) {
|
|
|
3337
3677
|
installSpinner.start("Installing skills...");
|
|
3338
3678
|
const runner = getPackageRunnerPrefix(packageManager);
|
|
3339
3679
|
const globalFlags = scope === "global" ? ["-g"] : [];
|
|
3680
|
+
const agentTargets = expandSkillsAgentTargets(selectedAgents);
|
|
3340
3681
|
for (const [source, skills] of Object.entries(skillsBySource)) if ((await Result.tryPromise({
|
|
3341
3682
|
try: async () => {
|
|
3342
3683
|
const args = [
|
|
@@ -3348,7 +3689,7 @@ async function setupSkills(config) {
|
|
|
3348
3689
|
"--skill",
|
|
3349
3690
|
...skills,
|
|
3350
3691
|
"--agent",
|
|
3351
|
-
...
|
|
3692
|
+
...agentTargets,
|
|
3352
3693
|
"-y"
|
|
3353
3694
|
];
|
|
3354
3695
|
await $({
|
|
@@ -3660,7 +4001,7 @@ const HOOKS = {
|
|
|
3660
4001
|
claude: { label: "Claude Code" },
|
|
3661
4002
|
copilot: { label: "GitHub Copilot" }
|
|
3662
4003
|
};
|
|
3663
|
-
const ULTRACITE_VERSION = "7.9.
|
|
4004
|
+
const ULTRACITE_VERSION = "7.9.4";
|
|
3664
4005
|
const DEFAULT_LINTER = "biome";
|
|
3665
4006
|
const DEFAULT_EDITORS = ["vscode"];
|
|
3666
4007
|
const DEFAULT_AGENTS = ["universal"];
|
|
@@ -5387,9 +5728,7 @@ async function getProjectName(initialName) {
|
|
|
5387
5728
|
*/
|
|
5388
5729
|
function isTelemetryEnabled() {
|
|
5389
5730
|
const BTS_TELEMETRY_DISABLED = process.env.BTS_TELEMETRY_DISABLED;
|
|
5390
|
-
const BTS_TELEMETRY = "1";
|
|
5391
5731
|
if (BTS_TELEMETRY_DISABLED !== void 0) return BTS_TELEMETRY_DISABLED !== "1";
|
|
5392
|
-
if (BTS_TELEMETRY !== void 0) return BTS_TELEMETRY === "1";
|
|
5393
5732
|
return true;
|
|
5394
5733
|
}
|
|
5395
5734
|
//#endregion
|
|
@@ -5767,7 +6106,7 @@ function validateArrayOptions(options) {
|
|
|
5767
6106
|
}
|
|
5768
6107
|
//#endregion
|
|
5769
6108
|
//#region src/validation.ts
|
|
5770
|
-
const CORE_STACK_FLAGS = new Set([
|
|
6109
|
+
const CORE_STACK_FLAGS = /* @__PURE__ */ new Set([
|
|
5771
6110
|
"database",
|
|
5772
6111
|
"orm",
|
|
5773
6112
|
"backend",
|
|
@@ -6017,7 +6356,7 @@ async function initMongoDBAtlas(serverDir) {
|
|
|
6017
6356
|
await $({
|
|
6018
6357
|
cwd: serverDir,
|
|
6019
6358
|
stdio: "inherit"
|
|
6020
|
-
})`atlas
|
|
6359
|
+
})`atlas setup`;
|
|
6021
6360
|
cliLog.success("MongoDB Atlas deployment ready");
|
|
6022
6361
|
},
|
|
6023
6362
|
catch: (e) => new DatabaseSetupError({
|
|
@@ -6066,7 +6405,7 @@ ${pc.green("MongoDB Atlas Manual Setup Instructions:")}
|
|
|
6066
6405
|
${pc.blue("https://www.mongodb.com/docs/atlas/cli/stable/install-atlas-cli/")}
|
|
6067
6406
|
|
|
6068
6407
|
2. Run the following command and follow the prompts:
|
|
6069
|
-
${pc.blue("atlas
|
|
6408
|
+
${pc.blue("atlas setup")}
|
|
6070
6409
|
|
|
6071
6410
|
3. Get your connection string from the Atlas dashboard:
|
|
6072
6411
|
Format: ${pc.dim("mongodb+srv://USERNAME:PASSWORD@CLUSTER.mongodb.net/DATABASE_NAME")}
|
|
@@ -6167,10 +6506,6 @@ const NEON_REGIONS = [
|
|
|
6167
6506
|
label: "AWS Asia Pacific (Singapore)",
|
|
6168
6507
|
value: "aws-ap-southeast-1"
|
|
6169
6508
|
},
|
|
6170
|
-
{
|
|
6171
|
-
label: "AWS South America East 1 (São Paulo)",
|
|
6172
|
-
value: "aws-sa-east-1"
|
|
6173
|
-
},
|
|
6174
6509
|
{
|
|
6175
6510
|
label: "AWS Asia Pacific (Sydney)",
|
|
6176
6511
|
value: "aws-ap-southeast-2"
|
|
@@ -6180,13 +6515,12 @@ const NEON_REGIONS = [
|
|
|
6180
6515
|
value: "azure-eastus2"
|
|
6181
6516
|
}
|
|
6182
6517
|
];
|
|
6183
|
-
async function executeNeonCommand(
|
|
6518
|
+
async function executeNeonCommand(commandArgs, spinnerText) {
|
|
6184
6519
|
const s = createSpinner();
|
|
6185
|
-
const args = getPackageExecutionArgs(packageManager, commandArgsString);
|
|
6186
6520
|
if (spinnerText) s.start(spinnerText);
|
|
6187
6521
|
return Result.tryPromise({
|
|
6188
6522
|
try: async () => {
|
|
6189
|
-
const result = await $`${
|
|
6523
|
+
const result = await $`${commandArgs}`;
|
|
6190
6524
|
if (spinnerText) s.stop(pc.green(spinnerText.replace("...", "").replace("ing ", "ed ").trim()));
|
|
6191
6525
|
return result;
|
|
6192
6526
|
},
|
|
@@ -6200,8 +6534,22 @@ async function executeNeonCommand(packageManager, commandArgsString, spinnerText
|
|
|
6200
6534
|
}
|
|
6201
6535
|
});
|
|
6202
6536
|
}
|
|
6537
|
+
function getNeonProjectCreateArgs(packageManager, projectName, regionId) {
|
|
6538
|
+
return [
|
|
6539
|
+
...getPackageRunnerPrefix(packageManager),
|
|
6540
|
+
"neon@latest",
|
|
6541
|
+
"projects",
|
|
6542
|
+
"create",
|
|
6543
|
+
"--name",
|
|
6544
|
+
projectName,
|
|
6545
|
+
"--region-id",
|
|
6546
|
+
regionId,
|
|
6547
|
+
"--output",
|
|
6548
|
+
"json"
|
|
6549
|
+
];
|
|
6550
|
+
}
|
|
6203
6551
|
async function createNeonProject(projectName, regionId, packageManager) {
|
|
6204
|
-
const execResult = await executeNeonCommand(packageManager,
|
|
6552
|
+
const execResult = await executeNeonCommand(getNeonProjectCreateArgs(packageManager, projectName, regionId), `Creating Neon project "${projectName}"...`);
|
|
6205
6553
|
if (execResult.isErr()) return Result.err(execResult.error);
|
|
6206
6554
|
const parseResult = Result.try({
|
|
6207
6555
|
try: () => JSON.parse(execResult.value.stdout),
|
|
@@ -6245,7 +6593,7 @@ async function writeEnvFile$2(projectDir, backend, config) {
|
|
|
6245
6593
|
}
|
|
6246
6594
|
async function setupWithNeonDb(projectDir, packageManager, backend) {
|
|
6247
6595
|
const s = createSpinner();
|
|
6248
|
-
s.start("Creating Neon database using
|
|
6596
|
+
s.start("Creating Neon database using neon-new...");
|
|
6249
6597
|
const targetApp = backend === "self" ? "apps/web" : "apps/server";
|
|
6250
6598
|
const targetDir = path.join(projectDir, targetApp);
|
|
6251
6599
|
const ensureDirResult = await Result.tryPromise({
|
|
@@ -6260,17 +6608,17 @@ async function setupWithNeonDb(projectDir, packageManager, backend) {
|
|
|
6260
6608
|
s.stop(pc.red("Failed to create directory"));
|
|
6261
6609
|
return ensureDirResult;
|
|
6262
6610
|
}
|
|
6263
|
-
const packageArgs = getPackageExecutionArgs(packageManager, `
|
|
6611
|
+
const packageArgs = getPackageExecutionArgs(packageManager, `neon-new@latest --yes --ref "sbA3tIe"`);
|
|
6264
6612
|
return Result.tryPromise({
|
|
6265
6613
|
try: async () => {
|
|
6266
6614
|
await $({ cwd: targetDir })`${packageArgs}`;
|
|
6267
6615
|
s.stop(pc.green("Neon database created successfully!"));
|
|
6268
6616
|
},
|
|
6269
6617
|
catch: (e) => {
|
|
6270
|
-
s.stop(pc.red("Failed to create database with
|
|
6618
|
+
s.stop(pc.red("Failed to create database with neon-new"));
|
|
6271
6619
|
return new DatabaseSetupError({
|
|
6272
6620
|
provider: "neon",
|
|
6273
|
-
message: `Failed to create database with
|
|
6621
|
+
message: `Failed to create database with neon-new: ${e instanceof Error ? e.message : String(e)}`,
|
|
6274
6622
|
cause: e
|
|
6275
6623
|
});
|
|
6276
6624
|
}
|
|
@@ -6331,25 +6679,25 @@ async function setupNeonPostgres(config, cliInput) {
|
|
|
6331
6679
|
return Result.ok(void 0);
|
|
6332
6680
|
}
|
|
6333
6681
|
let setupMethod = cliInput?.dbSetupOptions?.neon?.method ?? config.dbSetupOptions?.neon?.method;
|
|
6334
|
-
if (!setupMethod) if (isSilent()) setupMethod = "
|
|
6682
|
+
if (!setupMethod) if (isSilent()) setupMethod = "neon-new";
|
|
6335
6683
|
else {
|
|
6336
6684
|
const promptedSetupMethod = await select({
|
|
6337
6685
|
message: "Choose your Neon setup method:",
|
|
6338
6686
|
options: [{
|
|
6339
|
-
label: "Quick setup with
|
|
6340
|
-
value: "
|
|
6687
|
+
label: "Quick setup with neon-new",
|
|
6688
|
+
value: "neon-new",
|
|
6341
6689
|
hint: "fastest, no auth required"
|
|
6342
6690
|
}, {
|
|
6343
|
-
label: "Custom setup with
|
|
6344
|
-
value: "
|
|
6691
|
+
label: "Custom setup with Neon CLI",
|
|
6692
|
+
value: "neon",
|
|
6345
6693
|
hint: "More control - choose project name and region"
|
|
6346
6694
|
}],
|
|
6347
|
-
initialValue: "
|
|
6695
|
+
initialValue: "neon-new"
|
|
6348
6696
|
});
|
|
6349
6697
|
if (isCancel(promptedSetupMethod)) return userCancelled("Operation cancelled");
|
|
6350
6698
|
setupMethod = promptedSetupMethod;
|
|
6351
6699
|
}
|
|
6352
|
-
if (setupMethod === "neondb") {
|
|
6700
|
+
if (setupMethod === "neon-new" || setupMethod === "neondb") {
|
|
6353
6701
|
const neonDbResult = await setupWithNeonDb(projectDir, packageManager, backend);
|
|
6354
6702
|
if (neonDbResult.isErr()) {
|
|
6355
6703
|
cliLog.error(pc.red(neonDbResult.error.message));
|
|
@@ -7269,7 +7617,7 @@ async function getDockerStatus(database) {
|
|
|
7269
7617
|
//#endregion
|
|
7270
7618
|
//#region src/helpers/core/post-installation.ts
|
|
7271
7619
|
function getDesktopStaticBuildNote(frontend) {
|
|
7272
|
-
const staticBuildFrontends = new Map([
|
|
7620
|
+
const staticBuildFrontends = /* @__PURE__ */ new Map([
|
|
7273
7621
|
["tanstack-start", "TanStack Start"],
|
|
7274
7622
|
["next", "Next.js"],
|
|
7275
7623
|
["nuxt", "Nuxt"],
|
|
@@ -8100,7 +8448,7 @@ const router = t.router({
|
|
|
8100
8448
|
}),
|
|
8101
8449
|
createJson: t.procedure.meta({
|
|
8102
8450
|
description: "Create a project from a raw JSON payload (agent-friendly)",
|
|
8103
|
-
jsonInput:
|
|
8451
|
+
jsonInput: "always"
|
|
8104
8452
|
}).input(types_exports.CreateInputSchema).mutation(async ({ input }) => {
|
|
8105
8453
|
const result = await createProjectHandler(input, { silent: true });
|
|
8106
8454
|
if (!result) throw new UserCancelledError({ message: "Operation cancelled" });
|
|
@@ -8122,7 +8470,7 @@ const router = t.router({
|
|
|
8122
8470
|
}),
|
|
8123
8471
|
addJson: t.procedure.meta({
|
|
8124
8472
|
description: "Add addons from a raw JSON payload (agent-friendly)",
|
|
8125
|
-
jsonInput:
|
|
8473
|
+
jsonInput: "always"
|
|
8126
8474
|
}).input(types_exports.AddInputSchema).mutation(async ({ input }) => {
|
|
8127
8475
|
const result = await addHandler(input, { silent: true });
|
|
8128
8476
|
if (!result) throw new UserCancelledError({ message: "Operation cancelled" });
|
|
@@ -8273,7 +8621,7 @@ async function createVirtual(options) {
|
|
|
8273
8621
|
webDeploy: virtualOptions.webDeploy || "none",
|
|
8274
8622
|
serverDeploy: virtualOptions.serverDeploy || "none"
|
|
8275
8623
|
};
|
|
8276
|
-
const validationResult = validateConfigCompatibility(config, new Set([
|
|
8624
|
+
const validationResult = validateConfigCompatibility(config, /* @__PURE__ */ new Set([
|
|
8277
8625
|
"database",
|
|
8278
8626
|
"orm",
|
|
8279
8627
|
"backend",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.38.0",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"better-auth",
|
|
@@ -69,24 +69,24 @@
|
|
|
69
69
|
"prepublishOnly": "npm run build"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@better-t-stack/template-generator": "^3.
|
|
73
|
-
"@better-t-stack/types": "^3.
|
|
72
|
+
"@better-t-stack/template-generator": "^3.38.0",
|
|
73
|
+
"@better-t-stack/types": "^3.38.0",
|
|
74
74
|
"@clack/core": "^1.4.3",
|
|
75
75
|
"@clack/prompts": "^1.7.0",
|
|
76
|
-
"@modelcontextprotocol/sdk": "1.
|
|
77
|
-
"@trpc/server": "^11.
|
|
78
|
-
"better-result": "^2.
|
|
76
|
+
"@modelcontextprotocol/sdk": "1.30.0",
|
|
77
|
+
"@trpc/server": "^11.18.0",
|
|
78
|
+
"better-result": "^2.10.0",
|
|
79
79
|
"consola": "^3.4.2",
|
|
80
80
|
"env-paths": "^4.0.0",
|
|
81
|
-
"execa": "^
|
|
82
|
-
"fs-extra": "^11.
|
|
81
|
+
"execa": "^10.0.0",
|
|
82
|
+
"fs-extra": "^11.4.0",
|
|
83
83
|
"gradient-string": "^3.0.0",
|
|
84
84
|
"handlebars": "^4.7.9",
|
|
85
85
|
"jsonc-parser": "^3.3.1",
|
|
86
|
-
"oxfmt": "^0.
|
|
86
|
+
"oxfmt": "^0.61.0",
|
|
87
87
|
"picocolors": "^1.1.1",
|
|
88
|
-
"tinyglobby": "^0.2.
|
|
89
|
-
"trpc-cli": "^0.
|
|
88
|
+
"tinyglobby": "^0.2.17",
|
|
89
|
+
"trpc-cli": "^0.16.0",
|
|
90
90
|
"ts-morph": "^28.0.0",
|
|
91
91
|
"yaml": "^2.9.0",
|
|
92
92
|
"zod": "^4.4.3"
|
|
@@ -94,9 +94,9 @@
|
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@types/bun": "^1.3.14",
|
|
96
96
|
"@types/fs-extra": "^11.0.4",
|
|
97
|
-
"@types/node": "^
|
|
98
|
-
"publint": "^0.3.
|
|
99
|
-
"tsdown": "^0.22.
|
|
97
|
+
"@types/node": "^26.1.2",
|
|
98
|
+
"publint": "^0.3.22",
|
|
99
|
+
"tsdown": "^0.22.14",
|
|
100
100
|
"typescript": "^6.0.3"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
File without changes
|