UNPKG

template-syncer

Version:

智能模板同步工具 - 让你的项目与模板仓库保持同步,支持智能合并、差异对比和交互式更新

33 lines (32 loc) 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.logger = void 0; const chalk = require('chalk'); exports.logger = { info: (msg) => console.log(chalk.blue(msg)), success: (msg) => console.log(chalk.green(`✅ ${msg}`)), warn: (msg) => console.log(chalk.yellow(`⚠️ ${msg}`)), error: (msg) => console.log(chalk.red(`❌ ${msg}`)), step: (msg) => console.log(chalk.cyan(`▶ ${msg}`)), file(icon, filePath, status) { const colorFn = status === '已删除' ? chalk.red : status === '已创建' ? chalk.green : status === '已跳过' ? chalk.gray : status.startsWith('失败') ? chalk.red : chalk.yellow; console.log(` ${icon} ${filePath} ${colorFn(status)}`); }, summary(result) { const sep = chalk.gray('─'.repeat(48)); console.log(`\n${sep}`); if (result.success.length > 0) console.log(chalk.green(`✅ 成功 ${result.success.length} 个`)); if (result.skipped.length > 0) console.log(chalk.gray(`⏭ 跳过 ${result.skipped.length} 个`)); if (result.failed.length > 0) { console.log(chalk.red(`❌ 失败 ${result.failed.length} 个`)); result.failed.forEach(f => console.log(chalk.red(` • ${f.path}: ${f.error}`))); } console.log(`${sep}\n`); } };