From 092da70964109d2203527445f1817e417e1f70b7 Mon Sep 17 00:00:00 2001 From: Nico Albanese Date: Tue, 23 Jan 2024 11:57:57 +0000 Subject: [PATCH] minor aesthetic changes to cli --- package.json | 1 + pnpm-lock.yaml | 9 +++++++++ src/commands/add/index.ts | 1 + src/commands/init/index.ts | 9 +++++++-- src/utils.ts | 2 -- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1f8b3b90..38095f9b 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "commander": "^11.0.0", "consola": "^3.2.3", "execa": "^8.0.1", + "figlet": "^1.7.0", "ora": "^8.0.1", "pluralize": "^8.0.0", "strip-json-comments": "^5.0.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85025304..01016a75 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ dependencies: execa: specifier: ^8.0.1 version: 8.0.1 + figlet: + specifier: ^1.7.0 + version: 1.7.0 ora: specifier: ^8.0.1 version: 8.0.1 @@ -744,6 +747,12 @@ packages: reusify: 1.0.4 dev: true + /figlet@1.7.0: + resolution: {integrity: sha512-gO8l3wvqo0V7wEFLXPbkX83b7MVjRrk1oRLfYlZXol8nEpb/ON9pcKLI4qpBv5YtOTfrINtqb7b40iYY2FTWFg==} + engines: {node: '>= 0.4.0'} + hasBin: true + dev: false + /figures@3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} diff --git a/src/commands/add/index.ts b/src/commands/add/index.ts index 2420d909..ed7cf522 100644 --- a/src/commands/add/index.ts +++ b/src/commands/add/index.ts @@ -125,6 +125,7 @@ export const addPackage = async (options?: InitOptions) => { const config = readConfigFile(); const { shared } = getFilePaths(); + console.log("\n"); const promptResponse = await promptUser(options); const start = Date.now(); spinner.start(); diff --git a/src/commands/init/index.ts b/src/commands/init/index.ts index 681960c2..93047234 100644 --- a/src/commands/init/index.ts +++ b/src/commands/init/index.ts @@ -6,6 +6,8 @@ import { addPackage } from "../add/index.js"; import { existsSync, readFileSync } from "fs"; import path from "path"; import { checkForPackageManager } from "./utils.js"; +import figlet from "figlet"; +import chalk from "chalk"; export async function initProject(options?: InitOptions) { const nextjsProjectExists = existsSync("package.json"); @@ -22,6 +24,9 @@ export async function initProject(options?: InitOptions) { process.exit(0); } + console.clear(); + console.log("\n"); + console.log(chalk(figlet.textSync("Kirimase", { font: "ANSI Shadow" }))); const srcExists = usingAppDirWithSrc ?? options.hasSrcFolder ?? @@ -71,7 +76,7 @@ export async function initProject(options?: InitOptions) { t3: false, alias, }); - consola.success("Kirimase initialized!"); - consola.info("You can now add packages."); + // consola.success("Kirimase initialized!"); + // consola.info("You can now add packages."); addPackage(options); } diff --git a/src/utils.ts b/src/utils.ts index 20c3562f..672d67da 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -77,7 +77,6 @@ export async function installPackages( try { spinner.stop(); - console.log("\n"); consola.info("Installing Dependencies"); if (packages.regular) { await runCommand( @@ -178,7 +177,6 @@ export async function installShadcnUIComponents( // ); try { spinner.stop(); - console.log("\n"); consola.info("Installing ShadcnUI Components"); await execa(pmInstallCommand[preferredPackageManager], installArgs, { stdio: "inherit",