Commit 8dcba68
committed
refactor: convert Tier 2-3 commands to return-based output and consola
Convert remaining non-streaming commands away from direct stdout/stderr
writes, continuing the output convergence started in #382.
Return-based output (OutputConfig<T>):
- project/view, log/view: pure formatter functions, return { data, hint }
- org/list, trace/list: return structured data with human formatters
- Add jsonTransform to OutputConfig for custom JSON envelopes (trace/list)
- Widen buildListCommand to accept OutputConfig alongside "json"
Consola logging:
- auth/login, logout, status: logger.withTag("auth.*"), log.info/success/warn
- cli/feedback, setup, fix, upgrade: logger.withTag("cli.*")
- api.ts: remove stderr: Writer param from 4 helper functions
Infrastructure:
- OutputConfig<T> gains jsonTransform property for envelope wrapping
- ListCommandFunction type allows unknown returns
All tests updated to spy on process.stderr.write (consola target) instead
of mock context stdout/stderr. 26 files changed across src and test.1 parent fc90123 commit 8dcba68
File tree
26 files changed
+1681
-1252
lines changed- src
- commands
- auth
- cli
- log
- org
- project
- trace
- lib
- formatters
- test
- commands
- auth
- cli
- log
- e2e
- lib/formatters
26 files changed
+1681
-1252
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
312 | | - | |
| 313 | + | |
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
328 | | - | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
| 334 | + | |
336 | 335 | | |
337 | 336 | | |
338 | 337 | | |
| |||
358 | 357 | | |
359 | 358 | | |
360 | 359 | | |
361 | | - | |
362 | | - | |
| 360 | + | |
| 361 | + | |
363 | 362 | | |
364 | 363 | | |
365 | 364 | | |
| |||
742 | 741 | | |
743 | 742 | | |
744 | 743 | | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
749 | 748 | | |
750 | 749 | | |
751 | 750 | | |
| |||
771 | 770 | | |
772 | 771 | | |
773 | 772 | | |
774 | | - | |
775 | | - | |
776 | | - | |
| 773 | + | |
| 774 | + | |
777 | 775 | | |
778 | 776 | | |
779 | 777 | | |
| |||
913 | 911 | | |
914 | 912 | | |
915 | 913 | | |
916 | | - | |
| 914 | + | |
917 | 915 | | |
918 | 916 | | |
919 | 917 | | |
920 | 918 | | |
921 | 919 | | |
922 | 920 | | |
923 | | - | |
924 | | - | |
| 921 | + | |
925 | 922 | | |
926 | 923 | | |
927 | 924 | | |
928 | 925 | | |
929 | | - | |
930 | | - | |
| 926 | + | |
| 927 | + | |
931 | 928 | | |
932 | 929 | | |
933 | 930 | | |
934 | 931 | | |
935 | 932 | | |
936 | 933 | | |
937 | | - | |
| 934 | + | |
938 | 935 | | |
939 | 936 | | |
940 | 937 | | |
| |||
986 | 983 | | |
987 | 984 | | |
988 | 985 | | |
989 | | - | |
990 | | - | |
| 986 | + | |
991 | 987 | | |
992 | 988 | | |
993 | 989 | | |
| |||
1026 | 1022 | | |
1027 | 1023 | | |
1028 | 1024 | | |
1029 | | - | |
| 1025 | + | |
1030 | 1026 | | |
1031 | 1027 | | |
1032 | 1028 | | |
1033 | 1029 | | |
1034 | | - | |
1035 | | - | |
1036 | 1030 | | |
1037 | 1031 | | |
1038 | 1032 | | |
| |||
1162 | 1156 | | |
1163 | 1157 | | |
1164 | 1158 | | |
1165 | | - | |
| 1159 | + | |
1166 | 1160 | | |
1167 | 1161 | | |
1168 | | - | |
| 1162 | + | |
1169 | 1163 | | |
1170 | 1164 | | |
1171 | 1165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
51 | | - | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
29 | | - | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
0 commit comments