create-better-t-stack 3.28.0 → 3.28.1-pr1036.ff20c00

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.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-CHenuE55.mjs";
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-Bx8Ofji-.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";
@@ -9,6 +9,7 @@ const ToolResponseSchema = z.object({
9
9
  data: z.any().optional(),
10
10
  error: z.string().optional()
11
11
  });
12
+ const SchemaToolInputSchema = z.object({ name: SchemaNameSchema.optional().describe("Schema name to inspect. Defaults to all.") });
12
13
  const McpCreateProjectInputSchema = types_exports.CreateInputSchema.safeExtend({
13
14
  projectName: z.string().describe("Project name or relative path"),
14
15
  frontend: z.array(types_exports.FrontendSchema).describe("Explicit frontend app surfaces. Do not use native frontends as styling options."),
@@ -134,7 +135,6 @@ function createBtsMcpServer() {
134
135
  server.registerTool("bts_get_stack_guidance", {
135
136
  title: "Get Better T Stack MCP Guidance",
136
137
  description: "Read MCP-specific guidance for choosing valid Better T Stack configurations. Use this before planning when user intent is ambiguous. This explains the full explicit config required by MCP project creation, plus important field semantics and ambiguity rules.",
137
- inputSchema: z.object({}),
138
138
  outputSchema: ToolResponseSchema,
139
139
  annotations: {
140
140
  title: "Get Better T Stack MCP Guidance",
@@ -153,7 +153,7 @@ function createBtsMcpServer() {
153
153
  server.registerTool("bts_get_schema", {
154
154
  title: "Get Better T Stack Schemas",
155
155
  description: "Inspect Better T Stack CLI and input schemas so agents can plan valid create/add requests. Use this together with bts_get_stack_guidance before creating a project if any part of the request is ambiguous.",
156
- inputSchema: z.object({ name: SchemaNameSchema.optional().describe("Schema name to inspect. Defaults to all.") }),
156
+ inputSchema: SchemaToolInputSchema,
157
157
  outputSchema: ToolResponseSchema,
158
158
  annotations: {
159
159
  title: "Get Better T Stack Schemas",
package/dist/index.d.mts CHANGED
@@ -152,6 +152,7 @@ declare const SchemaNameSchema: z.ZodDefault<z.ZodEnum<{
152
152
  addInput: "addInput";
153
153
  projectConfig: "projectConfig";
154
154
  betterTStackConfig: "betterTStackConfig";
155
+ betterTStackConfigFile: "betterTStackConfigFile";
155
156
  initResult: "initResult";
156
157
  }>>;
157
158
  type SchemaName = z.infer<typeof SchemaNameSchema>;
@@ -294,7 +295,7 @@ declare const router: _$_trpc_server0.TRPCBuiltRouter<{
294
295
  }>;
295
296
  schema: _$_trpc_server0.TRPCQueryProcedure<{
296
297
  input: {
297
- 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" | "initResult" | undefined;
298
+ 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;
298
299
  };
299
300
  output: unknown;
300
301
  meta: TrpcCliMeta;
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-CHenuE55.mjs";
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-Bx8Ofji-.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 };
@@ -338,7 +338,7 @@ async function readHistory() {
338
338
  cause: e
339
339
  })
340
340
  });
341
- if (existsResult.isErr()) return existsResult;
341
+ if (existsResult.isErr()) return Result.err(existsResult.error);
342
342
  if (!existsResult.value) return Result.ok(emptyHistory());
343
343
  const readResult = await Result.tryPromise({
344
344
  try: async () => await fs.readJson(historyPath),
@@ -352,7 +352,7 @@ async function readHistory() {
352
352
  }
353
353
  async function writeHistory(history) {
354
354
  const ensureDirResult = await ensureHistoryDir();
355
- if (ensureDirResult.isErr()) return ensureDirResult;
355
+ if (ensureDirResult.isErr()) return Result.err(ensureDirResult.error);
356
356
  return Result.tryPromise({
357
357
  try: async () => {
358
358
  await fs.writeJson(getHistoryPath(), history, { spaces: 2 });
@@ -365,7 +365,7 @@ async function writeHistory(history) {
365
365
  }
366
366
  async function addToHistory(config, reproducibleCommand) {
367
367
  const historyResult = await readHistory();
368
- if (historyResult.isErr()) return historyResult;
368
+ if (historyResult.isErr()) return Result.err(historyResult.error);
369
369
  const history = historyResult.value;
370
370
  const entry = {
371
371
  id: generateId(),
@@ -395,7 +395,7 @@ async function addToHistory(config, reproducibleCommand) {
395
395
  }
396
396
  async function getHistory(limit = 10) {
397
397
  const historyResult = await readHistory();
398
- if (historyResult.isErr()) return historyResult;
398
+ if (historyResult.isErr()) return Result.err(historyResult.error);
399
399
  return Result.ok(historyResult.value.entries.slice(0, limit));
400
400
  }
401
401
  async function clearHistory() {
@@ -4868,24 +4868,14 @@ async function getProjectName(initialName) {
4868
4868
  */
4869
4869
  function isTelemetryEnabled() {
4870
4870
  const BTS_TELEMETRY_DISABLED = process.env.BTS_TELEMETRY_DISABLED;
4871
- const BTS_TELEMETRY = "1";
4871
+ const BTS_TELEMETRY = "0";
4872
4872
  if (BTS_TELEMETRY_DISABLED !== void 0) return BTS_TELEMETRY_DISABLED !== "1";
4873
4873
  if (BTS_TELEMETRY !== void 0) return BTS_TELEMETRY === "1";
4874
4874
  return true;
4875
4875
  }
4876
4876
  //#endregion
4877
4877
  //#region src/utils/analytics.ts
4878
- const CONVEX_INGEST_URL = "https://striped-seahorse-863.convex.site/api/analytics/ingest";
4879
- async function sendConvexEvent(payload) {
4880
- await Result.tryPromise({
4881
- try: () => fetch(CONVEX_INGEST_URL, {
4882
- method: "POST",
4883
- headers: { "Content-Type": "application/json" },
4884
- body: JSON.stringify(payload)
4885
- }),
4886
- catch: () => void 0
4887
- });
4888
- }
4878
+ async function sendConvexEvent(payload) {}
4889
4879
  async function trackProjectCreation(config, disableAnalytics = false) {
4890
4880
  if (!isTelemetryEnabled() || disableAnalytics) return;
4891
4881
  const { projectName: _projectName, projectDir: _projectDir, relativePath: _relativePath, ...safeConfig } = config;
@@ -5450,7 +5440,7 @@ async function initMongoDBAtlas(serverDir) {
5450
5440
  cause: e
5451
5441
  })
5452
5442
  });
5453
- if (deployResult.isErr()) return deployResult;
5443
+ if (deployResult.isErr()) return Result.err(deployResult.error);
5454
5444
  const connectionString = await text({
5455
5445
  message: "Enter your MongoDB connection string:",
5456
5446
  placeholder: "mongodb+srv://username:password@cluster.mongodb.net/database",
@@ -5561,7 +5551,7 @@ async function setupMongoDBAtlas(config, cliInput) {
5561
5551
  cliLog.success(pc.green("MongoDB Atlas setup complete! Connection saved to .env file."));
5562
5552
  return Result.ok(void 0);
5563
5553
  }
5564
- if (UserCancelledError.is(mongoConfigResult.error)) return mongoConfigResult;
5554
+ if (UserCancelledError.is(mongoConfigResult.error)) return Result.err(mongoConfigResult.error);
5565
5555
  cliLog.warn(pc.yellow("Falling back to local MongoDB configuration"));
5566
5556
  const envResult = await writeEnvFile$3(projectDir, backend);
5567
5557
  if (envResult.isErr()) return envResult;
@@ -5626,7 +5616,7 @@ async function executeNeonCommand(packageManager, commandArgsString, spinnerText
5626
5616
  }
5627
5617
  async function createNeonProject(projectName, regionId, packageManager) {
5628
5618
  const execResult = await executeNeonCommand(packageManager, `neonctl@latest projects create --name ${projectName} --region-id ${regionId} --output json`, `Creating Neon project "${projectName}"...`);
5629
- if (execResult.isErr()) return execResult;
5619
+ if (execResult.isErr()) return Result.err(execResult.error);
5630
5620
  const parseResult = Result.try({
5631
5621
  try: () => JSON.parse(execResult.value.stdout),
5632
5622
  catch: (e) => new DatabaseSetupError({
@@ -5635,7 +5625,7 @@ async function createNeonProject(projectName, regionId, packageManager) {
5635
5625
  cause: e
5636
5626
  })
5637
5627
  });
5638
- if (parseResult.isErr()) return parseResult;
5628
+ if (parseResult.isErr()) return Result.err(parseResult.error);
5639
5629
  const response = parseResult.value;
5640
5630
  if (response.project && response.connection_uris && response.connection_uris.length > 0) {
5641
5631
  const projectId = response.project.id;
@@ -5717,6 +5707,12 @@ async function setupNeonPostgres(config, cliInput) {
5717
5707
  dbSetupOptions: cliInput?.dbSetupOptions ?? config.dbSetupOptions
5718
5708
  });
5719
5709
  const target = backend === "self" ? "apps/web" : "apps/server";
5710
+ if (shouldSkipExternalCommands()) {
5711
+ const envResult = await writeEnvFile$2(projectDir, backend);
5712
+ if (envResult.isErr()) return envResult;
5713
+ displayManualSetupInstructions$2(target);
5714
+ return Result.ok(void 0);
5715
+ }
5720
5716
  if (setupMode === "manual") {
5721
5717
  const envResult = await writeEnvFile$2(projectDir, backend);
5722
5718
  if (envResult.isErr()) return envResult;
@@ -5960,7 +5956,7 @@ async function setupWithCreateDb(serverDir, packageManager, regionId) {
5960
5956
  });
5961
5957
  }
5962
5958
  });
5963
- if (execResult.isErr()) return execResult;
5959
+ if (execResult.isErr()) return Result.err(execResult.error);
5964
5960
  const parseResult = Result.try({
5965
5961
  try: () => JSON.parse(execResult.value),
5966
5962
  catch: (e) => new DatabaseSetupError({
@@ -5969,7 +5965,7 @@ async function setupWithCreateDb(serverDir, packageManager, regionId) {
5969
5965
  cause: e
5970
5966
  })
5971
5967
  });
5972
- if (parseResult.isErr()) return parseResult;
5968
+ if (parseResult.isErr()) return Result.err(parseResult.error);
5973
5969
  const createDbResponse = parseResult.value;
5974
5970
  return Result.ok({
5975
5971
  databaseUrl: createDbResponse.connectionString,
@@ -6060,7 +6056,7 @@ async function setupPrismaPostgres(config, cliInput) {
6060
6056
  }
6061
6057
  const prismaConfigResult = await setupWithCreateDb(dbDir, packageManager, cliInput?.dbSetupOptions?.prismaPostgres?.regionId ?? config.dbSetupOptions?.prismaPostgres?.regionId);
6062
6058
  if (prismaConfigResult.isErr()) {
6063
- if (UserCancelledError.is(prismaConfigResult.error)) return prismaConfigResult;
6059
+ if (UserCancelledError.is(prismaConfigResult.error)) return Result.err(prismaConfigResult.error);
6064
6060
  cliLog.error(pc.red(prismaConfigResult.error.message));
6065
6061
  const envResult = await writeEnvFile$1(projectDir, backend);
6066
6062
  if (envResult.isErr()) return envResult;
@@ -6360,7 +6356,7 @@ async function createTursoDatabase(dbName, groupName) {
6360
6356
  });
6361
6357
  }
6362
6358
  });
6363
- if (createResult.isErr()) return createResult;
6359
+ if (createResult.isErr()) return Result.err(createResult.error);
6364
6360
  s.start("Retrieving database connection details...");
6365
6361
  return Result.tryPromise({
6366
6362
  try: async () => {
@@ -6512,7 +6508,7 @@ async function setupTurso(config, cliInput) {
6512
6508
  if (!selectedGroup) if (isSilent()) selectedGroup = (await getTursoGroups())[0]?.name ?? null;
6513
6509
  else {
6514
6510
  const groupResult = await selectTursoGroup();
6515
- if (groupResult.isErr()) return groupResult;
6511
+ if (groupResult.isErr()) return Result.err(groupResult.error);
6516
6512
  selectedGroup = groupResult.value;
6517
6513
  }
6518
6514
  let suggestedName = cliInput?.dbSetupOptions?.turso?.databaseName ?? config.dbSetupOptions?.turso?.databaseName ?? path.basename(projectDir);
@@ -7364,6 +7360,7 @@ const SchemaNameSchema = z.enum([
7364
7360
  "addInput",
7365
7361
  "projectConfig",
7366
7362
  "betterTStackConfig",
7363
+ "betterTStackConfigFile",
7367
7364
  "initResult"
7368
7365
  ]).default("all");
7369
7366
  const t = initTRPC.meta().create();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "3.28.0",
3
+ "version": "3.28.1-pr1036.ff20c00",
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",
@@ -70,13 +70,13 @@
70
70
  "prepublishOnly": "npm run build"
71
71
  },
72
72
  "dependencies": {
73
- "@better-t-stack/template-generator": "^3.28.0",
74
- "@better-t-stack/types": "^3.28.0",
75
- "@clack/core": "^1.2.0",
76
- "@clack/prompts": "^1.2.0",
73
+ "@better-t-stack/template-generator": "3.28.1-pr1036.ff20c00",
74
+ "@better-t-stack/types": "3.28.1-pr1036.ff20c00",
75
+ "@clack/core": "^1.3.0",
76
+ "@clack/prompts": "^1.3.0",
77
77
  "@modelcontextprotocol/sdk": "1.29.0",
78
- "@trpc/server": "^11.16.0",
79
- "better-result": "^2.8.2",
78
+ "@trpc/server": "^11.17.0",
79
+ "better-result": "^2.9.1",
80
80
  "consola": "^3.4.2",
81
81
  "env-paths": "^4.0.0",
82
82
  "execa": "^9.6.1",
@@ -84,20 +84,20 @@
84
84
  "gradient-string": "^3.0.0",
85
85
  "handlebars": "^4.7.9",
86
86
  "jsonc-parser": "^3.3.1",
87
- "oxfmt": "^0.46.0",
87
+ "oxfmt": "^0.47.0",
88
88
  "picocolors": "^1.1.1",
89
89
  "tinyglobby": "^0.2.15",
90
90
  "trpc-cli": "^0.14.0",
91
91
  "ts-morph": "^28.0.0",
92
- "yaml": "^2.8.3",
93
- "zod": "^4.3.6"
92
+ "yaml": "^2.8.4",
93
+ "zod": "^4.4.2"
94
94
  },
95
95
  "devDependencies": {
96
- "@types/bun": "^1.3.12",
96
+ "@types/bun": "^1.3.13",
97
97
  "@types/fs-extra": "^11.0.4",
98
98
  "@types/node": "^25.6.0",
99
99
  "publint": "^0.3.18",
100
- "tsdown": "^0.21.9",
100
+ "tsdown": "^0.21.10",
101
101
  "typescript": "^6.0.3"
102
102
  }
103
103
  }