create-better-t-stack 3.41.2 → 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 +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-CCnlcJnd.mjs → src-C8JXMrWB.mjs} +21 -5
- package/package.json +3 -3
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-
|
|
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.d.mts
CHANGED
|
@@ -355,6 +355,7 @@ declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
355
355
|
packageManager?: "bun" | "npm" | "pnpm" | undefined;
|
|
356
356
|
projectDir?: string | undefined;
|
|
357
357
|
dryRun?: boolean | undefined;
|
|
358
|
+
disableAnalytics?: boolean | undefined;
|
|
358
359
|
};
|
|
359
360
|
output: void;
|
|
360
361
|
meta: TrpcCliMeta;
|
|
@@ -404,6 +405,7 @@ declare const router: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
404
405
|
install?: boolean | undefined;
|
|
405
406
|
packageManager?: "bun" | "npm" | "pnpm" | undefined;
|
|
406
407
|
dryRun?: boolean | undefined;
|
|
408
|
+
disableAnalytics?: boolean | undefined;
|
|
407
409
|
};
|
|
408
410
|
output: AddResult;
|
|
409
411
|
meta: TrpcCliMeta;
|
|
@@ -476,7 +478,7 @@ declare function builder(): Promise<void>;
|
|
|
476
478
|
* ```
|
|
477
479
|
*/
|
|
478
480
|
declare function createVirtual(options: Partial<Omit<types_d_exports.ProjectConfig, "projectDir" | "relativePath">>): Promise<Result$1<VirtualFileTree$1, GeneratorError$1>>;
|
|
479
|
-
type AddOptions = Pick<types_d_exports.AddInput, "addons" | "addonOptions" | "package" | "install" | "packageManager" | "projectDir" | "dryRun">;
|
|
481
|
+
type AddOptions = Pick<types_d_exports.AddInput, "addons" | "addonOptions" | "package" | "install" | "packageManager" | "projectDir" | "dryRun" | "disableAnalytics">;
|
|
480
482
|
/**
|
|
481
483
|
* Programmatic API to add addons or a workspace package to an existing Better-T-Stack project.
|
|
482
484
|
*
|
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-
|
|
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
|
|
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) {
|
|
@@ -4886,7 +4900,8 @@ async function addHandler(input, options = {}) {
|
|
|
4886
4900
|
const { silent = false, mode } = options;
|
|
4887
4901
|
return runWithContextAsync({
|
|
4888
4902
|
silent,
|
|
4889
|
-
mode
|
|
4903
|
+
mode,
|
|
4904
|
+
analyticsDisabled: input.disableAnalytics
|
|
4890
4905
|
}, async () => {
|
|
4891
4906
|
const result = await addHandlerInternal(input);
|
|
4892
4907
|
await reportAddOutcome(input, result);
|
|
@@ -9029,7 +9044,7 @@ async function executeCreateProjectHandler(input, options) {
|
|
|
9029
9044
|
async function reportCreateOutcome(input, result) {
|
|
9030
9045
|
if (result.isOk()) return;
|
|
9031
9046
|
const error = result.error;
|
|
9032
|
-
if (
|
|
9047
|
+
if (isUserCancellation(error)) return;
|
|
9033
9048
|
await reportDiagnostic("cli_failed", {
|
|
9034
9049
|
command: "create",
|
|
9035
9050
|
mode: resolveInvocationMode(input.yes),
|
|
@@ -9049,7 +9064,7 @@ async function createProjectHandler(input, options = {}) {
|
|
|
9049
9064
|
if (result.isOk()) return result.value;
|
|
9050
9065
|
const error = result.error;
|
|
9051
9066
|
const elapsedTimeMs = Date.now() - startTime;
|
|
9052
|
-
if (
|
|
9067
|
+
if (isUserCancellation(error)) {
|
|
9053
9068
|
if (silent) return createEmptyResult(timeScaffolded, elapsedTimeMs, error.message);
|
|
9054
9069
|
return;
|
|
9055
9070
|
}
|
|
@@ -9431,7 +9446,8 @@ const router = t.router({
|
|
|
9431
9446
|
install: z.boolean().optional().default(false).describe("Install dependencies after adding"),
|
|
9432
9447
|
packageManager: types_exports.PackageManagerSchema.optional().describe("Package manager to use"),
|
|
9433
9448
|
projectDir: z.string().optional().describe("Project directory (defaults to current)"),
|
|
9434
|
-
dryRun: z.boolean().optional().default(false).describe("Preview addon changes without writing files")
|
|
9449
|
+
dryRun: z.boolean().optional().default(false).describe("Preview addon changes without writing files"),
|
|
9450
|
+
disableAnalytics: z.boolean().optional().default(false).describe("Disable analytics")
|
|
9435
9451
|
})).mutation(async ({ input }) => {
|
|
9436
9452
|
await addHandler(input);
|
|
9437
9453
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.41.
|
|
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.
|
|
73
|
-
"@better-t-stack/types": "^3.41.
|
|
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",
|