Replace Chalk with Kleur (#264)

- Remove Chalk
- Add Kleur
- Update index.js
- Update copyright in README

Fixes #256
This commit is contained in:
Sam Clulow
2020-06-29 17:27:44 +02:00
committed by GitHub
parent 59f657b422
commit a2cc2c7942
3 changed files with 15 additions and 15 deletions

View File

@@ -139,7 +139,7 @@ If you're opening issues related to these, please mention the version that the i
## License ## License
Pa11y Dashboard is licensed under the [GNU General Public License 3.0][info-license].<br/> Pa11y Dashboard is licensed under the [GNU General Public License 3.0][info-license].<br/>
Copyright &copy; 20132019, Team Pa11y and contributors Copyright &copy; 20132020, Team Pa11y and contributors
[gpl]: http://www.gnu.org/licenses/gpl-3.0.html [gpl]: http://www.gnu.org/licenses/gpl-3.0.html
[mongo]: http://www.mongodb.org/ [mongo]: http://www.mongodb.org/

View File

@@ -14,7 +14,7 @@
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
'use strict'; 'use strict';
const chalk = require('chalk'); const kleur = require('kleur');
const config = require('./config'); const config = require('./config');
process.on('SIGINT', () => { process.on('SIGINT', () => {
@@ -29,16 +29,16 @@ require('./app')(config, (error, app) => {
} }
console.log(''); console.log('');
console.log(chalk.underline.magenta('Pa11y Dashboard started')); console.log(kleur.underline().magenta('Pa11y Dashboard started'));
console.log(chalk.grey('mode: %s'), process.env.NODE_ENV); console.log(kleur.grey('mode: %s'), process.env.NODE_ENV);
console.log(chalk.grey('uri: %s'), app.address); console.log(kleur.grey('uri: %s'), app.address);
app.on('route-error', error => { app.on('route-error', error => {
const stack = (error.stack ? error.stack.split('\n') : [error.message]); const stack = (error.stack ? error.stack.split('\n') : [error.message]);
const msg = chalk.red(stack.shift()); const msg = kleur.red(stack.shift());
console.error(''); console.error('');
console.error(msg); console.error(msg);
console.error(chalk.grey(stack.join('\n'))); console.error(kleur.grey(stack.join('\n')));
}); });
// Start the webservice if required // Start the webservice if required
@@ -50,11 +50,11 @@ require('./app')(config, (error, app) => {
} }
console.log(''); console.log('');
console.log(chalk.underline.cyan('Pa11y Webservice started')); console.log(kleur.underline().cyan('Pa11y Webservice started'));
console.log(chalk.grey('mode: %s'), process.env.NODE_ENV); console.log(kleur.grey('mode: %s'), process.env.NODE_ENV);
console.log(chalk.grey('uri: %s'), webservice.server.info.uri); console.log(kleur.grey('uri: %s'), webservice.server.info.uri);
console.log(chalk.grey('database: %s'), config.webservice.database); console.log(kleur.grey('database: %s'), config.webservice.database);
console.log(chalk.grey('cron: %s'), config.webservice.cron); console.log(kleur.grey('cron: %s'), config.webservice.cron);
}); });
} }

View File

@@ -26,14 +26,14 @@
}, },
"dependencies": { "dependencies": {
"body-parser": "~1.19.0", "body-parser": "~1.19.0",
"chalk": "~2.4.2",
"compression": "~1.7.4", "compression": "~1.7.4",
"express-hbs": "~2.1.2",
"express": "~4.17.1", "express": "~4.17.1",
"express-hbs": "~2.1.2",
"http-headers": "~3.0.2", "http-headers": "~3.0.2",
"kleur": "^4.0.2",
"moment": "~2.24.0", "moment": "~2.24.0",
"pa11y-webservice-client-node": "~2.0.0",
"pa11y-webservice": "~3.1.2", "pa11y-webservice": "~3.1.2",
"pa11y-webservice-client-node": "~2.0.0",
"underscore": "~1.9.1" "underscore": "~1.9.1"
}, },
"devDependencies": { "devDependencies": {