create-better-t-stack 3.29.0 → 3.30.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 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-DBbRu-AO.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-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-DBbRu-AO.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-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 };
@@ -903,12 +903,10 @@ function validateAddonsAgainstFrontends(addons = [], frontends = [], auth, backe
903
903
  function validateAddonsAgainstConfig(addons = [], config) {
904
904
  return validateAddonsAgainstFrontends(addons, config.frontend ?? [], config.auth, config.backend, config.runtime);
905
905
  }
906
- function validatePaymentsCompatibility(payments, auth, _backend, frontends = []) {
906
+ function validatePaymentsCompatibility(payments, auth, _backend, _frontends = []) {
907
907
  if (!payments || payments === "none") return Result.ok(void 0);
908
908
  if (payments === "polar") {
909
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.");
910
- const { web } = splitFrontends(frontends);
911
- 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.");
912
910
  }
913
911
  return Result.ok(void 0);
914
912
  }
@@ -4652,10 +4650,10 @@ async function getPackageManagerChoice(packageManager) {
4652
4650
  }
4653
4651
  //#endregion
4654
4652
  //#region src/prompts/payments.ts
4655
- async function getPaymentsChoice(payments, auth, backend, frontends) {
4653
+ async function getPaymentsChoice(payments, auth, backend, _frontends) {
4656
4654
  if (payments !== void 0) return payments;
4657
4655
  if (backend === "none") return "none";
4658
- if (!(auth === "better-auth" && backend !== "convex" && (frontends?.length === 0 || splitFrontends(frontends).web.length > 0))) return "none";
4656
+ if (!(auth === "better-auth")) return "none";
4659
4657
  const response = await navigableSelect({
4660
4658
  message: "Select payments provider",
4661
4659
  options: [{
@@ -6726,7 +6724,6 @@ async function displayPostInstallInstructions(config) {
6726
6724
  const pwaInstructions = addons?.includes("pwa") && frontend?.includes("react-router") ? getPwaInstructions() : "";
6727
6725
  const starlightInstructions = addons?.includes("starlight") ? getStarlightInstructions(runCmd) : "";
6728
6726
  const clerkInstructions = config.auth === "clerk" ? getClerkInstructions(frontend || [], backend, api) : "";
6729
- const polarInstructions = config.payments === "polar" && config.auth === "better-auth" ? getPolarInstructions(backend) : "";
6730
6727
  const alchemyDeployInstructions = getAlchemyDeployInstructions(runCmd, webDeploy, serverDeploy, backend);
6731
6728
  const hasWeb = frontend?.some((f) => types_exports.desktopWebFrontends.includes(f));
6732
6729
  const hasNative = frontend?.includes("native-bare") || frontend?.includes("native-uniwind") || frontend?.includes("native-unistyles");
@@ -6736,6 +6733,7 @@ async function displayPostInstallInstructions(config) {
6736
6733
  const hasAstro = frontend?.includes("astro");
6737
6734
  const webPort = hasReactRouter || hasTanStackRouter || hasSvelte ? "5173" : hasAstro ? "4321" : "3001";
6738
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) : "";
6739
6737
  const bunWebNativeWarning = packageManager === "bun" && hasNative && hasWeb ? getBunWebNativeWarning() : "";
6740
6738
  const noOrmWarning = !isConvex && database !== "none" && orm === "none" ? getNoOrmWarning() : "";
6741
6739
  let output = `${pc.bold("Next steps")}\n${pc.cyan("1.")} ${cdCmd}\n`;
@@ -6935,7 +6933,11 @@ function getBetterAuthConvexInstructions(hasWeb, webPort, packageManager) {
6935
6933
  const cmd = packageManager === "npm" ? "npx" : packageManager;
6936
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` : "");
6937
6935
  }
6938
- 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
+ }
6939
6941
  const envPath = backend === "self" ? "apps/web/.env" : "apps/server/.env";
6940
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}`;
6941
6943
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "3.29.0",
3
+ "version": "3.30.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",
@@ -69,8 +69,8 @@
69
69
  "prepublishOnly": "npm run build"
70
70
  },
71
71
  "dependencies": {
72
- "@better-t-stack/template-generator": "^3.29.0",
73
- "@better-t-stack/types": "^3.29.0",
72
+ "@better-t-stack/template-generator": "^3.30.3",
73
+ "@better-t-stack/types": "^3.30.3",
74
74
  "@clack/core": "^1.3.1",
75
75
  "@clack/prompts": "^1.4.0",
76
76
  "@modelcontextprotocol/sdk": "1.29.0",