create-better-t-stack 2.40.0 → 2.40.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-DO2f6nII.js → src-CVKVAMv_.js} +30 -19
- package/package.json +1 -1
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -828,8 +828,11 @@ async function getDBSetupChoice(databaseType, dbSetup, orm, backend, runtime) {
|
|
|
828
828
|
//#endregion
|
|
829
829
|
//#region src/prompts/examples.ts
|
|
830
830
|
async function getExamplesChoice(examples, database, frontends, backend, api) {
|
|
831
|
-
if (api === "none") return [];
|
|
832
831
|
if (examples !== void 0) return examples;
|
|
832
|
+
if (api === "none") {
|
|
833
|
+
if (backend === "convex") return ["todo"];
|
|
834
|
+
return [];
|
|
835
|
+
}
|
|
833
836
|
if (backend === "convex") return ["todo"];
|
|
834
837
|
if (backend === "none") return [];
|
|
835
838
|
if (database === "none") return [];
|
|
@@ -1233,23 +1236,6 @@ async function gatherConfig(flags, projectName, projectDir, relativePath) {
|
|
|
1233
1236
|
packageManager: () => getPackageManagerChoice(flags.packageManager),
|
|
1234
1237
|
install: () => getinstallChoice(flags.install)
|
|
1235
1238
|
}, { onCancel: () => exitCancelled("Operation cancelled") });
|
|
1236
|
-
if (result.backend === "convex") {
|
|
1237
|
-
result.runtime = "none";
|
|
1238
|
-
result.database = "none";
|
|
1239
|
-
result.orm = "none";
|
|
1240
|
-
result.api = "none";
|
|
1241
|
-
result.dbSetup = "none";
|
|
1242
|
-
result.examples = ["todo"];
|
|
1243
|
-
}
|
|
1244
|
-
if (result.backend === "none") {
|
|
1245
|
-
result.runtime = "none";
|
|
1246
|
-
result.database = "none";
|
|
1247
|
-
result.orm = "none";
|
|
1248
|
-
result.api = "none";
|
|
1249
|
-
result.auth = "none";
|
|
1250
|
-
result.dbSetup = "none";
|
|
1251
|
-
result.examples = [];
|
|
1252
|
-
}
|
|
1253
1239
|
return {
|
|
1254
1240
|
projectName,
|
|
1255
1241
|
projectDir,
|
|
@@ -1694,6 +1680,30 @@ function validateDatabaseSetup(config, providedFlags) {
|
|
|
1694
1680
|
}
|
|
1695
1681
|
}
|
|
1696
1682
|
}
|
|
1683
|
+
function validateConvexConstraints(config, providedFlags) {
|
|
1684
|
+
const { backend } = config;
|
|
1685
|
+
if (backend !== "convex") return;
|
|
1686
|
+
const has = (k) => providedFlags.has(k);
|
|
1687
|
+
if (has("runtime") && config.runtime !== "none") exitWithError("Convex backend requires '--runtime none'. Please remove the --runtime flag or set it to 'none'.");
|
|
1688
|
+
if (has("database") && config.database !== "none") exitWithError("Convex backend requires '--database none'. Please remove the --database flag or set it to 'none'.");
|
|
1689
|
+
if (has("orm") && config.orm !== "none") exitWithError("Convex backend requires '--orm none'. Please remove the --orm flag or set it to 'none'.");
|
|
1690
|
+
if (has("api") && config.api !== "none") exitWithError("Convex backend requires '--api none'. Please remove the --api flag or set it to 'none'.");
|
|
1691
|
+
if (has("dbSetup") && config.dbSetup !== "none") exitWithError("Convex backend requires '--db-setup none'. Please remove the --db-setup flag or set it to 'none'.");
|
|
1692
|
+
if (has("serverDeploy") && config.serverDeploy !== "none") exitWithError("Convex backend requires '--server-deploy none'. Please remove the --server-deploy flag or set it to 'none'.");
|
|
1693
|
+
if (has("auth") && config.auth === "better-auth") exitWithError("Better-Auth is not compatible with Convex backend. Please use '--auth clerk' or '--auth none'.");
|
|
1694
|
+
}
|
|
1695
|
+
function validateBackendNoneConstraints(config, providedFlags) {
|
|
1696
|
+
const { backend } = config;
|
|
1697
|
+
if (backend !== "none") return;
|
|
1698
|
+
const has = (k) => providedFlags.has(k);
|
|
1699
|
+
if (has("runtime") && config.runtime !== "none") exitWithError("Backend 'none' requires '--runtime none'. Please remove the --runtime flag or set it to 'none'.");
|
|
1700
|
+
if (has("database") && config.database !== "none") exitWithError("Backend 'none' requires '--database none'. Please remove the --database flag or set it to 'none'.");
|
|
1701
|
+
if (has("orm") && config.orm !== "none") exitWithError("Backend 'none' requires '--orm none'. Please remove the --orm flag or set it to 'none'.");
|
|
1702
|
+
if (has("api") && config.api !== "none") exitWithError("Backend 'none' requires '--api none'. Please remove the --api flag or set it to 'none'.");
|
|
1703
|
+
if (has("auth") && config.auth !== "none") exitWithError("Backend 'none' requires '--auth none'. Please remove the --auth flag or set it to 'none'.");
|
|
1704
|
+
if (has("dbSetup") && config.dbSetup !== "none") exitWithError("Backend 'none' requires '--db-setup none'. Please remove the --db-setup flag or set it to 'none'.");
|
|
1705
|
+
if (has("serverDeploy") && config.serverDeploy !== "none") exitWithError("Backend 'none' requires '--server-deploy none'. Please remove the --server-deploy flag or set it to 'none'.");
|
|
1706
|
+
}
|
|
1697
1707
|
function validateBackendConstraints(config, providedFlags, options) {
|
|
1698
1708
|
const { backend } = config;
|
|
1699
1709
|
if (config.auth === "clerk" && backend !== "convex") exitWithError("Clerk authentication is only supported with the Convex backend. Please use '--backend convex' or choose a different auth provider.");
|
|
@@ -1705,7 +1715,6 @@ function validateBackendConstraints(config, providedFlags, options) {
|
|
|
1705
1715
|
].includes(f));
|
|
1706
1716
|
if (incompatibleFrontends.length > 0) exitWithError(`Clerk authentication is not compatible with the following frontends: ${incompatibleFrontends.join(", ")}. Please choose a different frontend or auth provider.`);
|
|
1707
1717
|
}
|
|
1708
|
-
if (backend === "convex" && config.auth === "better-auth" && providedFlags.has("auth")) exitWithError("Better-Auth is not compatible with the Convex backend. Please use '--auth clerk' or '--auth none'.");
|
|
1709
1718
|
if (providedFlags.has("backend") && backend && backend !== "convex" && backend !== "none") {
|
|
1710
1719
|
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.");
|
|
1711
1720
|
}
|
|
@@ -1731,6 +1740,8 @@ function validateApiConstraints(config, options) {
|
|
|
1731
1740
|
function validateFullConfig(config, providedFlags, options) {
|
|
1732
1741
|
validateDatabaseOrmAuth(config, providedFlags);
|
|
1733
1742
|
validateDatabaseSetup(config, providedFlags);
|
|
1743
|
+
validateConvexConstraints(config, providedFlags);
|
|
1744
|
+
validateBackendNoneConstraints(config, providedFlags);
|
|
1734
1745
|
validateBackendConstraints(config, providedFlags, options);
|
|
1735
1746
|
validateFrontendConstraints(config, providedFlags);
|
|
1736
1747
|
validateApiConstraints(config, options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "2.40.
|
|
3
|
+
"version": "2.40.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",
|