@harborppm/cli 0.1.0 → 0.1.1
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/lib/format.mjs +4 -3
- package/package.json +1 -1
package/lib/format.mjs
CHANGED
|
@@ -8,13 +8,14 @@ const STATUS = {
|
|
|
8
8
|
done: "done",
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
/** `mine` leaves out whose each task is: every one is yours. */
|
|
12
|
+
export function taskLine(t, { today, mine = false } = {}) {
|
|
12
13
|
const late = t.due && today && t.due < today && t.status !== "done";
|
|
13
14
|
const bits = [
|
|
14
15
|
STATUS[t.status] ?? t.status,
|
|
15
16
|
t.due ? (late ? `late, due ${t.due}` : `due ${t.due}`) : null,
|
|
16
17
|
t.priority && t.priority !== "medium" ? t.priority : null,
|
|
17
|
-
t.assignee ?? null,
|
|
18
|
+
mine ? null : (t.assignee ?? null),
|
|
18
19
|
t.project ?? null,
|
|
19
20
|
t.waitingOn ? `waits on ${t.waitingOn}` : null,
|
|
20
21
|
].filter(Boolean);
|
|
@@ -24,7 +25,7 @@ export function taskLine(t, { today } = {}) {
|
|
|
24
25
|
export function myWork(w, opts) {
|
|
25
26
|
if (!w.you) return w.note ?? "Nothing is yours in this harbor yet.";
|
|
26
27
|
const out = [`${w.you}: ${w.openTasks} open${w.late ? `, ${w.late} late` : ""}`];
|
|
27
|
-
if (w.tasks?.length) out.push("", ...w.tasks.map((t) => taskLine(t, opts)));
|
|
28
|
+
if (w.tasks?.length) out.push("", ...w.tasks.map((t) => taskLine(t, { ...opts, mine: true })));
|
|
28
29
|
if (w.waitingOnYou?.length) {
|
|
29
30
|
out.push("", "Waiting on you:");
|
|
30
31
|
for (const x of w.waitingOnYou)
|