Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var debug = require('debug')('pm2:conf');
var p = require('path');
var util = require('util');
var chalk = require('chalk');
var chalk = require('ansis');

/**
* Get PM2 path structure
Expand Down
2 changes: 1 addition & 1 deletion examples/sourcemap-auto-resolve/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var eachLimit = require('async/eachLimit');
var series = require('async/series');
var debug = require('debug')('pm2:cli');
var util = require('util');
var chalk = require('chalk');
var chalk = require('ansis');
var fclone = require('fclone');

var IMMUTABLE_MSG = chalk.bold.blue('Use --update-env to update environment variables');
Expand Down
2 changes: 1 addition & 1 deletion lib/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const eachLimit = require('async/eachLimit');
const series = require('async/series');
const debug = require('debug')('pm2:cli');
const util = require('util');
const chalk = require('chalk');
const chalk = require('ansis');
const fclone = require('fclone');

var DockerMgmt = require('./API/ExtraMgmt/Docker.js')
Expand Down
2 changes: 1 addition & 1 deletion lib/API/Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var Common = require('../Common.js');
var cst = require('../../constants.js');
var UX = require('./UX');
var chalk = require('chalk');
var chalk = require('ansis');
var Configuration = require('../Configuration.js');

module.exports = function(CLI) {
Expand Down
4 changes: 2 additions & 2 deletions lib/API/Containerizer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

var spawn = require('child_process').spawn;
var exec = require('child_process').exec;
var chalk = require('chalk');
var chalk = require('ansis');
var util = require('util');
var fmt = require('../tools/fmt.js');
var fs = require('fs');
Expand Down Expand Up @@ -322,7 +322,7 @@ module.exports = function(CLI) {
})
.catch(function(err) {
console.log();
console.log(chalk.grey('Raw error=', err.message));
console.log(chalk.gray('Raw error=', err.message));
self.disconnect();
});

Expand Down
6 changes: 3 additions & 3 deletions lib/API/Extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
var cst = require('../../constants.js');
var Common = require('../Common.js');
var UX = require('./UX');
var chalk = require('chalk');
var chalk = require('ansis');
var path = require('path');
var fs = require('fs');
var fmt = require('../tools/fmt.js');
Expand Down Expand Up @@ -258,10 +258,10 @@ module.exports = function(CLI) {
isInner = false
else if (isInner == false)
isInner = true
console.log(chalk.grey(l))
console.log(chalk.gray(l))
}
else if (l.startsWith('`'))
console.log(chalk.grey(l))
console.log(chalk.gray(l))
else
console.log(l)
})
Expand Down
10 changes: 5 additions & 5 deletions lib/API/Log.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
var fs = require('fs'),
util = require('util'),
chalk = require('chalk'),
chalk = require('ansis'),
forEachLimit = require('async/forEachLimit'),
dayjs = require('dayjs');

Expand Down Expand Up @@ -53,7 +53,7 @@ Log.tail = function(apps_list, lines, raw, callback) {
return next();

getLastLines(app.path, lines, function(output) {
console.log(chalk.grey('%s last %d lines:'), app.path, lines);
console.log(chalk.gray('%s last %d lines:'), app.path, lines);
output.forEach(function(out) {
if (raw)
return app.type === 'err' ? console.error(out) : console.log(out);
Expand Down Expand Up @@ -89,7 +89,7 @@ Log.stream = function(Client, id, raw, timestamp, exclusive, highlight) {
socket.on('reconnect attempt', function() {
if (global._auto_exit === true) {
if (timestamp)
process.stdout.write(chalk['dim'](chalk.grey(dayjs().format(timestamp) + ' ')));
process.stdout.write(chalk['dim'](chalk.gray(dayjs().format(timestamp) + ' ')));
process.stdout.write(chalk.blue(pad(DEFAULT_PADDING, 'PM2') + ' | ') + '[[[ Target PM2 killed. ]]]');
process.exit(0);
}
Expand Down Expand Up @@ -125,7 +125,7 @@ Log.stream = function(Client, id, raw, timestamp, exclusive, highlight) {
return type === 'err' ? process.stderr.write(util.format(line) + '\n') : process.stdout.write(util.format(line) + '\n');

if (timestamp)
process.stdout.write(chalk['dim'](chalk.grey(dayjs().format(timestamp) + ' ')));
process.stdout.write(chalk['dim'](chalk.gray(dayjs().format(timestamp) + ' ')));

var name = packet.process.pm_id + '|' + packet.process.name;

Expand Down Expand Up @@ -191,7 +191,7 @@ Log.devStream = function(Client, id, raw, timestamp, exclusive) {
return process.stdout.write(util.format(line) + '\n');

if (timestamp)
process.stdout.write(chalk['dim'](chalk.grey(dayjs().format(timestamp) + ' ')));
process.stdout.write(chalk['dim'](chalk.gray(dayjs().format(timestamp) + ' ')));

var name = packet.process.name + '-' + packet.process.pm_id;

Expand Down
8 changes: 4 additions & 4 deletions lib/API/LogManagement.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var chalk = require('chalk');
var chalk = require('ansis');
var util = require('util');
var fs = require('fs');
var exec = require('child_process').exec;
Expand Down Expand Up @@ -72,7 +72,7 @@ module.exports = function(CLI) {
if (process.getuid() != 0) {
return exec('whoami', function(err, stdout, stderr) {
Common.printError(cst.PREFIX_MSG + 'You have to run this command as root. Execute the following command:');
Common.printError(cst.PREFIX_MSG + chalk.grey(' sudo env PATH=$PATH:' + path.dirname(process.execPath) + ' pm2 logrotate -u ' + stdout.trim()));
Common.printError(cst.PREFIX_MSG + chalk.gray(' sudo env PATH=$PATH:' + path.dirname(process.execPath) + ' pm2 logrotate -u ' + stdout.trim()));

cb ? cb(Common.retErr('You have to run this with elevated rights')) : that.exitCli(cst.ERROR_EXIT);
});
Expand Down Expand Up @@ -171,7 +171,7 @@ module.exports = function(CLI) {
if (lines === 0)
return Log.stream(that.Client, id, raw, timestamp, exclusive, highlight);

Common.printOut(chalk.bold.grey(util.format.call(this, '[TAILING] Tailing last %d lines for [%s] process%s (change the value with --lines option)', lines, id, id === 'all' ? 'es' : '')));
Common.printOut(chalk.bold.gray(util.format.call(this, '[TAILING] Tailing last %d lines for [%s] process%s (change the value with --lines option)', lines, id, id === 'all' ? 'es' : '')));

// Populate the array `files_list` with the paths of all files we need to tail
list.forEach(function(proc) {
Expand Down Expand Up @@ -312,7 +312,7 @@ module.exports = function(CLI) {
return that.exitCli(cst.SUCCESS_EXIT)
}

Common.printOut(chalk.bold.grey(util.format.call(this, '[TAILING] Tailing last %d lines for [%s] process%s (change the value with --lines option)', lines, id, id === 'all' ? 'es' : '')));
Common.printOut(chalk.bold.gray(util.format.call(this, '[TAILING] Tailing last %d lines for [%s] process%s (change the value with --lines option)', lines, id, id === 'all' ? 'es' : '')));

// Populate the array `files_list` with the paths of all files we need to tail
list.forEach(function(proc) {
Expand Down
2 changes: 1 addition & 1 deletion lib/API/Modules/LOCAL.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var path = require('path');
var fs = require('fs');
var os = require('os');
var spawn = require('child_process').spawn;
var chalk = require('chalk');
var chalk = require('ansis');
var parallel = require('async/parallel');

var Configuration = require('../../Configuration.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/API/Modules/NPM.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const fs = require('fs');
const os = require('os');
const spawn = require('child_process').spawn;
const chalk = require('chalk');
const chalk = require('ansis');

const readline = require('readline')
const which = require('../../tools/which.js')
Expand Down
2 changes: 1 addition & 1 deletion lib/API/Modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

var cst = require('../../../constants.js');
var Common = require('../../Common.js');
var chalk = require('chalk');
var chalk = require('ansis');
var forEachLimit = require('async/forEachLimit');

var Modularizer = require('./Modularizer.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/API/Monit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
var multimeter = require('pm2-multimeter');
var os = require('os');
var p = require('path');
var chalk = require('chalk');
var chalk = require('ansis');

var UX = require('./UX');

Expand Down
2 changes: 1 addition & 1 deletion lib/API/Startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Use of this source code is governed by a license that
* can be found in the LICENSE file.
*/
var chalk = require('chalk');
var chalk = require('ansis');
var path = require('path');
var fs = require('fs');
var forEachLimit = require('async/forEachLimit');
Expand Down
2 changes: 1 addition & 1 deletion lib/API/UX/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const chalk = require('chalk')
const chalk = require('ansis')
const Helpers = {}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/API/UX/pm2-describe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Table = require('cli-tableau')
const chalk = require('chalk')
const chalk = require('ansis')
const UxHelpers = require('./helpers.js')
const Common = require('../../Common.js')

Expand Down
6 changes: 3 additions & 3 deletions lib/API/UX/pm2-ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const cst = require('../../../constants')
const Common = require('../../Common')
const Configuration = require('../../Configuration')
const UxHelpers = require('./helpers.js')
const chalk = require('chalk')
const chalk = require('ansis')
const Table = require('cli-tableau')
const Passwd = require('../../tools/passwd.js')

Expand Down Expand Up @@ -280,7 +280,7 @@ function listModulesAndAppsManaged(list, commander) {

// Watch status
if (!CONDENSED_MODE)
obj[key].push(l.pm2_env.watch ? chalk.green.bold('enabled') : chalk.grey('disabled'))
obj[key].push(l.pm2_env.watch ? chalk.green.bold('enabled') : chalk.gray('disabled'))

UxHelpers.safe_push(app_table, obj)
}
Expand Down Expand Up @@ -452,7 +452,7 @@ function miniMonitBar(sys_infos) {
disks.forEach(fs => {
let use = sys_metrics[`fs:use:${fs}`].value
if (use > 60)
sys_summary_line += `${chalk.grey(fs)} ${UxHelpers.colorizedMetric(use, 80, 90, '%')} `
sys_summary_line += `${chalk.gray(fs)} ${UxHelpers.colorizedMetric(use, 80, 90, '%')} `
})
}

Expand Down
2 changes: 1 addition & 1 deletion lib/API/pm2-plus/PM2IO.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

var cst = require('../../../constants.js');
const chalk = require('chalk');
const chalk = require('ansis');
const path = require('path');
const fs = require('fs');
const Table = require('cli-tableau');
Expand Down
2 changes: 1 addition & 1 deletion lib/API/pm2-plus/auth-strategies/CliAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const tryEach = require('async/tryEach')
const path = require('path')
const os = require('os')
const needle = require('needle')
const chalk = require('chalk')
const chalk = require('ansis')
const cst = require('../../../../constants.js')
const promptly = require('promptly')

Expand Down
2 changes: 1 addition & 1 deletion lib/API/pm2-plus/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var cst = require('../../../constants.js');
var Common = require('../../Common.js');

const chalk = require('chalk');
const chalk = require('ansis');
const forEach = require('async/forEach');
const open = require('../../tools/open.js');
const Modules = require('../Modules');
Expand Down
2 changes: 1 addition & 1 deletion lib/API/pm2-plus/link.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

var cst = require('../../../constants.js');
var Common = require('../../Common.js');
var chalk = require('chalk');
var chalk = require('ansis');
var fs = require('fs');
var KMDaemon = require('@pm2/agent/src/InteractorClient');
var pkg = require('../../../package.json')
Expand Down
2 changes: 1 addition & 1 deletion lib/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var fs = require('fs');
var path = require('path');
var os = require('os');
var util = require('util');
var chalk = require('chalk');
var chalk = require('ansis');
var fclone = require('fclone');
var semver = require('semver');
var dayjs = require('dayjs');
Expand Down
4 changes: 2 additions & 2 deletions lib/binaries/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ process.env.PM2_USAGE = 'CLI';
var cst = require('../../constants.js');

var commander = require('commander');
var chalk = require('chalk');
var chalk = require('ansis');
var forEachLimit = require('async/forEachLimit');

var debug = require('debug')('pm2:cli');
Expand Down Expand Up @@ -1013,7 +1013,7 @@ commander.command('autoinstall')
commander.command('examples')
.description('display pm2 usage examples')
.action(() => {
console.log(cst.PREFIX_MSG + chalk.grey('pm2 usage examples:\n'));
console.log(cst.PREFIX_MSG + chalk.gray('pm2 usage examples:\n'));
displayExamples();
process.exit(cst.SUCCESS_EXIT);
})
Expand Down
2 changes: 1 addition & 1 deletion lib/binaries/DevCLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var PM2 = require('../..');
var Log = require('../API/Log');
var cst = require('../../constants.js');
var pkg = require('../../package.json');
var chalk = require('chalk');
var chalk = require('ansis');
var path = require('path');
var fmt = require('../tools/fmt.js');
var exec = require('child_process').exec;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@
"@pm2/js-api": "~0.8.0",
"@pm2/io": "~6.1.0",
"@pm2/pm2-version-check": "latest",
"ansis": "4.0.0",
"async": "~3.2.6",
"blessed": "0.1.81",
"chalk": "3.0.0",
"chokidar": "^3.5.3",
"cli-tableau": "^2.0.0",
"commander": "2.15.1",
Expand Down
2 changes: 1 addition & 1 deletion test/parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const forEachLimit = require('async/forEachLimit')
const fs = require('fs')
const exec = require('child_process').exec
const path = require('path')
const chalk = require('chalk')
const chalk = require('ansis')
const Table = require('cli-table-redemption');

const testFolder = './test/e2e/'
Expand Down