mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix: enforce Convex backend when --api none is specified
This commit is contained in:
5
.changeset/chilly-wings-shake.md
Normal file
5
.changeset/chilly-wings-shake.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-better-t-stack": patch
|
||||
---
|
||||
|
||||
Fixed an issue where the CLI would still allow selecting non-Convex backends after specifying `--api none` flag.
|
||||
@@ -244,6 +244,19 @@ function processAndValidateFlags(
|
||||
Object.keys(options).filter((key) => key !== "_" && key !== "$0"),
|
||||
);
|
||||
|
||||
if (options.api) {
|
||||
config.api = options.api as ProjectApi;
|
||||
if (options.api === "none") {
|
||||
if (options.backend && options.backend !== "convex") {
|
||||
consola.fatal(
|
||||
`'--api none' is only supported with '--backend convex'. Please choose a different API setting or use '--backend convex'.`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
config.backend = "convex";
|
||||
}
|
||||
}
|
||||
|
||||
if (options.backend) {
|
||||
config.backend = options.backend as ProjectBackend;
|
||||
}
|
||||
@@ -285,9 +298,6 @@ function processAndValidateFlags(
|
||||
if (options.runtime) {
|
||||
config.runtime = options.runtime as ProjectRuntime;
|
||||
}
|
||||
if (options.api) {
|
||||
config.api = options.api as ProjectApi;
|
||||
}
|
||||
if (options.dbSetup) {
|
||||
config.dbSetup = options.dbSetup as ProjectDBSetup;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user