Skip to content

Commit

Permalink
chore: drop prod dependency on chalk. (#58)
Browse files Browse the repository at this point in the history
* Inline the warning symbol to drop prod dependency on log-symbols,
  which depends on chalk.
  • Loading branch information
ludofischer committed Nov 29, 2020
1 parent 72002c7 commit 791276d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/formatter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
var { bold, underline, yellow } = require('colorette');
var path = require('path');
var symbols = require('log-symbols');
var sortBy = require('lodash.sortby');
var util = require('./util');

var supportsLargeCharset = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color';
var warningSymbol = supportsLargeCharset ? '⚠' : '!!';

module.exports = function(opts) {
var options = opts || {};
var sortByPosition = (typeof options.sortByPosition !== 'undefined') ? options.sortByPosition : true;
Expand Down Expand Up @@ -64,7 +66,7 @@ module.exports = function(opts) {
}

if (!options.noIcon && message.type === 'warning') {
str += yellow(symbols.warning + ' ');
str += yellow(warningSymbol + ' ');
}

str += message.text;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"eslint": "7.10.0",
"less": "3.12.2",
"lodash": "^4.17.20",
"log-symbols": "^4.0.0",
"postcss": "^8.1.0",
"source-map": "0.7.3",
"strip-color": "^0.1.0",
Expand All @@ -46,7 +47,6 @@
"lodash.forown": "^4.4.0",
"lodash.get": "^4.4.2",
"lodash.groupby": "^4.6.0",
"lodash.sortby": "^4.7.0",
"log-symbols": "^4.0.0"
"lodash.sortby": "^4.7.0"
}
}

0 comments on commit 791276d

Please sign in to comment.