gh-manager-cli 1.21.0 → 1.23.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/CHANGELOG.md +2 -9
- package/README.md +5 -15
- package/dist/{chunk-RI2B33OX.js → chunk-GFBV3TQA.js} +26 -41
- package/dist/{github-ERXQNAVD.js → github-O7QMBYSD.js} +3 -5
- package/dist/index.js +408 -768
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
changeRepositoryVisibility,
|
|
7
7
|
checkOrganizationIsEnterprise,
|
|
8
8
|
deleteRepositoryRest,
|
|
9
|
+
fetchRestRateLimits,
|
|
9
10
|
fetchViewerOrganizations,
|
|
10
11
|
fetchViewerReposPageUnified,
|
|
11
12
|
getRepositoryFromCache,
|
|
@@ -14,23 +15,21 @@ import {
|
|
|
14
15
|
logger,
|
|
15
16
|
makeClient,
|
|
16
17
|
purgeApolloCacheFiles,
|
|
17
|
-
renameRepositoryById,
|
|
18
18
|
searchRepositoriesUnified,
|
|
19
19
|
syncForkWithUpstream,
|
|
20
20
|
unarchiveRepositoryById,
|
|
21
21
|
updateCacheAfterArchive,
|
|
22
22
|
updateCacheAfterDelete,
|
|
23
|
-
updateCacheAfterRename,
|
|
24
23
|
updateCacheAfterVisibilityChange,
|
|
25
24
|
updateCacheWithRepository
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GFBV3TQA.js";
|
|
27
26
|
|
|
28
27
|
// package.json
|
|
29
28
|
var require_package = __commonJS({
|
|
30
29
|
"package.json"(exports, module) {
|
|
31
30
|
module.exports = {
|
|
32
31
|
name: "gh-manager-cli",
|
|
33
|
-
version: "1.
|
|
32
|
+
version: "1.23.0",
|
|
34
33
|
private: false,
|
|
35
34
|
description: "Interactive CLI to manage your GitHub repos (personal) with Ink",
|
|
36
35
|
license: "MIT",
|
|
@@ -76,7 +75,6 @@ var require_package = __commonJS({
|
|
|
76
75
|
"@octokit/graphql": "^9.0.1",
|
|
77
76
|
"apollo3-cache-persist": "^0.14.1",
|
|
78
77
|
chalk: "^5.6.0",
|
|
79
|
-
clipboardy: "^4.0.0",
|
|
80
78
|
dotenv: "^17.2.1",
|
|
81
79
|
"env-paths": "^3.0.0",
|
|
82
80
|
graphql: "^16.11.0",
|
|
@@ -156,13 +154,13 @@ var require_package = __commonJS({
|
|
|
156
154
|
|
|
157
155
|
// src/index.tsx
|
|
158
156
|
var import_package = __toESM(require_package(), 1);
|
|
159
|
-
import { render, Box as
|
|
157
|
+
import { render, Box as Box17, Text as Text18 } from "ink";
|
|
160
158
|
import "dotenv/config";
|
|
161
159
|
|
|
162
160
|
// src/ui/App.tsx
|
|
163
|
-
import { useEffect as
|
|
164
|
-
import { Box as
|
|
165
|
-
import
|
|
161
|
+
import { useEffect as useEffect8, useMemo as useMemo2, useState as useState12 } from "react";
|
|
162
|
+
import { Box as Box16, Text as Text17, useApp as useApp2, useStdout as useStdout2, useInput as useInput12 } from "ink";
|
|
163
|
+
import TextInput5 from "ink-text-input";
|
|
166
164
|
|
|
167
165
|
// src/config.ts
|
|
168
166
|
import fs from "fs";
|
|
@@ -407,10 +405,10 @@ async function openGitHubAuthorizationPage() {
|
|
|
407
405
|
}
|
|
408
406
|
|
|
409
407
|
// src/ui/RepoList.tsx
|
|
410
|
-
import
|
|
411
|
-
import { Box as
|
|
412
|
-
import
|
|
413
|
-
import
|
|
408
|
+
import React10, { useEffect as useEffect7, useMemo, useState as useState10, useRef, useCallback } from "react";
|
|
409
|
+
import { Box as Box13, Text as Text14, useApp, useInput as useInput10, useStdout } from "ink";
|
|
410
|
+
import TextInput4 from "ink-text-input";
|
|
411
|
+
import chalk11 from "chalk";
|
|
414
412
|
|
|
415
413
|
// src/apolloMeta.ts
|
|
416
414
|
import fs2 from "fs";
|
|
@@ -488,7 +486,7 @@ function OrgSwitcher({ token, currentContext, onSelect, onClose }) {
|
|
|
488
486
|
try {
|
|
489
487
|
setLoading(true);
|
|
490
488
|
setError(null);
|
|
491
|
-
const client = await import("./github-
|
|
489
|
+
const client = await import("./github-O7QMBYSD.js").then((m) => m.makeClient(token));
|
|
492
490
|
const orgs = await fetchViewerOrganizations(client);
|
|
493
491
|
setOrganizations(orgs);
|
|
494
492
|
const entOrgs = /* @__PURE__ */ new Set();
|
|
@@ -639,51 +637,6 @@ function formatDate(dateStr) {
|
|
|
639
637
|
if (diffDays < 365) return `${Math.floor(diffDays / 30)} months ago`;
|
|
640
638
|
return `${Math.floor(diffDays / 365)} years ago`;
|
|
641
639
|
}
|
|
642
|
-
async function copyToClipboard(text) {
|
|
643
|
-
try {
|
|
644
|
-
const clipboardy = await import("clipboardy");
|
|
645
|
-
await clipboardy.write(text);
|
|
646
|
-
return;
|
|
647
|
-
} catch (error) {
|
|
648
|
-
const { spawn } = await import("child_process");
|
|
649
|
-
const { promisify } = await import("util");
|
|
650
|
-
const spawnCommand = (command, args = []) => {
|
|
651
|
-
return new Promise((resolve, reject) => {
|
|
652
|
-
const child = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"] });
|
|
653
|
-
child.stdin.write(text);
|
|
654
|
-
child.stdin.end();
|
|
655
|
-
child.on("close", (code) => {
|
|
656
|
-
if (code === 0) {
|
|
657
|
-
resolve();
|
|
658
|
-
} else {
|
|
659
|
-
reject(new Error(`Command failed with code ${code}`));
|
|
660
|
-
}
|
|
661
|
-
});
|
|
662
|
-
child.on("error", reject);
|
|
663
|
-
});
|
|
664
|
-
};
|
|
665
|
-
try {
|
|
666
|
-
const platform = process.platform;
|
|
667
|
-
if (platform === "darwin") {
|
|
668
|
-
await spawnCommand("pbcopy");
|
|
669
|
-
} else if (platform === "win32") {
|
|
670
|
-
await spawnCommand("clip");
|
|
671
|
-
} else {
|
|
672
|
-
try {
|
|
673
|
-
await spawnCommand("xclip", ["-selection", "clipboard"]);
|
|
674
|
-
} catch {
|
|
675
|
-
try {
|
|
676
|
-
await spawnCommand("xsel", ["--clipboard", "--input"]);
|
|
677
|
-
} catch {
|
|
678
|
-
await spawnCommand("wl-copy");
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
} catch (osError) {
|
|
683
|
-
throw new Error(`Failed to copy to clipboard. Please install a clipboard utility for your system.`);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
640
|
|
|
688
641
|
// src/ui/components/modals/InfoModal.tsx
|
|
689
642
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -1147,228 +1100,10 @@ var ChangeVisibilityModal = ({
|
|
|
1147
1100
|
);
|
|
1148
1101
|
};
|
|
1149
1102
|
|
|
1150
|
-
// src/ui/components/modals/RenameModal.tsx
|
|
1151
|
-
import { useState as useState10, useEffect as useEffect7 } from "react";
|
|
1152
|
-
import { Box as Box10, Text as Text11, useInput as useInput10 } from "ink";
|
|
1153
|
-
import TextInput3 from "ink-text-input";
|
|
1154
|
-
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1155
|
-
function RenameModal({ repo, onRename, onCancel }) {
|
|
1156
|
-
const [newName, setNewName] = useState10("");
|
|
1157
|
-
const [renaming, setRenaming] = useState10(false);
|
|
1158
|
-
const [renameError, setRenameError] = useState10(null);
|
|
1159
|
-
useEffect7(() => {
|
|
1160
|
-
if (repo) {
|
|
1161
|
-
setNewName(repo.name);
|
|
1162
|
-
setRenameError(null);
|
|
1163
|
-
}
|
|
1164
|
-
}, [repo]);
|
|
1165
|
-
useInput10((input, key) => {
|
|
1166
|
-
if (renaming) return;
|
|
1167
|
-
if (key.escape) {
|
|
1168
|
-
onCancel();
|
|
1169
|
-
return;
|
|
1170
|
-
}
|
|
1171
|
-
if (key.return) {
|
|
1172
|
-
if (newName.trim() && newName !== repo?.name) {
|
|
1173
|
-
handleRenameConfirm();
|
|
1174
|
-
}
|
|
1175
|
-
return;
|
|
1176
|
-
}
|
|
1177
|
-
});
|
|
1178
|
-
const handleRenameConfirm = async () => {
|
|
1179
|
-
if (!repo || renaming || !newName.trim() || newName === repo.name) return;
|
|
1180
|
-
try {
|
|
1181
|
-
setRenaming(true);
|
|
1182
|
-
setRenameError(null);
|
|
1183
|
-
await onRename(repo, newName.trim());
|
|
1184
|
-
} catch (e) {
|
|
1185
|
-
setRenameError(e.message || "Failed to rename repository");
|
|
1186
|
-
setRenaming(false);
|
|
1187
|
-
}
|
|
1188
|
-
};
|
|
1189
|
-
const handleNameChange = (value) => {
|
|
1190
|
-
const filtered = value.replace(/[^a-zA-Z0-9\-_.]/g, "");
|
|
1191
|
-
setNewName(filtered);
|
|
1192
|
-
};
|
|
1193
|
-
if (!repo) return null;
|
|
1194
|
-
const owner = repo.nameWithOwner.split("/")[0];
|
|
1195
|
-
const isDisabled = !newName.trim() || newName === repo.name;
|
|
1196
|
-
return /* @__PURE__ */ jsxs10(
|
|
1197
|
-
Box10,
|
|
1198
|
-
{
|
|
1199
|
-
flexDirection: "column",
|
|
1200
|
-
borderStyle: "round",
|
|
1201
|
-
borderColor: "cyan",
|
|
1202
|
-
paddingX: 3,
|
|
1203
|
-
paddingY: 2,
|
|
1204
|
-
width: 80,
|
|
1205
|
-
children: [
|
|
1206
|
-
/* @__PURE__ */ jsx11(Text11, { bold: true, color: "cyan", children: "Rename Repository" }),
|
|
1207
|
-
/* @__PURE__ */ jsx11(Box10, { height: 1, children: /* @__PURE__ */ jsx11(Text11, { children: " " }) }),
|
|
1208
|
-
/* @__PURE__ */ jsxs10(Text11, { color: "gray", children: [
|
|
1209
|
-
"Current: ",
|
|
1210
|
-
repo.nameWithOwner
|
|
1211
|
-
] }),
|
|
1212
|
-
/* @__PURE__ */ jsx11(Box10, { height: 1, children: /* @__PURE__ */ jsx11(Text11, { children: " " }) }),
|
|
1213
|
-
/* @__PURE__ */ jsx11(Text11, { children: "New name:" }),
|
|
1214
|
-
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "row", alignItems: "center", children: [
|
|
1215
|
-
/* @__PURE__ */ jsxs10(Text11, { children: [
|
|
1216
|
-
owner,
|
|
1217
|
-
"/"
|
|
1218
|
-
] }),
|
|
1219
|
-
/* @__PURE__ */ jsx11(
|
|
1220
|
-
TextInput3,
|
|
1221
|
-
{
|
|
1222
|
-
value: newName,
|
|
1223
|
-
onChange: handleNameChange,
|
|
1224
|
-
placeholder: repo.name,
|
|
1225
|
-
focus: !renaming
|
|
1226
|
-
}
|
|
1227
|
-
)
|
|
1228
|
-
] }),
|
|
1229
|
-
renaming ? /* @__PURE__ */ jsx11(Box10, { marginTop: 2, justifyContent: "center", children: /* @__PURE__ */ jsxs10(Box10, { flexDirection: "row", children: [
|
|
1230
|
-
/* @__PURE__ */ jsx11(Box10, { marginRight: 1, children: /* @__PURE__ */ jsx11(SlowSpinner, {}) }),
|
|
1231
|
-
/* @__PURE__ */ jsx11(Text11, { color: "cyan", children: "Renaming repository..." })
|
|
1232
|
-
] }) }) : /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
1233
|
-
/* @__PURE__ */ jsx11(Box10, { marginTop: 2, children: /* @__PURE__ */ jsx11(Text11, { color: "gray", children: isDisabled ? "Enter a different name to rename" : `Press Enter to rename to "${newName}"` }) }),
|
|
1234
|
-
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: "gray", children: "Press Esc to cancel" }) })
|
|
1235
|
-
] }),
|
|
1236
|
-
renameError && /* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: "red", children: renameError }) })
|
|
1237
|
-
]
|
|
1238
|
-
}
|
|
1239
|
-
);
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
// src/ui/components/modals/CopyUrlModal.tsx
|
|
1243
|
-
import { useState as useState11 } from "react";
|
|
1244
|
-
import { Box as Box11, Text as Text12, useInput as useInput11 } from "ink";
|
|
1245
|
-
import chalk10 from "chalk";
|
|
1246
|
-
import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1247
|
-
function CopyUrlModal({ repo, terminalWidth, onClose, onCopy }) {
|
|
1248
|
-
const [copyError, setCopyError] = useState11(null);
|
|
1249
|
-
const [selectedType, setSelectedType] = useState11("SSH");
|
|
1250
|
-
const urlTypes = ["SSH", "HTTPS"];
|
|
1251
|
-
useInput11((input, key) => {
|
|
1252
|
-
if (!repo) return;
|
|
1253
|
-
const ch = input?.toLowerCase();
|
|
1254
|
-
if (key.escape || ch === "c" || ch === "q") {
|
|
1255
|
-
onClose();
|
|
1256
|
-
return;
|
|
1257
|
-
}
|
|
1258
|
-
if (key.leftArrow || key.rightArrow) {
|
|
1259
|
-
const currentIndex = urlTypes.indexOf(selectedType);
|
|
1260
|
-
let newIndex;
|
|
1261
|
-
if (key.leftArrow) {
|
|
1262
|
-
newIndex = currentIndex === 0 ? urlTypes.length - 1 : currentIndex - 1;
|
|
1263
|
-
} else {
|
|
1264
|
-
newIndex = currentIndex === urlTypes.length - 1 ? 0 : currentIndex + 1;
|
|
1265
|
-
}
|
|
1266
|
-
setSelectedType(urlTypes[newIndex]);
|
|
1267
|
-
return;
|
|
1268
|
-
}
|
|
1269
|
-
if (key.upArrow) {
|
|
1270
|
-
setSelectedType("SSH");
|
|
1271
|
-
return;
|
|
1272
|
-
}
|
|
1273
|
-
if (key.downArrow) {
|
|
1274
|
-
setSelectedType("HTTPS");
|
|
1275
|
-
return;
|
|
1276
|
-
}
|
|
1277
|
-
if (key.return || ch === "y") {
|
|
1278
|
-
const sshUrl2 = `git@github.com:${repo.nameWithOwner}.git`;
|
|
1279
|
-
const httpsUrl2 = `https://github.com/${repo.nameWithOwner}.git`;
|
|
1280
|
-
const urlToCopy = selectedType === "SSH" ? sshUrl2 : httpsUrl2;
|
|
1281
|
-
handleCopy(urlToCopy, selectedType);
|
|
1282
|
-
return;
|
|
1283
|
-
}
|
|
1284
|
-
if (ch === "s") {
|
|
1285
|
-
const sshUrl2 = `git@github.com:${repo.nameWithOwner}.git`;
|
|
1286
|
-
handleCopy(sshUrl2, "SSH");
|
|
1287
|
-
return;
|
|
1288
|
-
}
|
|
1289
|
-
if (ch === "h") {
|
|
1290
|
-
const httpsUrl2 = `https://github.com/${repo.nameWithOwner}.git`;
|
|
1291
|
-
handleCopy(httpsUrl2, "HTTPS");
|
|
1292
|
-
return;
|
|
1293
|
-
}
|
|
1294
|
-
});
|
|
1295
|
-
if (!repo) {
|
|
1296
|
-
return /* @__PURE__ */ jsx12(Text12, { color: "red", children: "No repository selected." });
|
|
1297
|
-
}
|
|
1298
|
-
const sshUrl = `git@github.com:${repo.nameWithOwner}.git`;
|
|
1299
|
-
const httpsUrl = `https://github.com/${repo.nameWithOwner}.git`;
|
|
1300
|
-
const handleCopy = async (url, type) => {
|
|
1301
|
-
try {
|
|
1302
|
-
setCopyError(null);
|
|
1303
|
-
await onCopy(url, type);
|
|
1304
|
-
onClose();
|
|
1305
|
-
} catch (error) {
|
|
1306
|
-
const message = error instanceof Error ? error.message : String(error) || "Unknown error";
|
|
1307
|
-
setCopyError(`Failed to copy ${type} URL: ${message}`);
|
|
1308
|
-
}
|
|
1309
|
-
};
|
|
1310
|
-
return /* @__PURE__ */ jsxs11(
|
|
1311
|
-
Box11,
|
|
1312
|
-
{
|
|
1313
|
-
flexDirection: "column",
|
|
1314
|
-
borderStyle: "round",
|
|
1315
|
-
borderColor: "blue",
|
|
1316
|
-
paddingX: 3,
|
|
1317
|
-
paddingY: 2,
|
|
1318
|
-
width: Math.min(terminalWidth - 8, 80),
|
|
1319
|
-
children: [
|
|
1320
|
-
/* @__PURE__ */ jsx12(Text12, { bold: true, color: "blue", children: "Copy Repository URL" }),
|
|
1321
|
-
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1322
|
-
/* @__PURE__ */ jsx12(Text12, { children: chalk10.bold(repo.nameWithOwner) }),
|
|
1323
|
-
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1324
|
-
/* @__PURE__ */ jsx12(Text12, { color: "gray", children: "SSH URL:" }),
|
|
1325
|
-
/* @__PURE__ */ jsx12(
|
|
1326
|
-
Box11,
|
|
1327
|
-
{
|
|
1328
|
-
paddingX: 2,
|
|
1329
|
-
paddingY: 1,
|
|
1330
|
-
borderStyle: "single",
|
|
1331
|
-
borderColor: selectedType === "SSH" ? "blue" : "gray",
|
|
1332
|
-
children: /* @__PURE__ */ jsxs11(Text12, { color: selectedType === "SSH" ? "blue" : void 0, children: [
|
|
1333
|
-
selectedType === "SSH" ? "\u25B6 " : " ",
|
|
1334
|
-
sshUrl
|
|
1335
|
-
] })
|
|
1336
|
-
}
|
|
1337
|
-
),
|
|
1338
|
-
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1339
|
-
/* @__PURE__ */ jsx12(Text12, { color: "gray", children: "HTTPS URL:" }),
|
|
1340
|
-
/* @__PURE__ */ jsx12(
|
|
1341
|
-
Box11,
|
|
1342
|
-
{
|
|
1343
|
-
paddingX: 2,
|
|
1344
|
-
paddingY: 1,
|
|
1345
|
-
borderStyle: "single",
|
|
1346
|
-
borderColor: selectedType === "HTTPS" ? "blue" : "gray",
|
|
1347
|
-
children: /* @__PURE__ */ jsxs11(Text12, { color: selectedType === "HTTPS" ? "blue" : void 0, children: [
|
|
1348
|
-
selectedType === "HTTPS" ? "\u25B6 " : " ",
|
|
1349
|
-
httpsUrl
|
|
1350
|
-
] })
|
|
1351
|
-
}
|
|
1352
|
-
),
|
|
1353
|
-
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1354
|
-
/* @__PURE__ */ jsxs11(Text12, { color: "gray", children: [
|
|
1355
|
-
"\u2191\u2193 Select \u2022 Enter/Y to copy ",
|
|
1356
|
-
selectedType,
|
|
1357
|
-
" \u2022 S copy SSH \u2022 H copy HTTPS \u2022 Esc/Q/C to close"
|
|
1358
|
-
] }),
|
|
1359
|
-
copyError && /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
1360
|
-
/* @__PURE__ */ jsx12(Box11, { height: 1, children: /* @__PURE__ */ jsx12(Text12, { children: " " }) }),
|
|
1361
|
-
/* @__PURE__ */ jsx12(Text12, { color: "red", children: copyError })
|
|
1362
|
-
] })
|
|
1363
|
-
]
|
|
1364
|
-
}
|
|
1365
|
-
);
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
1103
|
// src/ui/components/repo/RepoRow.tsx
|
|
1369
|
-
import { Box as
|
|
1370
|
-
import
|
|
1371
|
-
import { jsx as
|
|
1104
|
+
import { Box as Box10, Text as Text11 } from "ink";
|
|
1105
|
+
import chalk10 from "chalk";
|
|
1106
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1372
1107
|
function RepoRow({
|
|
1373
1108
|
repo,
|
|
1374
1109
|
selected,
|
|
@@ -1384,50 +1119,50 @@ function RepoRow({
|
|
|
1384
1119
|
const commitsBehind = hasCommitData ? repo.parent.defaultBranchRef.target.history.totalCount - repo.defaultBranchRef.target.history.totalCount : 0;
|
|
1385
1120
|
const showCommitsBehind = forkTracking && hasCommitData;
|
|
1386
1121
|
let line1 = "";
|
|
1387
|
-
const numColor = selected ?
|
|
1388
|
-
const nameColor = selected ?
|
|
1122
|
+
const numColor = selected ? chalk10.cyan : chalk10.gray;
|
|
1123
|
+
const nameColor = selected ? chalk10.cyan.bold : chalk10.white;
|
|
1389
1124
|
line1 += numColor(`${String(index).padStart(3, " ")}.`);
|
|
1390
1125
|
line1 += nameColor(` ${repo.nameWithOwner}`);
|
|
1391
1126
|
if (repo.visibility === "INTERNAL") {
|
|
1392
|
-
line1 +=
|
|
1127
|
+
line1 += chalk10.magenta(" Internal");
|
|
1393
1128
|
} else if (repo.visibility === "PRIVATE" || repo.isPrivate && !repo.visibility) {
|
|
1394
|
-
line1 +=
|
|
1129
|
+
line1 += chalk10.yellow(" Private");
|
|
1395
1130
|
}
|
|
1396
|
-
if (repo.isArchived) line1 += " " +
|
|
1131
|
+
if (repo.isArchived) line1 += " " + chalk10.bgGray.whiteBright(" Archived ") + " ";
|
|
1397
1132
|
if (repo.isFork && repo.parent) {
|
|
1398
|
-
line1 +=
|
|
1133
|
+
line1 += chalk10.blue(` Fork of ${repo.parent.nameWithOwner}`);
|
|
1399
1134
|
if (showCommitsBehind) {
|
|
1400
1135
|
if (commitsBehind > 0) {
|
|
1401
|
-
line1 +=
|
|
1136
|
+
line1 += chalk10.yellow(` (${commitsBehind} behind)`);
|
|
1402
1137
|
} else {
|
|
1403
|
-
line1 +=
|
|
1138
|
+
line1 += chalk10.green(` (0 behind)`);
|
|
1404
1139
|
}
|
|
1405
1140
|
}
|
|
1406
1141
|
}
|
|
1407
1142
|
let line2 = " ";
|
|
1408
|
-
const metaColor = selected ?
|
|
1409
|
-
if (langName) line2 +=
|
|
1143
|
+
const metaColor = selected ? chalk10.white : chalk10.gray;
|
|
1144
|
+
if (langName) line2 += chalk10.hex(langColor)("\u25CF ") + metaColor(`${langName} `);
|
|
1410
1145
|
line2 += metaColor(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount} Updated ${formatDate(repo.updatedAt)}`);
|
|
1411
1146
|
const line3 = repo.description ? ` ${truncate(repo.description, Math.max(30, maxWidth - 10))}` : null;
|
|
1412
1147
|
let fullText = line1 + "\n" + line2;
|
|
1413
1148
|
if (line3) fullText += "\n" + metaColor(line3);
|
|
1414
1149
|
const spacingAbove = Math.floor(spacingLines / 2);
|
|
1415
1150
|
const spacingBelow = spacingLines - spacingAbove;
|
|
1416
|
-
return /* @__PURE__ */
|
|
1417
|
-
spacingAbove > 0 && /* @__PURE__ */
|
|
1418
|
-
/* @__PURE__ */
|
|
1419
|
-
spacingBelow > 0 && /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", backgroundColor: selected ? "gray" : void 0, children: [
|
|
1152
|
+
spacingAbove > 0 && /* @__PURE__ */ jsx11(Box10, { height: spacingAbove, children: /* @__PURE__ */ jsx11(Text11, { children: " " }) }),
|
|
1153
|
+
/* @__PURE__ */ jsx11(Text11, { children: dim ? chalk10.dim(fullText) : fullText }),
|
|
1154
|
+
spacingBelow > 0 && /* @__PURE__ */ jsx11(Box10, { height: spacingBelow, children: /* @__PURE__ */ jsx11(Text11, { children: " " }) })
|
|
1420
1155
|
] });
|
|
1421
1156
|
}
|
|
1422
1157
|
|
|
1423
1158
|
// src/ui/components/repo/FilterInput.tsx
|
|
1424
|
-
import { Box as
|
|
1425
|
-
import
|
|
1426
|
-
import { jsx as
|
|
1159
|
+
import { Box as Box11, Text as Text12 } from "ink";
|
|
1160
|
+
import TextInput3 from "ink-text-input";
|
|
1161
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1427
1162
|
|
|
1428
1163
|
// src/ui/components/repo/RepoListHeader.tsx
|
|
1429
|
-
import { Box as
|
|
1430
|
-
import { Fragment as
|
|
1164
|
+
import { Box as Box12, Text as Text13 } from "ink";
|
|
1165
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1431
1166
|
function RepoListHeader({
|
|
1432
1167
|
ownerContext,
|
|
1433
1168
|
sortKey,
|
|
@@ -1441,35 +1176,35 @@ function RepoListHeader({
|
|
|
1441
1176
|
}) {
|
|
1442
1177
|
const contextLabel = ownerContext === "personal" ? "Personal Account" : ownerContext?.type === "organization" ? `Organization: ${ownerContext.name ?? ownerContext.login}` : "";
|
|
1443
1178
|
const visibilityLabel = visibilityFilter === "public" ? "Public" : visibilityFilter === "private" ? isEnterprise ? "Private/Internal" : "Private" : visibilityFilter === "internal" ? "Internal" : "";
|
|
1444
|
-
return /* @__PURE__ */
|
|
1445
|
-
contextLabel && /* @__PURE__ */
|
|
1446
|
-
/* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "row", gap: 2, marginBottom: 1, children: [
|
|
1180
|
+
contextLabel && /* @__PURE__ */ jsx13(Text13, { children: contextLabel }),
|
|
1181
|
+
/* @__PURE__ */ jsxs12(Text13, { color: "gray", dimColor: true, children: [
|
|
1447
1182
|
"Sort: ",
|
|
1448
1183
|
sortKey,
|
|
1449
1184
|
" ",
|
|
1450
1185
|
sortDir === "asc" ? "\u2191" : "\u2193"
|
|
1451
1186
|
] }),
|
|
1452
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ jsxs12(Text13, { color: "gray", dimColor: true, children: [
|
|
1453
1188
|
"Fork Status - Commits Behind: ",
|
|
1454
1189
|
forkTracking ? "ON" : "OFF"
|
|
1455
1190
|
] }),
|
|
1456
|
-
!!visibilityLabel && /* @__PURE__ */
|
|
1191
|
+
!!visibilityLabel && /* @__PURE__ */ jsxs12(Text13, { color: "yellow", children: [
|
|
1457
1192
|
"Visibility: ",
|
|
1458
1193
|
visibilityLabel
|
|
1459
1194
|
] }),
|
|
1460
|
-
filter && !searchActive && /* @__PURE__ */
|
|
1195
|
+
filter && !searchActive && /* @__PURE__ */ jsxs12(Text13, { color: "cyan", children: [
|
|
1461
1196
|
'Filter: "',
|
|
1462
1197
|
filter,
|
|
1463
1198
|
'"'
|
|
1464
1199
|
] }),
|
|
1465
|
-
searchActive && /* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1200
|
+
searchActive && /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
1201
|
+
/* @__PURE__ */ jsxs12(Text13, { color: "cyan", children: [
|
|
1467
1202
|
'Search: "',
|
|
1468
1203
|
filter.trim(),
|
|
1469
1204
|
'"'
|
|
1470
1205
|
] }),
|
|
1471
|
-
searchLoading && /* @__PURE__ */
|
|
1472
|
-
/* @__PURE__ */
|
|
1206
|
+
searchLoading && /* @__PURE__ */ jsx13(Box12, { marginLeft: 1, children: /* @__PURE__ */ jsxs12(Text13, { color: "cyan", children: [
|
|
1207
|
+
/* @__PURE__ */ jsx13(SlowSpinner, {}),
|
|
1473
1208
|
" Searching\u2026"
|
|
1474
1209
|
] }) })
|
|
1475
1210
|
] })
|
|
@@ -1477,7 +1212,7 @@ function RepoListHeader({
|
|
|
1477
1212
|
}
|
|
1478
1213
|
|
|
1479
1214
|
// src/ui/RepoList.tsx
|
|
1480
|
-
import { Fragment as
|
|
1215
|
+
import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1481
1216
|
var getPageSize = () => {
|
|
1482
1217
|
const envValue = process.env.REPOS_PER_FETCH;
|
|
1483
1218
|
if (envValue) {
|
|
@@ -1493,17 +1228,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1493
1228
|
const { exit } = useApp();
|
|
1494
1229
|
const { stdout } = useStdout();
|
|
1495
1230
|
const client = useMemo(() => makeClient(token), [token]);
|
|
1496
|
-
const [debugMessages, setDebugMessages] =
|
|
1231
|
+
const [debugMessages, setDebugMessages] = useState10([]);
|
|
1497
1232
|
const addDebugMessage = useCallback((msg) => {
|
|
1498
1233
|
if (process.env.GH_MANAGER_DEBUG === "1") {
|
|
1499
1234
|
setDebugMessages((prev) => [...prev.slice(-9), msg]);
|
|
1500
1235
|
}
|
|
1501
1236
|
}, []);
|
|
1502
1237
|
const handleOrgContextChangeRef = useRef(onOrgContextChange);
|
|
1503
|
-
|
|
1238
|
+
useEffect7(() => {
|
|
1504
1239
|
handleOrgContextChangeRef.current = onOrgContextChange;
|
|
1505
1240
|
}, [onOrgContextChange]);
|
|
1506
|
-
|
|
1241
|
+
React10.useEffect(() => {
|
|
1507
1242
|
addDebugMessage(`[RepoList] Component mounted`);
|
|
1508
1243
|
logger.info("RepoList component mounted", {
|
|
1509
1244
|
token: token ? "present" : "missing",
|
|
@@ -1515,76 +1250,64 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1515
1250
|
}, []);
|
|
1516
1251
|
const terminalWidth = stdout?.columns ?? 80;
|
|
1517
1252
|
const availableHeight = maxVisibleRows ?? 20;
|
|
1518
|
-
const [items, setItems] =
|
|
1519
|
-
const [cursor, setCursor] =
|
|
1520
|
-
const [endCursor, setEndCursor] =
|
|
1521
|
-
const [hasNextPage, setHasNextPage] =
|
|
1522
|
-
const [totalCount, setTotalCount] =
|
|
1523
|
-
const [loading, setLoading] =
|
|
1524
|
-
const [sortingLoading, setSortingLoading] =
|
|
1525
|
-
const [refreshing, setRefreshing] =
|
|
1526
|
-
const [loadingMore, setLoadingMore] =
|
|
1527
|
-
const [error, setError] =
|
|
1528
|
-
const [rateLimit, setRateLimit] =
|
|
1529
|
-
const [prevRateLimit, setPrevRateLimit] =
|
|
1530
|
-
const [
|
|
1531
|
-
const [
|
|
1532
|
-
const [
|
|
1533
|
-
const [
|
|
1534
|
-
const [
|
|
1535
|
-
const [
|
|
1536
|
-
const [
|
|
1537
|
-
const [
|
|
1538
|
-
const [
|
|
1539
|
-
const [
|
|
1540
|
-
const [
|
|
1541
|
-
const [
|
|
1542
|
-
const [
|
|
1543
|
-
const [
|
|
1544
|
-
const [
|
|
1545
|
-
const [
|
|
1546
|
-
const [
|
|
1547
|
-
const [
|
|
1548
|
-
const [
|
|
1549
|
-
const [
|
|
1550
|
-
const [
|
|
1551
|
-
const [
|
|
1552
|
-
const [
|
|
1553
|
-
const [
|
|
1554
|
-
const [
|
|
1555
|
-
const [syncMode, setSyncMode] =
|
|
1556
|
-
const [syncTarget, setSyncTarget] =
|
|
1557
|
-
const [syncing, setSyncing] =
|
|
1558
|
-
const [syncError, setSyncError] =
|
|
1559
|
-
const [syncFocus, setSyncFocus] =
|
|
1560
|
-
const [syncTrigger, setSyncTrigger] =
|
|
1561
|
-
const [infoMode, setInfoMode] =
|
|
1562
|
-
const [infoRepo, setInfoRepo] =
|
|
1563
|
-
const [logoutMode, setLogoutMode] =
|
|
1564
|
-
const [logoutFocus, setLogoutFocus] =
|
|
1565
|
-
const [logoutError, setLogoutError] =
|
|
1566
|
-
const [visibilityMode, setVisibilityMode] =
|
|
1567
|
-
const [isEnterpriseOrg, setIsEnterpriseOrg] =
|
|
1568
|
-
const [hasInternalRepos, setHasInternalRepos] =
|
|
1569
|
-
const [changeVisibilityMode, setChangeVisibilityMode] =
|
|
1570
|
-
const [changeVisibilityTarget, setChangeVisibilityTarget] =
|
|
1571
|
-
const [changingVisibility, setChangingVisibility] =
|
|
1572
|
-
const [changeVisibilityError, setChangeVisibilityError] =
|
|
1573
|
-
const [sortMode, setSortMode] =
|
|
1574
|
-
const [copyUrlMode, setCopyUrlMode] = useState12(false);
|
|
1575
|
-
const [copyUrlTarget, setCopyUrlTarget] = useState12(null);
|
|
1576
|
-
const [copyToast, setCopyToast] = useState12(null);
|
|
1577
|
-
const copyToastTimerRef = useRef(null);
|
|
1578
|
-
useEffect8(() => {
|
|
1579
|
-
return () => {
|
|
1580
|
-
if (copyToastTimerRef.current) {
|
|
1581
|
-
clearTimeout(copyToastTimerRef.current);
|
|
1582
|
-
copyToastTimerRef.current = null;
|
|
1583
|
-
}
|
|
1584
|
-
};
|
|
1585
|
-
}, []);
|
|
1253
|
+
const [items, setItems] = useState10([]);
|
|
1254
|
+
const [cursor, setCursor] = useState10(0);
|
|
1255
|
+
const [endCursor, setEndCursor] = useState10(null);
|
|
1256
|
+
const [hasNextPage, setHasNextPage] = useState10(false);
|
|
1257
|
+
const [totalCount, setTotalCount] = useState10(0);
|
|
1258
|
+
const [loading, setLoading] = useState10(true);
|
|
1259
|
+
const [sortingLoading, setSortingLoading] = useState10(false);
|
|
1260
|
+
const [refreshing, setRefreshing] = useState10(false);
|
|
1261
|
+
const [loadingMore, setLoadingMore] = useState10(false);
|
|
1262
|
+
const [error, setError] = useState10(null);
|
|
1263
|
+
const [rateLimit, setRateLimit] = useState10(void 0);
|
|
1264
|
+
const [prevRateLimit, setPrevRateLimit] = useState10(void 0);
|
|
1265
|
+
const [restRateLimit, setRestRateLimit] = useState10(void 0);
|
|
1266
|
+
const [prevRestRateLimit, setPrevRestRateLimit] = useState10(void 0);
|
|
1267
|
+
const [density, setDensity] = useState10(2);
|
|
1268
|
+
const [prefsLoaded, setPrefsLoaded] = useState10(false);
|
|
1269
|
+
const [ownerContext, setOwnerContext] = useState10("personal");
|
|
1270
|
+
const [ownerAffiliations, setOwnerAffiliations] = useState10(["OWNER"]);
|
|
1271
|
+
const [orgSwitcherOpen, setOrgSwitcherOpen] = useState10(false);
|
|
1272
|
+
const [searchItems, setSearchItems] = useState10([]);
|
|
1273
|
+
const [searchEndCursor, setSearchEndCursor] = useState10(null);
|
|
1274
|
+
const [searchHasNextPage, setSearchHasNextPage] = useState10(false);
|
|
1275
|
+
const [searchTotalCount, setSearchTotalCount] = useState10(0);
|
|
1276
|
+
const [searchLoading, setSearchLoading] = useState10(false);
|
|
1277
|
+
const [deleteMode, setDeleteMode] = useState10(false);
|
|
1278
|
+
const [deleteTarget, setDeleteTarget] = useState10(null);
|
|
1279
|
+
const [deleteCode, setDeleteCode] = useState10("");
|
|
1280
|
+
const [typedCode, setTypedCode] = useState10("");
|
|
1281
|
+
const [deleting, setDeleting] = useState10(false);
|
|
1282
|
+
const [deleteError, setDeleteError] = useState10(null);
|
|
1283
|
+
const [deleteConfirmStage, setDeleteConfirmStage] = useState10(false);
|
|
1284
|
+
const [confirmFocus, setConfirmFocus] = useState10("delete");
|
|
1285
|
+
const [archiveMode, setArchiveMode] = useState10(false);
|
|
1286
|
+
const [archiveTarget, setArchiveTarget] = useState10(null);
|
|
1287
|
+
const [archiving, setArchiving] = useState10(false);
|
|
1288
|
+
const [archiveError, setArchiveError] = useState10(null);
|
|
1289
|
+
const [archiveFocus, setArchiveFocus] = useState10("confirm");
|
|
1290
|
+
const [syncMode, setSyncMode] = useState10(false);
|
|
1291
|
+
const [syncTarget, setSyncTarget] = useState10(null);
|
|
1292
|
+
const [syncing, setSyncing] = useState10(false);
|
|
1293
|
+
const [syncError, setSyncError] = useState10(null);
|
|
1294
|
+
const [syncFocus, setSyncFocus] = useState10("confirm");
|
|
1295
|
+
const [syncTrigger, setSyncTrigger] = useState10(false);
|
|
1296
|
+
const [infoMode, setInfoMode] = useState10(false);
|
|
1297
|
+
const [infoRepo, setInfoRepo] = useState10(null);
|
|
1298
|
+
const [logoutMode, setLogoutMode] = useState10(false);
|
|
1299
|
+
const [logoutFocus, setLogoutFocus] = useState10("confirm");
|
|
1300
|
+
const [logoutError, setLogoutError] = useState10(null);
|
|
1301
|
+
const [visibilityMode, setVisibilityMode] = useState10(false);
|
|
1302
|
+
const [isEnterpriseOrg, setIsEnterpriseOrg] = useState10(false);
|
|
1303
|
+
const [hasInternalRepos, setHasInternalRepos] = useState10(false);
|
|
1304
|
+
const [changeVisibilityMode, setChangeVisibilityMode] = useState10(false);
|
|
1305
|
+
const [changeVisibilityTarget, setChangeVisibilityTarget] = useState10(null);
|
|
1306
|
+
const [changingVisibility, setChangingVisibility] = useState10(false);
|
|
1307
|
+
const [changeVisibilityError, setChangeVisibilityError] = useState10(null);
|
|
1308
|
+
const [sortMode, setSortMode] = useState10(false);
|
|
1586
1309
|
const appliedInitialOrg = useRef(false);
|
|
1587
|
-
|
|
1310
|
+
useEffect7(() => {
|
|
1588
1311
|
(async () => {
|
|
1589
1312
|
if (appliedInitialOrg.current) return;
|
|
1590
1313
|
if (!initialOrgSlug2) return;
|
|
@@ -1619,10 +1342,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1619
1342
|
setArchiveError(null);
|
|
1620
1343
|
setArchiveFocus("confirm");
|
|
1621
1344
|
}
|
|
1622
|
-
function closeRenameModal() {
|
|
1623
|
-
setRenameMode(false);
|
|
1624
|
-
setRenameTarget(null);
|
|
1625
|
-
}
|
|
1626
1345
|
function closeChangeVisibilityModal() {
|
|
1627
1346
|
setChangeVisibilityMode(false);
|
|
1628
1347
|
setChangeVisibilityTarget(null);
|
|
@@ -1637,42 +1356,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1637
1356
|
setSyncFocus("confirm");
|
|
1638
1357
|
setSyncTrigger(false);
|
|
1639
1358
|
}
|
|
1640
|
-
function openCopyUrlModal(repo) {
|
|
1641
|
-
setCopyUrlMode(true);
|
|
1642
|
-
setCopyUrlTarget(repo);
|
|
1643
|
-
setCopyToast(null);
|
|
1644
|
-
}
|
|
1645
|
-
function closeCopyUrlModal() {
|
|
1646
|
-
setCopyUrlMode(false);
|
|
1647
|
-
setCopyUrlTarget(null);
|
|
1648
|
-
setCopyToast(null);
|
|
1649
|
-
}
|
|
1650
|
-
async function handleCopyUrl(url, type) {
|
|
1651
|
-
try {
|
|
1652
|
-
if (copyToastTimerRef.current) {
|
|
1653
|
-
clearTimeout(copyToastTimerRef.current);
|
|
1654
|
-
copyToastTimerRef.current = null;
|
|
1655
|
-
}
|
|
1656
|
-
await copyToClipboard(url);
|
|
1657
|
-
setCopyToast(`Copied ${type} URL to clipboard`);
|
|
1658
|
-
copyToastTimerRef.current = setTimeout(() => {
|
|
1659
|
-
setCopyToast(null);
|
|
1660
|
-
copyToastTimerRef.current = null;
|
|
1661
|
-
}, 3e3);
|
|
1662
|
-
} catch (error2) {
|
|
1663
|
-
if (copyToastTimerRef.current) {
|
|
1664
|
-
clearTimeout(copyToastTimerRef.current);
|
|
1665
|
-
copyToastTimerRef.current = null;
|
|
1666
|
-
}
|
|
1667
|
-
const message = error2 instanceof Error ? error2.message : String(error2) || "Unknown error";
|
|
1668
|
-
setCopyToast(`Failed to copy ${type} URL: ${message}`);
|
|
1669
|
-
copyToastTimerRef.current = setTimeout(() => {
|
|
1670
|
-
setCopyToast(null);
|
|
1671
|
-
copyToastTimerRef.current = null;
|
|
1672
|
-
}, 5e3);
|
|
1673
|
-
throw error2;
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
1359
|
async function executeSync() {
|
|
1677
1360
|
if (!syncTarget || syncing) return;
|
|
1678
1361
|
try {
|
|
@@ -1733,22 +1416,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1733
1416
|
setArchiveError("Failed to update archive state. Check permissions.");
|
|
1734
1417
|
}
|
|
1735
1418
|
}
|
|
1736
|
-
async function executeRename(repo, newName) {
|
|
1737
|
-
if (!repo || !newName.trim()) return;
|
|
1738
|
-
try {
|
|
1739
|
-
const id = repo.id;
|
|
1740
|
-
const owner = repo.nameWithOwner.split("/")[0];
|
|
1741
|
-
const newNameWithOwner = `${owner}/${newName}`;
|
|
1742
|
-
await renameRepositoryById(client, id, newName);
|
|
1743
|
-
await updateCacheAfterRename(token, id, newName, newNameWithOwner);
|
|
1744
|
-
const updateRepo = (r) => r.id === id ? { ...r, name: newName, nameWithOwner: newNameWithOwner } : r;
|
|
1745
|
-
setItems((prev) => prev.map(updateRepo));
|
|
1746
|
-
setSearchItems((prev) => prev.map(updateRepo));
|
|
1747
|
-
closeRenameModal();
|
|
1748
|
-
} catch (error2) {
|
|
1749
|
-
throw error2;
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
1419
|
async function handleVisibilityChange(newVisibility) {
|
|
1753
1420
|
if (!changeVisibilityTarget || changingVisibility) return;
|
|
1754
1421
|
try {
|
|
@@ -1842,12 +1509,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1842
1509
|
setDeleteError("Failed to delete repository. Ensure delete_repo scope and admin permissions.");
|
|
1843
1510
|
}
|
|
1844
1511
|
}
|
|
1845
|
-
const [filter, setFilter] =
|
|
1846
|
-
const [filterMode, setFilterMode] =
|
|
1847
|
-
const [sortKey, setSortKey] =
|
|
1848
|
-
const [sortDir, setSortDir] =
|
|
1849
|
-
const [forkTracking, setForkTracking] =
|
|
1850
|
-
const [visibilityFilter, setVisibilityFilter] =
|
|
1512
|
+
const [filter, setFilter] = useState10("");
|
|
1513
|
+
const [filterMode, setFilterMode] = useState10(false);
|
|
1514
|
+
const [sortKey, setSortKey] = useState10("updated");
|
|
1515
|
+
const [sortDir, setSortDir] = useState10("desc");
|
|
1516
|
+
const [forkTracking, setForkTracking] = useState10(true);
|
|
1517
|
+
const [visibilityFilter, setVisibilityFilter] = useState10("all");
|
|
1851
1518
|
const previousVisibilityFilter = useRef("all");
|
|
1852
1519
|
const sortFieldMap = {
|
|
1853
1520
|
"updated": "UPDATED_AT",
|
|
@@ -1924,6 +1591,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
1924
1591
|
setPrevRateLimit(rateLimit.remaining);
|
|
1925
1592
|
}
|
|
1926
1593
|
setRateLimit(page.rateLimit);
|
|
1594
|
+
fetchRestRateLimits(token).then((restLimits) => {
|
|
1595
|
+
if (restLimits && restRateLimit) {
|
|
1596
|
+
setPrevRestRateLimit(restRateLimit.core.remaining);
|
|
1597
|
+
}
|
|
1598
|
+
if (restLimits) {
|
|
1599
|
+
setRestRateLimit(restLimits);
|
|
1600
|
+
}
|
|
1601
|
+
});
|
|
1927
1602
|
setError(null);
|
|
1928
1603
|
} catch (e) {
|
|
1929
1604
|
logger.error("Failed to fetch repositories in RepoList", {
|
|
@@ -2000,7 +1675,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2000
1675
|
setSearchLoading(false);
|
|
2001
1676
|
}
|
|
2002
1677
|
};
|
|
2003
|
-
|
|
1678
|
+
useEffect7(() => {
|
|
2004
1679
|
const ui = getUIPrefs();
|
|
2005
1680
|
if (ui.density !== void 0) setDensity(ui.density);
|
|
2006
1681
|
if (ui.sortKey && ["updated", "pushed", "name", "stars"].includes(ui.sortKey)) {
|
|
@@ -2031,7 +1706,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2031
1706
|
}
|
|
2032
1707
|
setPrefsLoaded(true);
|
|
2033
1708
|
}, [onOrgContextChange]);
|
|
2034
|
-
|
|
1709
|
+
useEffect7(() => {
|
|
2035
1710
|
if (!prefsLoaded) return;
|
|
2036
1711
|
let policy = "cache-first";
|
|
2037
1712
|
const orgLogin = ownerContext !== "personal" ? ownerContext.login : void 0;
|
|
@@ -2051,7 +1726,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2051
1726
|
setCursor(0);
|
|
2052
1727
|
fetchPage(null, true, false, void 0, policy);
|
|
2053
1728
|
}, [client, prefsLoaded, ownerContext, ownerAffiliations]);
|
|
2054
|
-
|
|
1729
|
+
useEffect7(() => {
|
|
2055
1730
|
if (!searchActive) {
|
|
2056
1731
|
if (items.length > 0) {
|
|
2057
1732
|
let policy = "cache-first";
|
|
@@ -2090,7 +1765,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2090
1765
|
}
|
|
2091
1766
|
}
|
|
2092
1767
|
}, [sortKey, sortDir]);
|
|
2093
|
-
|
|
1768
|
+
useEffect7(() => {
|
|
2094
1769
|
if (visibilityFilter !== "all" || previousVisibilityFilter.current && previousVisibilityFilter.current !== visibilityFilter) {
|
|
2095
1770
|
if (!searchActive) {
|
|
2096
1771
|
if (items.length > 0) {
|
|
@@ -2107,7 +1782,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2107
1782
|
}
|
|
2108
1783
|
previousVisibilityFilter.current = visibilityFilter;
|
|
2109
1784
|
}, [visibilityFilter]);
|
|
2110
|
-
|
|
1785
|
+
useEffect7(() => {
|
|
2111
1786
|
if (viewerLogin && searchActive && !searchLoading && searchItems.length === 0) {
|
|
2112
1787
|
let policy = "cache-first";
|
|
2113
1788
|
try {
|
|
@@ -2128,7 +1803,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2128
1803
|
fetchSearchPage(null, true, policy);
|
|
2129
1804
|
}
|
|
2130
1805
|
}, [viewerLogin]);
|
|
2131
|
-
|
|
1806
|
+
useInput10((input, key) => {
|
|
2132
1807
|
if (error) {
|
|
2133
1808
|
if (input && input.toUpperCase() === "Q") {
|
|
2134
1809
|
try {
|
|
@@ -2140,7 +1815,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2140
1815
|
exit();
|
|
2141
1816
|
return;
|
|
2142
1817
|
}
|
|
2143
|
-
if (input && input.toUpperCase() === "R"
|
|
1818
|
+
if (input && input.toUpperCase() === "R") {
|
|
2144
1819
|
setCursor(0);
|
|
2145
1820
|
setRefreshing(true);
|
|
2146
1821
|
setSortingLoading(true);
|
|
@@ -2190,9 +1865,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2190
1865
|
}
|
|
2191
1866
|
return;
|
|
2192
1867
|
}
|
|
2193
|
-
if (renameMode) {
|
|
2194
|
-
return;
|
|
2195
|
-
}
|
|
2196
1868
|
if (archiveMode) {
|
|
2197
1869
|
if (key.escape || input && input.toUpperCase() === "C") {
|
|
2198
1870
|
closeArchiveModal();
|
|
@@ -2285,9 +1957,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2285
1957
|
if (sortMode) {
|
|
2286
1958
|
return;
|
|
2287
1959
|
}
|
|
2288
|
-
if (copyUrlMode) {
|
|
2289
|
-
return;
|
|
2290
|
-
}
|
|
2291
1960
|
if (filterMode) {
|
|
2292
1961
|
if (key.escape) {
|
|
2293
1962
|
setFilterMode(false);
|
|
@@ -2359,7 +2028,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2359
2028
|
setCursor(visibleItems.length - 1);
|
|
2360
2029
|
return;
|
|
2361
2030
|
}
|
|
2362
|
-
if (input && input.toUpperCase() === "R"
|
|
2031
|
+
if (input && input.toUpperCase() === "R") {
|
|
2363
2032
|
setCursor(0);
|
|
2364
2033
|
setRefreshing(true);
|
|
2365
2034
|
setSortingLoading(true);
|
|
@@ -2387,14 +2056,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2387
2056
|
}
|
|
2388
2057
|
return;
|
|
2389
2058
|
}
|
|
2390
|
-
if (key.ctrl && (input === "r" || input === "R")) {
|
|
2391
|
-
const repo = visibleItems[cursor];
|
|
2392
|
-
if (repo) {
|
|
2393
|
-
setRenameTarget(repo);
|
|
2394
|
-
setRenameMode(true);
|
|
2395
|
-
}
|
|
2396
|
-
return;
|
|
2397
|
-
}
|
|
2398
2059
|
if (key.ctrl && (input === "v" || input === "V")) {
|
|
2399
2060
|
const repo = visibleItems[cursor];
|
|
2400
2061
|
if (repo) {
|
|
@@ -2452,13 +2113,6 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2452
2113
|
setInfoMode(true);
|
|
2453
2114
|
return;
|
|
2454
2115
|
}
|
|
2455
|
-
if (input && input.toUpperCase() === "C") {
|
|
2456
|
-
const repo = visibleItems[cursor];
|
|
2457
|
-
if (repo) {
|
|
2458
|
-
openCopyUrlModal(repo);
|
|
2459
|
-
}
|
|
2460
|
-
return;
|
|
2461
|
-
}
|
|
2462
2116
|
if (input && input.toUpperCase() === "W") {
|
|
2463
2117
|
setOrgSwitcherOpen(true);
|
|
2464
2118
|
return;
|
|
@@ -2553,12 +2207,12 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2553
2207
|
return result;
|
|
2554
2208
|
}, [searchItems, visibilityFilter]);
|
|
2555
2209
|
const visibleItems = searchActive ? filteredSearchItems : filteredAndSorted;
|
|
2556
|
-
|
|
2210
|
+
useEffect7(() => {
|
|
2557
2211
|
if (searchActive) {
|
|
2558
2212
|
addDebugMessage(`[State] searchActive=${searchActive}, searchItems=${searchItems.length}, visibleItems=${visibleItems.length}, filter="${filter}"`);
|
|
2559
2213
|
}
|
|
2560
2214
|
}, [searchActive, searchItems.length, visibleItems.length, filter]);
|
|
2561
|
-
|
|
2215
|
+
useEffect7(() => {
|
|
2562
2216
|
setCursor((c) => Math.min(c, Math.max(0, (searchActive ? searchItems.length : items.length) - 1)));
|
|
2563
2217
|
}, [searchActive, searchItems.length, items.length]);
|
|
2564
2218
|
const headerHeight = 2;
|
|
@@ -2579,7 +2233,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2579
2233
|
const end = Math.min(total, start + visibleRepos + buffer);
|
|
2580
2234
|
return { start, end };
|
|
2581
2235
|
}, [visibleItems.length, cursor, listHeight, spacingLines]);
|
|
2582
|
-
|
|
2236
|
+
useEffect7(() => {
|
|
2583
2237
|
const prefetchThreshold = Math.floor(visibleItems.length * 0.8);
|
|
2584
2238
|
const nearEnd = visibleItems.length > 0 && cursor >= prefetchThreshold;
|
|
2585
2239
|
if (searchActive) {
|
|
@@ -2599,96 +2253,98 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2599
2253
|
const cmd = platform === "darwin" ? `open "${url}"` : platform === "win32" ? `start "" "${url}"` : `xdg-open "${url}"`;
|
|
2600
2254
|
exec(cmd);
|
|
2601
2255
|
}
|
|
2602
|
-
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1);
|
|
2603
|
-
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode
|
|
2604
|
-
const headerBar = useMemo(() => /* @__PURE__ */
|
|
2605
|
-
/* @__PURE__ */
|
|
2606
|
-
/* @__PURE__ */
|
|
2256
|
+
const lowRate = rateLimit && rateLimit.remaining <= Math.ceil(rateLimit.limit * 0.1) || restRateLimit && restRateLimit.core.remaining <= Math.ceil(restRateLimit.core.limit * 0.1);
|
|
2257
|
+
const modalOpen = deleteMode || archiveMode || syncMode || logoutMode || infoMode || visibilityMode;
|
|
2258
|
+
const headerBar = useMemo(() => /* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: [
|
|
2259
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", gap: 1, children: [
|
|
2260
|
+
/* @__PURE__ */ jsxs13(Text14, { color: "cyan", bold: !modalOpen, dimColor: modalOpen, children: [
|
|
2607
2261
|
" ",
|
|
2608
2262
|
ownerContext === "personal" ? "Personal" : ownerContext.name || ownerContext.login,
|
|
2609
2263
|
ownerContext !== "personal" && isEnterpriseOrg && " (ENT)"
|
|
2610
2264
|
] }),
|
|
2611
|
-
/* @__PURE__ */
|
|
2612
|
-
/* @__PURE__ */
|
|
2265
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, color: modalOpen ? "gray" : void 0, dimColor: modalOpen ? true : void 0, children: "Repositories" }),
|
|
2266
|
+
/* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
2613
2267
|
"(",
|
|
2614
2268
|
visibleItems.length,
|
|
2615
2269
|
"/",
|
|
2616
2270
|
searchActive ? searchTotalCount : totalCount,
|
|
2617
2271
|
")"
|
|
2618
2272
|
] }),
|
|
2619
|
-
(loading || searchLoading) && /* @__PURE__ */
|
|
2273
|
+
(loading || searchLoading) && /* @__PURE__ */ jsx14(Box13, { width: 2, flexShrink: 0, flexGrow: 0, marginLeft: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "yellow", children: /* @__PURE__ */ jsx14(SlowSpinner, {}) }) })
|
|
2620
2274
|
] }),
|
|
2621
|
-
rateLimit && /* @__PURE__ */
|
|
2622
|
-
"
|
|
2623
|
-
rateLimit.remaining,
|
|
2624
|
-
"
|
|
2625
|
-
|
|
2626
|
-
|
|
2275
|
+
(rateLimit || restRateLimit) && /* @__PURE__ */ jsxs13(Text14, { color: lowRate ? "yellow" : "gray", children: [
|
|
2276
|
+
"GraphQL: ",
|
|
2277
|
+
rateLimit ? `${rateLimit.remaining}/${rateLimit.limit}` : "---/---",
|
|
2278
|
+
prevRateLimit !== void 0 && rateLimit && prevRateLimit !== rateLimit.remaining && /* @__PURE__ */ jsx14(Text14, { color: rateLimit.remaining < prevRateLimit ? "red" : "green", children: ` (${rateLimit.remaining - prevRateLimit > 0 ? "+" : ""}${rateLimit.remaining - prevRateLimit})` }),
|
|
2279
|
+
" | ",
|
|
2280
|
+
"REST: ",
|
|
2281
|
+
restRateLimit ? `${restRateLimit.core.remaining}/${restRateLimit.core.limit}` : "---/---",
|
|
2282
|
+
prevRestRateLimit !== void 0 && restRateLimit && prevRestRateLimit !== restRateLimit.core.remaining && /* @__PURE__ */ jsx14(Text14, { color: restRateLimit.core.remaining < prevRestRateLimit ? "red" : "green", children: ` (${restRateLimit.core.remaining - prevRestRateLimit > 0 ? "+" : ""}${restRateLimit.core.remaining - prevRestRateLimit})` }),
|
|
2627
2283
|
" "
|
|
2628
2284
|
] })
|
|
2629
|
-
] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg]);
|
|
2285
|
+
] }), [visibleItems.length, searchActive, searchTotalCount, totalCount, loading, searchLoading, rateLimit, lowRate, modalOpen, prevRateLimit, ownerContext, isEnterpriseOrg, restRateLimit, prevRestRateLimit]);
|
|
2630
2286
|
if (error) {
|
|
2631
|
-
return /* @__PURE__ */
|
|
2632
|
-
/* @__PURE__ */
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
2287
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", height: availableHeight, children: [
|
|
2288
|
+
/* @__PURE__ */ jsx14(Box13, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", gap: 1, children: [
|
|
2289
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, children: " Repositories" }),
|
|
2290
|
+
/* @__PURE__ */ jsx14(Text14, { color: "red", children: "(Error)" })
|
|
2635
2291
|
] }) }),
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
/* @__PURE__ */
|
|
2638
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ jsx14(Box13, { borderStyle: "single", borderColor: "red", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx14(Box13, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", alignItems: "center", children: [
|
|
2293
|
+
/* @__PURE__ */ jsx14(Text14, { color: "red", children: error }),
|
|
2294
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", dimColor: true, children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
2639
2295
|
] }) }) }),
|
|
2640
|
-
/* @__PURE__ */
|
|
2296
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", children: "Press R to retry \u2022 Ctrl+L to logout \u2022 Q to quit" }) })
|
|
2641
2297
|
] });
|
|
2642
2298
|
}
|
|
2643
2299
|
if (loading && items.length === 0 || sortingLoading) {
|
|
2644
|
-
return /* @__PURE__ */
|
|
2645
|
-
/* @__PURE__ */
|
|
2646
|
-
/* @__PURE__ */
|
|
2647
|
-
/* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", height: availableHeight, children: [
|
|
2301
|
+
/* @__PURE__ */ jsx14(Box13, { flexDirection: "row", justifyContent: "space-between", height: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", gap: 1, children: [
|
|
2302
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, children: " Repositories" }),
|
|
2303
|
+
/* @__PURE__ */ jsx14(Text14, { color: "gray", children: "(Loading...)" })
|
|
2648
2304
|
] }) }),
|
|
2649
|
-
/* @__PURE__ */
|
|
2650
|
-
/* @__PURE__ */
|
|
2651
|
-
/* @__PURE__ */
|
|
2652
|
-
/* @__PURE__ */
|
|
2305
|
+
/* @__PURE__ */ jsx14(Box13, { borderStyle: "single", borderColor: "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: /* @__PURE__ */ jsx14(Box13, { height: contentHeight, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx14(Box13, { flexDirection: "column", alignItems: "center", children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", alignItems: "center", children: [
|
|
2306
|
+
/* @__PURE__ */ jsxs13(Box13, { height: 1, flexDirection: "row", children: [
|
|
2307
|
+
/* @__PURE__ */ jsx14(Box13, { width: 2, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsx14(Text14, { color: "cyan", children: /* @__PURE__ */ jsx14(SlowSpinner, {}) }) }),
|
|
2308
|
+
/* @__PURE__ */ jsx14(Text14, { color: "cyan", children: refreshing ? "Refreshing..." : sortingLoading ? "Applying sort..." : "Loading repositories..." })
|
|
2653
2309
|
] }),
|
|
2654
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ jsx14(Box13, { height: 1, marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", children: refreshing ? "Fetching latest repository data" : sortingLoading ? `Sorting by ${sortKey} (${sortDir === "asc" ? "ascending" : "descending"})` : "Fetching your GitHub repositories" }) })
|
|
2655
2311
|
] }) }) }) }),
|
|
2656
|
-
/* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", children: "Please wait..." }) })
|
|
2657
2313
|
] });
|
|
2658
2314
|
}
|
|
2659
|
-
return /* @__PURE__ */
|
|
2315
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", height: availableHeight, children: [
|
|
2660
2316
|
headerBar,
|
|
2661
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ jsx14(Box13, { borderStyle: "single", borderColor: modalOpen ? "gray" : "yellow", paddingX: 1, paddingY: 1, marginX: 1, height: contentHeight + containerPadding + 2, flexDirection: "column", children: deleteMode && deleteTarget ? (
|
|
2662
2318
|
// Centered modal; hide list content while modal is open
|
|
2663
|
-
/* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2320
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, children: "Delete Confirmation" }),
|
|
2321
|
+
/* @__PURE__ */ jsx14(Text14, { color: "red", children: "\u26A0\uFE0F Delete repository?" }),
|
|
2322
|
+
/* @__PURE__ */ jsx14(Box13, { height: 2, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
2667
2323
|
(() => {
|
|
2668
2324
|
const langName = deleteTarget.primaryLanguage?.name || "";
|
|
2669
2325
|
const langColor = deleteTarget.primaryLanguage?.color || "#666666";
|
|
2670
2326
|
let line1 = "";
|
|
2671
|
-
line1 +=
|
|
2672
|
-
if (deleteTarget.isPrivate) line1 +=
|
|
2673
|
-
if (deleteTarget.isArchived) line1 +=
|
|
2674
|
-
if (deleteTarget.isFork && deleteTarget.parent) line1 +=
|
|
2327
|
+
line1 += chalk11.white(deleteTarget.nameWithOwner);
|
|
2328
|
+
if (deleteTarget.isPrivate) line1 += chalk11.yellow(" Private");
|
|
2329
|
+
if (deleteTarget.isArchived) line1 += chalk11.gray.dim(" Archived");
|
|
2330
|
+
if (deleteTarget.isFork && deleteTarget.parent) line1 += chalk11.blue(` Fork of ${deleteTarget.parent.nameWithOwner}`);
|
|
2675
2331
|
let line2 = "";
|
|
2676
|
-
if (langName) line2 +=
|
|
2677
|
-
line2 +=
|
|
2678
|
-
return /* @__PURE__ */
|
|
2679
|
-
/* @__PURE__ */
|
|
2680
|
-
/* @__PURE__ */
|
|
2332
|
+
if (langName) line2 += chalk11.hex(langColor)("\u25CF ") + chalk11.gray(`${langName} `);
|
|
2333
|
+
line2 += chalk11.gray(`\u2605 ${deleteTarget.stargazerCount} \u2442 ${deleteTarget.forkCount} Updated ${formatDate(deleteTarget.updatedAt)}`);
|
|
2334
|
+
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
2335
|
+
/* @__PURE__ */ jsx14(Text14, { children: line1 }),
|
|
2336
|
+
/* @__PURE__ */ jsx14(Text14, { children: line2 })
|
|
2681
2337
|
] });
|
|
2682
2338
|
})(),
|
|
2683
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsxs13(Text14, { children: [
|
|
2684
2340
|
"Type ",
|
|
2685
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsx14(Text14, { color: "yellow", bold: true, children: deleteCode }),
|
|
2686
2342
|
" to confirm."
|
|
2687
2343
|
] }) }),
|
|
2688
|
-
!deleteConfirmStage && /* @__PURE__ */
|
|
2689
|
-
/* @__PURE__ */
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
|
|
2344
|
+
!deleteConfirmStage && /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, children: [
|
|
2345
|
+
/* @__PURE__ */ jsx14(Text14, { children: "Confirm code: " }),
|
|
2346
|
+
/* @__PURE__ */ jsx14(
|
|
2347
|
+
TextInput4,
|
|
2692
2348
|
{
|
|
2693
2349
|
value: typedCode,
|
|
2694
2350
|
onChange: (v) => {
|
|
@@ -2714,11 +2370,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2714
2370
|
}
|
|
2715
2371
|
)
|
|
2716
2372
|
] }),
|
|
2717
|
-
deleteConfirmStage && /* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
/* @__PURE__ */
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
-
|
|
2373
|
+
deleteConfirmStage && /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, flexDirection: "column", children: [
|
|
2374
|
+
/* @__PURE__ */ jsx14(Text14, { color: "red", children: "This action will permanently delete the repository. This cannot be undone." }),
|
|
2375
|
+
/* @__PURE__ */ jsxs13(Box13, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2376
|
+
/* @__PURE__ */ jsx14(
|
|
2377
|
+
Box13,
|
|
2722
2378
|
{
|
|
2723
2379
|
borderStyle: "round",
|
|
2724
2380
|
borderColor: "red",
|
|
@@ -2727,11 +2383,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2727
2383
|
alignItems: "center",
|
|
2728
2384
|
justifyContent: "center",
|
|
2729
2385
|
flexDirection: "column",
|
|
2730
|
-
children: /* @__PURE__ */
|
|
2386
|
+
children: /* @__PURE__ */ jsx14(Text14, { children: confirmFocus === "delete" ? chalk11.bgRed.white.bold(" Delete ") : chalk11.red.bold("Delete") })
|
|
2731
2387
|
}
|
|
2732
2388
|
),
|
|
2733
|
-
/* @__PURE__ */
|
|
2734
|
-
|
|
2389
|
+
/* @__PURE__ */ jsx14(
|
|
2390
|
+
Box13,
|
|
2735
2391
|
{
|
|
2736
2392
|
borderStyle: "round",
|
|
2737
2393
|
borderColor: confirmFocus === "cancel" ? "white" : "gray",
|
|
@@ -2740,17 +2396,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2740
2396
|
alignItems: "center",
|
|
2741
2397
|
justifyContent: "center",
|
|
2742
2398
|
flexDirection: "column",
|
|
2743
|
-
children: /* @__PURE__ */
|
|
2399
|
+
children: /* @__PURE__ */ jsx14(Text14, { children: confirmFocus === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
2744
2400
|
}
|
|
2745
2401
|
)
|
|
2746
2402
|
] }),
|
|
2747
|
-
/* @__PURE__ */
|
|
2403
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
2748
2404
|
"Press Enter to ",
|
|
2749
2405
|
confirmFocus === "delete" ? "Delete" : "Cancel",
|
|
2750
2406
|
" | Y to Delete | C to Cancel"
|
|
2751
2407
|
] }) }),
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
|
|
2408
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(
|
|
2409
|
+
TextInput4,
|
|
2754
2410
|
{
|
|
2755
2411
|
value: "",
|
|
2756
2412
|
onChange: () => {
|
|
@@ -2763,18 +2419,18 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2763
2419
|
}
|
|
2764
2420
|
) })
|
|
2765
2421
|
] }),
|
|
2766
|
-
deleteError && /* @__PURE__ */
|
|
2767
|
-
deleting && /* @__PURE__ */
|
|
2422
|
+
deleteError && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "magenta", children: deleteError }) }),
|
|
2423
|
+
deleting && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "yellow", children: "Deleting..." }) })
|
|
2768
2424
|
] }) })
|
|
2769
|
-
) : archiveMode && archiveTarget ? /* @__PURE__ */
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
/* @__PURE__ */
|
|
2777
|
-
|
|
2425
|
+
) : archiveMode && archiveTarget ? /* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", borderStyle: "round", borderColor: archiveTarget.isArchived ? "green" : "yellow", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2426
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, children: archiveTarget.isArchived ? "Unarchive Confirmation" : "Archive Confirmation" }),
|
|
2427
|
+
/* @__PURE__ */ jsx14(Text14, { color: archiveTarget.isArchived ? "green" : "yellow", children: archiveTarget.isArchived ? "\u21BA Unarchive repository?" : "\u26A0\uFE0F Archive repository?" }),
|
|
2428
|
+
/* @__PURE__ */ jsx14(Box13, { height: 1, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
2429
|
+
/* @__PURE__ */ jsx14(Text14, { children: archiveTarget.nameWithOwner }),
|
|
2430
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { children: archiveTarget.isArchived ? "This will make the repository active again." : "This will make the repository read-only." }) }),
|
|
2431
|
+
/* @__PURE__ */ jsxs13(Box13, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2432
|
+
/* @__PURE__ */ jsx14(
|
|
2433
|
+
Box13,
|
|
2778
2434
|
{
|
|
2779
2435
|
borderStyle: "round",
|
|
2780
2436
|
borderColor: archiveTarget.isArchived ? "green" : "yellow",
|
|
@@ -2783,11 +2439,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2783
2439
|
alignItems: "center",
|
|
2784
2440
|
justifyContent: "center",
|
|
2785
2441
|
flexDirection: "column",
|
|
2786
|
-
children: /* @__PURE__ */
|
|
2442
|
+
children: /* @__PURE__ */ jsx14(Text14, { children: archiveFocus === "confirm" ? chalk11.bgGreen.white.bold(` ${archiveTarget.isArchived ? "Unarchive" : "Archive"} `) : chalk11.bold[archiveTarget.isArchived ? "green" : "yellow"](archiveTarget.isArchived ? "Unarchive" : "Archive") })
|
|
2787
2443
|
}
|
|
2788
2444
|
),
|
|
2789
|
-
/* @__PURE__ */
|
|
2790
|
-
|
|
2445
|
+
/* @__PURE__ */ jsx14(
|
|
2446
|
+
Box13,
|
|
2791
2447
|
{
|
|
2792
2448
|
borderStyle: "round",
|
|
2793
2449
|
borderColor: archiveFocus === "cancel" ? "white" : "gray",
|
|
@@ -2796,19 +2452,19 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2796
2452
|
alignItems: "center",
|
|
2797
2453
|
justifyContent: "center",
|
|
2798
2454
|
flexDirection: "column",
|
|
2799
|
-
children: /* @__PURE__ */
|
|
2455
|
+
children: /* @__PURE__ */ jsx14(Text14, { children: archiveFocus === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
2800
2456
|
}
|
|
2801
2457
|
)
|
|
2802
2458
|
] }),
|
|
2803
|
-
/* @__PURE__ */
|
|
2459
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
2804
2460
|
"Press Enter to ",
|
|
2805
2461
|
archiveFocus === "confirm" ? archiveTarget.isArchived ? "Unarchive" : "Archive" : "Cancel",
|
|
2806
2462
|
" | Y to ",
|
|
2807
2463
|
archiveTarget.isArchived ? "Unarchive" : "Archive",
|
|
2808
2464
|
" | C to Cancel"
|
|
2809
2465
|
] }) }),
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
|
|
2466
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(
|
|
2467
|
+
TextInput4,
|
|
2812
2468
|
{
|
|
2813
2469
|
value: "",
|
|
2814
2470
|
onChange: () => {
|
|
@@ -2822,28 +2478,21 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2822
2478
|
}
|
|
2823
2479
|
}
|
|
2824
2480
|
) }),
|
|
2825
|
-
archiveError && /* @__PURE__ */
|
|
2826
|
-
archiving && /* @__PURE__ */
|
|
2827
|
-
] }) }) :
|
|
2828
|
-
|
|
2829
|
-
{
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
}
|
|
2834
|
-
) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx16(Box15, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2835
|
-
/* @__PURE__ */ jsx16(Text16, { bold: true, children: "Sync Fork Confirmation" }),
|
|
2836
|
-
/* @__PURE__ */ jsx16(Text16, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
2837
|
-
/* @__PURE__ */ jsx16(Box15, { height: 1, children: /* @__PURE__ */ jsx16(Text16, { children: " " }) }),
|
|
2838
|
-
/* @__PURE__ */ jsx16(Text16, { children: syncTarget.nameWithOwner }),
|
|
2839
|
-
syncTarget.parent && /* @__PURE__ */ jsxs15(Text16, { color: "gray", children: [
|
|
2481
|
+
archiveError && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "magenta", children: archiveError }) }),
|
|
2482
|
+
archiving && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "yellow", children: archiveTarget.isArchived ? "Unarchiving..." : "Archiving..." }) })
|
|
2483
|
+
] }) }) : syncMode && syncTarget ? /* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2484
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, children: "Sync Fork Confirmation" }),
|
|
2485
|
+
/* @__PURE__ */ jsx14(Text14, { color: "blue", children: "\u27F2 Sync fork with upstream?" }),
|
|
2486
|
+
/* @__PURE__ */ jsx14(Box13, { height: 1, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
2487
|
+
/* @__PURE__ */ jsx14(Text14, { children: syncTarget.nameWithOwner }),
|
|
2488
|
+
syncTarget.parent && /* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
2840
2489
|
"Upstream: ",
|
|
2841
2490
|
syncTarget.parent.nameWithOwner
|
|
2842
2491
|
] }),
|
|
2843
|
-
/* @__PURE__ */
|
|
2844
|
-
/* @__PURE__ */
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
|
|
2492
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { children: "This will merge upstream changes into your fork." }) }),
|
|
2493
|
+
/* @__PURE__ */ jsxs13(Box13, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2494
|
+
/* @__PURE__ */ jsx14(
|
|
2495
|
+
Box13,
|
|
2847
2496
|
{
|
|
2848
2497
|
borderStyle: "round",
|
|
2849
2498
|
borderColor: "blue",
|
|
@@ -2852,11 +2501,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2852
2501
|
alignItems: "center",
|
|
2853
2502
|
justifyContent: "center",
|
|
2854
2503
|
flexDirection: "column",
|
|
2855
|
-
children: /* @__PURE__ */
|
|
2504
|
+
children: /* @__PURE__ */ jsx14(Text14, { children: syncFocus === "confirm" ? chalk11.bgBlue.white.bold(" Sync ") : chalk11.blue.bold("Sync") })
|
|
2856
2505
|
}
|
|
2857
2506
|
),
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
|
|
2507
|
+
/* @__PURE__ */ jsx14(
|
|
2508
|
+
Box13,
|
|
2860
2509
|
{
|
|
2861
2510
|
borderStyle: "round",
|
|
2862
2511
|
borderColor: syncFocus === "cancel" ? "white" : "gray",
|
|
@@ -2865,17 +2514,17 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2865
2514
|
alignItems: "center",
|
|
2866
2515
|
justifyContent: "center",
|
|
2867
2516
|
flexDirection: "column",
|
|
2868
|
-
children: /* @__PURE__ */
|
|
2517
|
+
children: /* @__PURE__ */ jsx14(Text14, { children: syncFocus === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
2869
2518
|
}
|
|
2870
2519
|
)
|
|
2871
2520
|
] }),
|
|
2872
|
-
/* @__PURE__ */
|
|
2521
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
2873
2522
|
"Press Enter to ",
|
|
2874
2523
|
syncFocus === "confirm" ? "Sync" : "Cancel",
|
|
2875
2524
|
" | Y to Sync | C to Cancel"
|
|
2876
2525
|
] }) }),
|
|
2877
|
-
/* @__PURE__ */
|
|
2878
|
-
|
|
2526
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(
|
|
2527
|
+
TextInput4,
|
|
2879
2528
|
{
|
|
2880
2529
|
value: "",
|
|
2881
2530
|
onChange: () => {
|
|
@@ -2889,14 +2538,14 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2889
2538
|
}
|
|
2890
2539
|
}
|
|
2891
2540
|
) }),
|
|
2892
|
-
syncError && /* @__PURE__ */
|
|
2893
|
-
syncing && /* @__PURE__ */
|
|
2894
|
-
] }) }) : logoutMode ? /* @__PURE__ */
|
|
2895
|
-
/* @__PURE__ */
|
|
2896
|
-
/* @__PURE__ */
|
|
2897
|
-
/* @__PURE__ */
|
|
2898
|
-
/* @__PURE__ */
|
|
2899
|
-
|
|
2541
|
+
syncError && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "magenta", children: syncError }) }),
|
|
2542
|
+
syncing && /* @__PURE__ */ jsx14(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "yellow", children: "Syncing..." }) })
|
|
2543
|
+
] }) }) : logoutMode ? /* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 80), children: [
|
|
2544
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, children: "Logout Confirmation" }),
|
|
2545
|
+
/* @__PURE__ */ jsx14(Text14, { color: "cyan", children: "Are you sure you want to log out?" }),
|
|
2546
|
+
/* @__PURE__ */ jsxs13(Box13, { marginTop: 1, flexDirection: "row", justifyContent: "center", gap: 6, children: [
|
|
2547
|
+
/* @__PURE__ */ jsx14(
|
|
2548
|
+
Box13,
|
|
2900
2549
|
{
|
|
2901
2550
|
borderStyle: "round",
|
|
2902
2551
|
borderColor: "cyan",
|
|
@@ -2905,11 +2554,11 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2905
2554
|
alignItems: "center",
|
|
2906
2555
|
justifyContent: "center",
|
|
2907
2556
|
flexDirection: "column",
|
|
2908
|
-
children: /* @__PURE__ */
|
|
2557
|
+
children: /* @__PURE__ */ jsx14(Text14, { children: logoutFocus === "confirm" ? chalk11.bgCyan.white.bold(" Logout ") : chalk11.cyan.bold("Logout") })
|
|
2909
2558
|
}
|
|
2910
2559
|
),
|
|
2911
|
-
/* @__PURE__ */
|
|
2912
|
-
|
|
2560
|
+
/* @__PURE__ */ jsx14(
|
|
2561
|
+
Box13,
|
|
2913
2562
|
{
|
|
2914
2563
|
borderStyle: "round",
|
|
2915
2564
|
borderColor: logoutFocus === "cancel" ? "white" : "gray",
|
|
@@ -2918,16 +2567,16 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2918
2567
|
alignItems: "center",
|
|
2919
2568
|
justifyContent: "center",
|
|
2920
2569
|
flexDirection: "column",
|
|
2921
|
-
children: /* @__PURE__ */
|
|
2570
|
+
children: /* @__PURE__ */ jsx14(Text14, { children: logoutFocus === "cancel" ? chalk11.bgGray.white.bold(" Cancel ") : chalk11.gray.bold("Cancel") })
|
|
2922
2571
|
}
|
|
2923
2572
|
)
|
|
2924
2573
|
] }),
|
|
2925
|
-
/* @__PURE__ */
|
|
2574
|
+
/* @__PURE__ */ jsx14(Box13, { marginTop: 1, flexDirection: "row", justifyContent: "center", children: /* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
2926
2575
|
"Press Enter to ",
|
|
2927
2576
|
logoutFocus === "confirm" ? "Logout" : "Cancel",
|
|
2928
2577
|
" | Y to Logout | C to Cancel"
|
|
2929
2578
|
] }) })
|
|
2930
|
-
] }) }) : orgSwitcherOpen ? /* @__PURE__ */
|
|
2579
|
+
] }) }) : orgSwitcherOpen ? /* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx14(
|
|
2931
2580
|
OrgSwitcher,
|
|
2932
2581
|
{
|
|
2933
2582
|
token,
|
|
@@ -2935,45 +2584,45 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2935
2584
|
onSelect: handleOrgContextChange,
|
|
2936
2585
|
onClose: () => setOrgSwitcherOpen(false)
|
|
2937
2586
|
}
|
|
2938
|
-
) }) : infoMode ? /* @__PURE__ */
|
|
2587
|
+
) }) : infoMode ? /* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: (() => {
|
|
2939
2588
|
const repo = infoRepo || visibleItems[cursor];
|
|
2940
|
-
if (!repo) return /* @__PURE__ */
|
|
2589
|
+
if (!repo) return /* @__PURE__ */ jsx14(Text14, { color: "red", children: "No repository selected." });
|
|
2941
2590
|
const langName = repo.primaryLanguage?.name || "N/A";
|
|
2942
2591
|
const langColor = repo.primaryLanguage?.color || "#666666";
|
|
2943
|
-
return /* @__PURE__ */
|
|
2944
|
-
/* @__PURE__ */
|
|
2592
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 3, paddingY: 2, width: Math.min(terminalWidth - 8, 90), children: [
|
|
2593
|
+
/* @__PURE__ */ jsxs13(Text14, { bold: true, children: [
|
|
2945
2594
|
"Repository Info ",
|
|
2946
|
-
infoRepo ?
|
|
2595
|
+
infoRepo ? chalk11.dim("(cached)") : ""
|
|
2947
2596
|
] }),
|
|
2948
|
-
/* @__PURE__ */
|
|
2949
|
-
/* @__PURE__ */
|
|
2950
|
-
repo.description && /* @__PURE__ */
|
|
2951
|
-
/* @__PURE__ */
|
|
2952
|
-
/* @__PURE__ */
|
|
2953
|
-
repo.visibility === "PRIVATE" ?
|
|
2954
|
-
repo.isArchived ?
|
|
2955
|
-
repo.isFork ?
|
|
2597
|
+
/* @__PURE__ */ jsx14(Box13, { height: 1, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
2598
|
+
/* @__PURE__ */ jsx14(Text14, { children: chalk11.bold(repo.nameWithOwner) }),
|
|
2599
|
+
repo.description && /* @__PURE__ */ jsx14(Text14, { color: "gray", children: repo.description }),
|
|
2600
|
+
/* @__PURE__ */ jsx14(Box13, { height: 1, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
2601
|
+
/* @__PURE__ */ jsxs13(Text14, { children: [
|
|
2602
|
+
repo.visibility === "PRIVATE" ? chalk11.yellow("Private") : repo.visibility === "INTERNAL" ? chalk11.magenta("Internal") : chalk11.green("Public"),
|
|
2603
|
+
repo.isArchived ? chalk11.gray(" Archived") : "",
|
|
2604
|
+
repo.isFork ? chalk11.blue(" Fork") : ""
|
|
2956
2605
|
] }),
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
|
|
2960
|
-
|
|
2606
|
+
/* @__PURE__ */ jsx14(Text14, { children: chalk11.gray(`\u2605 ${repo.stargazerCount} \u2442 ${repo.forkCount}`) }),
|
|
2607
|
+
/* @__PURE__ */ jsxs13(Text14, { children: [
|
|
2608
|
+
chalk11.hex(langColor)(`\u25CF `),
|
|
2609
|
+
chalk11.gray(`${langName}`)
|
|
2961
2610
|
] }),
|
|
2962
|
-
/* @__PURE__ */
|
|
2611
|
+
/* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
2963
2612
|
"Updated: ",
|
|
2964
2613
|
formatDate(repo.updatedAt),
|
|
2965
2614
|
" \u2022 Pushed: ",
|
|
2966
2615
|
formatDate(repo.pushedAt)
|
|
2967
2616
|
] }),
|
|
2968
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ jsxs13(Text14, { color: "gray", children: [
|
|
2969
2618
|
"Size: ",
|
|
2970
2619
|
repo.diskUsage,
|
|
2971
2620
|
" KB"
|
|
2972
2621
|
] }),
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ jsx14(Box13, { height: 1, children: /* @__PURE__ */ jsx14(Text14, { children: " " }) }),
|
|
2623
|
+
/* @__PURE__ */ jsx14(Text14, { color: "gray", children: "Press Esc or I to close" })
|
|
2975
2624
|
] });
|
|
2976
|
-
})() }) : visibilityMode ? /* @__PURE__ */
|
|
2625
|
+
})() }) : visibilityMode ? /* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx14(
|
|
2977
2626
|
VisibilityModal,
|
|
2978
2627
|
{
|
|
2979
2628
|
currentFilter: visibilityFilter,
|
|
@@ -2986,7 +2635,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2986
2635
|
},
|
|
2987
2636
|
onCancel: () => setVisibilityMode(false)
|
|
2988
2637
|
}
|
|
2989
|
-
) }) : sortMode ? /* @__PURE__ */
|
|
2638
|
+
) }) : sortMode ? /* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx14(
|
|
2990
2639
|
SortModal,
|
|
2991
2640
|
{
|
|
2992
2641
|
currentSort: sortKey,
|
|
@@ -2998,7 +2647,7 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
2998
2647
|
},
|
|
2999
2648
|
onCancel: () => setSortMode(false)
|
|
3000
2649
|
}
|
|
3001
|
-
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */
|
|
2650
|
+
) }) : changeVisibilityMode && changeVisibilityTarget ? /* @__PURE__ */ jsx14(Box13, { height: contentHeight, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx14(
|
|
3002
2651
|
ChangeVisibilityModal,
|
|
3003
2652
|
{
|
|
3004
2653
|
isOpen: changeVisibilityMode,
|
|
@@ -3011,16 +2660,8 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3011
2660
|
changing: changingVisibility,
|
|
3012
2661
|
error: changeVisibilityError
|
|
3013
2662
|
}
|
|
3014
|
-
) }) :
|
|
3015
|
-
|
|
3016
|
-
{
|
|
3017
|
-
repo: copyUrlTarget,
|
|
3018
|
-
terminalWidth,
|
|
3019
|
-
onClose: closeCopyUrlModal,
|
|
3020
|
-
onCopy: handleCopyUrl
|
|
3021
|
-
}
|
|
3022
|
-
) }) : /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
3023
|
-
/* @__PURE__ */ jsx16(
|
|
2663
|
+
) }) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
2664
|
+
/* @__PURE__ */ jsx14(
|
|
3024
2665
|
RepoListHeader,
|
|
3025
2666
|
{
|
|
3026
2667
|
ownerContext,
|
|
@@ -3034,10 +2675,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3034
2675
|
isEnterprise: isEnterpriseOrg
|
|
3035
2676
|
}
|
|
3036
2677
|
),
|
|
3037
|
-
filterMode && /* @__PURE__ */
|
|
3038
|
-
/* @__PURE__ */
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
|
|
2678
|
+
filterMode && /* @__PURE__ */ jsxs13(Box13, { marginBottom: 1, children: [
|
|
2679
|
+
/* @__PURE__ */ jsx14(Text14, { children: "Search: " }),
|
|
2680
|
+
/* @__PURE__ */ jsx14(
|
|
2681
|
+
TextInput4,
|
|
3041
2682
|
{
|
|
3042
2683
|
value: filter,
|
|
3043
2684
|
onChange: (val) => {
|
|
@@ -3076,10 +2717,10 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3076
2717
|
}
|
|
3077
2718
|
)
|
|
3078
2719
|
] }),
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", height: listHeight, children: [
|
|
2721
|
+
filterMode && filter.trim().length > 0 && filter.trim().length < 3 ? /* @__PURE__ */ jsx14(Box13, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", dimColor: true, children: "Type at least 3 characters to search" }) }) : visibleItems.slice(windowed.start, windowed.end).map((repo, i) => {
|
|
3081
2722
|
const idx = windowed.start + i;
|
|
3082
|
-
return /* @__PURE__ */
|
|
2723
|
+
return /* @__PURE__ */ jsx14(
|
|
3083
2724
|
RepoRow,
|
|
3084
2725
|
{
|
|
3085
2726
|
repo,
|
|
@@ -3092,33 +2733,32 @@ function RepoList({ token, maxVisibleRows, onLogout, viewerLogin, onOrgContextCh
|
|
|
3092
2733
|
repo.nameWithOwner
|
|
3093
2734
|
);
|
|
3094
2735
|
}),
|
|
3095
|
-
loadingMore && hasNextPage && /* @__PURE__ */
|
|
3096
|
-
/* @__PURE__ */
|
|
3097
|
-
/* @__PURE__ */
|
|
2736
|
+
loadingMore && hasNextPage && /* @__PURE__ */ jsx14(Box13, { justifyContent: "center", alignItems: "center", marginTop: 1, children: /* @__PURE__ */ jsxs13(Box13, { flexDirection: "row", children: [
|
|
2737
|
+
/* @__PURE__ */ jsx14(Box13, { width: 2, flexShrink: 0, flexGrow: 0, marginRight: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "cyan", children: /* @__PURE__ */ jsx14(SlowSpinner, {}) }) }),
|
|
2738
|
+
/* @__PURE__ */ jsx14(Text14, { color: "cyan", children: "Loading more repositories..." })
|
|
3098
2739
|
] }) }),
|
|
3099
|
-
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */
|
|
2740
|
+
!loading && !searchLoading && visibleItems.length === 0 && /* @__PURE__ */ jsx14(Box13, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: /* @__PURE__ */ jsx14(Text14, { color: "gray", dimColor: true, children: searchActive ? "No repositories match your search" : filter ? "No repositories match your filter" : "No repositories found" }) })
|
|
3100
2741
|
] })
|
|
3101
2742
|
] }) }),
|
|
3102
|
-
/* @__PURE__ */
|
|
3103
|
-
/* @__PURE__ */
|
|
3104
|
-
/* @__PURE__ */
|
|
3105
|
-
/* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ jsxs13(Box13, { marginTop: 1, paddingX: 1, flexDirection: "column", children: [
|
|
2744
|
+
/* @__PURE__ */ jsx14(Box13, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx14(Text14, { color: "gray", dimColor: modalOpen ? true : void 0, children: "\u2191\u2193 Navigate \u2022 \u23CE/O Open \u2022 R Refresh \u2022 W Org Switch \u2022 Ctrl+L Logout \u2022 Q Quit" }) }),
|
|
2745
|
+
/* @__PURE__ */ jsx14(Box13, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx14(Text14, { color: "gray", dimColor: modalOpen ? true : void 0, children: "Ctrl+G Top \u2022 G Bottom \u2022 / Search \u2022 S Sort \u2022 D Direction \u2022 T Density \u2022 F Fork Status \u2022 V Visibility" }) }),
|
|
2746
|
+
/* @__PURE__ */ jsx14(Box13, { width: terminalWidth, justifyContent: "center", children: /* @__PURE__ */ jsx14(Text14, { color: "gray", dimColor: modalOpen ? true : void 0, children: "I Info \u2022 K Cache Info \u2022 Ctrl+A Un/Archive \u2022 Ctrl+V Change Visibility \u2022 Del/Backspace Delete \u2022 Ctrl+S Sync Fork" }) })
|
|
3106
2747
|
] }),
|
|
3107
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3108
|
-
/* @__PURE__ */
|
|
3109
|
-
debugMessages.length === 0 ? /* @__PURE__ */
|
|
3110
|
-
] })
|
|
3111
|
-
copyToast && /* @__PURE__ */ jsx16(Box15, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx16(Box15, { borderStyle: "round", borderColor: copyToast.includes("Failed") ? "red" : "green", paddingX: 2, paddingY: 0, children: /* @__PURE__ */ jsx16(Text16, { color: copyToast.includes("Failed") ? "red" : "green", children: copyToast }) }) })
|
|
2748
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, borderStyle: "single", borderColor: "yellow", paddingX: 1, flexDirection: "column", children: [
|
|
2749
|
+
/* @__PURE__ */ jsx14(Text14, { bold: true, color: "yellow", children: "Debug Messages:" }),
|
|
2750
|
+
debugMessages.length === 0 ? /* @__PURE__ */ jsx14(Text14, { color: "gray", children: "No debug messages yet..." }) : debugMessages.map((msg, i) => /* @__PURE__ */ jsx14(Text14, { color: "gray", children: msg }, i))
|
|
2751
|
+
] })
|
|
3112
2752
|
] });
|
|
3113
2753
|
}
|
|
3114
2754
|
|
|
3115
2755
|
// src/ui/components/auth/AuthMethodSelector.tsx
|
|
3116
|
-
import { useState as
|
|
3117
|
-
import { Box as
|
|
3118
|
-
import
|
|
3119
|
-
import { jsx as
|
|
2756
|
+
import { useState as useState11 } from "react";
|
|
2757
|
+
import { Box as Box14, Text as Text15, useInput as useInput11 } from "ink";
|
|
2758
|
+
import chalk12 from "chalk";
|
|
2759
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3120
2760
|
function AuthMethodSelector({ onSelect, onQuit }) {
|
|
3121
|
-
const [selectedIndex, setSelectedIndex] =
|
|
2761
|
+
const [selectedIndex, setSelectedIndex] = useState11(0);
|
|
3122
2762
|
const methods = [
|
|
3123
2763
|
{
|
|
3124
2764
|
key: "oauth",
|
|
@@ -3131,7 +2771,7 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3131
2771
|
description: "Manually enter a GitHub Personal Access Token"
|
|
3132
2772
|
}
|
|
3133
2773
|
];
|
|
3134
|
-
|
|
2774
|
+
useInput11((input, key) => {
|
|
3135
2775
|
if (key.escape || input?.toLowerCase() === "q") {
|
|
3136
2776
|
if (onQuit) {
|
|
3137
2777
|
onQuit();
|
|
@@ -3150,34 +2790,34 @@ function AuthMethodSelector({ onSelect, onQuit }) {
|
|
|
3150
2790
|
onSelect("pat");
|
|
3151
2791
|
}
|
|
3152
2792
|
});
|
|
3153
|
-
return /* @__PURE__ */
|
|
3154
|
-
/* @__PURE__ */
|
|
3155
|
-
/* @__PURE__ */
|
|
2793
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, children: [
|
|
2794
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, marginBottom: 1, children: "Choose Authentication Method" }),
|
|
2795
|
+
/* @__PURE__ */ jsx15(Box14, { flexDirection: "column", marginY: 1, children: methods.map((method, index) => {
|
|
3156
2796
|
const isSelected = index === selectedIndex;
|
|
3157
|
-
const prefix = isSelected ?
|
|
2797
|
+
const prefix = isSelected ? chalk12.cyan("\u203A") : " ";
|
|
3158
2798
|
const numberPrefix = `${index + 1}.`;
|
|
3159
|
-
return /* @__PURE__ */
|
|
3160
|
-
/* @__PURE__ */
|
|
2799
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", marginBottom: 1, children: [
|
|
2800
|
+
/* @__PURE__ */ jsx15(Text15, { children: /* @__PURE__ */ jsxs14(Text15, { color: isSelected ? "cyan" : void 0, bold: isSelected, children: [
|
|
3161
2801
|
prefix,
|
|
3162
2802
|
" ",
|
|
3163
2803
|
numberPrefix,
|
|
3164
2804
|
" ",
|
|
3165
2805
|
method.label
|
|
3166
2806
|
] }) }),
|
|
3167
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ jsxs14(Text15, { color: "gray", dimColor: true, children: [
|
|
3168
2808
|
" ",
|
|
3169
2809
|
method.description
|
|
3170
2810
|
] })
|
|
3171
2811
|
] }, method.key);
|
|
3172
2812
|
}) }),
|
|
3173
|
-
/* @__PURE__ */
|
|
2813
|
+
/* @__PURE__ */ jsx15(Text15, { color: "gray", dimColor: true, marginTop: 1, children: "Use arrow keys to navigate, Enter to select, or press 1/2 \u2022 Q/Esc to quit" })
|
|
3174
2814
|
] });
|
|
3175
2815
|
}
|
|
3176
2816
|
|
|
3177
2817
|
// src/ui/components/auth/OAuthProgress.tsx
|
|
3178
|
-
import { Box as
|
|
2818
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
3179
2819
|
import Spinner from "ink-spinner";
|
|
3180
|
-
import { jsx as
|
|
2820
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3181
2821
|
function OAuthProgress({ status, error, deviceCode }) {
|
|
3182
2822
|
const statusMessages = {
|
|
3183
2823
|
initializing: {
|
|
@@ -3214,69 +2854,69 @@ function OAuthProgress({ status, error, deviceCode }) {
|
|
|
3214
2854
|
}
|
|
3215
2855
|
};
|
|
3216
2856
|
const { message, showSpinner } = statusMessages[status];
|
|
3217
|
-
return /* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
3219
|
-
/* @__PURE__ */
|
|
3220
|
-
/* @__PURE__ */
|
|
3221
|
-
/* @__PURE__ */
|
|
2857
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", borderStyle: "single", borderColor: status === "error" ? "red" : "cyan", paddingX: 2, paddingY: 1, children: [
|
|
2858
|
+
/* @__PURE__ */ jsx16(Text16, { bold: true, marginBottom: 1, children: "GitHub OAuth Authentication" }),
|
|
2859
|
+
/* @__PURE__ */ jsx16(Box15, { marginY: 1, children: showSpinner ? /* @__PURE__ */ jsxs15(Box15, { children: [
|
|
2860
|
+
/* @__PURE__ */ jsx16(Text16, { color: "green", children: /* @__PURE__ */ jsx16(Spinner, { type: "dots" }) }),
|
|
2861
|
+
/* @__PURE__ */ jsxs15(Text16, { children: [
|
|
3222
2862
|
" ",
|
|
3223
2863
|
message
|
|
3224
2864
|
] })
|
|
3225
|
-
] }) : /* @__PURE__ */
|
|
2865
|
+
] }) : /* @__PURE__ */ jsxs15(Text16, { color: status === "error" ? "red" : "green", children: [
|
|
3226
2866
|
status === "error" ? "\u2717" : "\u2713",
|
|
3227
2867
|
" ",
|
|
3228
2868
|
message
|
|
3229
2869
|
] }) }),
|
|
3230
|
-
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
2870
|
+
(status === "waiting_for_authorization" || status === "polling_for_token") && deviceCode && /* @__PURE__ */ jsxs15(Box15, { marginY: 1, flexDirection: "column", children: [
|
|
2871
|
+
/* @__PURE__ */ jsx16(Text16, { bold: true, color: "cyan", marginBottom: 1, children: "\u{1F4CB} Please complete these steps:" }),
|
|
2872
|
+
/* @__PURE__ */ jsxs15(Box15, { marginBottom: 1, children: [
|
|
2873
|
+
/* @__PURE__ */ jsx16(Text16, { children: "1. Visit: " }),
|
|
2874
|
+
/* @__PURE__ */ jsx16(Text16, { bold: true, color: "blue", children: deviceCode.verification_uri })
|
|
3235
2875
|
] }),
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3238
|
-
/* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ jsxs15(Box15, { marginBottom: 1, flexDirection: "column", children: [
|
|
2877
|
+
/* @__PURE__ */ jsx16(Text16, { children: "2. Enter this code:" }),
|
|
2878
|
+
/* @__PURE__ */ jsx16(Box15, { borderStyle: "single", borderColor: "yellow", paddingX: 2, paddingY: 1, marginTop: 1, children: /* @__PURE__ */ jsx16(Text16, { bold: true, color: "yellow", children: deviceCode.user_code }) })
|
|
3239
2879
|
] }),
|
|
3240
|
-
status === "waiting_for_authorization" && /* @__PURE__ */
|
|
3241
|
-
status === "polling_for_token" && /* @__PURE__ */
|
|
3242
|
-
/* @__PURE__ */
|
|
3243
|
-
/* @__PURE__ */
|
|
2880
|
+
status === "waiting_for_authorization" && /* @__PURE__ */ jsx16(Text16, { color: "gray", marginTop: 1, children: "Your browser should open automatically." }),
|
|
2881
|
+
status === "polling_for_token" && /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", marginTop: 1, children: [
|
|
2882
|
+
/* @__PURE__ */ jsx16(Text16, { color: "gray", children: "Waiting for you to complete authorization in your browser..." }),
|
|
2883
|
+
/* @__PURE__ */ jsx16(Text16, { color: "gray", dimColor: true, marginTop: 1, children: "This will timeout in 15 minutes. Press Esc to cancel." })
|
|
3244
2884
|
] })
|
|
3245
2885
|
] }),
|
|
3246
|
-
status === "error" && error && /* @__PURE__ */
|
|
3247
|
-
/* @__PURE__ */
|
|
3248
|
-
/* @__PURE__ */
|
|
2886
|
+
status === "error" && error && /* @__PURE__ */ jsxs15(Box15, { marginY: 1, flexDirection: "column", children: [
|
|
2887
|
+
/* @__PURE__ */ jsx16(Text16, { color: "red", children: error }),
|
|
2888
|
+
/* @__PURE__ */ jsx16(Text16, { color: "gray", marginTop: 1, children: "Press Esc to go back and try again." })
|
|
3249
2889
|
] }),
|
|
3250
|
-
status === "success" && /* @__PURE__ */
|
|
2890
|
+
status === "success" && /* @__PURE__ */ jsx16(Text16, { color: "gray", marginTop: 1, children: "Returning to application..." })
|
|
3251
2891
|
] });
|
|
3252
2892
|
}
|
|
3253
2893
|
|
|
3254
2894
|
// src/ui/App.tsx
|
|
3255
|
-
import { jsx as
|
|
2895
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3256
2896
|
var packageJson = require_package();
|
|
3257
2897
|
function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlineTokenEphemeral }) {
|
|
3258
2898
|
const { exit } = useApp2();
|
|
3259
2899
|
const { stdout } = useStdout2();
|
|
3260
|
-
const [mode, setMode] =
|
|
3261
|
-
const [token, setToken] =
|
|
3262
|
-
const [input, setInput] =
|
|
3263
|
-
const [error, setError] =
|
|
3264
|
-
const [viewer, setViewer] =
|
|
3265
|
-
const [rateLimitReset, setRateLimitReset] =
|
|
3266
|
-
const [wasRateLimited, setWasRateLimited] =
|
|
3267
|
-
const [orgContext, setOrgContext] =
|
|
3268
|
-
const [authMethod, setAuthMethod] =
|
|
3269
|
-
const [oauthStatus, setOAuthStatus] =
|
|
3270
|
-
const [tokenSource, setTokenSource] =
|
|
3271
|
-
const [sessionTokenOrigin, setSessionTokenOrigin] =
|
|
3272
|
-
const [deviceCodeResponse, setDeviceCodeResponse] =
|
|
3273
|
-
const [oauthDeviceCode, setOauthDeviceCode] =
|
|
3274
|
-
const [dims, setDims] =
|
|
2900
|
+
const [mode, setMode] = useState12("checking");
|
|
2901
|
+
const [token, setToken] = useState12(null);
|
|
2902
|
+
const [input, setInput] = useState12("");
|
|
2903
|
+
const [error, setError] = useState12(null);
|
|
2904
|
+
const [viewer, setViewer] = useState12(null);
|
|
2905
|
+
const [rateLimitReset, setRateLimitReset] = useState12(null);
|
|
2906
|
+
const [wasRateLimited, setWasRateLimited] = useState12(false);
|
|
2907
|
+
const [orgContext, setOrgContext] = useState12("personal");
|
|
2908
|
+
const [authMethod, setAuthMethod] = useState12("pat");
|
|
2909
|
+
const [oauthStatus, setOAuthStatus] = useState12("initializing");
|
|
2910
|
+
const [tokenSource, setTokenSource] = useState12("pat");
|
|
2911
|
+
const [sessionTokenOrigin, setSessionTokenOrigin] = useState12("stored");
|
|
2912
|
+
const [deviceCodeResponse, setDeviceCodeResponse] = useState12(null);
|
|
2913
|
+
const [oauthDeviceCode, setOauthDeviceCode] = useState12(null);
|
|
2914
|
+
const [dims, setDims] = useState12(() => {
|
|
3275
2915
|
const cols = stdout?.columns ?? 100;
|
|
3276
2916
|
const rows = stdout?.rows ?? 30;
|
|
3277
2917
|
return { cols, rows };
|
|
3278
2918
|
});
|
|
3279
|
-
|
|
2919
|
+
useEffect8(() => {
|
|
3280
2920
|
if (!stdout) return;
|
|
3281
2921
|
const onResize = () => {
|
|
3282
2922
|
const cols = stdout.columns ?? 100;
|
|
@@ -3288,7 +2928,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3288
2928
|
stdout.off?.("resize", onResize);
|
|
3289
2929
|
};
|
|
3290
2930
|
}, [stdout]);
|
|
3291
|
-
|
|
2931
|
+
useEffect8(() => {
|
|
3292
2932
|
const env = getTokenFromEnv();
|
|
3293
2933
|
const stored = getStoredToken();
|
|
3294
2934
|
const source = getTokenSource();
|
|
@@ -3312,7 +2952,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3312
2952
|
setMode("auth_method_selection");
|
|
3313
2953
|
}
|
|
3314
2954
|
}, [inlineToken2]);
|
|
3315
|
-
|
|
2955
|
+
useEffect8(() => {
|
|
3316
2956
|
if (mode !== "oauth_flow") return;
|
|
3317
2957
|
(async () => {
|
|
3318
2958
|
try {
|
|
@@ -3364,7 +3004,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3364
3004
|
setMode("oauth_flow");
|
|
3365
3005
|
}
|
|
3366
3006
|
};
|
|
3367
|
-
|
|
3007
|
+
useEffect8(() => {
|
|
3368
3008
|
(async () => {
|
|
3369
3009
|
if (mode !== "validating" || !token) return;
|
|
3370
3010
|
const timeoutId = setTimeout(() => {
|
|
@@ -3476,7 +3116,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3476
3116
|
setTokenSource("pat");
|
|
3477
3117
|
setMode("auth_method_selection");
|
|
3478
3118
|
};
|
|
3479
|
-
|
|
3119
|
+
useInput12((input2, key) => {
|
|
3480
3120
|
if ((mode === "prompt" || mode === "auth_method_selection") && key.escape) {
|
|
3481
3121
|
exit();
|
|
3482
3122
|
}
|
|
@@ -3508,19 +3148,19 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3508
3148
|
}
|
|
3509
3149
|
});
|
|
3510
3150
|
const verticalPadding = Math.floor(dims.rows * 0.15);
|
|
3511
|
-
const header = useMemo2(() => /* @__PURE__ */
|
|
3512
|
-
/* @__PURE__ */
|
|
3513
|
-
/* @__PURE__ */
|
|
3151
|
+
const header = useMemo2(() => /* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", justifyContent: "space-between", marginBottom: 1, children: [
|
|
3152
|
+
/* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", gap: 1, children: [
|
|
3153
|
+
/* @__PURE__ */ jsxs16(Text17, { bold: true, color: "cyan", children: [
|
|
3514
3154
|
" ",
|
|
3515
3155
|
"GitHub Repository Manager"
|
|
3516
3156
|
] }),
|
|
3517
|
-
/* @__PURE__ */
|
|
3157
|
+
/* @__PURE__ */ jsxs16(Text17, { color: "gray", dimColor: true, children: [
|
|
3518
3158
|
"v",
|
|
3519
3159
|
packageJson.version
|
|
3520
3160
|
] }),
|
|
3521
|
-
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */
|
|
3161
|
+
process.env.GH_MANAGER_DEBUG === "1" && /* @__PURE__ */ jsx17(Text17, { backgroundColor: "blue", color: "white", children: " debug mode " })
|
|
3522
3162
|
] }),
|
|
3523
|
-
viewer && /* @__PURE__ */
|
|
3163
|
+
viewer && /* @__PURE__ */ jsx17(Text17, { color: "gray", children: orgContext !== "personal" && orgContext.login ? `${orgContext.login}/@${viewer} ` : `@${viewer} ` })
|
|
3524
3164
|
] }), [viewer, orgContext]);
|
|
3525
3165
|
if (mode === "rate_limited") {
|
|
3526
3166
|
const formatResetTime = (resetTime) => {
|
|
@@ -3543,71 +3183,71 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3543
3183
|
return "Unknown";
|
|
3544
3184
|
}
|
|
3545
3185
|
};
|
|
3546
|
-
return /* @__PURE__ */
|
|
3186
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3547
3187
|
header,
|
|
3548
|
-
/* @__PURE__ */
|
|
3549
|
-
/* @__PURE__ */
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3552
|
-
rateLimitReset && /* @__PURE__ */
|
|
3553
|
-
/* @__PURE__ */
|
|
3554
|
-
/* @__PURE__ */
|
|
3188
|
+
/* @__PURE__ */ jsx17(Box16, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs16(Box16, { borderStyle: "single", borderColor: "yellow", paddingX: 3, paddingY: 2, flexDirection: "column", width: Math.min(dims.cols - 8, 80), children: [
|
|
3189
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, color: "yellow", marginBottom: 1, children: "\u26A0\uFE0F Rate Limit Exceeded" }),
|
|
3190
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", marginBottom: 1, children: "You've hit GitHub's API rate limit for your token." }),
|
|
3191
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", marginBottom: 1, children: "This happens when you make too many requests in a short time." }),
|
|
3192
|
+
rateLimitReset && /* @__PURE__ */ jsxs16(Box16, { marginTop: 1, marginBottom: 1, children: [
|
|
3193
|
+
/* @__PURE__ */ jsxs16(Text17, { children: [
|
|
3194
|
+
/* @__PURE__ */ jsx17(Text17, { color: "cyan", children: "Reset in:" }),
|
|
3555
3195
|
" ",
|
|
3556
|
-
/* @__PURE__ */
|
|
3196
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: formatResetTime(rateLimitReset) })
|
|
3557
3197
|
] }),
|
|
3558
|
-
/* @__PURE__ */
|
|
3198
|
+
/* @__PURE__ */ jsxs16(Text17, { color: "gray", dimColor: true, children: [
|
|
3559
3199
|
"(",
|
|
3560
3200
|
new Date(rateLimitReset).toLocaleTimeString(),
|
|
3561
3201
|
")"
|
|
3562
3202
|
] })
|
|
3563
3203
|
] }),
|
|
3564
|
-
/* @__PURE__ */
|
|
3565
|
-
/* @__PURE__ */
|
|
3566
|
-
/* @__PURE__ */
|
|
3567
|
-
/* @__PURE__ */
|
|
3568
|
-
/* @__PURE__ */
|
|
3204
|
+
/* @__PURE__ */ jsxs16(Box16, { marginTop: 2, flexDirection: "column", gap: 1, children: [
|
|
3205
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, children: "What would you like to do?" }),
|
|
3206
|
+
/* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", paddingLeft: 2, children: [
|
|
3207
|
+
/* @__PURE__ */ jsxs16(Text17, { children: [
|
|
3208
|
+
/* @__PURE__ */ jsx17(Text17, { color: "cyan", bold: true, children: "R" }),
|
|
3569
3209
|
" - Retry now ",
|
|
3570
3210
|
rateLimitReset && formatResetTime(rateLimitReset) !== "Now (should be reset)" ? "(likely to fail until reset)" : "(should work now)"
|
|
3571
3211
|
] }),
|
|
3572
|
-
/* @__PURE__ */
|
|
3573
|
-
/* @__PURE__ */
|
|
3212
|
+
/* @__PURE__ */ jsxs16(Text17, { children: [
|
|
3213
|
+
/* @__PURE__ */ jsx17(Text17, { color: "cyan", bold: true, children: "L" }),
|
|
3574
3214
|
" - Logout and choose authentication method"
|
|
3575
3215
|
] }),
|
|
3576
|
-
/* @__PURE__ */
|
|
3577
|
-
/* @__PURE__ */
|
|
3216
|
+
/* @__PURE__ */ jsxs16(Text17, { children: [
|
|
3217
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", bold: true, children: "Q/Esc" }),
|
|
3578
3218
|
" - Quit application"
|
|
3579
3219
|
] })
|
|
3580
3220
|
] })
|
|
3581
3221
|
] }),
|
|
3582
|
-
/* @__PURE__ */
|
|
3222
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: true, marginTop: 2, children: "Tip: Using multiple tokens or waiting between requests can help avoid rate limits." })
|
|
3583
3223
|
] }) })
|
|
3584
3224
|
] });
|
|
3585
3225
|
}
|
|
3586
3226
|
if (mode === "auth_method_selection") {
|
|
3587
|
-
return /* @__PURE__ */
|
|
3227
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3588
3228
|
header,
|
|
3589
|
-
/* @__PURE__ */
|
|
3590
|
-
/* @__PURE__ */
|
|
3591
|
-
error && /* @__PURE__ */
|
|
3229
|
+
/* @__PURE__ */ jsx17(Box16, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", alignItems: "center", children: [
|
|
3230
|
+
/* @__PURE__ */ jsx17(AuthMethodSelector, { onSelect: handleAuthMethodSelect }),
|
|
3231
|
+
error && /* @__PURE__ */ jsx17(Text17, { color: "red", marginTop: 1, children: error })
|
|
3592
3232
|
] }) })
|
|
3593
3233
|
] });
|
|
3594
3234
|
}
|
|
3595
3235
|
if (mode === "oauth_flow") {
|
|
3596
|
-
return /* @__PURE__ */
|
|
3236
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3597
3237
|
header,
|
|
3598
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx17(Box16, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx17(OAuthProgress, { status: oauthStatus, error: error || void 0, deviceCode: oauthDeviceCode || void 0 }) })
|
|
3599
3239
|
] });
|
|
3600
3240
|
}
|
|
3601
3241
|
if (mode === "prompt") {
|
|
3602
|
-
return /* @__PURE__ */
|
|
3242
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3603
3243
|
header,
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3606
|
-
/* @__PURE__ */
|
|
3607
|
-
/* @__PURE__ */
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */
|
|
3610
|
-
|
|
3244
|
+
/* @__PURE__ */ jsx17(Box16, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs16(Box16, { borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1, flexDirection: "column", children: [
|
|
3245
|
+
/* @__PURE__ */ jsx17(Text17, { bold: true, marginBottom: 1, children: "Authentication Required" }),
|
|
3246
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", marginBottom: 1, children: "Enter your GitHub Personal Access Token" }),
|
|
3247
|
+
/* @__PURE__ */ jsxs16(Box16, { children: [
|
|
3248
|
+
/* @__PURE__ */ jsx17(Text17, { children: "Token: " }),
|
|
3249
|
+
/* @__PURE__ */ jsx17(
|
|
3250
|
+
TextInput5,
|
|
3611
3251
|
{
|
|
3612
3252
|
value: input,
|
|
3613
3253
|
onChange: setInput,
|
|
@@ -3616,30 +3256,30 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3616
3256
|
}
|
|
3617
3257
|
)
|
|
3618
3258
|
] }),
|
|
3619
|
-
error && /* @__PURE__ */
|
|
3620
|
-
/* @__PURE__ */
|
|
3621
|
-
/* @__PURE__ */
|
|
3259
|
+
error && /* @__PURE__ */ jsx17(Text17, { color: "red", marginTop: 1, children: error }),
|
|
3260
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: true, marginTop: 1, children: "The token will be stored securely in your local config" }),
|
|
3261
|
+
/* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to go back" })
|
|
3622
3262
|
] }) })
|
|
3623
3263
|
] });
|
|
3624
3264
|
}
|
|
3625
3265
|
if (mode === "validating" || mode === "checking") {
|
|
3626
|
-
return /* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3627
3267
|
header,
|
|
3628
|
-
/* @__PURE__ */
|
|
3629
|
-
/* @__PURE__ */
|
|
3630
|
-
mode === "validating" && /* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ jsx17(Box16, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", alignItems: "center", children: [
|
|
3269
|
+
/* @__PURE__ */ jsx17(Text17, { color: "yellow", children: "Validating token..." }),
|
|
3270
|
+
mode === "validating" && /* @__PURE__ */ jsx17(Text17, { color: "gray", dimColor: true, marginTop: 1, children: "Press Esc to cancel" })
|
|
3631
3271
|
] }) })
|
|
3632
3272
|
] });
|
|
3633
3273
|
}
|
|
3634
3274
|
if (mode === "error") {
|
|
3635
|
-
return /* @__PURE__ */
|
|
3275
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3636
3276
|
header,
|
|
3637
|
-
/* @__PURE__ */
|
|
3277
|
+
/* @__PURE__ */ jsx17(Box16, { flexGrow: 1, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ jsx17(Text17, { color: "red", children: error ?? "Unexpected error" }) })
|
|
3638
3278
|
] });
|
|
3639
3279
|
}
|
|
3640
|
-
return /* @__PURE__ */
|
|
3280
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", height: dims.rows, paddingX: 2, paddingTop: verticalPadding, paddingBottom: verticalPadding, children: [
|
|
3641
3281
|
header,
|
|
3642
|
-
/* @__PURE__ */
|
|
3282
|
+
/* @__PURE__ */ jsx17(
|
|
3643
3283
|
RepoList,
|
|
3644
3284
|
{
|
|
3645
3285
|
token,
|
|
@@ -3654,7 +3294,7 @@ function App({ initialOrgSlug: initialOrgSlug2, inlineToken: inlineToken2, inlin
|
|
|
3654
3294
|
}
|
|
3655
3295
|
|
|
3656
3296
|
// src/index.tsx
|
|
3657
|
-
import { jsx as
|
|
3297
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3658
3298
|
var argv = process.argv.slice(2);
|
|
3659
3299
|
var getFlagValue = (name) => {
|
|
3660
3300
|
const idx = argv.findIndex((a) => a === `--${name}` || a.startsWith(`--${name}=`));
|
|
@@ -3749,8 +3389,8 @@ var inlineToken = (() => {
|
|
|
3749
3389
|
})();
|
|
3750
3390
|
logger.debug("Rendering UI");
|
|
3751
3391
|
var { unmount } = render(
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3754
|
-
/* @__PURE__ */
|
|
3392
|
+
/* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", children: [
|
|
3393
|
+
/* @__PURE__ */ jsx18(App, { initialOrgSlug, inlineToken, inlineTokenEphemeral: Boolean(inlineToken) }),
|
|
3394
|
+
/* @__PURE__ */ jsx18(Text18, { color: "gray" })
|
|
3755
3395
|
] })
|
|
3756
3396
|
);
|