@kud/jira-cli 0.4.1 → 0.5.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 +5 -1
- package/dist/{chunk-RTBMVYZM.js → chunk-QEOE2RPV.js} +50 -1
- package/dist/index.js +4 -23
- package/dist/tui-TWKZI63D.js +825 -0
- package/package.json +2 -2
- package/dist/tui-IET37PRI.js +0 -467
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/jira-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Jira on the command line — read issues, comments and attachments as plain text",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@kud/ink-ui": "0.25.0",
|
|
41
41
|
"@kud/jira": "0.3.0",
|
|
42
|
-
"@kud/jira-ink": "0.1
|
|
42
|
+
"@kud/jira-ink": "0.2.1",
|
|
43
43
|
"commander": "14.0.1",
|
|
44
44
|
"ink": "7.1.1",
|
|
45
45
|
"react": "19.2.5"
|
package/dist/tui-IET37PRI.js
DELETED
|
@@ -1,467 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
context
|
|
3
|
-
} from "./chunk-RTBMVYZM.js";
|
|
4
|
-
|
|
5
|
-
// src/tui/index.tsx
|
|
6
|
-
import { render } from "ink";
|
|
7
|
-
|
|
8
|
-
// src/tui/app.tsx
|
|
9
|
-
import { execFile } from "child_process";
|
|
10
|
-
import { Alert, ConfirmInput, Select, Spinner, TextInput } from "@kud/ink-ui";
|
|
11
|
-
import { Box as Box2, Text as Text2, useApp, useInput as useInput2, useStdout } from "ink";
|
|
12
|
-
import { useCallback, useEffect, useState } from "react";
|
|
13
|
-
import { IssueDetailView } from "@kud/jira-ink";
|
|
14
|
-
|
|
15
|
-
// src/tui/list.tsx
|
|
16
|
-
import { FooterHints, SelectableRow, useListCursor } from "@kud/ink-ui";
|
|
17
|
-
import { Box, Text, useInput } from "ink";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
var pad = (s, width) => s.length > width ? `${s.slice(0, width - 1)}\u2026` : s.padEnd(width);
|
|
20
|
-
var windowFor = (cursor, total, size) => {
|
|
21
|
-
const start = Math.max(
|
|
22
|
-
0,
|
|
23
|
-
Math.min(cursor - Math.floor(size / 2), total - size)
|
|
24
|
-
);
|
|
25
|
-
return { start: Math.max(0, start), end: Math.max(0, start) + size };
|
|
26
|
-
};
|
|
27
|
-
var IssueList = ({
|
|
28
|
-
rows,
|
|
29
|
-
showingAll,
|
|
30
|
-
onOpen,
|
|
31
|
-
onToggleAll,
|
|
32
|
-
onRefresh,
|
|
33
|
-
height
|
|
34
|
-
}) => {
|
|
35
|
-
const { cursor } = useListCursor(rows.length, { vimKeys: true });
|
|
36
|
-
useInput((input, key) => {
|
|
37
|
-
if (key.return && rows[cursor]) onOpen(rows[cursor].key);
|
|
38
|
-
if (input === "a") onToggleAll();
|
|
39
|
-
if (input === "r") onRefresh();
|
|
40
|
-
});
|
|
41
|
-
const hints = [
|
|
42
|
-
["\u2191\u2193", "move"],
|
|
43
|
-
["enter", "open"],
|
|
44
|
-
["a", showingAll ? "open only" : "show all"],
|
|
45
|
-
["r", "refresh"],
|
|
46
|
-
["q", "quit"]
|
|
47
|
-
];
|
|
48
|
-
if (rows.length === 0) {
|
|
49
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, children: [
|
|
50
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: showingAll ? "Nothing is assigned to you." : "No open issues assigned to you \u2014 press a to include closed ones." }),
|
|
51
|
-
/* @__PURE__ */ jsx(FooterHints, { hints })
|
|
52
|
-
] });
|
|
53
|
-
}
|
|
54
|
-
const size = Math.max(3, height - 5);
|
|
55
|
-
const { start, end } = windowFor(cursor, rows.length, size);
|
|
56
|
-
const visible = rows.slice(start, end);
|
|
57
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
58
|
-
/* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
59
|
-
pad("KEY", 11),
|
|
60
|
-
pad("STATUS", 17),
|
|
61
|
-
pad("SUMMARY", 60),
|
|
62
|
-
"ASSIGNEE"
|
|
63
|
-
] }) }),
|
|
64
|
-
visible.map((row, i) => /* @__PURE__ */ jsx(SelectableRow, { active: start + i === cursor, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
65
|
-
pad(row.key, 11),
|
|
66
|
-
pad(row.status, 17),
|
|
67
|
-
pad(row.summary, 60),
|
|
68
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: row.assignee })
|
|
69
|
-
] }) }, row.key)),
|
|
70
|
-
/* @__PURE__ */ jsxs(Box, { marginTop: 1, flexDirection: "column", children: [
|
|
71
|
-
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
72
|
-
cursor + 1,
|
|
73
|
-
"/",
|
|
74
|
-
rows.length,
|
|
75
|
-
showingAll ? " \xB7 all" : " \xB7 open only"
|
|
76
|
-
] }),
|
|
77
|
-
/* @__PURE__ */ jsx(FooterHints, { hints })
|
|
78
|
-
] })
|
|
79
|
-
] });
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// src/tui/app.tsx
|
|
83
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
84
|
-
var MIN_WIDTH = 60;
|
|
85
|
-
var MIN_HEIGHT = 12;
|
|
86
|
-
var App = ({ data, initialScreen, initialKey }) => {
|
|
87
|
-
const { exit } = useApp();
|
|
88
|
-
const { stdout } = useStdout();
|
|
89
|
-
const width = stdout?.columns ?? 80;
|
|
90
|
-
const height = stdout?.rows ?? 24;
|
|
91
|
-
const [screen, setScreen] = useState(initialScreen);
|
|
92
|
-
const [rows, setRows] = useState(null);
|
|
93
|
-
const [issue, setIssue] = useState(null);
|
|
94
|
-
const [overlay, setOverlay] = useState({ kind: "none" });
|
|
95
|
-
const [showingAll, setShowingAll] = useState(false);
|
|
96
|
-
const [error, setError] = useState(null);
|
|
97
|
-
const [busy, setBusy] = useState(null);
|
|
98
|
-
const loadList = useCallback(
|
|
99
|
-
async (all) => {
|
|
100
|
-
setError(null);
|
|
101
|
-
setRows(null);
|
|
102
|
-
try {
|
|
103
|
-
setRows(await data.listIssues(all));
|
|
104
|
-
} catch (e) {
|
|
105
|
-
setError(e instanceof Error ? e.message : String(e));
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
[data]
|
|
109
|
-
);
|
|
110
|
-
const loadIssue = useCallback(
|
|
111
|
-
async (key) => {
|
|
112
|
-
setError(null);
|
|
113
|
-
setIssue(null);
|
|
114
|
-
setScreen("detail");
|
|
115
|
-
try {
|
|
116
|
-
setIssue(await data.getIssue(key));
|
|
117
|
-
} catch (e) {
|
|
118
|
-
setError(e instanceof Error ? e.message : String(e));
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
[data]
|
|
122
|
-
);
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
if (initialScreen === "detail" && initialKey) void loadIssue(initialKey);
|
|
125
|
-
else void loadList(false);
|
|
126
|
-
}, [initialScreen, initialKey, loadIssue, loadList]);
|
|
127
|
-
useInput2((input, key) => {
|
|
128
|
-
if (overlay.kind !== "none") return;
|
|
129
|
-
if (input === "q" || key.ctrl && input === "c") exit();
|
|
130
|
-
if (error && input === "r") {
|
|
131
|
-
if (screen === "issues") void loadList(showingAll);
|
|
132
|
-
else if (issue) void loadIssue(issue.key);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
if (width < MIN_WIDTH || height < MIN_HEIGHT) {
|
|
136
|
-
return /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
137
|
-
"Terminal too small \u2014 needs at least ",
|
|
138
|
-
MIN_WIDTH,
|
|
139
|
-
"\xD7",
|
|
140
|
-
MIN_HEIGHT,
|
|
141
|
-
", this is",
|
|
142
|
-
" ",
|
|
143
|
-
width,
|
|
144
|
-
"\xD7",
|
|
145
|
-
height,
|
|
146
|
-
"."
|
|
147
|
-
] });
|
|
148
|
-
}
|
|
149
|
-
if (error) {
|
|
150
|
-
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, children: [
|
|
151
|
-
/* @__PURE__ */ jsx2(Alert, { variant: "error", children: error }),
|
|
152
|
-
/* @__PURE__ */ jsx2(Text2, { dimColor: true, children: "r retry \xB7 q quit" })
|
|
153
|
-
] });
|
|
154
|
-
}
|
|
155
|
-
if (busy) return /* @__PURE__ */ jsx2(Spinner, { label: busy });
|
|
156
|
-
if (overlay.kind === "transition") {
|
|
157
|
-
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, children: [
|
|
158
|
-
/* @__PURE__ */ jsxs2(Text2, { bold: true, children: [
|
|
159
|
-
"Move ",
|
|
160
|
-
issue?.key,
|
|
161
|
-
" to\u2026"
|
|
162
|
-
] }),
|
|
163
|
-
/* @__PURE__ */ jsx2(
|
|
164
|
-
Select,
|
|
165
|
-
{
|
|
166
|
-
options: overlay.options.map((t) => ({
|
|
167
|
-
label: `${t.name} \u2192 ${t.to}`,
|
|
168
|
-
value: t.id
|
|
169
|
-
})),
|
|
170
|
-
onSubmit: (id) => {
|
|
171
|
-
setOverlay({ kind: "none" });
|
|
172
|
-
void (async () => {
|
|
173
|
-
setBusy("Transitioning\u2026");
|
|
174
|
-
try {
|
|
175
|
-
await data.transition(issue.key, id);
|
|
176
|
-
await loadIssue(issue.key);
|
|
177
|
-
} catch (e) {
|
|
178
|
-
setError(e instanceof Error ? e.message : String(e));
|
|
179
|
-
} finally {
|
|
180
|
-
setBusy(null);
|
|
181
|
-
}
|
|
182
|
-
})();
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
),
|
|
186
|
-
/* @__PURE__ */ jsx2(Text2, { dimColor: true, children: "esc cancel" })
|
|
187
|
-
] });
|
|
188
|
-
}
|
|
189
|
-
if (overlay.kind === "comment") {
|
|
190
|
-
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, children: [
|
|
191
|
-
/* @__PURE__ */ jsxs2(Text2, { bold: true, children: [
|
|
192
|
-
"Comment on ",
|
|
193
|
-
issue?.key
|
|
194
|
-
] }),
|
|
195
|
-
/* @__PURE__ */ jsx2(
|
|
196
|
-
TextInput,
|
|
197
|
-
{
|
|
198
|
-
placeholder: "Markdown is supported\u2026",
|
|
199
|
-
onSubmit: (body) => {
|
|
200
|
-
setOverlay({ kind: "none" });
|
|
201
|
-
if (!body.trim()) return;
|
|
202
|
-
void (async () => {
|
|
203
|
-
setBusy("Posting\u2026");
|
|
204
|
-
try {
|
|
205
|
-
await data.comment(issue.key, body);
|
|
206
|
-
await loadIssue(issue.key);
|
|
207
|
-
} catch (e) {
|
|
208
|
-
setError(e instanceof Error ? e.message : String(e));
|
|
209
|
-
} finally {
|
|
210
|
-
setBusy(null);
|
|
211
|
-
}
|
|
212
|
-
})();
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
)
|
|
216
|
-
] });
|
|
217
|
-
}
|
|
218
|
-
if (overlay.kind === "assign") {
|
|
219
|
-
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, children: [
|
|
220
|
-
/* @__PURE__ */ jsxs2(Text2, { children: [
|
|
221
|
-
"Assign ",
|
|
222
|
-
issue?.key,
|
|
223
|
-
" to yourself?"
|
|
224
|
-
] }),
|
|
225
|
-
/* @__PURE__ */ jsx2(
|
|
226
|
-
ConfirmInput,
|
|
227
|
-
{
|
|
228
|
-
onCancel: () => setOverlay({ kind: "none" }),
|
|
229
|
-
onConfirm: () => {
|
|
230
|
-
setOverlay({ kind: "none" });
|
|
231
|
-
void (async () => {
|
|
232
|
-
setBusy("Assigning\u2026");
|
|
233
|
-
try {
|
|
234
|
-
await data.assignToMe(issue.key);
|
|
235
|
-
await loadIssue(issue.key);
|
|
236
|
-
} catch (e) {
|
|
237
|
-
setError(e instanceof Error ? e.message : String(e));
|
|
238
|
-
} finally {
|
|
239
|
-
setBusy(null);
|
|
240
|
-
}
|
|
241
|
-
})();
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
)
|
|
245
|
-
] });
|
|
246
|
-
}
|
|
247
|
-
if (screen === "detail") {
|
|
248
|
-
if (!issue) return /* @__PURE__ */ jsx2(Spinner, { label: "Loading issue\u2026" });
|
|
249
|
-
return /* @__PURE__ */ jsx2(
|
|
250
|
-
IssueDetailView,
|
|
251
|
-
{
|
|
252
|
-
issue,
|
|
253
|
-
width,
|
|
254
|
-
height,
|
|
255
|
-
onBack: () => setScreen("issues"),
|
|
256
|
-
onOpenBrowser: () => execFile(opener(), [issue.url]),
|
|
257
|
-
onAssign: () => setOverlay({ kind: "assign" }),
|
|
258
|
-
onComment: () => setOverlay({ kind: "comment" }),
|
|
259
|
-
onTransition: () => {
|
|
260
|
-
void (async () => {
|
|
261
|
-
setBusy("Loading transitions\u2026");
|
|
262
|
-
try {
|
|
263
|
-
const options = await data.getTransitions(issue.key);
|
|
264
|
-
setOverlay({ kind: "transition", options });
|
|
265
|
-
} catch (e) {
|
|
266
|
-
setError(e instanceof Error ? e.message : String(e));
|
|
267
|
-
} finally {
|
|
268
|
-
setBusy(null);
|
|
269
|
-
}
|
|
270
|
-
})();
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
if (!rows) return /* @__PURE__ */ jsx2(Spinner, { label: "Loading issues\u2026" });
|
|
276
|
-
return /* @__PURE__ */ jsx2(
|
|
277
|
-
IssueList,
|
|
278
|
-
{
|
|
279
|
-
rows,
|
|
280
|
-
height,
|
|
281
|
-
showingAll,
|
|
282
|
-
onOpen: (key) => void loadIssue(key),
|
|
283
|
-
onRefresh: () => void loadList(showingAll),
|
|
284
|
-
onToggleAll: () => {
|
|
285
|
-
const next = !showingAll;
|
|
286
|
-
setShowingAll(next);
|
|
287
|
-
void loadList(next);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
);
|
|
291
|
-
};
|
|
292
|
-
var opener = () => process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
293
|
-
|
|
294
|
-
// src/tui/data.ts
|
|
295
|
-
import {
|
|
296
|
-
issueDetailOf,
|
|
297
|
-
transitionsOf
|
|
298
|
-
} from "@kud/jira-ink";
|
|
299
|
-
var OPEN_ONLY = "statusCategory != Done";
|
|
300
|
-
var toRow = (issue) => ({
|
|
301
|
-
key: issue.key,
|
|
302
|
-
status: issue.fields.status?.name ?? "\u2014",
|
|
303
|
-
summary: issue.fields.summary ?? "",
|
|
304
|
-
assignee: issue.fields.assignee?.displayName ?? "unassigned",
|
|
305
|
-
updated: issue.fields.updated?.slice(0, 10) ?? ""
|
|
306
|
-
});
|
|
307
|
-
var liveData = (ctx = context()) => ({
|
|
308
|
-
baseUrl: ctx.config.baseUrl,
|
|
309
|
-
listIssues: async (all) => {
|
|
310
|
-
const jql = `assignee = currentUser()${all ? "" : ` AND ${OPEN_ONLY}`} ORDER BY updated DESC`;
|
|
311
|
-
return (await ctx.client.searchIssues(jql, { limit: 200 })).map(toRow);
|
|
312
|
-
},
|
|
313
|
-
getIssue: (key) => issueDetailOf(ctx.client, ctx.config.baseUrl, key),
|
|
314
|
-
getTransitions: (key) => transitionsOf(ctx.client, key),
|
|
315
|
-
transition: (key, transitionId) => ctx.client.transitionIssue(key, transitionId),
|
|
316
|
-
comment: async (key, body) => {
|
|
317
|
-
const { markdownToAdf } = await import("@kud/jira");
|
|
318
|
-
await ctx.client.addComment(key, markdownToAdf(body));
|
|
319
|
-
},
|
|
320
|
-
assignToMe: async (key) => {
|
|
321
|
-
const me = await ctx.client.getMe();
|
|
322
|
-
await ctx.client.assignIssue(key, me.accountId);
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
// src/tui/mock.ts
|
|
327
|
-
var ROWS = [
|
|
328
|
-
{
|
|
329
|
-
key: "SHOP-412",
|
|
330
|
-
status: "In Progress",
|
|
331
|
-
summary: "Checkout total ignores the discount on the last item",
|
|
332
|
-
assignee: "Ada Okafor",
|
|
333
|
-
updated: "2026-08-14"
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
key: "SHOP-408",
|
|
337
|
-
status: "In Review",
|
|
338
|
-
summary: "Add a dark theme to the storefront",
|
|
339
|
-
assignee: "Ada Okafor",
|
|
340
|
-
updated: "2026-08-13"
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
key: "SHOP-397",
|
|
344
|
-
status: "To Do",
|
|
345
|
-
summary: "Search returns stale results after a filter change",
|
|
346
|
-
assignee: "Ada Okafor",
|
|
347
|
-
updated: "2026-08-11"
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
key: "PLAT-88",
|
|
351
|
-
status: "Blocked",
|
|
352
|
-
summary: "Rotate the staging database credentials",
|
|
353
|
-
assignee: "Ada Okafor",
|
|
354
|
-
updated: "2026-08-09"
|
|
355
|
-
}
|
|
356
|
-
];
|
|
357
|
-
var DETAIL = {
|
|
358
|
-
"SHOP-412": {
|
|
359
|
-
key: "SHOP-412",
|
|
360
|
-
summary: "Checkout total ignores the discount on the last item",
|
|
361
|
-
status: "In Progress",
|
|
362
|
-
type: "Bug",
|
|
363
|
-
assignee: "Ada Okafor",
|
|
364
|
-
reporter: "Bram Nilsen",
|
|
365
|
-
labels: ["checkout", "regression"],
|
|
366
|
-
parent: { key: "SHOP-300", summary: "Basket and checkout correctness" },
|
|
367
|
-
url: "https://example.atlassian.net/browse/SHOP-412",
|
|
368
|
-
description: [
|
|
369
|
-
"## What happens",
|
|
370
|
-
"",
|
|
371
|
-
"The basket total is correct until the **last** line item, whose discount is",
|
|
372
|
-
"dropped from the sum.",
|
|
373
|
-
"",
|
|
374
|
-
"```js",
|
|
375
|
-
"const total = items.slice(0, -1).reduce(withDiscount, 0)",
|
|
376
|
-
"```",
|
|
377
|
-
"",
|
|
378
|
-
"1. Add three items",
|
|
379
|
-
"2. Apply `SUMMER20`",
|
|
380
|
-
"3. Compare the total against the line items",
|
|
381
|
-
"",
|
|
382
|
-
"[attachment: basket.png]"
|
|
383
|
-
].join("\n"),
|
|
384
|
-
comments: [
|
|
385
|
-
{
|
|
386
|
-
id: "c1",
|
|
387
|
-
author: "Bram Nilsen",
|
|
388
|
-
created: "2026-08-13",
|
|
389
|
-
body: "Reproduced on staging. Screenshot attached.\n\n[attachment: basket.png]"
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
id: "c2",
|
|
393
|
-
author: "Ada Okafor",
|
|
394
|
-
created: "2026-08-14",
|
|
395
|
-
body: "Off-by-one in `slice(0, -1)`. Fix and a regression test on the way."
|
|
396
|
-
}
|
|
397
|
-
],
|
|
398
|
-
attachments: [
|
|
399
|
-
{
|
|
400
|
-
id: "9001",
|
|
401
|
-
filename: "basket.png",
|
|
402
|
-
mimeType: "image/png",
|
|
403
|
-
size: 48213,
|
|
404
|
-
origins: [{ kind: "comment", commentId: "c1", author: "Bram Nilsen" }]
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
id: "9002",
|
|
408
|
-
filename: "checkout.log",
|
|
409
|
-
mimeType: "text/plain",
|
|
410
|
-
size: 2044,
|
|
411
|
-
origins: [{ kind: "issue" }]
|
|
412
|
-
}
|
|
413
|
-
]
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
var fallbackDetail = (key) => {
|
|
417
|
-
const row = ROWS.find((r) => r.key === key) ?? ROWS[0];
|
|
418
|
-
return {
|
|
419
|
-
key: row.key,
|
|
420
|
-
summary: row.summary,
|
|
421
|
-
status: row.status,
|
|
422
|
-
type: "Task",
|
|
423
|
-
assignee: row.assignee,
|
|
424
|
-
reporter: "Bram Nilsen",
|
|
425
|
-
labels: [],
|
|
426
|
-
url: `https://example.atlassian.net/browse/${row.key}`,
|
|
427
|
-
description: "_No description._",
|
|
428
|
-
comments: [],
|
|
429
|
-
attachments: []
|
|
430
|
-
};
|
|
431
|
-
};
|
|
432
|
-
var mockData = () => ({
|
|
433
|
-
baseUrl: "https://example.atlassian.net",
|
|
434
|
-
listIssues: async (all) => all ? ROWS : ROWS.filter((r) => r.status !== "Done"),
|
|
435
|
-
getIssue: async (key) => DETAIL[key] ?? fallbackDetail(key),
|
|
436
|
-
getTransitions: async () => [
|
|
437
|
-
{ id: "11", name: "Start progress", to: "In Progress" },
|
|
438
|
-
{ id: "21", name: "Ready for review", to: "In Review" },
|
|
439
|
-
{ id: "31", name: "Done", to: "Done" }
|
|
440
|
-
],
|
|
441
|
-
transition: async () => {
|
|
442
|
-
},
|
|
443
|
-
comment: async () => {
|
|
444
|
-
},
|
|
445
|
-
assignToMe: async () => {
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
// src/tui/index.tsx
|
|
450
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
451
|
-
var SCREENS = ["issues", "detail"];
|
|
452
|
-
var runTui = async ({
|
|
453
|
-
screen,
|
|
454
|
-
mock,
|
|
455
|
-
issueKey
|
|
456
|
-
}) => {
|
|
457
|
-
const data = mock ? mockData() : liveData();
|
|
458
|
-
const key = issueKey ?? (mock ? "SHOP-412" : void 0);
|
|
459
|
-
const { waitUntilExit } = render(
|
|
460
|
-
/* @__PURE__ */ jsx3(App, { data, initialScreen: screen, initialKey: key })
|
|
461
|
-
);
|
|
462
|
-
await waitUntilExit();
|
|
463
|
-
};
|
|
464
|
-
export {
|
|
465
|
-
SCREENS,
|
|
466
|
-
runTui
|
|
467
|
-
};
|