gh-manager-cli 1.10.4 → 1.10.5
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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.10.5](https://github.com/wiiiimm/gh-manager-cli/compare/v1.10.4...v1.10.5) (2025-09-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* prevent duplicate modal handlers and improve modal UI ([79281d3](https://github.com/wiiiimm/gh-manager-cli/commit/79281d34fe42d3345885cad257e6800e94eb2bb3))
|
|
7
|
+
|
|
1
8
|
## [1.10.4](https://github.com/wiiiimm/gh-manager-cli/compare/v1.10.3...v1.10.4) (2025-09-01)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -668,19 +668,6 @@ async function syncForkWithUpstream(token, owner, repo, branch = "main") {
|
|
|
668
668
|
const body = await res.json();
|
|
669
669
|
return body;
|
|
670
670
|
}
|
|
671
|
-
if (res.status === 422) {
|
|
672
|
-
try {
|
|
673
|
-
const body = await res.json();
|
|
674
|
-
if (body && body.message && body.message.includes("There was a problem updating the branch")) {
|
|
675
|
-
return {
|
|
676
|
-
message: "Sync completed (with warnings)",
|
|
677
|
-
merge_type: "merge",
|
|
678
|
-
base_branch: branch
|
|
679
|
-
};
|
|
680
|
-
}
|
|
681
|
-
} catch {
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
671
|
let msg = `Fork sync failed (status ${res.status})`;
|
|
685
672
|
try {
|
|
686
673
|
const body = await res.json();
|
|
@@ -689,6 +676,9 @@ async function syncForkWithUpstream(token, owner, repo, branch = "main") {
|
|
|
689
676
|
if (res.status === 409) {
|
|
690
677
|
msg += " (conflicts detected - manual merge required)";
|
|
691
678
|
}
|
|
679
|
+
if (res.status === 422) {
|
|
680
|
+
msg += " (branch could not be synced)";
|
|
681
|
+
}
|
|
692
682
|
}
|
|
693
683
|
} catch {
|
|
694
684
|
}
|
package/dist/index.js
CHANGED
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
updateCacheAfterArchive,
|
|
17
17
|
updateCacheAfterDelete,
|
|
18
18
|
updateCacheWithRepository
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-XCFI3TG5.js";
|
|
20
20
|
|
|
21
21
|
// package.json
|
|
22
22
|
var require_package = __commonJS({
|
|
23
23
|
"package.json"(exports, module) {
|
|
24
24
|
module.exports = {
|
|
25
25
|
name: "gh-manager-cli",
|
|
26
|
-
version: "1.10.
|
|
26
|
+
version: "1.10.5",
|
|
27
27
|
private: false,
|
|
28
28
|
description: "Interactive CLI to manage your GitHub repos (personal) with Ink",
|
|
29
29
|
license: "MIT",
|
|
@@ -279,7 +279,7 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
|
|
|
279
279
|
const loadOrgs = async () => {
|
|
280
280
|
try {
|
|
281
281
|
setLoading(true);
|
|
282
|
-
const client = await import("./github-
|
|
282
|
+
const client = await import("./github-6IFMCQKW.js").then((m) => m.makeClient(token));
|
|
283
283
|
const orgs = await fetchViewerOrganizations(client);
|
|
284
284
|
setOrganizations(orgs);
|
|
285
285
|
if (!isPersonalContext) {
|
|
@@ -546,6 +546,27 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
546
546
|
setSyncError(e.message || "Failed to sync fork. Check permissions and network.");
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
+
async function executeArchive() {
|
|
550
|
+
if (!archiveTarget || archiving) return;
|
|
551
|
+
try {
|
|
552
|
+
setArchiving(true);
|
|
553
|
+
const isArchived = archiveTarget.isArchived;
|
|
554
|
+
const id = archiveTarget.id;
|
|
555
|
+
if (isArchived) {
|
|
556
|
+
await unarchiveRepositoryById(client, id);
|
|
557
|
+
} else {
|
|
558
|
+
await archiveRepositoryById(client, id);
|
|
559
|
+
}
|
|
560
|
+
await updateCacheAfterArchive(token, id, !isArchived);
|
|
561
|
+
const updateRepo = (r) => r.id === id ? { ...r, isArchived: !isArchived } : r;
|
|
562
|
+
setItems((prev) => prev.map(updateRepo));
|
|
563
|
+
setSearchItems((prev) => prev.map(updateRepo));
|
|
564
|
+
closeArchiveModal();
|
|
565
|
+
} catch (e) {
|
|
566
|
+
setArchiving(false);
|
|
567
|
+
setArchiveError("Failed to update archive state. Check permissions.");
|
|
568
|
+
}
|
|
569
|
+
}
|
|
549
570
|
function handleOrgContextChange(newContext) {
|
|
550
571
|
setOwnerContext(newContext);
|
|
551
572
|
storeUIPrefs({ ownerContext: newContext });
|
|
@@ -836,13 +857,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
836
857
|
setConfirmFocus("cancel");
|
|
837
858
|
return;
|
|
838
859
|
}
|
|
839
|
-
if (key.return) {
|
|
840
|
-
if (confirmFocus === "delete") confirmDeleteNow();
|
|
841
|
-
else cancelDeleteModal();
|
|
842
|
-
return;
|
|
843
|
-
}
|
|
844
860
|
if (input && input.toUpperCase() === "Y") {
|
|
845
|
-
|
|
861
|
+
if (confirmFocus === "delete") {
|
|
862
|
+
confirmDeleteNow();
|
|
863
|
+
} else {
|
|
864
|
+
cancelDeleteModal();
|
|
865
|
+
}
|
|
846
866
|
return;
|
|
847
867
|
}
|
|
848
868
|
}
|
|
@@ -861,29 +881,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
861
881
|
setArchiveFocus("cancel");
|
|
862
882
|
return;
|
|
863
883
|
}
|
|
864
|
-
if (
|
|
884
|
+
if (input && input.toUpperCase() === "Y") {
|
|
865
885
|
if (archiveFocus === "cancel") {
|
|
866
886
|
closeArchiveModal();
|
|
867
887
|
return;
|
|
868
888
|
}
|
|
869
|
-
|
|
870
|
-
(async () => {
|
|
871
|
-
try {
|
|
872
|
-
setArchiving(true);
|
|
873
|
-
const isArchived = archiveTarget.isArchived;
|
|
874
|
-
const id = archiveTarget.id;
|
|
875
|
-
if (isArchived) await unarchiveRepositoryById(client, id);
|
|
876
|
-
else await archiveRepositoryById(client, id);
|
|
877
|
-
await updateCacheAfterArchive(token, id, !isArchived);
|
|
878
|
-
const updateRepo = (r) => r.id === id ? { ...r, isArchived: !isArchived } : r;
|
|
879
|
-
setItems((prev) => prev.map(updateRepo));
|
|
880
|
-
setSearchItems((prev) => prev.map(updateRepo));
|
|
881
|
-
closeArchiveModal();
|
|
882
|
-
} catch (e) {
|
|
883
|
-
setArchiving(false);
|
|
884
|
-
setArchiveError("Failed to update archive state. Check permissions.");
|
|
885
|
-
}
|
|
886
|
-
})();
|
|
889
|
+
executeArchive();
|
|
887
890
|
return;
|
|
888
891
|
}
|
|
889
892
|
return;
|
|
@@ -909,9 +912,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
909
912
|
}
|
|
910
913
|
return;
|
|
911
914
|
}
|
|
912
|
-
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
915
|
+
return;
|
|
915
916
|
}
|
|
916
917
|
if (logoutMode) {
|
|
917
918
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
@@ -1366,7 +1367,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1366
1367
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs5(Text6, { color: "gray", children: [
|
|
1367
1368
|
"Press Enter to ",
|
|
1368
1369
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
1369
|
-
"
|
|
1370
|
+
" | Y to Delete | C to Cancel"
|
|
1370
1371
|
] }) }),
|
|
1371
1372
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, children: /* @__PURE__ */ jsx6(
|
|
1372
1373
|
TextInput2,
|
|
@@ -1422,7 +1423,9 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1422
1423
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs5(Text6, { color: "gray", children: [
|
|
1423
1424
|
"Press Enter to ",
|
|
1424
1425
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
1425
|
-
"
|
|
1426
|
+
" | Y to ",
|
|
1427
|
+
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
1428
|
+
" | C to Cancel"
|
|
1426
1429
|
] }) }),
|
|
1427
1430
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, children: /* @__PURE__ */ jsx6(
|
|
1428
1431
|
TextInput2,
|
|
@@ -1432,23 +1435,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1432
1435
|
},
|
|
1433
1436
|
onSubmit: () => {
|
|
1434
1437
|
if (archiveFocus === "confirm") {
|
|
1435
|
-
(
|
|
1436
|
-
try {
|
|
1437
|
-
setArchiving(true);
|
|
1438
|
-
const isArchived = archiveTarget.isArchived;
|
|
1439
|
-
const id = archiveTarget.id;
|
|
1440
|
-
if (isArchived) await unarchiveRepositoryById(client, id);
|
|
1441
|
-
else await archiveRepositoryById(client, id);
|
|
1442
|
-
await updateCacheAfterArchive(token, id, !isArchived);
|
|
1443
|
-
const updateRepo = (r) => r.id === id ? { ...r, isArchived: !isArchived } : r;
|
|
1444
|
-
setItems((prev) => prev.map(updateRepo));
|
|
1445
|
-
setSearchItems((prev) => prev.map(updateRepo));
|
|
1446
|
-
closeArchiveModal();
|
|
1447
|
-
} catch (e) {
|
|
1448
|
-
setArchiving(false);
|
|
1449
|
-
setArchiveError("Failed to update archive state. Check permissions.");
|
|
1450
|
-
}
|
|
1451
|
-
})();
|
|
1438
|
+
executeArchive();
|
|
1452
1439
|
} else {
|
|
1453
1440
|
closeArchiveModal();
|
|
1454
1441
|
}
|
|
@@ -1498,7 +1485,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1498
1485
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs5(Text6, { color: "gray", children: [
|
|
1499
1486
|
"Press Enter to ",
|
|
1500
1487
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
1501
|
-
"
|
|
1488
|
+
" | Y to Sync | C to Cancel"
|
|
1502
1489
|
] }) }),
|
|
1503
1490
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, children: /* @__PURE__ */ jsx6(
|
|
1504
1491
|
TextInput2,
|
|
@@ -1551,7 +1538,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1551
1538
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs5(Text6, { color: "gray", children: [
|
|
1552
1539
|
"Press Enter to ",
|
|
1553
1540
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
1554
|
-
"
|
|
1541
|
+
" | Y to Logout | C to Cancel"
|
|
1555
1542
|
] }) })
|
|
1556
1543
|
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx6(Box5, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx6(
|
|
1557
1544
|
OrgSwitcher,
|