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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Dispatch work from a data-only workspace to visible Codex project tasks.",
5
5
  "author": {
6
6
  "name": "Favo Yang",
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 show one row per configured GitHub repository.
285
- Project details repeat on each row so multi-repository projects remain clear.
286
- A project without a configured repository has one row containing `-` in the
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
- payments git https://github.com/example/payments-sdk /workspace/payments
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "A non-blocking interactive dispatcher for visible Codex tasks.",
5
5
  "license": "MIT",
6
6
  "author": "Favo Yang",
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) => value === null || value === undefined || value === ""
101
- ? "-"
102
- : String(value);
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 repositories = project.githubRepos.length > 0 ? project.githubRepos : [null];
114
- return repositories.map((repository) => [
117
+ const [primaryRepository = null, ...additionalRepositories] = project.githubRepos;
118
+ return [[
115
119
  project.name,
116
120
  project.isGitRepository ? "git" : "folder",
117
- repository,
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