@staff0rd/assist 0.784.3 → 0.785.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/dist/commands/sessions/web/bundle.js +188 -188
- package/dist/index.js +24 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.785.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -14166,6 +14166,7 @@ function toNextPr(node, author, requested, viewer) {
|
|
|
14166
14166
|
author,
|
|
14167
14167
|
createdAt: node.createdAt,
|
|
14168
14168
|
url: node.url,
|
|
14169
|
+
isDraft: node.isDraft,
|
|
14169
14170
|
requestedAt: requested ? lastRequestedAt(node, viewer) : node.createdAt,
|
|
14170
14171
|
reason: requested ? "requested" : "peer",
|
|
14171
14172
|
checks: rollup && CHECK_STATES[rollup] || null
|
|
@@ -15167,7 +15168,7 @@ var getOpenPrs = createCachedGhJson(
|
|
|
15167
15168
|
"--state",
|
|
15168
15169
|
"open",
|
|
15169
15170
|
"--json",
|
|
15170
|
-
"number,title,author,createdAt,url"
|
|
15171
|
+
"number,title,author,createdAt,url,isDraft"
|
|
15171
15172
|
],
|
|
15172
15173
|
(stdout) => {
|
|
15173
15174
|
const parsed = JSON.parse(stdout);
|
|
@@ -15177,7 +15178,8 @@ var getOpenPrs = createCachedGhJson(
|
|
|
15177
15178
|
title: pr.title,
|
|
15178
15179
|
author: pr.author?.name || pr.author?.login || "unknown",
|
|
15179
15180
|
createdAt: pr.createdAt,
|
|
15180
|
-
url: pr.url
|
|
15181
|
+
url: pr.url,
|
|
15182
|
+
isDraft: pr.isDraft === true
|
|
15181
15183
|
}));
|
|
15182
15184
|
},
|
|
15183
15185
|
[]
|
|
@@ -15382,10 +15384,25 @@ async function previewImage(req, res) {
|
|
|
15382
15384
|
createReadStream2(path106).pipe(res);
|
|
15383
15385
|
}
|
|
15384
15386
|
|
|
15385
|
-
// src/commands/sessions/web/
|
|
15387
|
+
// src/commands/sessions/web/getCurrentBranch.ts
|
|
15386
15388
|
import { execFile as execFile8 } from "child_process";
|
|
15387
15389
|
import { promisify as promisify9 } from "util";
|
|
15388
15390
|
var execFileAsync8 = promisify9(execFile8);
|
|
15391
|
+
async function getCurrentBranch(cwd) {
|
|
15392
|
+
try {
|
|
15393
|
+
const { stdout } = await execFileAsync8(
|
|
15394
|
+
"git",
|
|
15395
|
+
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
15396
|
+
{ encoding: "utf8", windowsHide: true, cwd }
|
|
15397
|
+
);
|
|
15398
|
+
const branch2 = stdout.trim();
|
|
15399
|
+
return branch2 && branch2 !== "HEAD" ? branch2 : void 0;
|
|
15400
|
+
} catch {
|
|
15401
|
+
return void 0;
|
|
15402
|
+
}
|
|
15403
|
+
}
|
|
15404
|
+
|
|
15405
|
+
// src/commands/sessions/web/prStatus.ts
|
|
15389
15406
|
function toPrSummary(parsed) {
|
|
15390
15407
|
if (typeof parsed.number !== "number") return null;
|
|
15391
15408
|
return {
|
|
@@ -15393,10 +15410,11 @@ function toPrSummary(parsed) {
|
|
|
15393
15410
|
title: parsed.title ?? "",
|
|
15394
15411
|
author: parsed.author?.name || parsed.author?.login || "unknown",
|
|
15395
15412
|
createdAt: parsed.createdAt ?? "",
|
|
15396
|
-
url: parsed.url ?? ""
|
|
15413
|
+
url: parsed.url ?? "",
|
|
15414
|
+
isDraft: parsed.isDraft === true
|
|
15397
15415
|
};
|
|
15398
15416
|
}
|
|
15399
|
-
var prFields = "number,title,author,createdAt,url";
|
|
15417
|
+
var prFields = "number,title,author,createdAt,url,isDraft";
|
|
15400
15418
|
var getPrByNumber = createCachedGhJson(
|
|
15401
15419
|
["pr", "view", "--json", prFields],
|
|
15402
15420
|
(stdout) => toPrSummary(JSON.parse(stdout)),
|
|
@@ -15413,19 +15431,6 @@ var getOpenPrForBranch = createCachedGhJson(
|
|
|
15413
15431
|
null,
|
|
15414
15432
|
{ cacheFallback: false }
|
|
15415
15433
|
);
|
|
15416
|
-
async function getCurrentBranch(cwd) {
|
|
15417
|
-
try {
|
|
15418
|
-
const { stdout } = await execFileAsync8(
|
|
15419
|
-
"git",
|
|
15420
|
-
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
15421
|
-
{ encoding: "utf8", windowsHide: true, cwd }
|
|
15422
|
-
);
|
|
15423
|
-
const branch2 = stdout.trim();
|
|
15424
|
-
return branch2 && branch2 !== "HEAD" ? branch2 : void 0;
|
|
15425
|
-
} catch {
|
|
15426
|
-
return void 0;
|
|
15427
|
-
}
|
|
15428
|
-
}
|
|
15429
15434
|
function getNumberParam(req) {
|
|
15430
15435
|
const raw = new URL(req.url ?? "/", "http://localhost").searchParams.get(
|
|
15431
15436
|
"number"
|