@caliber-ai/cli 0.21.0 → 0.21.1
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/bin.js +13 -14
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1997,25 +1997,24 @@ function openReview(method, stagedFiles) {
|
|
|
1997
1997
|
console.log(chalk3.dim(" Diffs opened in your editor.\n"));
|
|
1998
1998
|
} else {
|
|
1999
1999
|
for (const file of stagedFiles) {
|
|
2000
|
-
console.log(chalk3.bold(` ${file.relativePath}`));
|
|
2001
2000
|
if (file.currentPath) {
|
|
2002
|
-
const
|
|
2003
|
-
const
|
|
2004
|
-
const patch = createTwoFilesPatch(file.relativePath, file.relativePath,
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2001
|
+
const currentLines = fs17.readFileSync(file.currentPath, "utf-8").split("\n");
|
|
2002
|
+
const proposedLines = fs17.readFileSync(file.proposedPath, "utf-8").split("\n");
|
|
2003
|
+
const patch = createTwoFilesPatch(file.relativePath, file.relativePath, currentLines.join("\n"), proposedLines.join("\n"));
|
|
2004
|
+
let added = 0, removed = 0;
|
|
2005
|
+
for (const line of patch.split("\n")) {
|
|
2006
|
+
if (line.startsWith("+") && !line.startsWith("+++")) added++;
|
|
2007
|
+
if (line.startsWith("-") && !line.startsWith("---")) removed++;
|
|
2009
2008
|
}
|
|
2009
|
+
console.log(` ${chalk3.yellow("~")} ${file.relativePath} ${chalk3.green(`+${added}`)} ${chalk3.red(`-${removed}`)}`);
|
|
2010
2010
|
} else {
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
const preview = content.split("\n").slice(0, 20);
|
|
2014
|
-
for (const line of preview) console.log(chalk3.green(` +${line}`));
|
|
2015
|
-
if (content.split("\n").length > 20) console.log(chalk3.dim(` ... ${content.split("\n").length - 20} more lines`));
|
|
2011
|
+
const lines = fs17.readFileSync(file.proposedPath, "utf-8").split("\n").length;
|
|
2012
|
+
console.log(` ${chalk3.green("+")} ${file.relativePath} ${chalk3.dim(`${lines} lines`)}`);
|
|
2016
2013
|
}
|
|
2017
|
-
console.log("");
|
|
2018
2014
|
}
|
|
2015
|
+
console.log("");
|
|
2016
|
+
console.log(chalk3.dim(` Files staged at .caliber/staged/ for manual inspection.
|
|
2017
|
+
`));
|
|
2019
2018
|
}
|
|
2020
2019
|
}
|
|
2021
2020
|
async function promptReviewAction() {
|