Commit d76ea3c
committed
refactor: convert org-list handlers to return ListResult instead of writing stdout
All org-scoped list handlers now return ListResult<T> containing items +
metadata (hasMore, nextCursor, hint, errors, jsonExtra) instead of writing
directly to stdout. This enables callers (buildOrgListCommand) to handle
rendering via OutputConfig.
Changes:
- org-list.ts: All default handlers return ListResult, removed stdout params
from handleOrgAll, handleAutoDetect, handleExplicitOrg,
handleExplicitProject, handleProjectSearch
- list-command.ts: buildOrgListCommand uses OutputConfig with formatListHuman
and jsonTransformList for automatic rendering
- project/list.ts: All 4 override handlers return ListResult<ProjectWithOrg>,
command func returns CommandOutput<ListResult> with full OutputConfig
- issue/list.ts: handleOrgAllIssues and handleResolvedTargets return
ListResult<SentryIssue> (still write to stdout internally due to complex
rendering, but satisfy the ModeHandler return type contract)
- team/list.ts, repo/list.ts: displayTable returns string via formatTable
- formatters/table.ts: Added formatTable() returning string (writeTable
delegates to it)
Test updates:
- org-list.test.ts: Assert on returned ListResult instead of stdout writes
- list-command.test.ts: dispatchSpy returns ListResult, buildOrgListCommand
takes 3 args (config, docs, routeName), displayTable returns string
- project/list.test.ts: Handler tests use new signatures without stdout param1 parent 4304ab8 commit d76ea3c
File tree
10 files changed
+933
-932
lines changed- src
- commands
- issue
- project
- repo
- team
- lib
- formatters
- test
- commands/project
- lib
10 files changed
+933
-932
lines changedLarge diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
97 | | - | |
| 103 | + | |
98 | 104 | | |
99 | | - | |
100 | | - | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| |||
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
121 | 139 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
403 | 408 | | |
404 | 409 | | |
405 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
406 | 446 | | |
407 | 447 | | |
408 | 448 | | |
409 | 449 | | |
410 | 450 | | |
411 | | - | |
| 451 | + | |
412 | 452 | | |
413 | 453 | | |
414 | 454 | | |
415 | 455 | | |
416 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
417 | 459 | | |
418 | 460 | | |
419 | 461 | | |
| 462 | + | |
420 | 463 | | |
421 | 464 | | |
422 | 465 | | |
| |||
425 | 468 | | |
426 | 469 | | |
427 | 470 | | |
428 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
429 | 477 | | |
430 | 478 | | |
431 | 479 | | |
| |||
445 | 493 | | |
446 | 494 | | |
447 | 495 | | |
448 | | - | |
| 496 | + | |
449 | 497 | | |
450 | 498 | | |
451 | 499 | | |
452 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
453 | 511 | | |
454 | 512 | | |
455 | 513 | | |
0 commit comments