stacked-pr-sync
Version:
A Node.js tool for syncing stacked pull requests with advanced conflict detection and resolution
51 lines (42 loc) • 875 B
JavaScript
// ANSI color codes for better output
const colors = {
reset: '\x1b[0m',
bright: '\x1b[1m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
magenta: '\x1b[35m',
cyan: '\x1b[36m',
}
function log(message, color = 'reset') {
console.log(`${colors[color]}${message}${colors.reset}`)
}
function logStep(step, message) {
log(`\n${colors.bright}${step}${colors.reset}: ${message}`, 'cyan')
}
function logSuccess(message) {
log(`✓ ${message}`, 'green')
}
function logError(message) {
log(`✗ ${message}`, 'red')
}
function logWarning(message) {
log(`⚠ ${message}`, 'yellow')
}
function logInfo(message) {
log(`ℹ ${message}`, 'blue')
}
function logCommand(command) {
log(`🔧 ${command}`, 'red')
}
module.exports = {
log,
logStep,
logSuccess,
logError,
logWarning,
logInfo,
logCommand,
colors,
}