Improve CLI prompts and template cleanup

This commit is contained in:
Aman Varshney
2025-03-18 17:28:37 +05:30
parent 83168410d7
commit 640e64ef46
8 changed files with 16 additions and 31 deletions

View File

@@ -0,0 +1,5 @@
---
"create-better-t-stack": patch
---
Improve package manager prompts

View File

@@ -8,7 +8,7 @@ export async function getNoInstallChoice(
if (noInstall !== undefined) return noInstall;
const response = await confirm({
message: "Install dependencies?",
message: "Do you want to install project dependencies?",
initialValue: !DEFAULT_CONFIG.noInstall,
});

View File

@@ -1,4 +1,4 @@
import { cancel, confirm, isCancel, select } from "@clack/prompts";
import { cancel, isCancel, select } from "@clack/prompts";
import pc from "picocolors";
import type { PackageManager } from "../types";
import { getUserPkgManager } from "../utils/get-package-manager";
@@ -9,21 +9,16 @@ export async function getPackageManagerChoice(
if (packageManager !== undefined) return packageManager;
const detectedPackageManager = getUserPkgManager();
const useDetected = await confirm({
message: `Use ${detectedPackageManager} as your package manager?`,
});
if (isCancel(useDetected)) {
cancel(pc.red("Operation cancelled"));
process.exit(0);
}
if (useDetected) return detectedPackageManager;
const response = await select<PackageManager>({
message: "Which package manager would you like to use?",
message: "Which package manager do you want to use?",
options: [
{ value: "npm", label: "npm", hint: "Node Package Manager" },
{
value: "bun",
label: "bun",
hint: "All-in-one JavaScript runtime & toolkit",
},
{
value: "pnpm",
label: "pnpm",
@@ -34,13 +29,8 @@ export async function getPackageManagerChoice(
label: "yarn",
hint: "Fast, reliable, and secure dependency management",
},
{
value: "bun",
label: "bun",
hint: "All-in-one JavaScript runtime & toolkit",
},
],
initialValue: "bun",
initialValue: detectedPackageManager,
});
if (isCancel(response)) {

View File

@@ -44,14 +44,6 @@
--color-chart-5: hsl(var(--chart-5));
}
/*
The default border color has changed to `currentColor` in Tailwind CSS v4,
so we've added these compatibility styles to make sure everything still
looks the same as it did with Tailwind CSS v3.
If we ever want to remove these styles, we need to add an explicit border
color utility to any element that depends on these defaults.
*/
@layer base {
*,
::after,

View File

@@ -10,7 +10,6 @@ function HomeComponent() {
return (
<div className="p-2">
<h3>Welcome Home!</h3>
<Link to="/dashboard">Go to Dashboard</Link>
<p>healthCheck: {healthCheck.data}</p>
</div>
);

View File

@@ -1 +0,0 @@
VITE_SERVER_URL=http://localhost:3000

View File

@@ -3,7 +3,7 @@ import { PrismaLibSQL } from "@prisma/adapter-libsql";
import { createClient } from "@libsql/client";
const libsql = createClient({
url: process.env.TURSO_DATABASE_URL,
url: process.env.TURSO_DATABASE_URL!,
authToken: process.env.TURSO_AUTH_TOKEN,
});

View File

@@ -4,6 +4,6 @@ import prisma from "../db";
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "sqlite", // or "mysql", "postgresql", ...etc
provider: "sqlite",
}),
});