(results: Map<any, any>)
| 87 | } |
| 88 | |
| 89 | export async function renderSummary(results: Map<any, any>) { |
| 90 | console.log(chalk.hex(colors.green)("[Done]")); |
| 91 | |
| 92 | const skippedResults = Array.from(results.values()).filter( |
| 93 | (r) => r.status === "skipped", |
| 94 | ); |
| 95 | const succeededResults = Array.from(results.values()).filter( |
| 96 | (r) => r.status === "success", |
| 97 | ); |
| 98 | const failedResults = Array.from(results.values()).filter( |
| 99 | (r) => r.status === "error", |
| 100 | ); |
| 101 | |
| 102 | console.log( |
| 103 | `• ${chalk.hex(colors.yellow)(skippedResults.length)} from cache`, |
| 104 | ); |
| 105 | console.log( |
| 106 | `• ${chalk.hex(colors.yellow)(succeededResults.length)} processed`, |
| 107 | ); |
| 108 | console.log(`• ${chalk.hex(colors.yellow)(failedResults.length)} failed`); |
| 109 | |
| 110 | // Show processed files |
| 111 | if (succeededResults.length > 0) { |
| 112 | console.log(chalk.hex(colors.green)("\n[Processed Files]")); |
| 113 | for (const result of succeededResults) { |
| 114 | const displayPath = |
| 115 | result.pathPattern?.replace("[locale]", result.targetLocale) || |
| 116 | "unknown"; |
| 117 | console.log( |
| 118 | ` ✓ ${chalk.dim(displayPath)} ${chalk.hex(colors.yellow)(`(${result.sourceLocale} → ${result.targetLocale})`)}`, |
| 119 | ); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | // Show cached files |
| 124 | if (skippedResults.length > 0) { |
| 125 | console.log(chalk.hex(colors.blue)("\n[Cached Files]")); |
| 126 | for (const result of skippedResults) { |
| 127 | const displayPath = |
| 128 | result.pathPattern?.replace("[locale]", result.targetLocale) || |
| 129 | "unknown"; |
| 130 | console.log( |
| 131 | ` ⚡ ${chalk.dim(displayPath)} ${chalk.hex(colors.yellow)(`(${result.sourceLocale} → ${result.targetLocale})`)}`, |
| 132 | ); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | // Show failed files |
| 137 | if (failedResults.length > 0) { |
| 138 | console.log(chalk.hex(colors.orange)("\n[Failed Files]")); |
| 139 | for (const result of failedResults) { |
| 140 | const displayPath = |
| 141 | result.pathPattern?.replace("[locale]", result.targetLocale) || |
| 142 | "unknown"; |
| 143 | console.log( |
| 144 | ` ❌ ${chalk.dim(displayPath)} ${chalk.hex(colors.yellow)(`(${result.sourceLocale} → ${result.targetLocale})`)}`, |
| 145 | ); |
| 146 | console.log( |
no test coverage detected