From e6d539aee09521e104e7e4a42bd9753f47bd35a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85kerberg?= Date: Wed, 13 Nov 2019 23:22:00 +0100 Subject: [PATCH 1/4] Replace chalk.reset with stripAnsi When logging multi-line logs, the logger uses chalk.reset in order to get the length of the tag for the log. This is to achieve an indented layout of multi-line logs. chalk.reset only replaces styles such as bold and italic, not color. When the tag contains colors, the result is not pretty. Replacing with stripAnsi gets the intended result. --- packages/@vue/cli-shared-utils/lib/logger.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-shared-utils/lib/logger.js b/packages/@vue/cli-shared-utils/lib/logger.js index a1b1fa8faf..0e6379a47c 100644 --- a/packages/@vue/cli-shared-utils/lib/logger.js +++ b/packages/@vue/cli-shared-utils/lib/logger.js @@ -1,4 +1,5 @@ const chalk = require('chalk') +const stripAnsi = require('strip-ansi'); const readline = require('readline') const padStart = require('string.prototype.padstart') const EventEmitter = require('events') @@ -19,7 +20,7 @@ const format = (label, msg) => { return msg.split('\n').map((line, i) => { return i === 0 ? `${label} ${line}` - : padStart(line, chalk.reset(label).length) + : padStart(line, stripAnsi(label).length) }).join('\n') } From 9527beeba9532fc8f7e9ea40cd777f6e14174a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85kerberg?= Date: Thu, 14 Nov 2019 09:41:00 +0100 Subject: [PATCH 2/4] Adds reference to strip-ansi --- packages/@vue/cli-shared-utils/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-shared-utils/package.json b/packages/@vue/cli-shared-utils/package.json index 852f187bf1..9da6b6ff14 100644 --- a/packages/@vue/cli-shared-utils/package.json +++ b/packages/@vue/cli-shared-utils/package.json @@ -31,7 +31,8 @@ "request": "^2.87.0", "request-promise-native": "^1.0.7", "semver": "^6.1.0", - "string.prototype.padstart": "^3.0.0" + "string.prototype.padstart": "^3.0.0", + "strip-ansi" : "^6.0.0", }, "publishConfig": { "access": "public" From 606fb3cda2e8f27c87155672e9de47164c26229d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85kerberg?= Date: Thu, 14 Nov 2019 09:43:27 +0100 Subject: [PATCH 3/4] Removes misplaces comma from package.json --- packages/@vue/cli-shared-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-shared-utils/package.json b/packages/@vue/cli-shared-utils/package.json index 9da6b6ff14..53a713d60d 100644 --- a/packages/@vue/cli-shared-utils/package.json +++ b/packages/@vue/cli-shared-utils/package.json @@ -32,7 +32,7 @@ "request-promise-native": "^1.0.7", "semver": "^6.1.0", "string.prototype.padstart": "^3.0.0", - "strip-ansi" : "^6.0.0", + "strip-ansi" : "^6.0.0" }, "publishConfig": { "access": "public" From 92710c65ec316c990f784e13ac9e9dc59b88af5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85kerberg?= Date: Tue, 26 Nov 2019 21:59:42 +0100 Subject: [PATCH 4/4] Removes extraneous semicolon --- packages/@vue/cli-shared-utils/lib/logger.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-shared-utils/lib/logger.js b/packages/@vue/cli-shared-utils/lib/logger.js index 0e6379a47c..47d12ba3ed 100644 --- a/packages/@vue/cli-shared-utils/lib/logger.js +++ b/packages/@vue/cli-shared-utils/lib/logger.js @@ -1,5 +1,5 @@ const chalk = require('chalk') -const stripAnsi = require('strip-ansi'); +const stripAnsi = require('strip-ansi') const readline = require('readline') const padStart = require('string.prototype.padstart') const EventEmitter = require('events')