]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
refactor: replace chalk with kleur 11693/head
authorDaniel Ruf <daniel@daniel-ruf.de>
Sat, 23 Feb 2019 15:48:09 +0000 (16:48 +0100)
committerDaniel Ruf <daniel@daniel-ruf.de>
Sat, 23 Feb 2019 16:53:28 +0000 (17:53 +0100)
gulp/tasks/babel-error.js
package.json
script/husky-commit-lint.js
script/husky-commit-test.js
script/husky-push-test.js

index 9e0a3f0f911de515a05833c999d55018e459ba4c..68068326f569012f722940242dfbc53b1d3e18dc 100644 (file)
@@ -1,8 +1,8 @@
-var chalk = require('chalk');
+var { red } = require('kleur');
 
 module.exports = function(err) {
   console.log(
-    chalk.red(
+    red(
       err.fileName +
       (
           err.loc ?
@@ -13,4 +13,4 @@ module.exports = function(err) {
     'error Babel: ' + err.message + '\n' +
     err.codeFrame
   );
-}
\ No newline at end of file
+}
index efe202804ebeba44ba0769f6b227fb5e2807a128..2c0e62338dd74796e35f750f71394f393bcb1a7a 100644 (file)
@@ -44,7 +44,6 @@
     "browserstack-runner": "^0.9.0",
     "chai": "^4.1.2",
     "chai-jquery": "^2.1.0",
-    "chalk": "^2.4.2",
     "clipboard": "^2.0.4",
     "corejs-typeahead": "^1.1.1",
     "cz-conventional-changelog": "^2.1.0",
@@ -78,6 +77,7 @@
     "is-empty-object": "^1.1.1",
     "jquery": "^3.3.1",
     "js-yaml": "^3.12.1",
+    "kleur": "^3.0.2",
     "mocha": "^5.0.5",
     "mocha-headless-chrome": "^2.0.1",
     "motion-ui": "^2.0.2",
index 988df49444aa2238871eb4a805cf11fa3de78128..30f25fb303ae7ad5a07f90a6f015da9c09678b16 100644 (file)
@@ -1,9 +1,9 @@
-const chalk = require('chalk')
+const { yellow, red } = require('kleur');
 const spawn = require('child_process').spawn
 
 const args = process.argv.splice(process.execArgv.length + 2);
 
-console.log(chalk.yellow('🐶  Checking the commit message...'))
+console.log(yellow('🐶  Checking the commit message...'))
 
 const child = spawn('commitlint', args, { shell: true })
 
@@ -12,13 +12,13 @@ child.stdout.on('data', function (data) {
 })
 
 child.on('error', function (err) {
-  console.log(chalk.red(err))
+  console.log(red(err))
 })
 
 child.on('exit', function (code) {
   if(code !== 0){
-    console.log(chalk.yellow('🐶  ✗ Commit message is invalid.'))
-    console.log(chalk.yellow('     See https://git.io/contribute for help'))
+    console.log(yellow('🐶  ✗ Commit message is invalid.'))
+    console.log(yellow('     See https://git.io/contribute for help'))
     process.exit(code);
   }
 })
index 3a665ff50f31c51411e1856009caf8fd95cb0990..191673a6fb7d360332c7692657088252b81dd6da 100644 (file)
@@ -1,7 +1,7 @@
-const chalk = require('chalk')
+const { yellow, red } = require('kleur');
 const spawn = require('child_process').spawn
 
-console.log(chalk.yellow('🐶  Checking tests before committing...'))
+console.log(yellow('🐶  Checking tests before committing...'))
 
 const child = spawn('npm run test', [], { shell: true })
 
@@ -10,14 +10,14 @@ child.stdout.on('data', function (data) {
 })
 
 child.on('error', function (err) {
-  console.log(chalk.red(err))
+  console.log(red(err))
 })
 
 child.on('exit', function (code) {
   if(code === 0){
-    console.log(chalk.yellow('🐶  ✓ Tests run well, we can commit...'))
+    console.log(yellow('🐶  ✓ Tests run well, we can commit...'))
   } else {
-    console.log(chalk.yellow('🐶  ✗ Tests are failing, please fix them before committing.'))
+    console.log(yellow('🐶  ✗ Tests are failing, please fix them before committing.'))
     process.exit(code);
   }
 })
index 259c98b6f3d1275c4ec33115bba47793968c10c8..a9631a72c2e7ac47e89843833071387c60dd4c92 100644 (file)
@@ -1,7 +1,7 @@
-const chalk = require('chalk')
+const { yellow, red } = require('kleur');
 const spawn = require('child_process').spawn
 
-console.log(chalk.yellow('🐶  Checking tests before pushing...'))
+console.log(yellow('🐶  Checking tests before pushing...'))
 
 const child = spawn('npm run test', [], { shell: true })
 
@@ -10,14 +10,14 @@ child.stdout.on('data', function (data) {
 })
 
 child.on('error', function (err) {
-  console.log(chalk.red(err))
+  console.log(red(err))
 })
 
 child.on('exit', function (code) {
   if(code === 0){
-    console.log(chalk.yellow('🐶  ✓ Tests run well, we can push...'))
+    console.log(yellow('🐶  ✓ Tests run well, we can push...'))
   } else {
-    console.log(chalk.yellow('🐶  ✗ Tests are failing, please fix them before pushing.'))
+    console.log(yellow('🐶  ✗ Tests are failing, please fix them before pushing.'))
     process.exit(code);
   }
 })