taskchef 4.1.0 → 4.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/.codex-plugin/plugin.json +1 -1
- package/README.md +9 -7
- package/package.json +1 -1
- package/src/cli.js +19 -10
package/README.md
CHANGED
|
@@ -253,15 +253,17 @@ taskchef project list --workspace <workspace>
|
|
|
253
253
|
taskchef project remove payments --workspace <workspace>
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
Human-readable project listings
|
|
257
|
-
|
|
258
|
-
project without a configured repository has
|
|
256
|
+
Human-readable project listings show one parent row per project. Configured
|
|
257
|
+
GitHub repositories appear beneath it as indented tree rows, with repeated kind
|
|
258
|
+
and path cells left blank. A project without a configured repository has only
|
|
259
|
+
its parent row, containing `-` in the repository column:
|
|
259
260
|
|
|
260
261
|
```text
|
|
261
|
-
NAME
|
|
262
|
-
|
|
263
|
-
payments
|
|
264
|
-
|
|
262
|
+
NAME KIND GITHUB REPOSITORY PATH
|
|
263
|
+
notes folder - /workspace/notes
|
|
264
|
+
payments git - /workspace/payments
|
|
265
|
+
├─ repository https://github.com/example/payments-api
|
|
266
|
+
└─ repository https://github.com/example/payments-sdk
|
|
265
267
|
```
|
|
266
268
|
|
|
267
269
|
Import projects as a JSON array from a file or standard input:
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
resolveTask,
|
|
16
16
|
} from "./workspace.js";
|
|
17
17
|
|
|
18
|
+
const BLANK_TABLE_CELL = Symbol("blank table cell");
|
|
19
|
+
|
|
18
20
|
async function readStdin() {
|
|
19
21
|
let input = "";
|
|
20
22
|
process.stdin.setEncoding("utf8");
|
|
@@ -88,27 +90,34 @@ function print(value, args, human) {
|
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
function table(headers, rows) {
|
|
91
|
-
const display = (value) =>
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
const display = (value) => {
|
|
94
|
+
if (value === BLANK_TABLE_CELL) return "";
|
|
95
|
+
if (value === null || value === undefined || value === "") return "-";
|
|
96
|
+
return String(value);
|
|
97
|
+
};
|
|
94
98
|
const widths = headers.map((header, index) =>
|
|
95
99
|
Math.max(header.length, ...rows.map((row) => display(row[index]).length)));
|
|
96
100
|
const format = (row) => row.map((value, index) => index === row.length - 1
|
|
97
101
|
? display(value)
|
|
98
|
-
: display(value).padEnd(widths[index])).join(" ");
|
|
102
|
+
: display(value).padEnd(widths[index])).join(" ").trimEnd();
|
|
99
103
|
return [format(headers), ...rows.map(format)].join("\n");
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
function projectRows(projects) {
|
|
103
|
-
return projects.flatMap((project) =>
|
|
104
|
-
|
|
105
|
-
return repositories.map((repository) => [
|
|
107
|
+
return projects.flatMap((project) => [
|
|
108
|
+
[
|
|
106
109
|
project.name,
|
|
107
110
|
project.isGitRepository ? "git" : "folder",
|
|
108
|
-
|
|
111
|
+
null,
|
|
109
112
|
project.path,
|
|
110
|
-
]
|
|
111
|
-
|
|
113
|
+
],
|
|
114
|
+
...project.githubRepos.map((repository, index) => [
|
|
115
|
+
` ${index === project.githubRepos.length - 1 ? "└─" : "├─"} repository`,
|
|
116
|
+
BLANK_TABLE_CELL,
|
|
117
|
+
repository,
|
|
118
|
+
BLANK_TABLE_CELL,
|
|
119
|
+
]),
|
|
120
|
+
]);
|
|
112
121
|
}
|
|
113
122
|
|
|
114
123
|
function sortTasksByCreatedAt(tasks, ascending) {
|