chore(): start moving some packages to the core directory (#7215)

This commit is contained in:
Adrien de Peretti
2024-05-03 13:37:41 +02:00
committed by GitHub
parent fdee748eed
commit bbccd6481d
1436 changed files with 275 additions and 756 deletions
@@ -0,0 +1,27 @@
import chalk from "chalk"
import { program } from "commander"
import { logger } from "./logger.js"
type LogOptions = {
message: string
type?: "error" | "success" | "info" | "warning" | "verbose"
}
export default ({ message, type = "info" }: LogOptions) => {
switch (type) {
case "info":
logger.info(chalk.white(message))
break
case "success":
logger.info(chalk.green(message))
break
case "warning":
logger.warning(chalk.yellow(message))
break
case "verbose":
logger.info(`${chalk.bgYellowBright("VERBOSE LOG:")} ${message}`)
break
case "error":
program.error(chalk.bold.red(message))
}
}