taskchef 5.0.0 → 5.0.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 +5 -5
- package/package.json +1 -1
- package/src/cli.js +16 -7
package/README.md
CHANGED
|
@@ -281,16 +281,16 @@ taskchef project list
|
|
|
281
281
|
taskchef project remove payments
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
-
Human-readable project listings
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
repository column:
|
|
284
|
+
Human-readable project listings group configured GitHub repositories by
|
|
285
|
+
project. The first row shows the project details; additional repository rows
|
|
286
|
+
leave the repeated name, kind, and path columns blank. A project without a
|
|
287
|
+
configured repository has one row containing `-` in the repository column:
|
|
288
288
|
|
|
289
289
|
```text
|
|
290
290
|
NAME KIND GITHUB REPOSITORY PATH
|
|
291
291
|
notes folder - /workspace/notes
|
|
292
292
|
payments git https://github.com/example/payments-api /workspace/payments
|
|
293
|
-
|
|
293
|
+
https://github.com/example/payments-sdk
|
|
294
294
|
```
|
|
295
295
|
|
|
296
296
|
Import projects as a JSON array from a file or standard input:
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
resolveTask,
|
|
19
19
|
} from "./workspace.js";
|
|
20
20
|
|
|
21
|
+
const BLANK_TABLE_CELL = Symbol("blank table cell");
|
|
22
|
+
|
|
21
23
|
async function readStdin() {
|
|
22
24
|
let input = "";
|
|
23
25
|
process.stdin.setEncoding("utf8");
|
|
@@ -97,9 +99,11 @@ function print(value, args, human) {
|
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
function table(headers, rows) {
|
|
100
|
-
const display = (value) =>
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
const display = (value) => {
|
|
103
|
+
if (value === BLANK_TABLE_CELL) return "";
|
|
104
|
+
if (value === null || value === undefined || value === "") return "-";
|
|
105
|
+
return String(value);
|
|
106
|
+
};
|
|
103
107
|
const widths = headers.map((header, index) =>
|
|
104
108
|
Math.max(header.length, ...rows.map((row) => display(row[index]).length)));
|
|
105
109
|
const format = (row) => row.map((value, index) => index === row.length - 1
|
|
@@ -110,13 +114,18 @@ function table(headers, rows) {
|
|
|
110
114
|
|
|
111
115
|
function projectRows(projects) {
|
|
112
116
|
return projects.flatMap((project) => {
|
|
113
|
-
const
|
|
114
|
-
return
|
|
117
|
+
const [primaryRepository = null, ...additionalRepositories] = project.githubRepos;
|
|
118
|
+
return [[
|
|
115
119
|
project.name,
|
|
116
120
|
project.isGitRepository ? "git" : "folder",
|
|
117
|
-
|
|
121
|
+
primaryRepository,
|
|
118
122
|
project.path,
|
|
119
|
-
])
|
|
123
|
+
], ...additionalRepositories.map((repository) => [
|
|
124
|
+
BLANK_TABLE_CELL,
|
|
125
|
+
BLANK_TABLE_CELL,
|
|
126
|
+
repository,
|
|
127
|
+
BLANK_TABLE_CELL,
|
|
128
|
+
])];
|
|
120
129
|
});
|
|
121
130
|
}
|
|
122
131
|
|