@kud/jira-cli 0.6.0 → 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.
- package/README.md +2 -2
- package/dist/index.js +2 -2
- package/dist/{tui-V2HHFJ2H.js → tui-NYMHOUTL.js} +105 -47
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -51,11 +51,11 @@ jira
|
|
|
51
51
|
|
|
52
52
|
Your issues as a board. By default the tabs are Jira's three status *categories* — **To do**, **In progress**, **Done** — so it works on any instance without knowing what your board calls its columns. Pass `--board <id>` (or set `defaultBoard` in the config file) and the tabs become that board's own columns, matched by status id; statuses no column claims land on an **Off board** tab. Hand-written `tabs` in the config file win over both. Rows hang under their epic, carry a type pill, a priority glyph (`▲` high, `▼` low) and how long since they last moved. Closed work from the last fortnight is on the Done tab; `a` loads everything.
|
|
53
53
|
|
|
54
|
-
`↑↓` to move, `←→` (or `⇥`) to switch tab, `enter` to open, `?` for the legend, `r` to refresh
|
|
54
|
+
`↑↓` to move, `←→` (or `⇥`) to switch tab, `enter` to open, `?` for the legend, `r` to refresh. `q` quits from anywhere; `esc` or `⌫` goes back one level — a prompt, then the issue, then nothing.
|
|
55
55
|
|
|
56
56
|
`/` searches. Plain words narrow the list as you type and, on `enter`, run as `text ~ "…"` within your issues — so a match in a comment counts too. Anything shaped like JQL (`status = Done`, `labels in (a, b)`, `ORDER BY …`) is sent as-is and replaces the scope; the tag at the end of the line says which reading it took, and `⇥` flips it. A query Jira rejects shows Jira's own message under the box and keeps your text for editing. `esc` clears the search.
|
|
57
57
|
|
|
58
|
-
Inside an issue,
|
|
58
|
+
Inside an issue, `⇥` switches between description, comments and attachments — descriptions and comments render as real Markdown, and attachments are listed with the comment or description each was embedded in. `t` moves it, `c` comments, `a` assigns to you, `o` opens the browser, `esc` or `⌫` goes back. Writes ask before they act.
|
|
59
59
|
|
|
60
60
|
Ink is loaded only for this view, via a dynamic import, so `jira issue list | grep` never pays for it. Piped or redirected, bare `jira` prints help instead of opening a UI.
|
|
61
61
|
|
package/dist/index.js
CHANGED
|
@@ -900,7 +900,7 @@ var interactiveArgs = (argv) => {
|
|
|
900
900
|
var main = async () => {
|
|
901
901
|
const { screen, mock, board, isBare } = interactiveArgs(process.argv);
|
|
902
902
|
if (screen === "list" && isBare) {
|
|
903
|
-
const { SCREENS } = await import("./tui-
|
|
903
|
+
const { SCREENS } = await import("./tui-NYMHOUTL.js");
|
|
904
904
|
process.stdout.write(`${SCREENS.join("\n")}
|
|
905
905
|
`);
|
|
906
906
|
return;
|
|
@@ -910,7 +910,7 @@ var main = async () => {
|
|
|
910
910
|
program.outputHelp();
|
|
911
911
|
return;
|
|
912
912
|
}
|
|
913
|
-
const { runTui } = await import("./tui-
|
|
913
|
+
const { runTui } = await import("./tui-NYMHOUTL.js");
|
|
914
914
|
const [, key] = (screen ?? "").split(":");
|
|
915
915
|
await runTui({
|
|
916
916
|
screen: screen?.startsWith("detail") ? "detail" : "issues",
|
|
@@ -12,9 +12,10 @@ import {
|
|
|
12
12
|
ConfirmInput,
|
|
13
13
|
Select,
|
|
14
14
|
Spinner,
|
|
15
|
-
TextInput
|
|
15
|
+
TextInput,
|
|
16
|
+
useAppKeys
|
|
16
17
|
} from "@kud/ink-ui";
|
|
17
|
-
import { Box
|
|
18
|
+
import { Box, Text, useApp, useInput, useStdout } from "ink";
|
|
18
19
|
import { useCallback, useEffect, useState } from "react";
|
|
19
20
|
import { errorMessagesOf, isJiraApiError } from "@kud/jira";
|
|
20
21
|
import {
|
|
@@ -23,25 +24,43 @@ import {
|
|
|
23
24
|
} from "@kud/jira-ink";
|
|
24
25
|
|
|
25
26
|
// src/tui/frame.tsx
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
import { Page } from "@kud/ink-ui";
|
|
28
|
+
import { jsx } from "react/jsx-runtime";
|
|
29
|
+
var Frame = ({
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
facts,
|
|
33
|
+
count,
|
|
34
|
+
user,
|
|
35
|
+
scope,
|
|
36
|
+
status,
|
|
37
|
+
hints,
|
|
38
|
+
page = "root",
|
|
39
|
+
gap = true,
|
|
40
|
+
children
|
|
41
|
+
}) => /* @__PURE__ */ jsx(
|
|
42
|
+
Page,
|
|
43
|
+
{
|
|
44
|
+
icon: "\u{1F3AB}",
|
|
45
|
+
title: "Jira",
|
|
46
|
+
facts,
|
|
47
|
+
count,
|
|
48
|
+
user,
|
|
49
|
+
scope,
|
|
50
|
+
status,
|
|
51
|
+
hints,
|
|
52
|
+
page,
|
|
53
|
+
gap,
|
|
54
|
+
width,
|
|
55
|
+
height,
|
|
56
|
+
children
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
var FRAME_CHROME = 4;
|
|
41
60
|
|
|
42
61
|
// src/tui/app.tsx
|
|
43
|
-
import { jsx as jsx2, jsxs
|
|
44
|
-
var DETAIL_CHROME =
|
|
62
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
63
|
+
var DETAIL_CHROME = 3;
|
|
45
64
|
var MIN_WIDTH = 60;
|
|
46
65
|
var MIN_HEIGHT = 12;
|
|
47
66
|
var App = ({ data, initialScreen, initialKey }) => {
|
|
@@ -55,6 +74,7 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
55
74
|
const [loadedAt, setLoadedAt] = useState(Date.now);
|
|
56
75
|
const [scope, setScope] = useState({ kind: "mine" });
|
|
57
76
|
const [searchError, setSearchError] = useState(null);
|
|
77
|
+
const [inputFocused, setInputFocused] = useState(false);
|
|
58
78
|
const [issue, setIssue] = useState(null);
|
|
59
79
|
const [overlay, setOverlay] = useState({ kind: "none" });
|
|
60
80
|
const [showingAll, setShowingAll] = useState(false);
|
|
@@ -110,16 +130,30 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
110
130
|
if (initialScreen === "detail" && initialKey) void loadIssue(initialKey);
|
|
111
131
|
else void loadList(false);
|
|
112
132
|
}, [initialScreen, initialKey, loadIssue, loadList]);
|
|
113
|
-
|
|
133
|
+
useAppKeys({
|
|
134
|
+
isActive: overlay.kind !== "comment" && !inputFocused,
|
|
135
|
+
onQuit: exit,
|
|
136
|
+
onBack: () => {
|
|
137
|
+
if (overlay.kind !== "none") {
|
|
138
|
+
setOverlay({ kind: "none" });
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
if (screen === "detail") {
|
|
142
|
+
setScreen("issues");
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
useInput((input) => {
|
|
114
149
|
if (overlay.kind !== "none") return;
|
|
115
|
-
if (input === "q" || key.ctrl && input === "c") exit();
|
|
116
150
|
if (error && input === "r") {
|
|
117
151
|
if (screen === "issues") void loadList(showingAll);
|
|
118
152
|
else if (issue) void loadIssue(issue.key);
|
|
119
153
|
}
|
|
120
154
|
});
|
|
121
155
|
if (width < MIN_WIDTH || height < MIN_HEIGHT) {
|
|
122
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
123
157
|
"Terminal too small \u2014 needs at least ",
|
|
124
158
|
MIN_WIDTH,
|
|
125
159
|
"\xD7",
|
|
@@ -132,18 +166,17 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
132
166
|
"."
|
|
133
167
|
] });
|
|
134
168
|
}
|
|
135
|
-
const framed = (facts, body, hints) => /* @__PURE__ */ jsx2(Frame, { width, height, facts, hints, children: /* @__PURE__ */ jsx2(
|
|
169
|
+
const framed = (facts, body, hints, page = screen === "detail" ? "nested" : "root") => /* @__PURE__ */ jsx2(Frame, { width, height, facts, hints, page, children: /* @__PURE__ */ jsx2(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, flexGrow: 1, children: body }) });
|
|
136
170
|
if (error)
|
|
137
171
|
return framed("error", /* @__PURE__ */ jsx2(Alert, { variant: "error", children: error }), [
|
|
138
|
-
["r", "retry"]
|
|
139
|
-
["q", "quit"]
|
|
172
|
+
["r", "retry"]
|
|
140
173
|
]);
|
|
141
174
|
if (busy) return framed("working\u2026", /* @__PURE__ */ jsx2(Spinner, { label: busy }));
|
|
142
175
|
if (overlay.kind === "transition") {
|
|
143
176
|
return framed(
|
|
144
177
|
issue?.key ?? "",
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, children: [
|
|
179
|
+
/* @__PURE__ */ jsxs(Text, { bold: true, children: [
|
|
147
180
|
"Move ",
|
|
148
181
|
issue?.key,
|
|
149
182
|
" to\u2026"
|
|
@@ -171,15 +204,15 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
171
204
|
}
|
|
172
205
|
}
|
|
173
206
|
),
|
|
174
|
-
/* @__PURE__ */ jsx2(
|
|
207
|
+
/* @__PURE__ */ jsx2(Text, { dimColor: true, children: "esc cancel" })
|
|
175
208
|
] })
|
|
176
209
|
);
|
|
177
210
|
}
|
|
178
211
|
if (overlay.kind === "comment") {
|
|
179
212
|
return framed(
|
|
180
213
|
issue?.key ?? "",
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, children: [
|
|
215
|
+
/* @__PURE__ */ jsxs(Text, { bold: true, children: [
|
|
183
216
|
"Comment on ",
|
|
184
217
|
issue?.key
|
|
185
218
|
] }),
|
|
@@ -187,6 +220,7 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
187
220
|
TextInput,
|
|
188
221
|
{
|
|
189
222
|
placeholder: "Markdown is supported\u2026",
|
|
223
|
+
onCancel: () => setOverlay({ kind: "none" }),
|
|
190
224
|
onSubmit: (body) => {
|
|
191
225
|
setOverlay({ kind: "none" });
|
|
192
226
|
if (!body.trim()) return;
|
|
@@ -210,8 +244,8 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
210
244
|
if (overlay.kind === "assign") {
|
|
211
245
|
return framed(
|
|
212
246
|
issue?.key ?? "",
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, children: [
|
|
248
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
215
249
|
"Assign ",
|
|
216
250
|
issue?.key,
|
|
217
251
|
" to yourself?"
|
|
@@ -247,19 +281,29 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
247
281
|
issue,
|
|
248
282
|
width,
|
|
249
283
|
height: height - FRAME_CHROME - DETAIL_CHROME,
|
|
250
|
-
frame: ({ title, subtitle, hints, body }) => /* @__PURE__ */
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
children:
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
284
|
+
frame: ({ title, subtitle, hints, body }) => /* @__PURE__ */ jsxs(
|
|
285
|
+
Frame,
|
|
286
|
+
{
|
|
287
|
+
width,
|
|
288
|
+
height,
|
|
289
|
+
scope: title,
|
|
290
|
+
hints: hints.filter(([k]) => k !== "\u232B"),
|
|
291
|
+
page: "nested",
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ jsx2(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx2(Text, { dimColor: true, children: subtitle }) }),
|
|
294
|
+
/* @__PURE__ */ jsx2(
|
|
295
|
+
Box,
|
|
296
|
+
{
|
|
297
|
+
flexDirection: "column",
|
|
298
|
+
marginTop: 1,
|
|
299
|
+
paddingLeft: 2,
|
|
300
|
+
flexGrow: 1,
|
|
301
|
+
children: body
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
),
|
|
263
307
|
onBack: () => setScreen("issues"),
|
|
264
308
|
onOpenBrowser: () => execFile(opener(), [issue.url]),
|
|
265
309
|
onAssign: () => setOverlay({ kind: "assign" }),
|
|
@@ -285,13 +329,27 @@ var App = ({ data, initialScreen, initialKey }) => {
|
|
|
285
329
|
IssueBoard,
|
|
286
330
|
{
|
|
287
331
|
model,
|
|
288
|
-
frame: ({
|
|
332
|
+
frame: ({ title, hints, body }) => /* @__PURE__ */ jsx2(
|
|
333
|
+
Frame,
|
|
334
|
+
{
|
|
335
|
+
width,
|
|
336
|
+
height,
|
|
337
|
+
count: title.count,
|
|
338
|
+
user: title.user,
|
|
339
|
+
scope: title.scope,
|
|
340
|
+
status: title.status,
|
|
341
|
+
hints,
|
|
342
|
+
gap: false,
|
|
343
|
+
children: body
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
onInputFocus: setInputFocused,
|
|
289
347
|
viewer,
|
|
290
348
|
loadedAt,
|
|
291
349
|
scope,
|
|
292
350
|
searchError,
|
|
293
351
|
width,
|
|
294
|
-
height: height - FRAME_CHROME - 1,
|
|
352
|
+
height: height - (FRAME_CHROME - 1) - 1,
|
|
295
353
|
showingAll,
|
|
296
354
|
onOpen: (key) => void loadIssue(key),
|
|
297
355
|
onRefresh: () => void (scope.kind === "search" ? runSearch(scope.query, scope.mode) : loadList(showingAll)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/jira-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Jira on the command line — read issues, comments and attachments as plain text",
|
|
6
6
|
"keywords": [
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"prepublishOnly": "npm run build"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@kud/ink-ui": "0.
|
|
40
|
+
"@kud/ink-ui": "0.28.2",
|
|
41
41
|
"@kud/jira": "0.4.0",
|
|
42
|
-
"@kud/jira-ink": "0.
|
|
42
|
+
"@kud/jira-ink": "0.5.0",
|
|
43
43
|
"commander": "14.0.1",
|
|
44
44
|
"ink": "7.1.1",
|
|
45
45
|
"react": "19.2.5"
|