Replace colors with chalk in @cosmjs/cli

This commit is contained in:
Simon Warta
2022-01-10 14:27:29 +01:00
parent e7b107a0d0
commit 0bd186d0e3
7 changed files with 22 additions and 21 deletions
+1 -1
View File
@@ -53,7 +53,7 @@
"@cosmjs/utils": "workspace:packages/utils",
"axios": "^0.21.2",
"babylon": "^6.18.0",
"colors": "^1.3.3",
"chalk": "^4",
"cosmjs-types": "^0.4.0",
"diff": "^4",
"recast": "^0.20",
+4 -5
View File
@@ -1,12 +1,11 @@
import axios from "axios";
import chalk from "chalk";
import * as fs from "fs";
import { join } from "path";
import yargs from "yargs";
import { TsRepl } from "./tsrepl";
import colors = require("colors/safe");
export async function installedPackages(): Promise<string[]> {
return new Promise((resolve, reject) => {
fs.readFile(__dirname + "/../package.json", { encoding: "utf8" }, (error, data) => {
@@ -49,12 +48,12 @@ export async function main(originalArgs: readonly string[]): Promise<void> {
.group(["debug", "selftest"], "Maintainer options")
.parse(originalArgs);
console.info(colors.green("Initializing session for you. Have fun!"));
console.info(chalk.green("Initializing session for you. Have fun!"));
const visiblePackages = (await installedPackages()).filter(
(name) => name.startsWith("@cosmjs/") || name === "axios",
);
console.info(colors.yellow("The following packages have been installed and can be imported:"));
console.info(colors.yellow(visiblePackages.join(", ")));
console.info(chalk.yellow("The following packages have been installed and can be imported:"));
console.info(chalk.yellow(visiblePackages.join(", ")));
let init = "";
if (args.selftest) {