pipe-kan 0.24.0 → 0.24.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/dist/pipe-kan.js CHANGED
@@ -311,6 +311,14 @@ function parseFlags(flags) {
311
311
  function flagsToJql(flags) {
312
312
  return parseFlags(flags).jql;
313
313
  }
314
+ function argvToFlags(argv) {
315
+ const args = argv.slice(2);
316
+ if (args.length === 0)
317
+ return "";
318
+ if (args.length === 1 && !args[0].startsWith("-"))
319
+ return args[0];
320
+ return args.join(" ");
321
+ }
314
322
 
315
323
  // src/store.ts
316
324
  var ME = {
@@ -981,6 +989,10 @@ function createApp(opts) {
981
989
  }
982
990
  },
983
991
  async children(epic) {
992
+ const listed = issuesToBoard(epicsPayload).epics;
993
+ if (!listed.some((e) => e.key === epic)) {
994
+ return { columns: [], epics: [] };
995
+ }
984
996
  if (hasChildrenCache) {
985
997
  const cards = Object.fromEntries(Object.entries(columnsOf(childrenRaw)).map(([title, list]) => [
986
998
  title,
@@ -1030,18 +1042,20 @@ function createApp(opts) {
1030
1042
  // src/boot.ts
1031
1043
  async function createBoardApp(opts) {
1032
1044
  const env = opts.env ?? process.env;
1045
+ const flags = opts.flags ?? "";
1033
1046
  const store = IssueStore.fromRaw(opts.raw);
1034
1047
  const bin = resolveJiraBin(env.JIRA_BIN ?? "jira", env.PATH ?? "");
1035
1048
  const cli = bin ? createJiraCli({
1036
1049
  bin,
1037
1050
  configPath: env.JIRA_CONFIG_FILE,
1038
- token: env.JIRA_API_TOKEN
1039
- }) : createStoreCli(store);
1051
+ token: env.JIRA_API_TOKEN,
1052
+ flags
1053
+ }) : createStoreCli(store, flags);
1040
1054
  const app = createApp({ store, cli });
1041
1055
  if (opts.piped) {
1042
1056
  app.hydrate(opts.raw);
1043
1057
  } else {
1044
- const local = createStoreCli(store);
1058
+ const local = createStoreCli(store, flags);
1045
1059
  app.hydrate(JSON.parse(await local.list(app.flags)), { fromStore: true });
1046
1060
  }
1047
1061
  return { app, store, kind: bin ? "jira" : "store" };
@@ -12069,9 +12083,11 @@ function announce(line) {
12069
12083
  async function runServer(opts) {
12070
12084
  const piped = await readPipe();
12071
12085
  const raw = piped ?? JSON.parse(readFileSync4(join8(opts.root, "fixtures/issues.json"), "utf8"));
12086
+ const flags = argvToFlags(process.argv);
12072
12087
  const { app, store, kind } = await createBoardApp({
12073
12088
  raw,
12074
- piped: Boolean(piped)
12089
+ piped: Boolean(piped),
12090
+ flags
12075
12091
  });
12076
12092
  const server = createServer((req, res) => {
12077
12093
  if (handleRequest(req, res, { app, store }))