mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
dont allow examples when api is none (#243)
This commit is contained in:
@@ -399,12 +399,11 @@ function processAndValidateFlags(
|
||||
config.api = options.api as ProjectApi;
|
||||
if (options.api === "none") {
|
||||
if (
|
||||
options.backend &&
|
||||
options.backend !== "convex" &&
|
||||
options.backend !== "none"
|
||||
options.examples &&
|
||||
!(options.examples.length === 1 && options.examples[0] === "none")
|
||||
) {
|
||||
consola.fatal(
|
||||
`'--api none' is only supported with '--backend convex' or '--backend none'. Please choose a different API setting or use '--backend convex' or '--backend none'.`,
|
||||
"Cannot use '--examples' when '--api' is set to 'none'. Please remove the --examples flag or choose an API type.",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -421,12 +420,6 @@ function processAndValidateFlags(
|
||||
config.backend !== "convex" &&
|
||||
config.backend !== "none"
|
||||
) {
|
||||
if (providedFlags.has("api") && options.api === "none") {
|
||||
consola.fatal(
|
||||
`'--api none' is only supported with '--backend convex' or '--backend none'. Please choose 'trpc', 'orpc', or remove the --api flag.`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
if (providedFlags.has("runtime") && options.runtime === "none") {
|
||||
consola.fatal(
|
||||
`'--runtime none' is only supported with '--backend convex' or '--backend none'. Please choose 'bun', 'node', or remove the --runtime flag.`,
|
||||
@@ -782,26 +775,13 @@ function processAndValidateFlags(
|
||||
consola.fatal(
|
||||
`tRPC API is not supported with '${
|
||||
includesNuxt ? "nuxt" : includesSvelte ? "svelte" : "solid"
|
||||
}' frontend. Please use --api orpc or remove '${
|
||||
}' frontend. Please use --api orpc or --api none or remove '${
|
||||
includesNuxt ? "nuxt" : includesSvelte ? "svelte" : "solid"
|
||||
}' from --frontend.`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (
|
||||
(includesNuxt || includesSvelte || includesSolid) &&
|
||||
effectiveApi !== "orpc" &&
|
||||
(!options.api || (options.yes && options.api === "trpc"))
|
||||
) {
|
||||
if (config.api !== "none") {
|
||||
config.api = "orpc";
|
||||
log.info(
|
||||
`Due to frontend selection, API has been set to 'orpc'. tRPC is not compatible with Nuxt, Svelte, or Solid Framework`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.addons && config.addons.length > 0) {
|
||||
const webSpecificAddons = ["pwa", "tauri"];
|
||||
const hasWebSpecificAddons = config.addons.some((addon) =>
|
||||
|
||||
Reference in New Issue
Block a user