create-better-t-stack 2.38.1 → 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 +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-DlPots7G.js → src-C2nUxBND.js} +27 -54
- package/package.json +1 -1
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -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"
|
|
1755
|
-
const
|
|
1756
|
-
if (
|
|
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;
|
|
@@ -6170,10 +6146,7 @@ async function createProjectHandler(input) {
|
|
|
6170
6146
|
projectDir: finalResolvedPath,
|
|
6171
6147
|
relativePath: finalPathInput
|
|
6172
6148
|
};
|
|
6173
|
-
coerceBackendPresets(config);
|
|
6174
6149
|
validateConfigCompatibility(config, providedFlags, cliInput);
|
|
6175
|
-
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`);
|
|
6176
|
-
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");
|
|
6177
6150
|
log.info(pc.yellow("Using default/flag options (config prompts skipped):"));
|
|
6178
6151
|
log.message(displayConfig(config));
|
|
6179
6152
|
log.message("");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "2.38.
|
|
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",
|