@kud/jira-cli 0.3.0 → 0.4.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/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import {
12
12
 
13
13
  // src/index.ts
14
14
  import { realpathSync } from "fs";
15
+ import { createRequire } from "module";
15
16
  import { fileURLToPath } from "url";
16
17
  import { Command } from "commander";
17
18
  import { isJiraApiError } from "@kud/jira";
@@ -453,6 +454,9 @@ var registerIssueCommands = (program2) => {
453
454
  const lines = [
454
455
  `${bold(found.key)} ${f.summary ?? ""}`,
455
456
  "",
457
+ ...f.parent ? [
458
+ `${dim("parent")} ${f.parent.key} ${truncate(f.parent.fields?.summary ?? "", 60)}`
459
+ ] : [],
456
460
  `${dim("status")} ${f.status?.name ?? "\u2014"}`,
457
461
  `${dim("type")} ${f.issuetype?.name ?? "\u2014"}`,
458
462
  `${dim("assignee")} ${f.assignee?.displayName ?? "unassigned"}`,
@@ -837,7 +841,9 @@ Then add the custom fields you care about:
837
841
 
838
842
  // src/index.ts
839
843
  var program = new Command();
840
- program.name("jira").description("Jira on the command line").version("0.2.0").addHelpText(
844
+ program.name("jira").description("Jira on the command line").version(
845
+ createRequire(import.meta.url)("../package.json").version
846
+ ).addHelpText(
841
847
  "after",
842
848
  `
843
849
  Setup:
@@ -884,11 +890,15 @@ var fail = (error) => {
884
890
  };
885
891
  var interactiveArgs = (argv) => {
886
892
  const rest = argv.slice(2);
887
- const screenAt = rest.indexOf("--screen");
888
- const screen = screenAt === -1 ? void 0 : rest[screenAt + 1];
889
- const consumed = new Set(
890
- screenAt === -1 ? ["--mock"] : ["--mock", "--screen", screen ?? ""]
891
- );
893
+ const inlineAt = rest.findIndex((a) => a.startsWith("--screen="));
894
+ const spacedAt = rest.indexOf("--screen");
895
+ const screen = inlineAt !== -1 ? rest[inlineAt]?.slice("--screen=".length) : spacedAt === -1 ? void 0 : rest[spacedAt + 1];
896
+ const consumed = /* @__PURE__ */ new Set(["--mock"]);
897
+ if (inlineAt !== -1) consumed.add(rest[inlineAt]);
898
+ if (spacedAt !== -1) {
899
+ consumed.add("--screen");
900
+ consumed.add(rest[spacedAt + 1] ?? "");
901
+ }
892
902
  return {
893
903
  screen,
894
904
  mock: rest.includes("--mock"),
@@ -898,7 +908,7 @@ var interactiveArgs = (argv) => {
898
908
  var main = async () => {
899
909
  const { screen, mock, isBare } = interactiveArgs(process.argv);
900
910
  if (screen === "list" && isBare) {
901
- const { SCREENS } = await import("./tui-4JIAFCJF.js");
911
+ const { SCREENS } = await import("./tui-UKK2JQS3.js");
902
912
  process.stdout.write(`${SCREENS.join("\n")}
903
913
  `);
904
914
  return;
@@ -908,7 +918,7 @@ var main = async () => {
908
918
  program.outputHelp();
909
919
  return;
910
920
  }
911
- const { runTui } = await import("./tui-4JIAFCJF.js");
921
+ const { runTui } = await import("./tui-UKK2JQS3.js");
912
922
  const [, key] = (screen ?? "").split(":");
913
923
  await runTui({
914
924
  screen: screen?.startsWith("detail") ? "detail" : "issues",
@@ -1,5 +1,6 @@
1
1
  import {
2
- context
2
+ context,
3
+ truncate
3
4
  } from "./chunk-5MFNIQDW.js";
4
5
 
5
6
  // src/tui/index.tsx
@@ -82,6 +83,13 @@ var IssueDetailView = ({
82
83
  issue.summary
83
84
  ] }),
84
85
  /* @__PURE__ */ jsxs(Box, { marginTop: 1, flexDirection: "column", children: [
86
+ issue.parent && /* @__PURE__ */ jsx(
87
+ KeyValue,
88
+ {
89
+ label: "parent",
90
+ value: `${issue.parent.key} ${truncate(issue.parent.summary, 60)}`
91
+ }
92
+ ),
85
93
  /* @__PURE__ */ jsx(KeyValue, { label: "status", value: /* @__PURE__ */ jsx(Badge, { children: issue.status }) }),
86
94
  /* @__PURE__ */ jsx(KeyValue, { label: "type", value: issue.type }),
87
95
  /* @__PURE__ */ jsx(KeyValue, { label: "assignee", value: issue.assignee }),
@@ -158,7 +166,7 @@ var IssueList = ({
158
166
  const { start, end } = windowFor(cursor, rows.length, size);
159
167
  const visible = rows.slice(start, end);
160
168
  return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
161
- /* @__PURE__ */ jsx2(Box2, { paddingLeft: 2, children: /* @__PURE__ */ jsxs2(Text2, { dimColor: true, children: [
169
+ /* @__PURE__ */ jsx2(Box2, { paddingLeft: 4, children: /* @__PURE__ */ jsxs2(Text2, { dimColor: true, children: [
162
170
  pad("KEY", 11),
163
171
  pad("STATUS", 17),
164
172
  pad("SUMMARY", 60),
@@ -423,6 +431,7 @@ var liveData = (ctx = context()) => ({
423
431
  assignee: f.assignee?.displayName ?? "unassigned",
424
432
  reporter: f.reporter?.displayName ?? "\u2014",
425
433
  labels: f.labels ?? [],
434
+ parent: f.parent ? { key: f.parent.key, summary: f.parent.fields?.summary ?? "" } : void 0,
426
435
  url: `${ctx.config.baseUrl}/browse/${issue.key}`,
427
436
  description: adfToMarkdown(f.description, filenameOf),
428
437
  comments: (f.comment?.comments ?? []).map((c) => ({
@@ -490,6 +499,7 @@ var DETAIL = {
490
499
  assignee: "Ada Okafor",
491
500
  reporter: "Bram Nilsen",
492
501
  labels: ["checkout", "regression"],
502
+ parent: { key: "SHOP-300", summary: "Basket and checkout correctness" },
493
503
  url: "https://example.atlassian.net/browse/SHOP-412",
494
504
  description: [
495
505
  "## What happens",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/jira-cli",
3
- "version": "0.3.0",
3
+ "version": "0.4.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-markdown": "0.1.1",
41
41
  "@kud/ink-ui": "0.14.1",
42
- "@kud/jira": "0.2.0",
42
+ "@kud/jira": "0.2.1",
43
43
  "commander": "14.0.1",
44
44
  "ink": "7.0.1",
45
45
  "react": "19.2.5"