conare 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1854,6 +1854,16 @@ function printFailureSummary(results, memories) {
|
|
|
1854
1854
|
console.log(` - ... and ${failures.length - 3} more`);
|
|
1855
1855
|
}
|
|
1856
1856
|
}
|
|
1857
|
+
function renderProgressSummary(success, failed, noun) {
|
|
1858
|
+
const total = success + failed;
|
|
1859
|
+
const barWidth = 20;
|
|
1860
|
+
const ratio = total === 0 ? 1 : success / total;
|
|
1861
|
+
const pct = (ratio * 100).toFixed(1);
|
|
1862
|
+
const filled = Math.round(ratio * barWidth);
|
|
1863
|
+
const bar = "█".repeat(filled) + "░".repeat(barWidth - filled);
|
|
1864
|
+
return `\r \x1B[32m✓\x1B[0m [\x1B[36m${bar}\x1B[0m] ${success} ${noun}, ${failed} failed (${pct}%)${" ".repeat(12)}
|
|
1865
|
+
`;
|
|
1866
|
+
}
|
|
1857
1867
|
function parseArgs() {
|
|
1858
1868
|
const args = process.argv.slice(2);
|
|
1859
1869
|
let key = "";
|
|
@@ -2035,8 +2045,7 @@ Nothing new to index.`);
|
|
|
2035
2045
|
const bar = "█".repeat(filled) + "░".repeat(barWidth - filled);
|
|
2036
2046
|
process.stdout.write(`\r Uploading [\x1B[36m${bar}\x1B[0m] ${uploaded}/${total} (${pct}%)`);
|
|
2037
2047
|
});
|
|
2038
|
-
process.stdout.write(
|
|
2039
|
-
`);
|
|
2048
|
+
process.stdout.write(renderProgressSummary(success, failed, "indexed"));
|
|
2040
2049
|
const fileHashes = results.filter((result) => result.success).map((result) => getDedupKey(memories[result.index])).filter((key) => !!key);
|
|
2041
2050
|
markIngested("codebase", fileHashes);
|
|
2042
2051
|
printFailureSummary(results, memories);
|
|
@@ -2114,8 +2123,7 @@ Nothing new to index.`);
|
|
|
2114
2123
|
const bar = "█".repeat(filled) + "░".repeat(barWidth - filled);
|
|
2115
2124
|
process.stdout.write(`\r Uploading [\x1B[33m${bar}\x1B[0m] ${uploaded}/${total} (${pct}%)`);
|
|
2116
2125
|
});
|
|
2117
|
-
process.stdout.write(
|
|
2118
|
-
`);
|
|
2126
|
+
process.stdout.write(renderProgressSummary(success, failed, "uploaded"));
|
|
2119
2127
|
if (failed > 0) {
|
|
2120
2128
|
console.log(` Re-run with --force to retry failed memories.`);
|
|
2121
2129
|
}
|
|
@@ -2191,8 +2199,7 @@ Nothing new to index.`);
|
|
|
2191
2199
|
const bar = "█".repeat(filled) + "░".repeat(barWidth - filled);
|
|
2192
2200
|
process.stdout.write(`\r Uploading [\x1B[36m${bar}\x1B[0m] ${uploaded}/${total} (${pct}%)`);
|
|
2193
2201
|
});
|
|
2194
|
-
process.stdout.write(
|
|
2195
|
-
`);
|
|
2202
|
+
process.stdout.write(renderProgressSummary(success, failed, "indexed"));
|
|
2196
2203
|
const fileHashes = results.filter((result) => result.success).map((result) => getDedupKey(memories[result.index])).filter((key) => !!key);
|
|
2197
2204
|
markIngested("codebase", fileHashes);
|
|
2198
2205
|
printFailureSummary(results, memories);
|