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.
Files changed (2) hide show
  1. package/dist/pipe-kan.js +22 -19
  2. 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
- payload = JSON.parse(issues);
632
- epicsPayload = JSON.parse(epics);
633
- const keys = listedEpicKeys();
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
- childrenRaw = JSON.parse(await cli.listChildren(keys));
636
- const cards = cardsOf(childrenRaw);
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
- const stamped = [];
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
- hasChildrenCache = true;
642
+ nextHasCache = true;
645
643
  } catch (err) {
646
- hasChildrenCache = false;
647
- childrenRaw = [];
648
- childrenError = err instanceof Error ? err.message : "Epic children list failed";
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pipe-kan",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Local Kanban for jira-cli",
5
5
  "license": "MIT",
6
6
  "type": "module",