chore: remove chalk (#12447)

This commit is contained in:
Austen 2024-04-24 08:21:03 -07:00 committed by GitHub
parent 5eeac2f717
commit 4ba2a3534b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 17 deletions

View File

@ -12,7 +12,6 @@ import deepSortObjectByKey from '../utils/deep-sort-object-by-key.js';
import ensureString from 'type/string/ensure.js';
import isObject from 'type/object/is.js';
import wait from 'timers-ext/promise/sleep.js';
import chalk from 'chalk';
const { log } = utils;
@ -200,7 +199,7 @@ async function awsRequest(service, method, ...args) {
? [
'AWS provider credentials not found.',
' Learn how to set up AWS provider credentials',
` in our docs here: <${chalk.green('http://slss.io/aws-creds-setup')}>.`,
` in our docs here: http://slss.io/aws-creds-setup`,
].join('')
: bottomError.message;
message = errorMessage;

View File

@ -1,4 +1,3 @@
import chalk from 'chalk';
import utils from '@serverlessinc/sf-core/src/utils.js';
const { log } = utils;
@ -20,15 +19,13 @@ class CLI {
}
printDot() {
process.stdout.write(chalk.yellow('.'));
process.stdout.write('.');
}
log(message, entity, opts) {
const { underline = false, bold = false, color = null } = opts || {};
let print = chalk;
if (color) print = chalk.keyword(color);
if (color) print = color
if (underline) print = print.underline;
if (bold) print = print.bold;

View File

@ -10,7 +10,6 @@ import validate from '../lib/validate.js';
import ServerlessError from '../../../serverless-error.js';
import LocalLambda from './local-lambda/index.js';
import { fileURLToPath } from 'url';
import chalk from 'chalk'
const { log, progress } = utils;
const logger = log.get('sls:dev');
@ -90,13 +89,6 @@ const logFunctionEvent = (functionName, event, isVerbose) => {
const logFunctionResponse = (functionName, response, isVerbose) => {
try {
if (response) {
if (response.statusCode) {
let statusCodeColor = chalk.green;
if (response.statusCode >= 400) statusCodeColor = chalk.red;
// logger.aside(`← λ ${functionName} ${statusCodeColor(` ${response.statusCode} `)}`);
}
if (isVerbose) {
logger.aside(`${util.inspect(response, { showHidden: true, depth: null, colors: true })}`);
}
@ -463,7 +455,7 @@ class AwsDev {
});
device.on('connect', () => {
logger.success(`Connected ${chalk.grey('(Ctrl+C to cancel)')}`);
logger.success(`Connected (Ctrl+C to cancel)`);
setInterval(() => {
device.publish(this.getTopicId('_heartbeat'), JSON.stringify({ connected: true }), {

View File

@ -35,7 +35,6 @@
"aws-sdk": "^2.1604.0",
"bluebird": "^3.7.2",
"cachedir": "^2.3.0",
"chalk": "^4.1.2",
"child-process-ext": "^2.1.1",
"chokidar": "^3.6.0",
"ci-info": "^3.8.0",