@staff0rd/assist 0.736.0 → 0.737.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/README.md +6 -2
- package/dist/commands/sessions/web/bundle.js +2 -2
- package/dist/index.js +11 -30
- 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.737.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -13960,11 +13960,6 @@ async function fetchPeerPrs(cwd, repo, peers) {
|
|
|
13960
13960
|
return selectPeerPrs(nodes, viewer, peers).map((pr) => ({ ...pr, repo }));
|
|
13961
13961
|
}
|
|
13962
13962
|
|
|
13963
|
-
// src/commands/sessions/web/next/comparePickups.ts
|
|
13964
|
-
function comparePickups(a, b) {
|
|
13965
|
-
return a.priorityRank - b.priorityRank || a.createdAt.localeCompare(b.createdAt);
|
|
13966
|
-
}
|
|
13967
|
-
|
|
13968
13963
|
// src/commands/sessions/web/next/ghErrorText.ts
|
|
13969
13964
|
function ghErrorText(error) {
|
|
13970
13965
|
const stderr = error.stderr;
|
|
@@ -13987,9 +13982,6 @@ var pickupsQuery = `query($owner: String!, $number: Int!, $after: String) {
|
|
|
13987
13982
|
projectV2(number: $number) {
|
|
13988
13983
|
title
|
|
13989
13984
|
url
|
|
13990
|
-
priorityField: field(name: "Priority") {
|
|
13991
|
-
... on ProjectV2SingleSelectField { options { name } }
|
|
13992
|
-
}
|
|
13993
13985
|
items(first: 100, after: $after) {
|
|
13994
13986
|
pageInfo { hasNextPage endCursor }
|
|
13995
13987
|
nodes {
|
|
@@ -14041,12 +14033,7 @@ var MAX_PAGES = 10;
|
|
|
14041
14033
|
async function readProjectItems(cwd, project) {
|
|
14042
14034
|
const [owner, number] = project.split("/");
|
|
14043
14035
|
const nodes = [];
|
|
14044
|
-
const board = {
|
|
14045
|
-
project,
|
|
14046
|
-
title: project,
|
|
14047
|
-
url: "",
|
|
14048
|
-
priorityOrder: []
|
|
14049
|
-
};
|
|
14036
|
+
const board = { project, title: project, url: "" };
|
|
14050
14037
|
let after = null;
|
|
14051
14038
|
for (let page = 0; page < MAX_PAGES; page++) {
|
|
14052
14039
|
const response = await readProjectPage(cwd, owner, number, after);
|
|
@@ -14057,9 +14044,6 @@ async function readProjectItems(cwd, project) {
|
|
|
14057
14044
|
}
|
|
14058
14045
|
board.title = projectV2.title ?? project;
|
|
14059
14046
|
board.url = projectV2.url ?? "";
|
|
14060
|
-
board.priorityOrder = (projectV2.priorityField?.options ?? []).map(
|
|
14061
|
-
(option) => option.name
|
|
14062
|
-
);
|
|
14063
14047
|
for (const node of projectV2.items.nodes ?? []) if (node) nodes.push(node);
|
|
14064
14048
|
const { hasNextPage: hasNextPage2, endCursor } = projectV2.items.pageInfo ?? {};
|
|
14065
14049
|
if (!hasNextPage2 || !endCursor) break;
|
|
@@ -14109,16 +14093,11 @@ function isPickable(filter) {
|
|
|
14109
14093
|
}
|
|
14110
14094
|
|
|
14111
14095
|
// src/commands/sessions/web/next/selectPickups.ts
|
|
14112
|
-
function
|
|
14113
|
-
const index3 = priority ? order.indexOf(priority) : -1;
|
|
14114
|
-
return index3 === -1 ? order.length : index3;
|
|
14115
|
-
}
|
|
14116
|
-
function toPickup(node, board) {
|
|
14096
|
+
function toPickup(node, board, position) {
|
|
14117
14097
|
const issue = node.content;
|
|
14118
14098
|
const repo = issue?.repository?.nameWithOwner;
|
|
14119
14099
|
const status3 = node.status?.name;
|
|
14120
14100
|
if (!issue?.number || !issue.url || !repo || !status3) return null;
|
|
14121
|
-
const priority = node.priority?.name ?? null;
|
|
14122
14101
|
return {
|
|
14123
14102
|
repo,
|
|
14124
14103
|
number: issue.number,
|
|
@@ -14133,12 +14112,15 @@ function toPickup(node, board) {
|
|
|
14133
14112
|
projectTitle: board.title,
|
|
14134
14113
|
itemId: node.id,
|
|
14135
14114
|
status: status3,
|
|
14136
|
-
priority,
|
|
14137
|
-
|
|
14115
|
+
priority: node.priority?.name ?? null,
|
|
14116
|
+
position
|
|
14138
14117
|
};
|
|
14139
14118
|
}
|
|
14140
14119
|
function selectPickups(nodes, filter, board) {
|
|
14141
|
-
|
|
14120
|
+
const pickable = isPickable(filter);
|
|
14121
|
+
return nodes.flatMap(
|
|
14122
|
+
(node, position) => pickable(node) ? toPickup(node, board, position) ?? [] : []
|
|
14123
|
+
);
|
|
14142
14124
|
}
|
|
14143
14125
|
|
|
14144
14126
|
// src/commands/sessions/web/next/fetchPickups.ts
|
|
@@ -14151,14 +14133,13 @@ async function fetchPickups(cwd, projects, filter) {
|
|
|
14151
14133
|
async (project) => {
|
|
14152
14134
|
try {
|
|
14153
14135
|
const { nodes, board } = await readProjectItems(cwd, project);
|
|
14154
|
-
|
|
14155
|
-
boards.set(project, link3);
|
|
14136
|
+
boards.set(project, board);
|
|
14156
14137
|
return selectPickups(nodes, filter, board);
|
|
14157
14138
|
} catch (error) {
|
|
14158
14139
|
throw new Error(projectErrorText(error));
|
|
14159
14140
|
}
|
|
14160
14141
|
},
|
|
14161
|
-
|
|
14142
|
+
(a, b) => projects.indexOf(a.project) - projects.indexOf(b.project) || a.position - b.position
|
|
14162
14143
|
);
|
|
14163
14144
|
return {
|
|
14164
14145
|
pickups,
|