bstack 1.2.0 → 1.2.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/bstack.mjs +14 -1
- package/package.json +1 -1
package/dist/bstack.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import * as v from "valibot";
|
|
|
6
6
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { dirname } from "node:path";
|
|
8
8
|
//#region package.json
|
|
9
|
-
var version = "1.2.
|
|
9
|
+
var version = "1.2.1";
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/command.ts
|
|
12
12
|
var CommandError = class extends Error {
|
|
@@ -457,6 +457,13 @@ var GitHubCliPlatform = class {
|
|
|
457
457
|
String(stackNumber)
|
|
458
458
|
]);
|
|
459
459
|
}
|
|
460
|
+
closePullRequest(pr) {
|
|
461
|
+
this.gh([
|
|
462
|
+
"pr",
|
|
463
|
+
"close",
|
|
464
|
+
String(pr.number)
|
|
465
|
+
]);
|
|
466
|
+
}
|
|
460
467
|
editPullRequestBase(pr, base) {
|
|
461
468
|
this.gh([
|
|
462
469
|
"pr",
|
|
@@ -770,6 +777,12 @@ function syncStack(dependencies, options) {
|
|
|
770
777
|
}), remote, options.draft);
|
|
771
778
|
} else if (transition.kind === "partial") reporter.progress("Updating this down-stack prefix while preserving higher pull requests");
|
|
772
779
|
else reporter.progress("The native GitHub stack already has the correct members");
|
|
780
|
+
const currentIds = new Set(changes.map((change) => change.id));
|
|
781
|
+
const omittedPullRequests = transition.kind === "partial" ? [] : (previous?.changes ?? []).filter((change) => !currentIds.has(change.id)).map((change) => github.pullRequest(change.pullRequest)).filter((pullRequest) => pullRequest.state === "OPEN");
|
|
782
|
+
if (omittedPullRequests.length > 0) {
|
|
783
|
+
reporter.progress(`Closing ${omittedPullRequests.length} omitted pull request${omittedPullRequests.length === 1 ? "" : "s"}`);
|
|
784
|
+
for (const pullRequest of omittedPullRequests) github.closePullRequest(pullRequest);
|
|
785
|
+
}
|
|
773
786
|
reporter.progress("Synchronizing pull request titles and descriptions");
|
|
774
787
|
for (const [index, pr] of pullRequests.entries()) {
|
|
775
788
|
github.editPullRequest(pr, changes[index]);
|