Skip to content

Commit 86b892b

Browse files
author
Charlie Lodder
committed
Move from chalk to kleur and time-grunt to @lodder/time-grunt
1 parent c5772ec commit 86b892b

File tree

4 files changed

+74
-94
lines changed

4 files changed

+74
-94
lines changed

Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const processorsFn = () => {
1010

1111
module.exports = (grunt) => {
1212
require('load-grunt-tasks')(grunt);
13-
require('time-grunt')(grunt);
13+
require('@lodder/time-grunt')(grunt);
1414

1515
grunt.initConfig({
1616
jshint: {

package-lock.json

+61-81
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"LICENSE"
2727
],
2828
"dependencies": {
29-
"chalk": "^2.4.2",
29+
"kleur": "^3.0.1",
3030
"diff": "^4.0.1",
3131
"maxmin": "^2.1.0",
3232
"postcss": "^7.0.8"
@@ -39,7 +39,7 @@
3939
"grunt-contrib-nodeunit": "^2.0.0",
4040
"load-grunt-tasks": "^4.0.0",
4141
"postcss-scss": "^2.0.0",
42-
"time-grunt": "^2.0.0"
42+
"@lodder/time-grunt": "^3.0.1"
4343
},
4444
"peerDependencies": {
4545
"grunt": ">=1.0.3"

tasks/postcss.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

3-
const path = require('path');
4-
const postcss = require('postcss');
5-
const diff = require('diff');
6-
const chalk = require('chalk');
7-
const maxmin = require('maxmin');
3+
const path = require('path');
4+
const postcss = require('postcss');
5+
const diff = require('diff');
6+
const { cyan } = require('kleur');
7+
const maxmin = require('maxmin');
88

99
module.exports = function(grunt) {
1010
let options;
@@ -164,7 +164,7 @@ module.exports = function(grunt) {
164164
this.files.forEach(function(f) {
165165
let src = f.src.filter(function(filepath) {
166166
if (!grunt.file.exists(filepath)) {
167-
grunt.log.warn(`Source file ${chalk.cyan(filepath)} not found.`);
167+
grunt.log.warn(`Source file ${cyan(filepath)} not found.`);
168168

169169
return false;
170170
}
@@ -195,7 +195,7 @@ module.exports = function(grunt) {
195195
if (options.writeDest) {
196196
tally.sizeAfter += result.css.length;
197197
grunt.file.write(dest, result.css);
198-
log(`File ${chalk.cyan(dest)} created.${chalk.dim(maxmin(input.length, result.css.length))}`);
198+
log(`File ${cyan(dest)} created.${cyan(maxmin(input.length, result.css.length))}`);
199199
}
200200

201201
tally.sheets += 1;
@@ -208,7 +208,7 @@ module.exports = function(grunt) {
208208
}
209209

210210
grunt.file.write(mapDest, result.map.toString());
211-
log(`File ${chalk.cyan(`${dest}.map`)} created (source map).`);
211+
log(`File ${cyan(`${dest}.map`)} created (source map).`);
212212

213213
tally.maps += 1;
214214
}
@@ -217,7 +217,7 @@ module.exports = function(grunt) {
217217
const diffPath = (typeof options.diff === 'string') ? options.diff : `${dest}.diff`;
218218

219219
grunt.file.write(diffPath, diff.createPatch(dest, input, result.css));
220-
log(`File ${chalk.cyan(diffPath)} created (diff).`);
220+
log(`File ${cyan(diffPath)} created (diff).`);
221221

222222
tally.diffs += 1;
223223
}
@@ -228,7 +228,7 @@ module.exports = function(grunt) {
228228
runTasks().then(function() {
229229
if (tally.sheets) {
230230
if (options.writeDest) {
231-
const size = chalk.dim(maxmin(tally.sizeBefore, tally.sizeAfter));
231+
const size = cyan(maxmin(tally.sizeBefore, tally.sizeAfter));
232232
grunt.log.ok(`${tally.sheets} processed ${grunt.util.pluralize(tally.sheets, 'stylesheet/stylesheets')} created. ${size}`);
233233
} else {
234234
grunt.log.ok(`${tally.sheets} ${grunt.util.pluralize(tally.sheets, 'stylesheet/stylesheets')} processed, no files written.`);

0 commit comments

Comments
 (0)