create-better-t-stack 3.28.3 → 3.30.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.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-PtlLGeY1.mjs → src-ByCnjYDk.mjs} +12 -7
- package/package.json +6 -7
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-ByCnjYDk.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.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-ByCnjYDk.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 };
|
|
@@ -850,6 +850,7 @@ function isExampleTodoAllowed(backend, database, api) {
|
|
|
850
850
|
return true;
|
|
851
851
|
}
|
|
852
852
|
function isExampleAIAllowed(backend, frontends = []) {
|
|
853
|
+
if (backend === "none") return false;
|
|
853
854
|
const includesSolid = frontends.includes("solid");
|
|
854
855
|
const includesAstro = frontends.includes("astro");
|
|
855
856
|
if (includesSolid || includesAstro) return false;
|
|
@@ -902,12 +903,10 @@ function validateAddonsAgainstFrontends(addons = [], frontends = [], auth, backe
|
|
|
902
903
|
function validateAddonsAgainstConfig(addons = [], config) {
|
|
903
904
|
return validateAddonsAgainstFrontends(addons, config.frontend ?? [], config.auth, config.backend, config.runtime);
|
|
904
905
|
}
|
|
905
|
-
function validatePaymentsCompatibility(payments, auth, _backend,
|
|
906
|
+
function validatePaymentsCompatibility(payments, auth, _backend, _frontends = []) {
|
|
906
907
|
if (!payments || payments === "none") return Result.ok(void 0);
|
|
907
908
|
if (payments === "polar") {
|
|
908
909
|
if (!auth || auth === "none" || auth !== "better-auth") return validationErr$1("Polar payments requires Better Auth. Please use '--auth better-auth' or choose a different payments provider.");
|
|
909
|
-
const { web } = splitFrontends(frontends);
|
|
910
|
-
if (web.length === 0 && frontends.length > 0) return validationErr$1("Polar payments requires a web frontend or no frontend. Please select a web frontend or choose a different payments provider.");
|
|
911
910
|
}
|
|
912
911
|
return Result.ok(void 0);
|
|
913
912
|
}
|
|
@@ -919,6 +918,8 @@ function validateExamplesCompatibility(examples, backend, database, frontend, ap
|
|
|
919
918
|
if (api === "none") return validationErr$1("The 'todo' example requires an API layer (tRPC or oRPC). Cannot use --examples todo when api is 'none'.");
|
|
920
919
|
}
|
|
921
920
|
if (examplesArr.includes("ai") && (frontend ?? []).includes("solid")) return validationErr$1("The 'ai' example is not compatible with the Solid frontend.");
|
|
921
|
+
if (examplesArr.includes("ai") && (frontend ?? []).includes("astro")) return validationErr$1("The 'ai' example is not compatible with the Astro frontend.");
|
|
922
|
+
if (examplesArr.includes("ai") && backend === "none") return validationErr$1("The 'ai' example requires a backend.");
|
|
922
923
|
if (examplesArr.includes("ai") && backend === "convex") {
|
|
923
924
|
const frontendArr = frontend ?? [];
|
|
924
925
|
const includesNuxt = frontendArr.includes("nuxt");
|
|
@@ -4649,10 +4650,10 @@ async function getPackageManagerChoice(packageManager) {
|
|
|
4649
4650
|
}
|
|
4650
4651
|
//#endregion
|
|
4651
4652
|
//#region src/prompts/payments.ts
|
|
4652
|
-
async function getPaymentsChoice(payments, auth, backend,
|
|
4653
|
+
async function getPaymentsChoice(payments, auth, backend, _frontends) {
|
|
4653
4654
|
if (payments !== void 0) return payments;
|
|
4654
4655
|
if (backend === "none") return "none";
|
|
4655
|
-
if (!(auth === "better-auth"
|
|
4656
|
+
if (!(auth === "better-auth")) return "none";
|
|
4656
4657
|
const response = await navigableSelect({
|
|
4657
4658
|
message: "Select payments provider",
|
|
4658
4659
|
options: [{
|
|
@@ -6723,7 +6724,6 @@ async function displayPostInstallInstructions(config) {
|
|
|
6723
6724
|
const pwaInstructions = addons?.includes("pwa") && frontend?.includes("react-router") ? getPwaInstructions() : "";
|
|
6724
6725
|
const starlightInstructions = addons?.includes("starlight") ? getStarlightInstructions(runCmd) : "";
|
|
6725
6726
|
const clerkInstructions = config.auth === "clerk" ? getClerkInstructions(frontend || [], backend, api) : "";
|
|
6726
|
-
const polarInstructions = config.payments === "polar" && config.auth === "better-auth" ? getPolarInstructions(backend) : "";
|
|
6727
6727
|
const alchemyDeployInstructions = getAlchemyDeployInstructions(runCmd, webDeploy, serverDeploy, backend);
|
|
6728
6728
|
const hasWeb = frontend?.some((f) => types_exports.desktopWebFrontends.includes(f));
|
|
6729
6729
|
const hasNative = frontend?.includes("native-bare") || frontend?.includes("native-uniwind") || frontend?.includes("native-unistyles");
|
|
@@ -6733,6 +6733,7 @@ async function displayPostInstallInstructions(config) {
|
|
|
6733
6733
|
const hasAstro = frontend?.includes("astro");
|
|
6734
6734
|
const webPort = hasReactRouter || hasTanStackRouter || hasSvelte ? "5173" : hasAstro ? "4321" : "3001";
|
|
6735
6735
|
const betterAuthConvexInstructions = isConvex && config.auth === "better-auth" ? getBetterAuthConvexInstructions(hasWeb ?? false, webPort, packageManager) : "";
|
|
6736
|
+
const polarInstructions = config.payments === "polar" && config.auth === "better-auth" ? getPolarInstructions(backend, packageManager) : "";
|
|
6736
6737
|
const bunWebNativeWarning = packageManager === "bun" && hasNative && hasWeb ? getBunWebNativeWarning() : "";
|
|
6737
6738
|
const noOrmWarning = !isConvex && database !== "none" && orm === "none" ? getNoOrmWarning() : "";
|
|
6738
6739
|
let output = `${pc.bold("Next steps")}\n${pc.cyan("1.")} ${cdCmd}\n`;
|
|
@@ -6932,7 +6933,11 @@ function getBetterAuthConvexInstructions(hasWeb, webPort, packageManager) {
|
|
|
6932
6933
|
const cmd = packageManager === "npm" ? "npx" : packageManager;
|
|
6933
6934
|
return `${pc.bold("Better Auth + Convex Setup:")}\n${pc.cyan("•")} Set environment variables from ${pc.white("packages/backend")}:\n${pc.white(" cd packages/backend")}\n${pc.white(` ${cmd} convex env set BETTER_AUTH_SECRET=$(openssl rand -base64 32)`)}\n` + (hasWeb ? `${pc.white(` ${cmd} convex env set SITE_URL http://localhost:${webPort}`)}\n` : "");
|
|
6934
6935
|
}
|
|
6935
|
-
function getPolarInstructions(backend) {
|
|
6936
|
+
function getPolarInstructions(backend, packageManager) {
|
|
6937
|
+
if (backend === "convex") {
|
|
6938
|
+
const cmd = packageManager === "npm" ? "npx" : packageManager;
|
|
6939
|
+
return `${pc.bold("Polar Payments Setup:")}\n${pc.cyan("•")} Create a Polar organization token, webhook secret, and product in ${pc.underline("https://sandbox.polar.sh/")}\n${pc.cyan("•")} Set the Convex env vars from ${pc.white("packages/backend")}:\n${pc.white(" cd packages/backend")}\n${pc.white(` ${cmd} convex env set POLAR_ORGANIZATION_TOKEN your_polar_token`)}\n${pc.white(` ${cmd} convex env set POLAR_WEBHOOK_SECRET your_polar_webhook_secret`)}\n${pc.white(` Optional: ${cmd} convex env set POLAR_SERVER production`)}\n${pc.cyan("•")} Configure a Polar webhook to ${pc.white("https://<your-convex-site-url>/polar/events")}`;
|
|
6940
|
+
}
|
|
6936
6941
|
const envPath = backend === "self" ? "apps/web/.env" : "apps/server/.env";
|
|
6937
6942
|
return `${pc.bold("Polar Payments Setup:")}\n${pc.cyan("•")} Get access token & product ID from ${pc.underline("https://sandbox.polar.sh/")}\n${pc.cyan("•")} Set POLAR_ACCESS_TOKEN in ${envPath}`;
|
|
6938
6943
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.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",
|
|
@@ -63,15 +63,14 @@
|
|
|
63
63
|
"build": "tsdown --publint",
|
|
64
64
|
"dev": "tsdown --watch",
|
|
65
65
|
"check-types": "tsc --noEmit",
|
|
66
|
-
"test": "bun
|
|
67
|
-
"test:
|
|
68
|
-
"test:
|
|
69
|
-
"test:ci": "bun run build && CI=1 bun test --bail=5",
|
|
66
|
+
"test": "bun test",
|
|
67
|
+
"test:ci": "bun run build && BTS_SKIP_EXTERNAL_COMMANDS=1 BTS_TEST_MODE=1 bun test --bail=5",
|
|
68
|
+
"test:complete": "cd ../.. && bun run build && cd apps/cli && BTS_MATRIX_MODE=smoke BTS_BUILD_SAMPLES=1 bun test --bail=5",
|
|
70
69
|
"prepublishOnly": "npm run build"
|
|
71
70
|
},
|
|
72
71
|
"dependencies": {
|
|
73
|
-
"@better-t-stack/template-generator": "^3.
|
|
74
|
-
"@better-t-stack/types": "^3.
|
|
72
|
+
"@better-t-stack/template-generator": "^3.30.0",
|
|
73
|
+
"@better-t-stack/types": "^3.30.0",
|
|
75
74
|
"@clack/core": "^1.3.1",
|
|
76
75
|
"@clack/prompts": "^1.4.0",
|
|
77
76
|
"@modelcontextprotocol/sdk": "1.29.0",
|