@zinn-dev/cli 0.7.0 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-dev/cli",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "A kanban workflow in the terminal.",
5
5
  "license": "MIT",
6
6
  "bugs": {
@@ -42,6 +42,6 @@
42
42
  "access": "public"
43
43
  },
44
44
  "dependencies": {
45
- "@zinn-dev/core": "0.7.0"
45
+ "@zinn-dev/core": "0.8.0"
46
46
  }
47
47
  }
@@ -1,7 +1,7 @@
1
1
  import type { RouteDef } from "../types";
2
2
 
3
3
  import { parseArgs } from "node:util";
4
- import { project, relation, relationCreateSchema, task } from "@zinn-dev/core";
4
+ import { relation, relationCreateSchema, task } from "@zinn-dev/core";
5
5
  import { quit } from "../lib";
6
6
 
7
7
  export function formatRelations(taskKey: string) {
@@ -69,15 +69,13 @@ export const relationRouter = {
69
69
  const source = task.getByKey(sourceTaskKey);
70
70
  const target = task.getByKey(targetTaskKey);
71
71
 
72
- const sourceKey = `${project.getById(source.project_id)!.key}-${source.number}`;
73
- const targetKey = `${project.getById(target.project_id)!.key}-${target.number}`;
74
-
75
72
  const label = {
76
73
  related: "related to",
77
74
  dependency: "depends on",
78
75
  duplicate: "is a duplicate of",
79
76
  }[typeResult.data];
80
- console.info(`${sourceKey} ${label} ${targetKey}`);
77
+
78
+ console.info(`${source.key} ${label} ${target.key}`);
81
79
  },
82
80
  help: `Usage: zinn task relation create <source-task-key> <target-task-key> --type <type>
83
81
 
@@ -10,9 +10,8 @@ function formatTask(
10
10
  taskMatch: ReturnType<typeof task.getByKey>,
11
11
  options: { showsStatus?: boolean } = {},
12
12
  ) {
13
- const taskProject = project.getById(taskMatch.project_id)!;
14
13
  const taskColumn = column.getById(taskMatch.column_id)!;
15
- const taskKey = `${taskProject.key}-${taskMatch.number}`;
14
+ const taskKey = taskMatch.key;
16
15
  const status = options.showsStatus
17
16
  ? ` | ${taskMatch.archived_at == null ? "Active" : "Archived"}`
18
17
  : "";
@@ -140,10 +139,8 @@ Example: zinn task create MDR "Refine the numbers" "Sort the numbers and meet th
140
139
  }
141
140
 
142
141
  const presentableTasks = tasks.map((t) => {
143
- // TODO: A task's project and column is fetched in both `list` and `view`. Make a reusable fetcher?
144
- const taskProject = project.getById(t.project_id)!;
145
142
  const taskColumn = column.getById(t.column_id)!;
146
- const taskKey = `${taskProject.key}-${t.number}`;
143
+ const taskKey = t.key;
147
144
 
148
145
  return {
149
146
  id: taskKey,