@staff0rd/assist 0.645.0 → 0.646.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/README.md +1 -1
- package/dist/commands/sessions/web/bundle.js +410 -406
- package/dist/index.js +11 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.646.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -25850,12 +25850,14 @@ function validateLine(line) {
|
|
|
25850
25850
|
process.exit(1);
|
|
25851
25851
|
}
|
|
25852
25852
|
}
|
|
25853
|
-
async function comment2(path91, line, body,
|
|
25853
|
+
async function comment2(path91, line, body, options2 = {}) {
|
|
25854
|
+
const { startLine, skipPreview } = options2;
|
|
25854
25855
|
validateBody(body);
|
|
25855
25856
|
validateLine(line);
|
|
25856
25857
|
if (startLine !== void 0) validateLine(startLine);
|
|
25857
25858
|
const range = startLine !== void 0 ? `${startLine}-${line}` : `${line}`;
|
|
25858
|
-
|
|
25859
|
+
if (!skipPreview)
|
|
25860
|
+
await reviewProposedPrComment(`Comment on ${path91}:${range}`, body, null);
|
|
25859
25861
|
try {
|
|
25860
25862
|
const prId = getCurrentPrNodeId();
|
|
25861
25863
|
postReviewComment({ prId, body, path: path91, line, startLine });
|
|
@@ -30029,13 +30031,16 @@ function buildCommentBody(finding) {
|
|
|
30029
30031
|
lines2.push("", `Recommendation: ${finding.recommendation}`);
|
|
30030
30032
|
return sanitiseReviewerNames(lines2.join("\n"));
|
|
30031
30033
|
}
|
|
30032
|
-
function postFindings(findings) {
|
|
30034
|
+
async function postFindings(findings) {
|
|
30033
30035
|
let posted = 0;
|
|
30034
30036
|
let failed2 = 0;
|
|
30035
30037
|
for (const finding of findings) {
|
|
30036
30038
|
const body = buildCommentBody(finding);
|
|
30037
30039
|
try {
|
|
30038
|
-
comment2(finding.file, finding.line, body,
|
|
30040
|
+
await comment2(finding.file, finding.line, body, {
|
|
30041
|
+
startLine: finding.startLine,
|
|
30042
|
+
skipPreview: true
|
|
30043
|
+
});
|
|
30039
30044
|
posted++;
|
|
30040
30045
|
} catch (error) {
|
|
30041
30046
|
failed2++;
|
|
@@ -30094,7 +30099,7 @@ async function decideSubmit(options2) {
|
|
|
30094
30099
|
}
|
|
30095
30100
|
}
|
|
30096
30101
|
async function postAndMaybeSubmit(lineBound, unanchored, markdown, options2) {
|
|
30097
|
-
const result = postFindings(lineBound);
|
|
30102
|
+
const result = await postFindings(lineBound);
|
|
30098
30103
|
const failedSuffix = result.failed > 0 ? `, ${result.failed} failed` : "";
|
|
30099
30104
|
console.log(`Posted ${result.posted} comment(s)${failedSuffix}.`);
|
|
30100
30105
|
const carried = carriedUnanchoredFindings(unanchored);
|