create-better-t-stack 2.38.0 → 2.38.2

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { createBtsCli } from "./src-BR5HLmM2.js";
2
+ import { createBtsCli } from "./src-C2nUxBND.js";
3
3
 
4
4
  //#region src/cli.ts
5
5
  createBtsCli().run();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { builder, createBtsCli, docs, init, router, sponsors } from "./src-BR5HLmM2.js";
2
+ import { builder, createBtsCli, docs, init, router, sponsors } from "./src-C2nUxBND.js";
3
3
 
4
4
  export { builder, createBtsCli, docs, init, router, sponsors };
@@ -502,49 +502,6 @@ function validateWorkersCompatibility(providedFlags, options, config) {
502
502
  if (providedFlags.has("database") && config.database === "mongodb" && config.runtime === "workers") exitWithError("MongoDB database is not compatible with Cloudflare Workers runtime. MongoDB requires Prisma or Mongoose ORM, but Workers runtime only supports Drizzle ORM. Please use a different database or runtime.");
503
503
  if (providedFlags.has("dbSetup") && options.dbSetup === "docker" && config.runtime === "workers") exitWithError("Docker setup (--db-setup docker) is not compatible with Cloudflare Workers runtime. Workers runtime uses serverless databases (D1) and doesn't support local Docker containers. Please use '--db-setup d1' for SQLite or choose a different runtime.");
504
504
  }
505
- function coerceBackendPresets(config) {
506
- if (config.backend === "convex") {
507
- config.database = "none";
508
- config.orm = "none";
509
- config.api = "none";
510
- config.runtime = "none";
511
- config.dbSetup = "none";
512
- config.examples = ["todo"];
513
- }
514
- if (config.backend === "none") {
515
- config.auth = "none";
516
- config.database = "none";
517
- config.orm = "none";
518
- config.api = "none";
519
- config.runtime = "none";
520
- config.dbSetup = "none";
521
- config.examples = [];
522
- }
523
- }
524
- function incompatibleFlagsForBackend(backend, providedFlags, options) {
525
- const list = [];
526
- if (backend === "convex") {
527
- if (providedFlags.has("auth") && options.auth && options.auth !== "none" && options.auth !== "clerk") list.push(`--auth ${options.auth}`);
528
- if (providedFlags.has("database") && options.database !== "none") list.push(`--database ${options.database}`);
529
- if (providedFlags.has("orm") && options.orm !== "none") list.push(`--orm ${options.orm}`);
530
- if (providedFlags.has("api") && options.api !== "none") list.push(`--api ${options.api}`);
531
- if (providedFlags.has("runtime") && options.runtime !== "none") list.push(`--runtime ${options.runtime}`);
532
- if (providedFlags.has("dbSetup") && options.dbSetup !== "none") list.push(`--db-setup ${options.dbSetup}`);
533
- }
534
- if (backend === "none") {
535
- if (providedFlags.has("auth") && options.auth && options.auth !== "none") list.push(`--auth ${options.auth}`);
536
- if (providedFlags.has("database") && options.database !== "none") list.push(`--database ${options.database}`);
537
- if (providedFlags.has("orm") && options.orm !== "none") list.push(`--orm ${options.orm}`);
538
- if (providedFlags.has("api") && options.api !== "none") list.push(`--api ${options.api}`);
539
- if (providedFlags.has("runtime") && options.runtime !== "none") list.push(`--runtime ${options.runtime}`);
540
- if (providedFlags.has("dbSetup") && options.dbSetup !== "none") list.push(`--db-setup ${options.dbSetup}`);
541
- if (providedFlags.has("examples") && options.examples) {
542
- const hasNonNoneExamples = options.examples.some((ex) => ex !== "none");
543
- if (hasNonNoneExamples) list.push("--examples");
544
- }
545
- }
546
- return list;
547
- }
548
505
  function validateApiFrontendCompatibility(api, frontends = []) {
549
506
  const includesNuxt = frontends.includes("nuxt");
550
507
  const includesSvelte = frontends.includes("svelte");
@@ -1751,14 +1708,9 @@ function validateBackendConstraints(config, providedFlags, options) {
1751
1708
  if (providedFlags.has("backend") && backend && backend !== "convex" && backend !== "none") {
1752
1709
  if (providedFlags.has("runtime") && options.runtime === "none") exitWithError("'--runtime none' is only supported with '--backend convex' or '--backend none'. Please choose 'bun', 'node', or remove the --runtime flag.");
1753
1710
  }
1754
- if (backend === "convex" || backend === "none") {
1755
- const incompatibleFlags = incompatibleFlagsForBackend(backend, providedFlags, options);
1756
- if (incompatibleFlags.length > 0) exitWithError(`The following flags are incompatible with '--backend ${backend}': ${incompatibleFlags.join(", ")}. Please remove them.`);
1757
- if (backend === "convex" && providedFlags.has("frontend") && options.frontend) {
1758
- const incompatibleFrontends = options.frontend.filter((f) => f === "solid");
1759
- if (incompatibleFrontends.length > 0) exitWithError(`The following frontends are not compatible with '--backend convex': ${incompatibleFrontends.join(", ")}. Please choose a different frontend or backend.`);
1760
- }
1761
- coerceBackendPresets(config);
1711
+ if (backend === "convex" && providedFlags.has("frontend") && options.frontend) {
1712
+ const incompatibleFrontends = options.frontend.filter((f) => f === "solid");
1713
+ if (incompatibleFrontends.length > 0) exitWithError(`The following frontends are not compatible with '--backend convex': ${incompatibleFrontends.join(", ")}. Please choose a different frontend or backend.`);
1762
1714
  }
1763
1715
  }
1764
1716
  function validateFrontendConstraints(config, providedFlags) {
@@ -1825,6 +1777,25 @@ function extractAndValidateProjectName(projectName, projectDirectory, throwOnErr
1825
1777
 
1826
1778
  //#endregion
1827
1779
  //#region src/validation.ts
1780
+ const CORE_STACK_FLAGS = new Set([
1781
+ "database",
1782
+ "orm",
1783
+ "backend",
1784
+ "runtime",
1785
+ "frontend",
1786
+ "addons",
1787
+ "examples",
1788
+ "auth",
1789
+ "dbSetup",
1790
+ "api",
1791
+ "webDeploy",
1792
+ "serverDeploy"
1793
+ ]);
1794
+ function validateYesFlagCombination(options, providedFlags) {
1795
+ if (!options.yes) return;
1796
+ const coreStackFlagsProvided = Array.from(providedFlags).filter((flag) => CORE_STACK_FLAGS.has(flag));
1797
+ if (coreStackFlagsProvided.length > 0) exitWithError(`Cannot combine --yes with core stack configuration flags: ${coreStackFlagsProvided.map((f) => `--${f}`).join(", ")}. The --yes flag uses default configuration. Remove these flags or use --yes without them.`);
1798
+ }
1828
1799
  function processAndValidateFlags(options, providedFlags, projectName) {
1829
1800
  if (options.yolo) {
1830
1801
  const cfg = processFlags(options, projectName);
@@ -1832,6 +1803,7 @@ function processAndValidateFlags(options, providedFlags, projectName) {
1832
1803
  if (validatedProjectName$1) cfg.projectName = validatedProjectName$1;
1833
1804
  return cfg;
1834
1805
  }
1806
+ validateYesFlagCombination(options, providedFlags);
1835
1807
  try {
1836
1808
  validateArrayOptions(options);
1837
1809
  } catch (error) {
@@ -1844,6 +1816,10 @@ function processAndValidateFlags(options, providedFlags, projectName) {
1844
1816
  return config;
1845
1817
  }
1846
1818
  function processProvidedFlagsWithoutValidation(options, projectName) {
1819
+ if (!options.yolo) {
1820
+ const providedFlags = getProvidedFlags(options);
1821
+ validateYesFlagCombination(options, providedFlags);
1822
+ }
1847
1823
  const config = processFlags(options, projectName);
1848
1824
  const validatedProjectName = extractAndValidateProjectName(projectName, options.projectDirectory, true);
1849
1825
  if (validatedProjectName) config.projectName = validatedProjectName;
@@ -5740,12 +5716,6 @@ async function displayPostInstallInstructions(config) {
5740
5716
  if (!depsInstalled) output += `${pc.cyan(`${stepCounter++}.`)} ${packageManager} install\n`;
5741
5717
  if (isConvex) {
5742
5718
  output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev:setup\n${pc.dim(" (this will guide you through Convex project setup)")}\n`;
5743
- if (config.auth === "clerk") {
5744
- output += `${pc.cyan(`${stepCounter++}.`)} ${pc.bold("Clerk Setup:")}\n${pc.dim(" Follow the Convex + Clerk guide to configure authentication:")}\n${pc.cyan(" ")}${pc.underline("https://docs.convex.dev/auth/clerk")}\n\n`;
5745
- output += `${pc.cyan(`${stepCounter++}.`)} ${pc.bold("Required Environment Variables:")}\n`;
5746
- output += `${pc.dim(" •")} Set CLERK_JWT_ISSUER_DOMAIN in Convex Dashboard\n`;
5747
- output += `${pc.dim(" •")} Set CLERK_PUBLISHABLE_KEY in apps/*/.env\n`;
5748
- }
5749
5719
  output += `${pc.cyan(`${stepCounter++}.`)} Copy environment variables from\n${pc.white(" packages/backend/.env.local")} to ${pc.white("apps/*/.env")}\n`;
5750
5720
  output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev\n\n`;
5751
5721
  } else {
@@ -5847,7 +5817,7 @@ function getWranglerDeployInstructions(runCmd, webDeploy, serverDeploy) {
5847
5817
  return instructions.length ? `\n${instructions.join("\n")}` : "";
5848
5818
  }
5849
5819
  function getClerkInstructions() {
5850
- return `${pc.bold("Clerk Authentication Setup:")}\n${pc.cyan("1.")} Sign up for Clerk at ${pc.underline("https://clerk.com/sign-up")}\n${pc.cyan("2.")} Create a new application in Clerk Dashboard\n${pc.cyan("3.")} Create a JWT template named ${pc.bold("'convex'")} (exact name required)\n${pc.cyan("4.")} Copy your Clerk Frontend API URL (Issuer URL)\n${pc.cyan("5.")} Set environment variables:\n${pc.dim(" •")} CLERK_JWT_ISSUER_DOMAIN in Convex Dashboard\n${pc.dim(" •")} CLERK_PUBLISHABLE_KEY in apps/*/.env\n${pc.cyan("6.")} Follow the complete guide: ${pc.underline("https://docs.convex.dev/auth/clerk")}\n${pc.yellow("NOTE:")} Use Convex's <Authenticated> components instead of Clerk's <SignedIn>`;
5820
+ return `${pc.bold("Clerk Authentication Setup:")}\n${pc.cyan("")} Follow the guide: ${pc.underline("https://docs.convex.dev/auth/clerk")}\n${pc.cyan("")} Set CLERK_JWT_ISSUER_DOMAIN in Convex Dashboard\n${pc.cyan("•")} Set CLERK_PUBLISHABLE_KEY in apps/*/.env`;
5851
5821
  }
5852
5822
  function getAlchemyDeployInstructions(runCmd, webDeploy, serverDeploy) {
5853
5823
  const instructions = [];
@@ -6176,10 +6146,7 @@ async function createProjectHandler(input) {
6176
6146
  projectDir: finalResolvedPath,
6177
6147
  relativePath: finalPathInput
6178
6148
  };
6179
- coerceBackendPresets(config);
6180
6149
  validateConfigCompatibility(config, providedFlags, cliInput);
6181
- if (config.backend === "convex") log.info(`Due to '--backend convex' flag, the following options have been automatically set: database=none, orm=none, api=none, runtime=none, dbSetup=none, examples=todo`);
6182
- else if (config.backend === "none") log.info("Due to '--backend none', the following options have been automatically set: --auth none, --database=none, --orm=none, --api=none, --runtime=none, --db-setup=none, --examples=none");
6183
6150
  log.info(pc.yellow("Using default/flag options (config prompts skipped):"));
6184
6151
  log.message(displayConfig(config));
6185
6152
  log.message("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "2.38.0",
3
+ "version": "2.38.2",
4
4
  "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5
5
  "type": "module",
6
6
  "license": "MIT",