sign-off-axi 0.6.1 → 0.6.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/cli.js +11 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1393,7 +1393,17 @@ function ticket(args) {
1393
1393
  const { id, title, parent } = values, write = [title, values.progress, parent, values.priority, values.project, values.hold, values.asked, values.release, values.state, values.pr].some((v) => v !== undefined);
1394
1394
  if (id === undefined && write)
1395
1395
  throw fail('--title, --progress, --parent, --priority, --project, --hold, --asked, --release, --state and --pr need --id <ticket id>', 'VALIDATION_ERROR', 'sign-off-axi ticket --id T-29 --title "Ship the new settings page" --progress 40');
1396
- const cardsOf = (t) => board(file).filter((d) => d.ticket === t.id && !d.dismissed).reverse().sort((x, y) => (Date.parse(y.filed ?? '') || 0) - (Date.parse(x.filed ?? '') || 0));
1396
+ // The board is read once per command, and its warnings print once, however many tickets name cards.
1397
+ let byTicket;
1398
+ const cardsOf = (t) => {
1399
+ if (!byTicket) {
1400
+ byTicket = new Map();
1401
+ for (const d of board(file))
1402
+ if (d.ticket !== undefined && !d.dismissed)
1403
+ byTicket.set(d.ticket, [...(byTicket.get(d.ticket) ?? []), d]);
1404
+ }
1405
+ return [...(byTicket.get(t.id) ?? [])].reverse().sort((x, y) => (Date.parse(y.filed ?? '') || 0) - (Date.parse(x.filed ?? '') || 0));
1406
+ };
1397
1407
  const row = (t) => ({ id: t.id, title: t.title, progress: t.progress, parent: t.parent ?? '', priority: t.priority ?? '', project: t.project ?? '', hold: t.hold ? 'yes' : 'no', asked: t.asked ? 'yes' : 'no', release: t.release ?? '', state: t.state ?? '', prs: t.prs ?? [] });
1398
1408
  if (id === undefined) {
1399
1409
  const all = rollUp(readTickets(file, warn));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sign-off-axi",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "One review board for evidence, quick yes/no decisions and retro changes.",
5
5
  "type": "module",
6
6
  "bin": { "sign-off-axi": "dist/cli.js" },