improve prompts

This commit is contained in:
Aman Varshney
2025-02-14 00:14:04 +05:30
parent 184277d508
commit 31f12717ee
7 changed files with 88 additions and 80 deletions

View File

@@ -26,9 +26,9 @@ interface TursoConfig {
async function loginToTurso() {
const s = spinner();
try {
s.start("Logging in to Turso...");
s.start("🔄 Logging in to Turso...");
await $`turso auth login`;
s.stop("Logged in to Turso successfully!");
s.stop("Logged in to Turso successfully!");
} catch (error) {
s.stop("Failed to log in to Turso");
throw error;
@@ -38,7 +38,7 @@ async function loginToTurso() {
async function installTursoCLI(isMac: boolean) {
const s = spinner();
try {
s.start("Installing Turso CLI...");
s.start("🔄 Installing Turso CLI...");
if (isMac) {
await $`brew install tursodatabase/tap/turso`;
@@ -48,7 +48,7 @@ async function installTursoCLI(isMac: boolean) {
await $`bash -c '${installScript}'`;
}
s.stop("Turso CLI installed successfully!");
s.stop("Turso CLI installed successfully!");
} catch (error) {
if (error instanceof Error && error.message.includes("User force closed")) {
s.stop();
@@ -91,7 +91,7 @@ TURSO_AUTH_TOKEN=`;
}
function displayManualSetupInstructions() {
log.info("📝 Manual Turso Setup Instructions:");
log.info("🔧 Manual Turso Setup Instructions:");
log.info("1. Visit https://turso.tech and create an account");
log.info("2. Create a new database from the dashboard");
log.info("3. Get your database URL and authentication token");
@@ -118,7 +118,7 @@ export async function setupTurso(projectDir: string) {
if (!isCliInstalled) {
const shouldInstall = await confirm({
message: "Would you like to install Turso CLI?",
message: "🔧 Would you like to install Turso CLI?",
});
if (isCancel(shouldInstall)) {
@@ -133,7 +133,7 @@ export async function setupTurso(projectDir: string) {
}
const s = spinner();
s.start("Installing Turso CLI...");
s.start("🔄 Installing Turso CLI...");
try {
if (isMac) {
await $`brew install tursodatabase/tap/turso`;
@@ -142,7 +142,7 @@ export async function setupTurso(projectDir: string) {
await $`curl -sSfL https://get.tur.so/install.sh`;
await $`bash -c '${installScript}'`;
}
s.stop("Turso CLI installed successfully!");
s.stop("Turso CLI installed successfully!");
} catch (error) {
s.stop("Failed to install Turso CLI");
throw error;
@@ -152,10 +152,10 @@ export async function setupTurso(projectDir: string) {
const isLoggedIn = await isTursoLoggedIn();
if (!isLoggedIn) {
const s = spinner();
s.start("Logging in to Turso...");
s.start("🔄 Logging in to Turso...");
try {
await $`turso auth login`;
s.stop("Logged in to Turso successfully!");
s.stop("Logged in to Turso successfully!");
} catch (error) {
s.stop("Failed to log in to Turso");
throw error;
@@ -168,7 +168,7 @@ export async function setupTurso(projectDir: string) {
while (!success) {
const dbNameResponse = await text({
message: "Enter database name:",
message: "📝 Enter a name for your database:",
defaultValue: suggestedName,
initialValue: suggestedName,
placeholder: suggestedName,
@@ -183,10 +183,10 @@ export async function setupTurso(projectDir: string) {
const s = spinner();
try {
s.start(`Creating Turso database "${dbName}"...`);
s.start(`🔄 Creating Turso database "${dbName}"...`);
const config = await createTursoDatabase(dbName);
await writeEnvFile(projectDir, config);
s.stop("Turso database configured successfully!");
s.stop("Turso database configured successfully!");
success = true;
} catch (error) {
if (error instanceof Error && error.message === "DATABASE_EXISTS") {