feat: remove colors in favour of chalk (#10142)

* feat: remove colors in favour of chalk

* fix: bad conversion from colors to chalk in src/cli/index.js

* fix: padWidth calculation to account for control characters

* fix: termWidth calculation, but swapped one problem for another

* fix: formatItem, implement my own padRight to take control characters into account
This commit is contained in:
Julian Lam
2022-02-01 21:43:09 -05:00
committed by GitHub
parent c7a5643932
commit cf8f62aed9
15 changed files with 106 additions and 78 deletions

View File

@@ -5,6 +5,7 @@ const path = require('path');
const winston = require('winston');
const semver = require('semver');
const nconf = require('nconf');
const chalk = require('chalk');
const request = require('request-promise-native');
const user = require('../user');
@@ -117,7 +118,7 @@ Plugins.reload = async function () {
console.log('');
winston.warn('[plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.');
for (let x = 0, numPlugins = Plugins.versionWarning.length; x < numPlugins; x += 1) {
console.log(' * '.yellow + Plugins.versionWarning[x]);
console.log(`${chalk.yellow(' * ') + Plugins.versionWarning[x]}`);
}
console.log('');
}