🎨 Move Slimer UI into Pretty CLI

- We'll want these log utils in other cli tools
This commit is contained in:
Hannah Wolfe 2018-10-04 13:30:59 +01:00
parent e80f4e93f2
commit dfe1610a47
2 changed files with 19 additions and 0 deletions

View File

@ -1,5 +1,6 @@
const Api = require('sywac/api'); const Api = require('sywac/api');
const styles = require('./styles'); const styles = require('./styles');
const ui = require('./ui');
/** /**
* Pretty CLI * Pretty CLI
* *
@ -24,3 +25,6 @@ module.exports.Api = Api;
// Export the styles // Export the styles
module.exports.styles = styles; module.exports.styles = styles;
// Export our ui tools
module.exports.ui = ui;

15
ghost/pretty-cli/ui.js Normal file
View File

@ -0,0 +1,15 @@
const chalk = require('chalk');
const log = (...args) => console.log(...args); // eslint-disable-line no-console
module.exports.log = log;
module.exports.log.error = (...args) => {
log(chalk.red('error'), ...args);
};
module.exports.log.info = (...args) => {
log(chalk.cyan('info'), ...args);
};
module.exports.log.ok = (...args) => {
log(chalk.green('ok'), ...args);
};