@colrealpro/react-luau-doctor 0.20.2 → 0.20.3
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/CHANGELOG.md +7 -0
- package/dist/cli.js +23 -6
- package/dist/cli.js.map +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ var package_default = {
|
|
|
11
11
|
publishConfig: {
|
|
12
12
|
access: "public"
|
|
13
13
|
},
|
|
14
|
-
version: "0.20.
|
|
14
|
+
version: "0.20.3",
|
|
15
15
|
description: "Static analysis for React-Luau hooks, effects, rendering, and performance.",
|
|
16
16
|
license: "MIT",
|
|
17
17
|
type: "module",
|
|
@@ -9464,10 +9464,10 @@ No eligible React-Luau files changed in this pull request \xB7 scan skipped`;
|
|
|
9464
9464
|
baseline: true
|
|
9465
9465
|
}
|
|
9466
9466
|
];
|
|
9467
|
-
const inlineNote = options.inlineCount > 0 ? "See inline comments for fixes" : "
|
|
9467
|
+
const inlineNote = total > 0 && options.inlineCount > 0 ? " \xB7 See inline comments for fixes" : "";
|
|
9468
9468
|
const footer = `
|
|
9469
9469
|
|
|
9470
|
-
<sub>Reviewed by [React-Luau Doctor](https://github.com/ColRealPro/react-luau-doctor)` + ` for commit ${inlineCode(options.sha.slice(0, 7))}
|
|
9470
|
+
<sub>Reviewed by [React-Luau Doctor](https://github.com/ColRealPro/react-luau-doctor)` + ` for commit ${inlineCode(options.sha.slice(0, 7))}${inlineNote}</sub>
|
|
9471
9471
|
`;
|
|
9472
9472
|
const reportLink = options.runUrl ? `[the full workflow report](${options.runUrl})` : "the workflow summary and logs";
|
|
9473
9473
|
const overflow = `
|
|
@@ -14735,12 +14735,29 @@ ${JSON.stringify({ ...report, fixedDiagnostics: fixed })}
|
|
|
14735
14735
|
await publishSummary();
|
|
14736
14736
|
if (settings.reviewComments && snapshot && base && !stale) {
|
|
14737
14737
|
try {
|
|
14738
|
+
const reviewBase = event.action === "synchronize" ? event.before : base;
|
|
14739
|
+
if (event.action === "synchronize" && (!reviewBase || !/^[a-f0-9]{40}$/i.test(reviewBase) || gitResult(scan.repoRoot, ["merge-base", "--is-ancestor", reviewBase, head]) === null)) {
|
|
14740
|
+
throw new Error("Previous PR head is unavailable or history was rewritten; new inline comments were skipped");
|
|
14741
|
+
}
|
|
14738
14742
|
const lines = createGitScopePlan(path11.resolve(settings.directory), {
|
|
14739
14743
|
scope: "lines",
|
|
14740
|
-
base
|
|
14744
|
+
base: reviewBase
|
|
14741
14745
|
}).changedLines;
|
|
14746
|
+
const canInline = (diagnostic) => (lines.get(diagnostic.file) ?? []).some((range) => diagnostic.location.line >= range.start && diagnostic.location.line <= range.end);
|
|
14747
|
+
let introduced = !event.action || event.action === "opened" ? analysis.introduced : [];
|
|
14748
|
+
if (analysis.complete && event.action === "synchronize" && analysis.introduced.some(({ diagnostic }) => canInline(diagnostic))) {
|
|
14749
|
+
const update = await scanForCi({ ...settings, scope: "changed" }, true, reviewBase, head);
|
|
14750
|
+
if (!update.analysis.complete) {
|
|
14751
|
+
throw new Error("Previous PR head analysis was incomplete; new inline comments were skipped");
|
|
14752
|
+
}
|
|
14753
|
+
const fresh = new Set(update.comparison.diagnostics.map((diagnostic) => diagnostic.file + "\x00" + diagnostic.id));
|
|
14754
|
+
introduced = analysis.introduced.filter(({ diagnostic }) => fresh.has(diagnostic.file + "\x00" + diagnostic.id));
|
|
14755
|
+
}
|
|
14742
14756
|
const latestSnapshot = await reviewSnapshot(client);
|
|
14743
|
-
inlineCount = await reconcileReviews(client, latestSnapshot,
|
|
14757
|
+
inlineCount = await reconcileReviews(client, latestSnapshot, {
|
|
14758
|
+
...analysis,
|
|
14759
|
+
introduced
|
|
14760
|
+
}, canInline);
|
|
14744
14761
|
} catch (error) {
|
|
14745
14762
|
stale ||= error instanceof StalePublication;
|
|
14746
14763
|
process.stderr.write(`react-luau-doctor: could not update inline review comments: ${errorMessage(error)}
|
|
@@ -16704,5 +16721,5 @@ ${renderUpdateNotice(update.current, update.latest, colorized)}
|
|
|
16704
16721
|
}
|
|
16705
16722
|
main();
|
|
16706
16723
|
|
|
16707
|
-
//# debugId=
|
|
16724
|
+
//# debugId=1B34073C2F3EACBB64756E2164756E21
|
|
16708
16725
|
//# sourceMappingURL=cli.js.map
|