create-better-t-stack 3.24.0 → 3.25.3
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 +2 -2
- package/dist/index.d.mts +222 -765
- package/dist/index.mjs +1 -1
- package/dist/{src-SYbbb0XN.mjs → src-BsKaExN8.mjs} +134 -109
- package/package.json +4 -4
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-BsKaExN8.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,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { n as __reExport, t as __exportAll } from "./chunk-BtN16TXe.mjs";
|
|
3
3
|
import { getAllJsonSchemas } from "@better-t-stack/types/json-schema";
|
|
4
|
-
import {
|
|
4
|
+
import { initTRPC } from "@trpc/server";
|
|
5
5
|
import { Result, Result as Result$1, TaggedError } from "better-result";
|
|
6
6
|
import { createCli } from "trpc-cli";
|
|
7
7
|
import z from "zod";
|
|
@@ -13,14 +13,14 @@ import fs from "fs-extra";
|
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
14
|
import { desktopWebFrontends as desktopWebFrontends$3 } from "@better-t-stack/types";
|
|
15
15
|
import { EMBEDDED_TEMPLATES, EMBEDDED_TEMPLATES as EMBEDDED_TEMPLATES$1, GeneratorError as GeneratorError$1, TEMPLATE_COUNT, VirtualFileSystem, VirtualFileSystem as VirtualFileSystem$1, dependencyVersionMap, generate, generate as generate$1, generateReproducibleCommand, processAddonTemplates, processAddonsDeps } from "@better-t-stack/template-generator";
|
|
16
|
-
import
|
|
16
|
+
import { consola, createConsola } from "consola";
|
|
17
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
17
18
|
import gradient from "gradient-string";
|
|
18
19
|
import { $, execa } from "execa";
|
|
19
20
|
import { writeTree } from "@better-t-stack/template-generator/fs-writer";
|
|
20
21
|
import { ConfirmPrompt, GroupMultiSelectPrompt, MultiSelectPrompt, SelectPrompt, isCancel as isCancel$1 } from "@clack/core";
|
|
21
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
22
22
|
import { applyEdits, modify, parse } from "jsonc-parser";
|
|
23
|
-
import os
|
|
23
|
+
import os from "node:os";
|
|
24
24
|
import { format } from "oxfmt";
|
|
25
25
|
//#region src/utils/get-package-manager.ts
|
|
26
26
|
const getUserPkgManager = () => {
|
|
@@ -89,6 +89,109 @@ const ADDON_COMPATIBILITY = {
|
|
|
89
89
|
none: []
|
|
90
90
|
};
|
|
91
91
|
//#endregion
|
|
92
|
+
//#region src/utils/context.ts
|
|
93
|
+
const cliStorage = new AsyncLocalStorage();
|
|
94
|
+
function defaultContext() {
|
|
95
|
+
return {
|
|
96
|
+
navigation: {
|
|
97
|
+
isFirstPrompt: false,
|
|
98
|
+
lastPromptShownUI: false
|
|
99
|
+
},
|
|
100
|
+
silent: false,
|
|
101
|
+
verbose: false
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function getContext() {
|
|
105
|
+
const ctx = cliStorage.getStore();
|
|
106
|
+
if (!ctx) return defaultContext();
|
|
107
|
+
return ctx;
|
|
108
|
+
}
|
|
109
|
+
function tryGetContext() {
|
|
110
|
+
return cliStorage.getStore();
|
|
111
|
+
}
|
|
112
|
+
function isSilent() {
|
|
113
|
+
return getContext().silent;
|
|
114
|
+
}
|
|
115
|
+
function isFirstPrompt() {
|
|
116
|
+
return getContext().navigation.isFirstPrompt;
|
|
117
|
+
}
|
|
118
|
+
function didLastPromptShowUI() {
|
|
119
|
+
return getContext().navigation.lastPromptShownUI;
|
|
120
|
+
}
|
|
121
|
+
function setIsFirstPrompt$1(value) {
|
|
122
|
+
const ctx = tryGetContext();
|
|
123
|
+
if (ctx) ctx.navigation.isFirstPrompt = value;
|
|
124
|
+
}
|
|
125
|
+
function setLastPromptShownUI(value) {
|
|
126
|
+
const ctx = tryGetContext();
|
|
127
|
+
if (ctx) ctx.navigation.lastPromptShownUI = value;
|
|
128
|
+
}
|
|
129
|
+
async function runWithContextAsync(options, fn) {
|
|
130
|
+
const ctx = {
|
|
131
|
+
navigation: {
|
|
132
|
+
isFirstPrompt: false,
|
|
133
|
+
lastPromptShownUI: false
|
|
134
|
+
},
|
|
135
|
+
silent: options.silent ?? false,
|
|
136
|
+
verbose: options.verbose ?? false,
|
|
137
|
+
projectDir: options.projectDir,
|
|
138
|
+
projectName: options.projectName,
|
|
139
|
+
packageManager: options.packageManager
|
|
140
|
+
};
|
|
141
|
+
return cliStorage.run(ctx, fn);
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/utils/terminal-output.ts
|
|
145
|
+
const noopSpinner = {
|
|
146
|
+
start() {},
|
|
147
|
+
stop() {},
|
|
148
|
+
message() {}
|
|
149
|
+
};
|
|
150
|
+
function createSpinner() {
|
|
151
|
+
return isSilent() ? noopSpinner : spinner();
|
|
152
|
+
}
|
|
153
|
+
const baseConsola = createConsola({
|
|
154
|
+
...consola.options,
|
|
155
|
+
formatOptions: {
|
|
156
|
+
...consola.options.formatOptions,
|
|
157
|
+
date: false
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const cliLog = {
|
|
161
|
+
info(message) {
|
|
162
|
+
if (!isSilent()) log.info(message);
|
|
163
|
+
},
|
|
164
|
+
warn(message) {
|
|
165
|
+
if (!isSilent()) log.warn(message);
|
|
166
|
+
},
|
|
167
|
+
success(message) {
|
|
168
|
+
if (!isSilent()) log.success(message);
|
|
169
|
+
},
|
|
170
|
+
error(message) {
|
|
171
|
+
if (!isSilent()) log.error(message);
|
|
172
|
+
},
|
|
173
|
+
message(message) {
|
|
174
|
+
if (!isSilent()) log.message(message);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const cliConsola = {
|
|
178
|
+
error(message) {
|
|
179
|
+
if (!isSilent()) baseConsola.error(message);
|
|
180
|
+
},
|
|
181
|
+
warn(message) {
|
|
182
|
+
if (!isSilent()) baseConsola.warn(message);
|
|
183
|
+
},
|
|
184
|
+
info(message) {
|
|
185
|
+
if (!isSilent()) baseConsola.info(message);
|
|
186
|
+
},
|
|
187
|
+
fatal(message) {
|
|
188
|
+
if (!isSilent()) baseConsola.fatal(message);
|
|
189
|
+
},
|
|
190
|
+
box(message) {
|
|
191
|
+
if (!isSilent()) baseConsola.box(message);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
//#endregion
|
|
92
195
|
//#region src/utils/errors.ts
|
|
93
196
|
/**
|
|
94
197
|
* User cancelled the operation (e.g., Ctrl+C in prompts)
|
|
@@ -174,7 +277,7 @@ function databaseSetupError(provider, message, cause) {
|
|
|
174
277
|
*/
|
|
175
278
|
function displayError(error) {
|
|
176
279
|
if (UserCancelledError.is(error)) cancel(pc.red(error.message));
|
|
177
|
-
else
|
|
280
|
+
else cliConsola.error(pc.red(error.message));
|
|
178
281
|
}
|
|
179
282
|
//#endregion
|
|
180
283
|
//#region src/utils/get-latest-cli-version.ts
|
|
@@ -490,7 +593,7 @@ function displaySponsorsBox(sponsors) {
|
|
|
490
593
|
if (website) output += ` ${pc.dim("Website:")} ${website}\n`;
|
|
491
594
|
if (idx < sponsors.specialSponsors.length - 1) output += "\n";
|
|
492
595
|
});
|
|
493
|
-
|
|
596
|
+
cliConsola.box(output);
|
|
494
597
|
}
|
|
495
598
|
function formatPostInstallSpecialSponsorsSection(sponsors) {
|
|
496
599
|
if (sponsors.specialSponsors.length === 0) return "";
|
|
@@ -779,58 +882,6 @@ function validateExamplesCompatibility(examples, backend, database, frontend, ap
|
|
|
779
882
|
return Result.ok(void 0);
|
|
780
883
|
}
|
|
781
884
|
//#endregion
|
|
782
|
-
//#region src/utils/context.ts
|
|
783
|
-
const cliStorage = new AsyncLocalStorage();
|
|
784
|
-
function defaultContext() {
|
|
785
|
-
return {
|
|
786
|
-
navigation: {
|
|
787
|
-
isFirstPrompt: false,
|
|
788
|
-
lastPromptShownUI: false
|
|
789
|
-
},
|
|
790
|
-
silent: false,
|
|
791
|
-
verbose: false
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
function getContext() {
|
|
795
|
-
const ctx = cliStorage.getStore();
|
|
796
|
-
if (!ctx) return defaultContext();
|
|
797
|
-
return ctx;
|
|
798
|
-
}
|
|
799
|
-
function tryGetContext() {
|
|
800
|
-
return cliStorage.getStore();
|
|
801
|
-
}
|
|
802
|
-
function isSilent() {
|
|
803
|
-
return getContext().silent;
|
|
804
|
-
}
|
|
805
|
-
function isFirstPrompt() {
|
|
806
|
-
return getContext().navigation.isFirstPrompt;
|
|
807
|
-
}
|
|
808
|
-
function didLastPromptShowUI() {
|
|
809
|
-
return getContext().navigation.lastPromptShownUI;
|
|
810
|
-
}
|
|
811
|
-
function setIsFirstPrompt$1(value) {
|
|
812
|
-
const ctx = tryGetContext();
|
|
813
|
-
if (ctx) ctx.navigation.isFirstPrompt = value;
|
|
814
|
-
}
|
|
815
|
-
function setLastPromptShownUI(value) {
|
|
816
|
-
const ctx = tryGetContext();
|
|
817
|
-
if (ctx) ctx.navigation.lastPromptShownUI = value;
|
|
818
|
-
}
|
|
819
|
-
async function runWithContextAsync(options, fn) {
|
|
820
|
-
const ctx = {
|
|
821
|
-
navigation: {
|
|
822
|
-
isFirstPrompt: false,
|
|
823
|
-
lastPromptShownUI: false
|
|
824
|
-
},
|
|
825
|
-
silent: options.silent ?? false,
|
|
826
|
-
verbose: options.verbose ?? false,
|
|
827
|
-
projectDir: options.projectDir,
|
|
828
|
-
projectName: options.projectName,
|
|
829
|
-
packageManager: options.packageManager
|
|
830
|
-
};
|
|
831
|
-
return cliStorage.run(ctx, fn);
|
|
832
|
-
}
|
|
833
|
-
//#endregion
|
|
834
885
|
//#region src/utils/navigation.ts
|
|
835
886
|
const GO_BACK_SYMBOL = Symbol("clack:goBack");
|
|
836
887
|
function isGoBack(value) {
|
|
@@ -1409,33 +1460,6 @@ function getPackageRunnerPrefix(packageManager) {
|
|
|
1409
1460
|
}
|
|
1410
1461
|
}
|
|
1411
1462
|
//#endregion
|
|
1412
|
-
//#region src/utils/terminal-output.ts
|
|
1413
|
-
const noopSpinner = {
|
|
1414
|
-
start() {},
|
|
1415
|
-
stop() {},
|
|
1416
|
-
message() {}
|
|
1417
|
-
};
|
|
1418
|
-
function createSpinner() {
|
|
1419
|
-
return isSilent() ? noopSpinner : spinner();
|
|
1420
|
-
}
|
|
1421
|
-
const cliLog = {
|
|
1422
|
-
info(message) {
|
|
1423
|
-
if (!isSilent()) log.info(message);
|
|
1424
|
-
},
|
|
1425
|
-
warn(message) {
|
|
1426
|
-
if (!isSilent()) log.warn(message);
|
|
1427
|
-
},
|
|
1428
|
-
success(message) {
|
|
1429
|
-
if (!isSilent()) log.success(message);
|
|
1430
|
-
},
|
|
1431
|
-
error(message) {
|
|
1432
|
-
if (!isSilent()) log.error(message);
|
|
1433
|
-
},
|
|
1434
|
-
message(message) {
|
|
1435
|
-
if (!isSilent()) log.message(message);
|
|
1436
|
-
}
|
|
1437
|
-
};
|
|
1438
|
-
//#endregion
|
|
1439
1463
|
//#region src/helpers/addons/fumadocs-setup.ts
|
|
1440
1464
|
const TEMPLATES$2 = {
|
|
1441
1465
|
"next-mdx": {
|
|
@@ -2839,7 +2863,7 @@ async function runSetup(setupFn) {
|
|
|
2839
2863
|
const result = await setupFn();
|
|
2840
2864
|
if (result.isErr()) {
|
|
2841
2865
|
if (UserCancelledError.is(result.error)) throw result.error;
|
|
2842
|
-
|
|
2866
|
+
cliConsola.error(pc.red(result.error.message));
|
|
2843
2867
|
}
|
|
2844
2868
|
}
|
|
2845
2869
|
async function runAddonStep(addon, step) {
|
|
@@ -2851,7 +2875,7 @@ async function runAddonStep(addon, step) {
|
|
|
2851
2875
|
cause: e
|
|
2852
2876
|
})
|
|
2853
2877
|
});
|
|
2854
|
-
if (result.isErr())
|
|
2878
|
+
if (result.isErr()) cliConsola.error(pc.red(result.error.message));
|
|
2855
2879
|
}
|
|
2856
2880
|
async function setupAddons(config) {
|
|
2857
2881
|
const { addons, frontend, projectDir } = config;
|
|
@@ -3905,7 +3929,7 @@ async function getProjectName(initialName) {
|
|
|
3905
3929
|
if (initialName === ".") return initialName;
|
|
3906
3930
|
if (!validateDirectoryName(path.basename(initialName))) {
|
|
3907
3931
|
if (isPathWithinCwd$1(path.resolve(process.cwd(), initialName))) return initialName;
|
|
3908
|
-
|
|
3932
|
+
cliConsola.error(pc.red("Project path must be within current directory"));
|
|
3909
3933
|
}
|
|
3910
3934
|
}
|
|
3911
3935
|
let isValid = false;
|
|
@@ -5715,7 +5739,7 @@ async function setupTurso(config, cliInput) {
|
|
|
5715
5739
|
return Result.ok(void 0);
|
|
5716
5740
|
}
|
|
5717
5741
|
setupSpinner.start("Checking Turso CLI availability...");
|
|
5718
|
-
const platform = os
|
|
5742
|
+
const platform = os.platform();
|
|
5719
5743
|
const isMac = platform === "darwin";
|
|
5720
5744
|
if (platform === "win32") {
|
|
5721
5745
|
setupSpinner.stop(pc.yellow("Turso setup not supported on Windows"));
|
|
@@ -5843,7 +5867,7 @@ async function setupDatabase(config, cliInput) {
|
|
|
5843
5867
|
const result = await setupFn();
|
|
5844
5868
|
if (result.isErr()) {
|
|
5845
5869
|
if (UserCancelledError.is(result.error)) throw result.error;
|
|
5846
|
-
|
|
5870
|
+
cliConsola.error(pc.red(result.error.message));
|
|
5847
5871
|
}
|
|
5848
5872
|
}
|
|
5849
5873
|
const resolvedCliInput = {
|
|
@@ -5929,7 +5953,7 @@ function getDockerInstallInstructions(platform, database) {
|
|
|
5929
5953
|
return `${pc.yellow("IMPORTANT:")} Docker required for ${databaseName}. Install for ${platformName}:\n${pc.blue(installUrl)}`;
|
|
5930
5954
|
}
|
|
5931
5955
|
async function getDockerStatus(database) {
|
|
5932
|
-
const platform = os
|
|
5956
|
+
const platform = os.platform();
|
|
5933
5957
|
if (!await isDockerInstalled()) return {
|
|
5934
5958
|
installed: false,
|
|
5935
5959
|
running: false,
|
|
@@ -6038,7 +6062,7 @@ async function displayPostInstallInstructions(config) {
|
|
|
6038
6062
|
if (specialSponsorsSection) output += `\n${specialSponsorsSection.trim()}\n`;
|
|
6039
6063
|
output += `\n${pc.bold("Like Better-T-Stack?")} Please consider giving us a star\n on GitHub:\n`;
|
|
6040
6064
|
output += pc.cyan("https://github.com/AmanVarshney01/create-better-t-stack");
|
|
6041
|
-
|
|
6065
|
+
cliConsola.box(output);
|
|
6042
6066
|
}
|
|
6043
6067
|
function getNativeInstructions(isConvex, isBackendSelf, frontend, runCmd) {
|
|
6044
6068
|
const envVar = isConvex ? "EXPO_PUBLIC_CONVEX_URL" : "EXPO_PUBLIC_SERVER_URL";
|
|
@@ -6205,7 +6229,7 @@ async function setPackageManagerVersion(projectDir, packageManager) {
|
|
|
6205
6229
|
if (!await fs.pathExists(pkgJsonPath)) return Result.ok(void 0);
|
|
6206
6230
|
const versionResult = await Result.tryPromise({
|
|
6207
6231
|
try: async () => {
|
|
6208
|
-
const { stdout } = await $({ cwd: os
|
|
6232
|
+
const { stdout } = await $({ cwd: os.tmpdir() })`${packageManager} -v`;
|
|
6209
6233
|
return stdout.trim();
|
|
6210
6234
|
},
|
|
6211
6235
|
catch: () => null
|
|
@@ -6283,7 +6307,7 @@ async function createProjectHandlerInternal(input, startTime, timeScaffolded) {
|
|
|
6283
6307
|
return Result.gen(async function* () {
|
|
6284
6308
|
if (!isSilent() && input.renderTitle !== false) renderTitle();
|
|
6285
6309
|
if (!isSilent()) intro(pc.magenta("Creating a new Better-T-Stack project"));
|
|
6286
|
-
if (!isSilent() && input.yolo)
|
|
6310
|
+
if (!isSilent() && input.yolo) cliConsola.fatal("YOLO mode enabled - skipping checks. Things may break!");
|
|
6287
6311
|
let currentPathInput;
|
|
6288
6312
|
if (isSilent()) currentPathInput = yield* Result.await(resolveProjectNameForSilent(input));
|
|
6289
6313
|
else if (input.yes && input.projectName) currentPathInput = input.projectName;
|
|
@@ -6561,6 +6585,7 @@ const SchemaNameSchema = z.enum([
|
|
|
6561
6585
|
"betterTStackConfig",
|
|
6562
6586
|
"initResult"
|
|
6563
6587
|
]).default("all");
|
|
6588
|
+
const t = initTRPC.meta().create();
|
|
6564
6589
|
function getCliSchemaJson() {
|
|
6565
6590
|
return createCli({
|
|
6566
6591
|
router,
|
|
@@ -6577,8 +6602,8 @@ function getSchemaResult(name) {
|
|
|
6577
6602
|
if (name === "cli") return getCliSchemaJson();
|
|
6578
6603
|
return schemas[name];
|
|
6579
6604
|
}
|
|
6580
|
-
const router =
|
|
6581
|
-
create:
|
|
6605
|
+
const router = t.router({
|
|
6606
|
+
create: t.procedure.meta({
|
|
6582
6607
|
description: "Create a new Better-T-Stack project",
|
|
6583
6608
|
default: true,
|
|
6584
6609
|
negateBooleans: true
|
|
@@ -6609,7 +6634,7 @@ const router = os.router({
|
|
|
6609
6634
|
disableAnalytics: z.boolean().optional().default(false).describe("Disable analytics"),
|
|
6610
6635
|
manualDb: z.boolean().optional().default(false).describe("Skip automatic/manual database setup prompt and use manual setup"),
|
|
6611
6636
|
dbSetupOptions: types_exports.DbSetupOptionsSchema.optional().describe("Structured database setup options")
|
|
6612
|
-
})])).
|
|
6637
|
+
})])).mutation(async ({ input }) => {
|
|
6613
6638
|
const [projectName, options] = input;
|
|
6614
6639
|
const result = await createProjectHandler({
|
|
6615
6640
|
projectName,
|
|
@@ -6617,41 +6642,41 @@ const router = os.router({
|
|
|
6617
6642
|
});
|
|
6618
6643
|
if (options.verbose || options.dryRun) return result;
|
|
6619
6644
|
}),
|
|
6620
|
-
createJson:
|
|
6645
|
+
createJson: t.procedure.meta({
|
|
6621
6646
|
description: "Create a project from a raw JSON payload (agent-friendly)",
|
|
6622
6647
|
jsonInput: true
|
|
6623
|
-
}).input(types_exports.CreateInputSchema).
|
|
6648
|
+
}).input(types_exports.CreateInputSchema).mutation(async ({ input }) => {
|
|
6624
6649
|
const result = await createProjectHandler(input, { silent: true });
|
|
6625
6650
|
if (!result) throw new UserCancelledError({ message: "Operation cancelled" });
|
|
6626
6651
|
if (!result.success) throw new CLIError({ message: result.error || "Unknown error occurred" });
|
|
6627
6652
|
return result;
|
|
6628
6653
|
}),
|
|
6629
|
-
schema:
|
|
6630
|
-
sponsors:
|
|
6631
|
-
docs:
|
|
6632
|
-
builder:
|
|
6633
|
-
add:
|
|
6654
|
+
schema: t.procedure.meta({ description: "Show runtime CLI and input schemas as JSON" }).input(z.object({ name: SchemaNameSchema.describe("Schema name to inspect") })).query(({ input }) => getSchemaResult(input.name)),
|
|
6655
|
+
sponsors: t.procedure.meta({ description: "Show Better-T-Stack sponsors" }).mutation(() => showSponsorsCommand()),
|
|
6656
|
+
docs: t.procedure.meta({ description: "Open Better-T-Stack documentation" }).mutation(() => openDocsCommand()),
|
|
6657
|
+
builder: t.procedure.meta({ description: "Open the web-based stack builder" }).mutation(() => openBuilderCommand()),
|
|
6658
|
+
add: t.procedure.meta({ description: "Add addons to an existing Better-T-Stack project" }).input(z.object({
|
|
6634
6659
|
addons: z.array(types_exports.AddonsSchema).optional().describe("Addons to add"),
|
|
6635
6660
|
install: z.boolean().optional().default(false).describe("Install dependencies after adding"),
|
|
6636
6661
|
packageManager: types_exports.PackageManagerSchema.optional().describe("Package manager to use"),
|
|
6637
6662
|
projectDir: z.string().optional().describe("Project directory (defaults to current)")
|
|
6638
|
-
})).
|
|
6663
|
+
})).mutation(async ({ input }) => {
|
|
6639
6664
|
await addHandler(input);
|
|
6640
6665
|
}),
|
|
6641
|
-
addJson:
|
|
6666
|
+
addJson: t.procedure.meta({
|
|
6642
6667
|
description: "Add addons from a raw JSON payload (agent-friendly)",
|
|
6643
6668
|
jsonInput: true
|
|
6644
|
-
}).input(types_exports.AddInputSchema).
|
|
6669
|
+
}).input(types_exports.AddInputSchema).mutation(async ({ input }) => {
|
|
6645
6670
|
const result = await addHandler(input, { silent: true });
|
|
6646
6671
|
if (!result) throw new UserCancelledError({ message: "Operation cancelled" });
|
|
6647
6672
|
if (!result.success) throw new CLIError({ message: result.error || "Unknown error occurred" });
|
|
6648
6673
|
return result;
|
|
6649
6674
|
}),
|
|
6650
|
-
history:
|
|
6675
|
+
history: t.procedure.meta({ description: "Show project creation history" }).input(z.object({
|
|
6651
6676
|
limit: z.number().optional().default(10).describe("Number of entries to show"),
|
|
6652
6677
|
clear: z.boolean().optional().default(false).describe("Clear all history"),
|
|
6653
6678
|
json: z.boolean().optional().default(false).describe("Output as JSON")
|
|
6654
|
-
})).
|
|
6679
|
+
})).mutation(async ({ input }) => {
|
|
6655
6680
|
await historyHandler(input);
|
|
6656
6681
|
})
|
|
6657
6682
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.3",
|
|
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,12 +70,12 @@
|
|
|
70
70
|
"prepublishOnly": "npm run build"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@better-t-stack/template-generator": "^3.
|
|
74
|
-
"@better-t-stack/types": "^3.
|
|
73
|
+
"@better-t-stack/template-generator": "^3.25.3",
|
|
74
|
+
"@better-t-stack/types": "^3.25.3",
|
|
75
75
|
"@clack/core": "^1.1.0",
|
|
76
76
|
"@clack/prompts": "^1.1.0",
|
|
77
77
|
"@modelcontextprotocol/sdk": "1.27.1",
|
|
78
|
-
"@
|
|
78
|
+
"@trpc/server": "^11.4.3",
|
|
79
79
|
"better-result": "^2.7.0",
|
|
80
80
|
"consola": "^3.4.2",
|
|
81
81
|
"env-paths": "^4.0.0",
|