use spaces instead of commas in flags

This commit is contained in:
Aman Varshney
2025-04-01 14:57:46 +05:30
parent 47e429554d
commit b296ac28ed
14 changed files with 390 additions and 163 deletions

View File

@@ -393,72 +393,58 @@ const StackArchitect = () => {
}
const projectName = stackState.projectName || "my-better-t-app";
const flags: string[] = ["--yes"]; // Start with yes flag
const flags: string[] = ["--yes"];
// Only add flags that differ from defaults
// Frontend (default is web)
if (stackState.frontend.length === 1 && stackState.frontend[0] === "none") {
flags.push("--frontend none");
} else if (
!(stackState.frontend.length === 1 && stackState.frontend[0] === "web")
) {
flags.push(`--frontend ${stackState.frontend.join(",")}`);
flags.push(`--frontend ${stackState.frontend.join(" ")}`);
}
// Database (default is sqlite)
if (stackState.database !== "sqlite") {
flags.push(`--database ${stackState.database}`);
}
// ORM (default is drizzle)
if (stackState.database !== "none" && stackState.orm !== "drizzle") {
flags.push(`--orm ${stackState.orm}`);
}
// Auth (default is true)
if (stackState.auth === "false") {
flags.push("--no-auth");
}
// Turso (default is false)
if (stackState.turso === "true") {
flags.push("--turso");
}
// Backend (default is hono)
if (stackState.backendFramework !== "hono") {
flags.push(`--backend ${stackState.backendFramework}`);
}
// Runtime (default is bun)
if (stackState.runtime !== "bun") {
flags.push(`--runtime ${stackState.runtime}`);
}
// Package manager (default is bun)
if (stackState.packageManager !== "bun") {
flags.push(`--package-manager ${stackState.packageManager}`);
}
// Git (default is true)
if (stackState.git === "false") {
flags.push("--no-git");
}
// Install (default is true)
if (stackState.install === "false") {
flags.push("--no-install");
}
// Addons (default is none)
if (stackState.addons.length > 0) {
flags.push(`--addons ${stackState.addons.join(",")}`);
flags.push(`--addons ${stackState.addons.join(" ")}`);
}
// Examples (default is none)
if (stackState.examples.length > 0) {
flags.push(`--examples ${stackState.examples.join(",")}`);
flags.push(`--examples ${stackState.examples.join(" ")}`);
}
return `${base} ${projectName} ${flags.join(" ")}`;
@@ -486,7 +472,6 @@ const StackArchitect = () => {
if (currentSelection.includes(techId)) {
if (currentSelection.length === 1) {
// Don't remove the last frontend option
return prev;
}
@@ -512,9 +497,7 @@ const StackArchitect = () => {
};
}
// Adding a frontend option
if (currentSelection.includes("none")) {
// Replace "none" with the selected option
return {
...prev,
frontend: [techId],

View File

@@ -42,7 +42,6 @@ export default function Testimonials() {
return () => window.removeEventListener("resize", handleResize);
}, []);
// Get visible tweets
const getVisibleTweets = () => {
const visible = [];
for (let i = 0; i < tweetsPerPage; i++) {

View File

@@ -9,7 +9,6 @@ import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
*/
export const baseOptions: BaseLayoutProps = {
nav: {
// can be JSX too!
title: "Better-T-Stack",
enabled: false,
},