pipe-kan 0.13.1 → 0.13.2
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/pipe-kan.js +22 -19
- package/package.json +1 -1
package/dist/pipe-kan.js
CHANGED
|
@@ -623,30 +623,33 @@ function createApp(opts) {
|
|
|
623
623
|
async refresh(next) {
|
|
624
624
|
if (next !== undefined)
|
|
625
625
|
flags = next;
|
|
626
|
-
childrenError = undefined;
|
|
627
626
|
const [issues, epics] = await Promise.all([
|
|
628
627
|
cli.list(flags),
|
|
629
628
|
cli.listEpics()
|
|
630
629
|
]);
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
const keys =
|
|
630
|
+
const nextPayload = JSON.parse(issues);
|
|
631
|
+
const nextEpics = JSON.parse(epics);
|
|
632
|
+
const keys = issuesToBoard(nextEpics).epics.map((epic) => epic.key);
|
|
633
|
+
let nextChildren = [];
|
|
634
|
+
let nextHasCache = false;
|
|
635
|
+
let nextError;
|
|
634
636
|
try {
|
|
635
|
-
|
|
636
|
-
const cards = cardsOf(
|
|
637
|
+
nextChildren = JSON.parse(await cli.listChildren(keys));
|
|
638
|
+
const cards = cardsOf(nextChildren);
|
|
637
639
|
if (cards.length > 0 && !cards.some((card) => card.epic)) {
|
|
638
|
-
|
|
639
|
-
for (const key of keys) {
|
|
640
|
-
stamped.push(...stampRawParent(JSON.parse(await cli.listEpic(key)), key));
|
|
641
|
-
}
|
|
642
|
-
childrenRaw = stamped;
|
|
640
|
+
nextChildren = (await Promise.all(keys.map(async (key) => stampRawParent(JSON.parse(await cli.listEpic(key)), key)))).flat();
|
|
643
641
|
}
|
|
644
|
-
|
|
642
|
+
nextHasCache = true;
|
|
645
643
|
} catch (err) {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
644
|
+
nextHasCache = false;
|
|
645
|
+
nextChildren = [];
|
|
646
|
+
nextError = err instanceof Error ? err.message : "Epic children list failed";
|
|
649
647
|
}
|
|
648
|
+
payload = nextPayload;
|
|
649
|
+
epicsPayload = nextEpics;
|
|
650
|
+
childrenRaw = nextChildren;
|
|
651
|
+
hasChildrenCache = nextHasCache;
|
|
652
|
+
childrenError = nextError;
|
|
650
653
|
return app.board();
|
|
651
654
|
},
|
|
652
655
|
async children(epic) {
|
|
@@ -1107,6 +1110,10 @@ async function runServer(opts) {
|
|
|
1107
1110
|
await new Promise((resolve) => server.listen(port, host, resolve));
|
|
1108
1111
|
const origin = `http://127.0.0.1:${port}`;
|
|
1109
1112
|
const fakeConfig = writeJiraConfig(join4(tmpdir(), "pipe-kan"), origin);
|
|
1113
|
+
console.log(`pipe-kan http://${host}:${port}`);
|
|
1114
|
+
console.log(`cli ${kind === "jira" ? resolveJiraBin() : "store"}`);
|
|
1115
|
+
console.log(`Fake Jira ${origin}/rest/api/2/search`);
|
|
1116
|
+
console.log(`Fake Jira config ${fakeConfig}`);
|
|
1110
1117
|
if (kind === "jira") {
|
|
1111
1118
|
try {
|
|
1112
1119
|
await refreshFromJira(app, kind, { piped: Boolean(piped) });
|
|
@@ -1115,10 +1122,6 @@ async function runServer(opts) {
|
|
|
1115
1122
|
console.error(err);
|
|
1116
1123
|
}
|
|
1117
1124
|
}
|
|
1118
|
-
console.log(`pipe-kan http://${host}:${port}`);
|
|
1119
|
-
console.log(`cli ${kind === "jira" ? resolveJiraBin() : "store"}`);
|
|
1120
|
-
console.log(`Fake Jira ${origin}/rest/api/2/search`);
|
|
1121
|
-
console.log(`Fake Jira config ${fakeConfig}`);
|
|
1122
1125
|
}
|
|
1123
1126
|
|
|
1124
1127
|
// src/bin.ts
|