create-better-t-stack 3.41.3 → 3.41.4

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 { D as setProcessMode, i as SchemaNameSchema, l as create, m as getSchemaResult, s as add, u as createBtsCli, v as types_exports, y as getLatestCLIVersion } from "./src-BhgA6H5Y.mjs";
2
+ import { D as setProcessMode, i as SchemaNameSchema, l as create, m as getSchemaResult, s as add, u as createBtsCli, v as types_exports, y as getLatestCLIVersion } from "./src-C8JXMrWB.mjs";
3
3
  import z from "zod";
4
4
  import { McpServer } from "@modelcontextprotocol/server";
5
5
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { C as DirectoryConflictError, E as ValidationError, S as DatabaseSetupError, T as UserCancelledError, _ as ProjectLauncherSchema, a as TEMPLATE_COUNT, b as CLIError, 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 ProjectCreationError, x as CompatibilityError } from "./src-BhgA6H5Y.mjs";
2
+ import { C as DirectoryConflictError, E as ValidationError, S as DatabaseSetupError, T as UserCancelledError, _ as ProjectLauncherSchema, a as TEMPLATE_COUNT, b as CLIError, 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 ProjectCreationError, x as CompatibilityError } from "./src-C8JXMrWB.mjs";
3
3
  export { CLIError, CompatibilityError, DatabaseSetupError, DirectoryConflictError, EMBEDDED_TEMPLATES, GeneratorError, ProjectCreationError, ProjectLauncherSchema, Result, SchemaNameSchema, TEMPLATE_COUNT, UserCancelledError, ValidationError, VirtualFileSystem, add, builder, create, createBtsCli, createVirtual, docs, generate, getSchemaResult, router, sponsors };
@@ -381,6 +381,14 @@ var UserCancelledError = class extends TaggedError("UserCancelledError") {
381
381
  }
382
382
  };
383
383
  /**
384
+ * True for a direct cancellation or one that a setup step wrapped in a ProjectCreationError
385
+ * (for example cancelling a prompt inside addon or database setup).
386
+ */
387
+ function isUserCancellation(cause) {
388
+ if (UserCancelledError.is(cause)) return true;
389
+ return ProjectCreationError.is(cause) && UserCancelledError.is(cause.cause);
390
+ }
391
+ /**
384
392
  * General CLI error for validation failures, invalid flags, etc.
385
393
  */
386
394
  var CLIError = class extends TaggedError("CLIError") {};
@@ -1782,7 +1790,13 @@ function failureStage(cause) {
1782
1790
  * project replaced by placeholders: quoted names, URLs, emails, and paths.
1783
1791
  */
1784
1792
  function scrubReason(cause) {
1785
- const scrubbed = ((cause instanceof Error ? cause.message : String(cause)).split(/\r?\n/, 1)[0] ?? "").replaceAll(/(["'`])(?:(?!\1).)*\1/g, "<name>").replaceAll(/https?:\/\/[^\s)\]"'>]+/gi, "<url>").replaceAll(/[\w.+-]+@[\w-]+\.[\w.-]+/g, "<email>").replaceAll(/(?:[a-zA-Z]:)?(?:[\\/][\w.@+ -]+)+[\\/][\w.@+-]+(?:[ \w.@+-]*\.\w+)?/g, "<path>").replaceAll(/\S*[\\/]\S*/g, "<path>").replaceAll(/\s+/g, " ").trim();
1793
+ const lines = (cause instanceof Error ? cause.message : String(cause)).split(/\r?\n/);
1794
+ const bullets = [];
1795
+ for (const line of lines.slice(1)) {
1796
+ if (!line.startsWith("- ")) break;
1797
+ bullets.push(line.slice(2));
1798
+ }
1799
+ const scrubbed = [lines[0] ?? "", ...bullets].join(" ").replaceAll(/(?<![\p{L}\p{N}\p{M}_])(["'`])(?:(?!\1).)*\1(?![\p{L}\p{N}\p{M}_])/gu, "<name>").replaceAll(/https?:\/\/[^\s)\]"'>]+/gi, "<url>").replaceAll(/[\w.+-]+@[\w-]+\.[\w.-]+/g, "<email>").replaceAll(/(?:[a-zA-Z]:)?(?:[\\/][\w.@+ -]+)+[\\/][\w.@+-]+(?:[ \w.@+-]*\.\w+)?/g, "<path>").replaceAll(/\S*[\\/]\S*/g, "<path>").replaceAll(/\s+/g, " ").trim();
1786
1800
  return scrubbed.length > MAX_REASON_LENGTH ? scrubbed.slice(0, MAX_REASON_LENGTH) : scrubbed;
1787
1801
  }
1788
1802
  function clampValue(value) {
@@ -9030,7 +9044,7 @@ async function executeCreateProjectHandler(input, options) {
9030
9044
  async function reportCreateOutcome(input, result) {
9031
9045
  if (result.isOk()) return;
9032
9046
  const error = result.error;
9033
- if (UserCancelledError.is(error)) return;
9047
+ if (isUserCancellation(error)) return;
9034
9048
  await reportDiagnostic("cli_failed", {
9035
9049
  command: "create",
9036
9050
  mode: resolveInvocationMode(input.yes),
@@ -9050,7 +9064,7 @@ async function createProjectHandler(input, options = {}) {
9050
9064
  if (result.isOk()) return result.value;
9051
9065
  const error = result.error;
9052
9066
  const elapsedTimeMs = Date.now() - startTime;
9053
- if (UserCancelledError.is(error)) {
9067
+ if (isUserCancellation(error)) {
9054
9068
  if (silent) return createEmptyResult(timeScaffolded, elapsedTimeMs, error.message);
9055
9069
  return;
9056
9070
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "3.41.3",
3
+ "version": "3.41.4",
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,8 +69,8 @@
69
69
  "prepublishOnly": "npm run build"
70
70
  },
71
71
  "dependencies": {
72
- "@better-t-stack/template-generator": "^3.41.3",
73
- "@better-t-stack/types": "^3.41.3",
72
+ "@better-t-stack/template-generator": "^3.41.4",
73
+ "@better-t-stack/types": "^3.41.4",
74
74
  "@clack/core": "^1.4.3",
75
75
  "@clack/prompts": "^1.7.0",
76
76
  "@modelcontextprotocol/server": "2.0.0",