mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Fix validation logic with --yes flag for addon compatibility
This commit is contained in:
5
.changeset/afraid-pillows-strive.md
Normal file
5
.changeset/afraid-pillows-strive.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"create-better-t-stack": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix validation logic with --yes flag for addon compatibility
|
||||||
@@ -402,7 +402,16 @@ function processAndValidateFlags(
|
|||||||
(f) => f === "tanstack-router" || f === "react-router",
|
(f) => f === "tanstack-router" || f === "react-router",
|
||||||
);
|
);
|
||||||
|
|
||||||
if (hasWebSpecificAddons && !hasCompatibleWebFrontend) {
|
if (
|
||||||
|
hasWebSpecificAddons &&
|
||||||
|
!hasCompatibleWebFrontend &&
|
||||||
|
!(
|
||||||
|
options.yes &&
|
||||||
|
DEFAULT_CONFIG.frontend.some(
|
||||||
|
(f) => f === "tanstack-router" || f === "react-router",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) {
|
||||||
cancel(
|
cancel(
|
||||||
pc.red(
|
pc.red(
|
||||||
"PWA and Tauri addons require tanstack-router or react-router. Cannot use these addons with your frontend selection.",
|
"PWA and Tauri addons require tanstack-router or react-router. Cannot use these addons with your frontend selection.",
|
||||||
@@ -439,7 +448,8 @@ function processAndValidateFlags(
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
options.examples.includes("ai") &&
|
options.examples.includes("ai") &&
|
||||||
(options.backend === "elysia" || config.backend === "elysia")
|
(options.backend === "elysia" || config.backend === "elysia") &&
|
||||||
|
!(options.yes && DEFAULT_CONFIG.backend !== "elysia")
|
||||||
) {
|
) {
|
||||||
cancel(
|
cancel(
|
||||||
pc.red(
|
pc.red(
|
||||||
@@ -459,7 +469,13 @@ function processAndValidateFlags(
|
|||||||
(!options.frontend ||
|
(!options.frontend ||
|
||||||
!options.frontend.some((f) =>
|
!options.frontend.some((f) =>
|
||||||
["tanstack-router", "react-router", "tanstack-start"].includes(f),
|
["tanstack-router", "react-router", "tanstack-start"].includes(f),
|
||||||
))
|
)) &&
|
||||||
|
!(
|
||||||
|
options.yes &&
|
||||||
|
DEFAULT_CONFIG.frontend.some((f) =>
|
||||||
|
["tanstack-router", "react-router", "tanstack-start"].includes(f),
|
||||||
|
)
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
cancel(
|
cancel(
|
||||||
pc.red(
|
pc.red(
|
||||||
@@ -468,7 +484,6 @@ function processAndValidateFlags(
|
|||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.examples = options.examples.filter(
|
config.examples = options.examples.filter(
|
||||||
(ex): ex is ProjectExamples => ex === "todo" || ex === "ai",
|
(ex): ex is ProjectExamples => ex === "todo" || ex === "ai",
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user