replace chalk with picocolors

This commit is contained in:
Aman Varshney
2025-02-15 03:29:32 +05:30
parent 75d6255d21
commit f98216e642
8 changed files with 76 additions and 80 deletions

View File

@@ -1,4 +1,3 @@
import chalk from "chalk";
import { DEFAULT_CONFIG } from "../consts";
import type { ProjectConfig } from "../types";
@@ -12,37 +11,34 @@ export function generateReproducibleCommand(config: ProjectConfig): string {
});
if (isMainlyDefault) {
flags.push(chalk.gray("-y"));
flags.push("-y");
}
if (config.database !== DEFAULT_CONFIG.database) {
flags.push(chalk.cyan(`--database ${config.database}`));
flags.push(`--database ${config.database}`);
}
if (config.auth !== DEFAULT_CONFIG.auth) {
flags.push(chalk.yellow("--no-auth"));
flags.push("--no-auth");
}
if (!config.git) {
flags.push(chalk.red("--no-git"));
flags.push("--no-git");
}
// Updated package manager flag handling
if (
config.packageManager &&
config.packageManager !== DEFAULT_CONFIG.packageManager
) {
flags.push(chalk.magenta(`--${config.packageManager}`));
flags.push(`--${config.packageManager}`);
}
for (const feature of config.features) {
flags.push(chalk.green(`--${feature}`));
flags.push(`--${feature}`);
}
const baseCommand = chalk.bold("npx create-better-t-stack");
const projectName = config.projectName
? chalk.blue(` ${config.projectName}`)
: "";
const baseCommand = "npx create-better-t-stack";
const projectName = config.projectName ? ` ${config.projectName}` : "";
const flagString = flags.length > 0 ? ` ${flags.join(" ")}` : "";
return `${baseCommand}${projectName}${flagString}`;