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

12
.pnp.cjs generated
View File

@ -928,7 +928,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
],
[
"chalk",
"npm:2.4.2"
"npm:4.1.2"
],
[
"chokidar",
@ -3281,7 +3281,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
["axios", "npm:0.21.4"],
["babylon", "npm:6.18.0"],
["colors", "npm:1.4.0"],
["chalk", "npm:4.1.2"],
["cosmjs-types", "npm:0.4.0"],
["diff", "npm:4.0.2"],
["eslint", "npm:7.26.0"],
@ -6670,10 +6670,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
],
"linkType": "HARD",
}],
["npm:4.1.1", {
"packageLocation": "./.yarn/cache/chalk-npm-4.1.1-f1ce6bae57-036e973e66.zip/node_modules/chalk/",
["npm:4.1.2", {
"packageLocation": "./.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip/node_modules/chalk/",
"packageDependencies": [
["chalk", "npm:4.1.1"],
["chalk", "npm:4.1.2"],
["ansi-styles", "npm:4.3.0"],
["supports-color", "npm:7.2.0"]
],
@ -7618,7 +7618,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@babel/code-frame", "npm:7.12.11"],
["@eslint/eslintrc", "npm:0.4.1"],
["ajv", "npm:6.12.6"],
["chalk", "npm:4.1.1"],
["chalk", "npm:4.1.2"],
["cross-spawn", "npm:7.0.3"],
["debug", "virtual:84aaab4674f4a44ff521c5f62bd452551ef7a2f3aa4df9a02b089f10fb2f0645a919a4bf72c9eb29c0c6447c3e3d72115cf19f79d920f85a14d3f7e8c3fbb38d#npm:4.3.2"],
["doctrine", "npm:3.0.0"],

BIN
.yarn/cache/chalk-npm-4.1.1-f1ce6bae57-036e973e66.zip (Stored with Git LFS) vendored

Binary file not shown.

BIN
.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip (Stored with Git LFS) vendored Normal file

Binary file not shown.

View File

@ -50,6 +50,8 @@ and this project adheres to
- @cosmjs/cosmwasm-stargate: Add support for wasmd 0.21. This changes the AMINO
JSON representation of `Msg{Execute,Instantiate,Migrate}Contract.msg` from
base64 strings to JSON objects. ([#948])
- @cosmjs/cli: Replace `colors` dependency with `chalk` (see
https://snyk.io/blog/open-source-npm-packages-colors-faker/)
[#865]: https://github.com/cosmos/cosmjs/issues/865
[#897]: https://github.com/cosmos/cosmjs/issues/897

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",

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) {

View File

@ -366,7 +366,7 @@ __metadata:
"@typescript-eslint/parser": ^4.28
axios: ^0.21.2
babylon: ^6.18.0
colors: ^1.3.3
chalk: ^4
cosmjs-types: ^0.4.0
diff: ^4
eslint: ^7.5
@ -2690,13 +2690,13 @@ __metadata:
languageName: node
linkType: hard
"chalk@npm:^4.0.0":
version: 4.1.1
resolution: "chalk@npm:4.1.1"
"chalk@npm:^4, chalk@npm:^4.0.0":
version: 4.1.2
resolution: "chalk@npm:4.1.2"
dependencies:
ansi-styles: ^4.1.0
supports-color: ^7.1.0
checksum: 036e973e665ba1a32c975e291d5f3d549bceeb7b1b983320d4598fb75d70fe20c5db5d62971ec0fe76cdbce83985a00ee42372416abfc3a5584465005a7855ed
checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc
languageName: node
linkType: hard
@ -2855,7 +2855,7 @@ __metadata:
languageName: node
linkType: hard
"colors@npm:1.4.0, colors@npm:^1.3.3, colors@npm:^1.4.0":
"colors@npm:1.4.0, colors@npm:^1.4.0":
version: 1.4.0
resolution: "colors@npm:1.4.0"
checksum: 98aa2c2418ad87dedf25d781be69dc5fc5908e279d9d30c34d8b702e586a0474605b3a189511482b9d5ed0d20c867515d22749537f7bc546256c6014f3ebdcec