depflow 3.0.0-dev.10 → 3.0.0-dev.12

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.
Files changed (175) hide show
  1. package/README.md +513 -117
  2. package/dist/builder/Builder.d.ts +279 -0
  3. package/dist/builder/Builder.js +391 -0
  4. package/dist/builder/Builder.js.map +1 -0
  5. package/dist/cli/Actions.d.ts +187 -0
  6. package/dist/cli/Actions.js +793 -0
  7. package/dist/cli/Actions.js.map +1 -0
  8. package/dist/cli/CLI.d.ts +170 -0
  9. package/dist/cli/CLI.js +231 -0
  10. package/dist/cli/CLI.js.map +1 -0
  11. package/dist/cli/DepflowCLI.d.ts +62 -0
  12. package/dist/cli/DepflowCLI.js +229 -0
  13. package/dist/cli/DepflowCLI.js.map +1 -0
  14. package/dist/cli/Flags.d.ts +106 -0
  15. package/dist/cli/Flags.js +125 -0
  16. package/dist/cli/Flags.js.map +1 -0
  17. package/dist/cli/bin.js +63 -0
  18. package/dist/cli/bin.js.map +1 -0
  19. package/dist/config/Config.d.ts +690 -0
  20. package/dist/config/Config.js +45 -0
  21. package/dist/config/Config.js.map +1 -0
  22. package/dist/config/ImportMap.d.ts +60 -0
  23. package/dist/config/ImportMap.js +66 -0
  24. package/dist/config/ImportMap.js.map +1 -0
  25. package/dist/config/JsonSchema.d.ts +12 -0
  26. package/dist/config/JsonSchema.js +26 -0
  27. package/dist/config/JsonSchema.js.map +1 -0
  28. package/dist/config/Settings.d.ts +201 -0
  29. package/dist/config/Settings.js +191 -0
  30. package/dist/config/Settings.js.map +1 -0
  31. package/dist/config/TSConfig.d.ts +73 -0
  32. package/dist/config/TSConfig.js +73 -0
  33. package/dist/config/TSConfig.js.map +1 -0
  34. package/dist/config/codecs/JsonCodec.d.ts +30 -0
  35. package/dist/config/codecs/JsonCodec.js +31 -0
  36. package/dist/config/codecs/JsonCodec.js.map +1 -0
  37. package/dist/config/codecs/YamlCodec.d.ts +62 -0
  38. package/dist/config/codecs/YamlCodec.js +89 -0
  39. package/dist/config/codecs/YamlCodec.js.map +1 -0
  40. package/dist/dependency/DepUtils.d.ts +78 -0
  41. package/dist/dependency/DepUtils.js +122 -0
  42. package/dist/dependency/DepUtils.js.map +1 -0
  43. package/dist/dependency/Dependency.d.ts +81 -0
  44. package/dist/dependency/Dependency.js +71 -0
  45. package/dist/dependency/Dependency.js.map +1 -0
  46. package/dist/dependency/Git.d.ts +75 -0
  47. package/dist/dependency/Git.js +97 -0
  48. package/dist/dependency/Git.js.map +1 -0
  49. package/dist/dependency/GitDependency.d.ts +30 -0
  50. package/dist/dependency/GitDependency.js +79 -0
  51. package/dist/dependency/GitDependency.js.map +1 -0
  52. package/dist/dependency/NpmDependency.d.ts +27 -0
  53. package/dist/dependency/NpmDependency.js +91 -0
  54. package/dist/dependency/NpmDependency.js.map +1 -0
  55. package/{build/support/PathResolver → dist/resolve}/AliasCompiler.d.ts +18 -5
  56. package/{build/support/PathResolver → dist/resolve}/AliasCompiler.js +31 -9
  57. package/dist/resolve/AliasCompiler.js.map +1 -0
  58. package/{build/support/PathResolver → dist/resolve}/PathResolver.d.ts +25 -8
  59. package/dist/resolve/PathResolver.js +133 -0
  60. package/dist/resolve/PathResolver.js.map +1 -0
  61. package/dist/resolve/PathRewriter.d.ts +24 -0
  62. package/{build/support/PathResolver → dist/resolve}/PathRewriter.js +21 -11
  63. package/dist/resolve/PathRewriter.js.map +1 -0
  64. package/{build → dist}/schema/Config/Builder.d.ts +114 -49
  65. package/dist/schema/Config/Builder.js +78 -0
  66. package/dist/schema/Config/Builder.js.map +1 -0
  67. package/{build → dist}/schema/Config/Config.d.ts +169 -78
  68. package/dist/schema/Config/Config.js +62 -0
  69. package/dist/schema/Config/Config.js.map +1 -0
  70. package/{build → dist}/schema/Config/Dependency.d.ts +219 -89
  71. package/dist/schema/Config/Dependency.js +80 -0
  72. package/dist/schema/Config/Dependency.js.map +1 -0
  73. package/{build → dist}/schema/Config/Extractor.d.ts +41 -17
  74. package/dist/schema/Config/Extractor.js +43 -0
  75. package/dist/schema/Config/Extractor.js.map +1 -0
  76. package/{build → dist}/schema/Config/Resolver.d.ts +25 -8
  77. package/dist/schema/Config/Resolver.js +43 -0
  78. package/dist/schema/Config/Resolver.js.map +1 -0
  79. package/{build → dist}/schema/Config/Transform.d.ts +22 -5
  80. package/dist/schema/Config/Transform.js +51 -0
  81. package/dist/schema/Config/Transform.js.map +1 -0
  82. package/dist/schema/Defaults.d.ts +20 -0
  83. package/dist/schema/Defaults.js +24 -0
  84. package/dist/schema/Defaults.js.map +1 -0
  85. package/dist/schema/ImportMap.d.ts +30 -0
  86. package/dist/schema/ImportMap.js +28 -0
  87. package/dist/schema/ImportMap.js.map +1 -0
  88. package/{build → dist}/schema/TSConfig.d.ts +23 -9
  89. package/dist/schema/TSConfig.js +39 -0
  90. package/dist/schema/TSConfig.js.map +1 -0
  91. package/{build → dist}/schema/schema.d.ts +11 -2
  92. package/{build → dist}/schema/schema.js +11 -2
  93. package/dist/schema/schema.js.map +1 -0
  94. package/dist/task/Command.d.ts +287 -0
  95. package/dist/task/Command.js +404 -0
  96. package/dist/task/Command.js.map +1 -0
  97. package/dist/task/Group.d.ts +15 -0
  98. package/dist/task/Group.js +29 -0
  99. package/dist/task/Group.js.map +1 -0
  100. package/dist/task/OutputPolicy.d.ts +262 -0
  101. package/dist/task/OutputPolicy.js +364 -0
  102. package/dist/task/OutputPolicy.js.map +1 -0
  103. package/dist/task/Task.d.ts +210 -0
  104. package/dist/task/Task.js +312 -0
  105. package/dist/task/Task.js.map +1 -0
  106. package/package.json +14 -10
  107. package/.gitignore +0 -7
  108. package/build/cli/DepFLowCLI.d.ts +0 -16
  109. package/build/cli/DepFLowCLI.js +0 -254
  110. package/build/cli/DepFLowCLI.js.map +0 -1
  111. package/build/cli/bin.js +0 -38
  112. package/build/cli/bin.js.map +0 -1
  113. package/build/config/Config.d.ts +0 -28
  114. package/build/config/Config.js +0 -46
  115. package/build/config/Config.js.map +0 -1
  116. package/build/config/ImportMap.d.ts +0 -51
  117. package/build/config/ImportMap.js +0 -97
  118. package/build/config/ImportMap.js.map +0 -1
  119. package/build/config/TSConfig.d.ts +0 -54
  120. package/build/config/TSConfig.js +0 -104
  121. package/build/config/TSConfig.js.map +0 -1
  122. package/build/schema/Config/Builder.js +0 -48
  123. package/build/schema/Config/Builder.js.map +0 -1
  124. package/build/schema/Config/Config.js +0 -20
  125. package/build/schema/Config/Config.js.map +0 -1
  126. package/build/schema/Config/Dependency.js +0 -25
  127. package/build/schema/Config/Dependency.js.map +0 -1
  128. package/build/schema/Config/Extractor.js +0 -25
  129. package/build/schema/Config/Extractor.js.map +0 -1
  130. package/build/schema/Config/Resolver.js +0 -25
  131. package/build/schema/Config/Resolver.js.map +0 -1
  132. package/build/schema/Config/Transform.js +0 -27
  133. package/build/schema/Config/Transform.js.map +0 -1
  134. package/build/schema/ImportMap.d.ts +0 -22
  135. package/build/schema/ImportMap.js +0 -12
  136. package/build/schema/ImportMap.js.map +0 -1
  137. package/build/schema/TSConfig.js +0 -19
  138. package/build/schema/TSConfig.js.map +0 -1
  139. package/build/schema/schema.js.map +0 -1
  140. package/build/support/Builder/Builder.d.ts +0 -46
  141. package/build/support/Builder/Builder.js +0 -116
  142. package/build/support/Builder/Builder.js.map +0 -1
  143. package/build/support/Dependency/Dependency.d.ts +0 -38
  144. package/build/support/Dependency/Dependency.js +0 -14
  145. package/build/support/Dependency/Dependency.js.map +0 -1
  146. package/build/support/Dependency/GitDependency.d.ts +0 -20
  147. package/build/support/Dependency/GitDependency.js +0 -67
  148. package/build/support/Dependency/GitDependency.js.map +0 -1
  149. package/build/support/Dependency/NpmDependency.d.ts +0 -18
  150. package/build/support/Dependency/NpmDependency.js +0 -65
  151. package/build/support/Dependency/NpmDependency.js.map +0 -1
  152. package/build/support/Git.d.ts +0 -53
  153. package/build/support/Git.js +0 -86
  154. package/build/support/Git.js.map +0 -1
  155. package/build/support/PathResolver/AliasCompiler.js.map +0 -1
  156. package/build/support/PathResolver/PathResolver.js +0 -105
  157. package/build/support/PathResolver/PathResolver.js.map +0 -1
  158. package/build/support/PathResolver/PathRewriter.d.ts +0 -18
  159. package/build/support/PathResolver/PathRewriter.js.map +0 -1
  160. package/build/support/PathResolver/Utils.d.ts +0 -36
  161. package/build/support/PathResolver/Utils.js +0 -45
  162. package/build/support/PathResolver/Utils.js.map +0 -1
  163. package/build/support/Task/Command.d.ts +0 -49
  164. package/build/support/Task/Command.js +0 -100
  165. package/build/support/Task/Command.js.map +0 -1
  166. package/build/support/Task/Task.d.ts +0 -84
  167. package/build/support/Task/Task.js +0 -145
  168. package/build/support/Task/Task.js.map +0 -1
  169. package/build/support/Utils.d.ts +0 -40
  170. package/build/support/Utils.js +0 -138
  171. package/build/support/Utils.js.map +0 -1
  172. package/build/support/Validator.d.ts +0 -22
  173. package/build/support/Validator.js +0 -28
  174. package/build/support/Validator.js.map +0 -1
  175. /package/{build → dist}/cli/bin.d.ts +0 -0
@@ -0,0 +1,262 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Decides how the output of the commands a run executes is presented: how much of it reaches
4
+ * the screen, which command every line belongs to, and what is kept as evidence.
5
+ * @license Apache-2.0
6
+ */
7
+ import Logger, { type Renderer } from "@netfeez/vterm";
8
+ import type Task from "./Task.js";
9
+ import type Builder from "../builder/Builder.js";
10
+ export declare class OutputPolicy {
11
+ /** The width a label is read at before it is closed with an ellipsis. */
12
+ static readonly LABEL_LENGTH: number;
13
+ readonly report: Logger;
14
+ /** The channel the failures of a silent run are reported through, free of the boxes of the run. */
15
+ protected readonly direct: Logger;
16
+ protected readonly evidence: Logger;
17
+ protected readonly vVerbosity: OutputPolicy.Verbosity;
18
+ protected readonly vDecoration: OutputPolicy.Decoration;
19
+ /** The command the stream being shown belongs to, so a new one is announced once and not once per line. */
20
+ protected vAnnounced: string | null;
21
+ /**
22
+ * Builds the policy of a run out of the logger its evidence is kept in and the mode it asked to be
23
+ * run in.
24
+ * @param info - The logger the evidence of the run is kept in, and the mode the run asked to be run in.
25
+ *
26
+ * @remarks The policy is the single owner of the mode, so it settles the channel the lifecycle of the
27
+ * run is reported through: a run that is not silent reports its lifecycle through the boxed report,
28
+ * and a silent run silences that channel and says the failures through the direct one, which is what
29
+ * makes the silence a mode instead of a decision each of the emitters of that lifecycle would have to
30
+ * know about.
31
+ *
32
+ * @remarks The three channels are compositions of their own, and they all attach to the file transport
33
+ * of the logger they are built on, so a run writes one evidence file however many of them end up
34
+ * saving: the evidence of a command and the report of the run belong to the same account of the same
35
+ * run.
36
+ */
37
+ constructor(info: OutputPolicy.Info);
38
+ /** How much of the output of the commands is shown. **/
39
+ get verbosity(): OutputPolicy.Verbosity;
40
+ /** Whether the output is drawn inside boxes, with timestamps, levels and names. **/
41
+ get decoration(): OutputPolicy.Decoration;
42
+ /**
43
+ * The channel the lifecycle of the run is reported through: the boxed report of the run, or the
44
+ * direct channel when the run is silent, so a silence says the failures and nothing of the boxes.
45
+ * @returns The channel to write the lifecycle to.
46
+ */
47
+ protected shown(): Logger;
48
+ /**
49
+ * Reports a line a command that is still running just wrote.
50
+ * @param identity - The step the commands of the task run in.
51
+ * @param line - The line the command wrote.
52
+ * @param ordinal - The position of the command inside its task, starting at 1.
53
+ * @param channel - The stream the line came from.
54
+ * @returns void
55
+ *
56
+ * @remarks Only a verbose run shows the stream of a command as it comes; the other two modes report
57
+ * the commands once they are done, read from the verdict of the task rather than from this stream,
58
+ * which is a projection of the output and not a transcript of it. Each line of the stream is trimmed
59
+ * of the whitespace around it, the inheritance of a projection that reads a line instead of
60
+ * reproducing the buffer it was written in.
61
+ */
62
+ live(identity: OutputPolicy.Identity, line: string, ordinal: number, channel: OutputPolicy.Channel): void;
63
+ /**
64
+ * Reports the commands of a task that is done: one result line per command and the failure of the ones
65
+ * that failed.
66
+ * @param identity - The step the commands of the task ran in.
67
+ * @param data - The summary of the run of the task.
68
+ * @returns void
69
+ *
70
+ * @remarks This is the only moment the output of the commands is consumed. The complete buffer of
71
+ * every command reaches the evidence file before its result is rendered, and neither the report of a
72
+ * build nor the summary of a task carries it past this point, so a command that is not reported here
73
+ * is a command whose output is nowhere.
74
+ */
75
+ settleTask(identity: OutputPolicy.Identity, data: Task.FinishData): void;
76
+ /**
77
+ * Reports a task that stopped, marking the step it belongs to as failed.
78
+ * @param identity - The step the task ran in, when it ran inside a pipeline.
79
+ * @param failure - The failure the task rejected with.
80
+ * @returns void
81
+ *
82
+ * @remarks What is marked here is the step and not its commands: every command of the task was already
83
+ * reported when the task settled, and the summary of the failure belongs to whoever catches it, which
84
+ * is the only place that can decide what the exit status of the process is going to be.
85
+ */
86
+ stepFailed(identity: OutputPolicy.Identity, failure: Task.Failure): void;
87
+ /**
88
+ * Reports a pipeline that is done, marking the steps that tolerated the failures they had.
89
+ * @param report - The report of the run of the pipeline.
90
+ * @returns void
91
+ *
92
+ * @remarks A tolerated failure is a fact about a step and not about a command, and it is said here
93
+ * because the report is where a step accounts for it. A command that failed under `allowFails` is
94
+ * never marked as completed, and a step that let it through is never reported as a success either:
95
+ * the two facts are both true and neither of them is told by the other.
96
+ *
97
+ * @remarks The verdict of the pipeline itself is not reported here. It belongs to whoever catches the
98
+ * failure of the run, so that a mode can never turn a failing build into a successful one.
99
+ */
100
+ settleBuild(report: Builder.Report): void;
101
+ /**
102
+ * Reports one command of a task that is done: what it captured, what it ended as, and what it printed.
103
+ * @param identity - The step the command ran in.
104
+ * @param result - The result of the command.
105
+ * @returns void
106
+ *
107
+ * @remarks A failure is never left with its marker alone in a mode that shows something: the
108
+ * diagnostic is what says what went wrong, and it is said once, as a line of its own, whether the
109
+ * command ended with a status or never had one to report.
110
+ *
111
+ * @remarks The complete buffer is the only thing a verbose run does not repeat, because that run has
112
+ * already shown it as it came. What the two modes share is the diagnostic, and what separates them
113
+ * is the buffer: neither of them shows it twice.
114
+ */
115
+ protected settle(identity: OutputPolicy.Identity, result: Task.commandResult): void;
116
+ /**
117
+ * Renders the failure of a command: what it was, how it ended, and everything it printed.
118
+ * @param result - The result of the command, which has a status of its own to report.
119
+ * @returns void
120
+ *
121
+ * @remarks The buffer of a command that never had a status is not rendered here: its capture is
122
+ * incomplete by definition, because the process it was capturing never ended, and presenting an
123
+ * incomplete capture as the evidence of a failure is a claim the data does not carry.
124
+ *
125
+ * @remarks The diagnostic is enough on its own for that case, because it already carries the label:
126
+ * the thinned label is not repeated above a line that says the same thing in full.
127
+ */
128
+ protected block(result: Task.commandResult, out?: Logger): void;
129
+ /**
130
+ * Writes everything a command captured into the evidence file, whether it is shown or not.
131
+ * @param identity - The step the command ran in.
132
+ * @param result - The result of the command.
133
+ * @returns void
134
+ *
135
+ * @remarks The evidence carries the complete buffer of every command in every mode, tagged with the
136
+ * identity of the command and labelled by channel, and a buffer of a process that never ended says so
137
+ * because an incomplete capture presented as a whole one is a lie about what the command said.
138
+ */
139
+ protected evident(identity: OutputPolicy.Identity, result: Task.commandResult): void;
140
+ /**
141
+ * Writes one captured channel of a command into a channel of the policy, labelled and line by line.
142
+ * @param logger - The channel the capture is written to.
143
+ * @param level - The level the capture is written at.
144
+ * @param channel - The stream the capture came from.
145
+ * @param content - Everything the stream accumulated.
146
+ * @param incomplete - Whether the capture stopped because the process never ended.
147
+ * @returns void
148
+ *
149
+ * @remarks An empty channel is not labelled: a label over nothing is noise, and a reader who sees no
150
+ * label knows there was nothing there. Each line is a call of its own, so the wrapping of a line
151
+ * longer than the render width applies to it alone and never to the whole capture.
152
+ */
153
+ protected captured(logger: Logger, level: OutputPolicy.Level, channel: OutputPolicy.Channel, content: string, incomplete: boolean): void;
154
+ /**
155
+ * Announces the command the stream now belongs to, once per command and not once per line.
156
+ * @param identity - The step the command runs in.
157
+ * @param ordinal - The position of the command inside its task, starting at 1.
158
+ * @returns void
159
+ */
160
+ protected announce(identity: OutputPolicy.Identity, ordinal: number): void;
161
+ /**
162
+ * The mode a run asked for out of the two flags that can conflict, where a silence wins over an addition.
163
+ * @param info - What the run asked for.
164
+ * @returns The mode of the run.
165
+ *
166
+ * @remarks The precedence lives here and not in the parser on purpose: a combination of flags is a
167
+ * thing a user types, not a thing a parser has an opinion about, and a mode that a parser rejected
168
+ * would leave a user with no way to say what they meant.
169
+ */
170
+ protected static verbosity(info: OutputPolicy.Info): OutputPolicy.Verbosity;
171
+ /**
172
+ * The renderer of the channels that are shown: a decorated line paints its head and its rails inside
173
+ * the width of the line, and an undecorated one wraps its content in the whole width.
174
+ * @param decoration - Whether the run decorates its output.
175
+ * @returns The renderer of the shown channels.
176
+ *
177
+ * @remarks The renderer asks the width of the terminal of the run through the columns callback the
178
+ * logger was built with, so a line never reaches further than the terminal that reads it, and the
179
+ * decoration lives inside that width instead of widening the line. That is why a decorated line wraps
180
+ * its content earlier than an undecorated one does, and why turning the decoration off changes what is
181
+ * drawn around the content and never reaches wider than the same terminal either.
182
+ */
183
+ protected static compose(decoration: OutputPolicy.Decoration): Renderer.Options;
184
+ /**
185
+ * The renderer of a channel that carries content and nothing else: no timestamp, level nor name, and
186
+ * no separator either, which is what keeps a transcript greppable and free of the group it was written in.
187
+ * @returns The renderer of a plain channel.
188
+ */
189
+ protected static plain(): Renderer.Options;
190
+ /**
191
+ * The visible identity of a command: the position it holds inside its own task, qualified by the
192
+ * position of the step it runs in only when the pipeline has more than one of them.
193
+ * @param identity - The step the command runs in.
194
+ * @param ordinal - The position of the command inside its task, starting at 1.
195
+ * @returns The identity of the command.
196
+ */
197
+ protected static identity(identity: OutputPolicy.Identity, ordinal: number): string;
198
+ /**
199
+ * The label of a command thinned to what identifies it: the executable of a program or the first word
200
+ * of a script, cut to the width a line can carry and closed with an ellipsis when it does not fit.
201
+ * @param label - The human readable form of the command, whole.
202
+ * @returns The label as it is shown.
203
+ */
204
+ protected static label(label: string): string;
205
+ /**
206
+ * How a command ended, in the few words a marker line carries: why there is no result at all, or the
207
+ * status or the signal of the process when there is one.
208
+ * @param result - The result of the command.
209
+ * @returns The way the command ended.
210
+ */
211
+ protected static reason(result: Task.commandResult): string;
212
+ /**
213
+ * The result line of a command that ended as it was asked to, which says so about the command and not
214
+ * about the step it belongs to.
215
+ * @param who - The visible identity of the command.
216
+ * @returns The result line of the command.
217
+ */
218
+ protected static completed(who: string): string;
219
+ /**
220
+ * The result line of a command that failed, told apart from one that never had a result to report.
221
+ * @param who - The visible identity of the command.
222
+ * @param result - The result of the command.
223
+ * @returns The result line of the command.
224
+ */
225
+ protected static verdict(who: string, result: Task.commandResult): string;
226
+ /**
227
+ * The single line a silent run shows about a command that failed: the marker, who the command was, what
228
+ * it was and how it ended, with nothing of what it printed.
229
+ * @param who - The visible identity of the command.
230
+ * @param result - The result of the command.
231
+ * @returns The line about the command.
232
+ */
233
+ protected static terse(who: string, result: Task.commandResult): string;
234
+ }
235
+ export declare namespace OutputPolicy {
236
+ type Verbosity = 'default' | 'verbose' | 'silent';
237
+ type Decoration = 'on' | 'off';
238
+ type Channel = 'stdout' | 'stderr';
239
+ type Level = 'info' | 'error';
240
+ /** Who the commands of a task are reported as: the step they run in, when they run inside a pipeline. */
241
+ interface Identity {
242
+ /** The position of the step of the pipeline, starting at 1, or `null` outside a pipeline. */
243
+ step: number | null;
244
+ }
245
+ /** What a run asked for: the logger its evidence is kept in, and the mode it asked to be run in. */
246
+ interface Info {
247
+ /**
248
+ * The logger the evidence of the run is kept in: the channels of the policy attach to its file
249
+ * transport, so where the evidence lands is decided here and kept by the run that was asked for it.
250
+ */
251
+ logger: Logger;
252
+ /** The name the channels of the policy are reported with. */
253
+ name: string;
254
+ /** Whether the output of the commands is shown as it comes. */
255
+ verbose: boolean;
256
+ /** Whether the run said as little as it can without hiding that something failed. */
257
+ silent: boolean;
258
+ /** Whether the output is drawn inside boxes, with timestamps, levels and names. */
259
+ decorate: boolean;
260
+ }
261
+ }
262
+ export default OutputPolicy;
@@ -0,0 +1,364 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Decides how the output of the commands a run executes is presented: how much of it reaches
4
+ * the screen, which command every line belongs to, and what is kept as evidence.
5
+ * @license Apache-2.0
6
+ */
7
+ import Logger from "@netfeez/vterm";
8
+ export class OutputPolicy {
9
+ /** The width a label is read at before it is closed with an ellipsis. */
10
+ static LABEL_LENGTH = 40;
11
+ report;
12
+ /** The channel the failures of a silent run are reported through, free of the boxes of the run. */
13
+ direct;
14
+ evidence;
15
+ vVerbosity;
16
+ vDecoration;
17
+ /** The command the stream being shown belongs to, so a new one is announced once and not once per line. */
18
+ vAnnounced = null;
19
+ /**
20
+ * Builds the policy of a run out of the logger its evidence is kept in and the mode it asked to be
21
+ * run in.
22
+ * @param info - The logger the evidence of the run is kept in, and the mode the run asked to be run in.
23
+ *
24
+ * @remarks The policy is the single owner of the mode, so it settles the channel the lifecycle of the
25
+ * run is reported through: a run that is not silent reports its lifecycle through the boxed report,
26
+ * and a silent run silences that channel and says the failures through the direct one, which is what
27
+ * makes the silence a mode instead of a decision each of the emitters of that lifecycle would have to
28
+ * know about.
29
+ *
30
+ * @remarks The three channels are compositions of their own, and they all attach to the file transport
31
+ * of the logger they are built on, so a run writes one evidence file however many of them end up
32
+ * saving: the evidence of a command and the report of the run belong to the same account of the same
33
+ * run.
34
+ */
35
+ constructor(info) {
36
+ this.vVerbosity = OutputPolicy.verbosity(info);
37
+ this.vDecoration = info.decorate ? 'on' : 'off';
38
+ this.report = new Logger({
39
+ name: info.name,
40
+ show: this.vVerbosity !== 'silent',
41
+ renderer: OutputPolicy.compose(this.vDecoration)
42
+ });
43
+ this.direct = new Logger({
44
+ name: info.name,
45
+ show: true,
46
+ renderer: OutputPolicy.compose(this.vDecoration)
47
+ });
48
+ this.evidence = new Logger({
49
+ name: info.name,
50
+ show: false,
51
+ renderer: OutputPolicy.plain()
52
+ });
53
+ info.logger.file?.attach(this.report.engine);
54
+ info.logger.file?.attach(this.direct.engine);
55
+ info.logger.file?.attach(this.evidence.engine);
56
+ }
57
+ /** How much of the output of the commands is shown. **/
58
+ get verbosity() { return this.vVerbosity; }
59
+ /** Whether the output is drawn inside boxes, with timestamps, levels and names. **/
60
+ get decoration() { return this.vDecoration; }
61
+ /**
62
+ * The channel the lifecycle of the run is reported through: the boxed report of the run, or the
63
+ * direct channel when the run is silent, so a silence says the failures and nothing of the boxes.
64
+ * @returns The channel to write the lifecycle to.
65
+ */
66
+ shown() {
67
+ return this.vVerbosity === 'silent' ? this.direct : this.report;
68
+ }
69
+ /**
70
+ * Reports a line a command that is still running just wrote.
71
+ * @param identity - The step the commands of the task run in.
72
+ * @param line - The line the command wrote.
73
+ * @param ordinal - The position of the command inside its task, starting at 1.
74
+ * @param channel - The stream the line came from.
75
+ * @returns void
76
+ *
77
+ * @remarks Only a verbose run shows the stream of a command as it comes; the other two modes report
78
+ * the commands once they are done, read from the verdict of the task rather than from this stream,
79
+ * which is a projection of the output and not a transcript of it. Each line of the stream is trimmed
80
+ * of the whitespace around it, the inheritance of a projection that reads a line instead of
81
+ * reproducing the buffer it was written in.
82
+ */
83
+ live(identity, line, ordinal, channel) {
84
+ if (this.vVerbosity !== 'verbose')
85
+ return;
86
+ this.announce(identity, ordinal);
87
+ if (channel === 'stdout')
88
+ this.shown().info(line.trim());
89
+ else
90
+ this.shown().error(line.trim());
91
+ }
92
+ /**
93
+ * Reports the commands of a task that is done: one result line per command and the failure of the ones
94
+ * that failed.
95
+ * @param identity - The step the commands of the task ran in.
96
+ * @param data - The summary of the run of the task.
97
+ * @returns void
98
+ *
99
+ * @remarks This is the only moment the output of the commands is consumed. The complete buffer of
100
+ * every command reaches the evidence file before its result is rendered, and neither the report of a
101
+ * build nor the summary of a task carries it past this point, so a command that is not reported here
102
+ * is a command whose output is nowhere.
103
+ */
104
+ settleTask(identity, data) {
105
+ data.results.forEach(result => this.settle(identity, result));
106
+ this.vAnnounced = null;
107
+ }
108
+ /**
109
+ * Reports a task that stopped, marking the step it belongs to as failed.
110
+ * @param identity - The step the task ran in, when it ran inside a pipeline.
111
+ * @param failure - The failure the task rejected with.
112
+ * @returns void
113
+ *
114
+ * @remarks What is marked here is the step and not its commands: every command of the task was already
115
+ * reported when the task settled, and the summary of the failure belongs to whoever catches it, which
116
+ * is the only place that can decide what the exit status of the process is going to be.
117
+ */
118
+ stepFailed(identity, failure) {
119
+ const where = identity.step === null ? 'step' : `S${identity.step} · step`;
120
+ const marker = failure.reason === 'command' ? '&C1✘' : '&C3⊘';
121
+ this.shown().error(`${marker} ${where} failed`);
122
+ }
123
+ /**
124
+ * Reports a pipeline that is done, marking the steps that tolerated the failures they had.
125
+ * @param report - The report of the run of the pipeline.
126
+ * @returns void
127
+ *
128
+ * @remarks A tolerated failure is a fact about a step and not about a command, and it is said here
129
+ * because the report is where a step accounts for it. A command that failed under `allowFails` is
130
+ * never marked as completed, and a step that let it through is never reported as a success either:
131
+ * the two facts are both true and neither of them is told by the other.
132
+ *
133
+ * @remarks The verdict of the pipeline itself is not reported here. It belongs to whoever catches the
134
+ * failure of the run, so that a mode can never turn a failing build into a successful one.
135
+ */
136
+ settleBuild(report) {
137
+ report.steps.forEach((step) => {
138
+ if (!step.tolerated)
139
+ return;
140
+ this.shown().warn(`&C3⚠ S${step.index} tolerated ${step.failed} ${step.failed === 1 ? 'failure' : 'failures'}`);
141
+ });
142
+ }
143
+ /**
144
+ * Reports one command of a task that is done: what it captured, what it ended as, and what it printed.
145
+ * @param identity - The step the command ran in.
146
+ * @param result - The result of the command.
147
+ * @returns void
148
+ *
149
+ * @remarks A failure is never left with its marker alone in a mode that shows something: the
150
+ * diagnostic is what says what went wrong, and it is said once, as a line of its own, whether the
151
+ * command ended with a status or never had one to report.
152
+ *
153
+ * @remarks The complete buffer is the only thing a verbose run does not repeat, because that run has
154
+ * already shown it as it came. What the two modes share is the diagnostic, and what separates them
155
+ * is the buffer: neither of them shows it twice.
156
+ */
157
+ settle(identity, result) {
158
+ this.evident(identity, result);
159
+ const who = OutputPolicy.identity(identity, result.ordinal);
160
+ const out = this.shown();
161
+ if (this.vVerbosity === 'silent') {
162
+ if (!result.success)
163
+ out.error(OutputPolicy.terse(who, result));
164
+ return;
165
+ }
166
+ if (result.success) {
167
+ out.info(OutputPolicy.completed(who));
168
+ return;
169
+ }
170
+ out.error(OutputPolicy.verdict(who, result));
171
+ if (result.reason !== null || this.vVerbosity === 'verbose') {
172
+ out.error(result.diagnostic);
173
+ return;
174
+ }
175
+ this.block(result, out);
176
+ }
177
+ /**
178
+ * Renders the failure of a command: what it was, how it ended, and everything it printed.
179
+ * @param result - The result of the command, which has a status of its own to report.
180
+ * @returns void
181
+ *
182
+ * @remarks The buffer of a command that never had a status is not rendered here: its capture is
183
+ * incomplete by definition, because the process it was capturing never ended, and presenting an
184
+ * incomplete capture as the evidence of a failure is a claim the data does not carry.
185
+ *
186
+ * @remarks The diagnostic is enough on its own for that case, because it already carries the label:
187
+ * the thinned label is not repeated above a line that says the same thing in full.
188
+ */
189
+ block(result, out = this.shown()) {
190
+ out.error(OutputPolicy.label(result.label));
191
+ out.error(result.diagnostic);
192
+ this.captured(out, 'error', 'stdout', result.stdout, false);
193
+ this.captured(out, 'error', 'stderr', result.stderr, false);
194
+ }
195
+ /**
196
+ * Writes everything a command captured into the evidence file, whether it is shown or not.
197
+ * @param identity - The step the command ran in.
198
+ * @param result - The result of the command.
199
+ * @returns void
200
+ *
201
+ * @remarks The evidence carries the complete buffer of every command in every mode, tagged with the
202
+ * identity of the command and labelled by channel, and a buffer of a process that never ended says so
203
+ * because an incomplete capture presented as a whole one is a lie about what the command said.
204
+ */
205
+ evident(identity, result) {
206
+ const incomplete = result.reason !== null;
207
+ this.evidence.info(`[${OutputPolicy.identity(identity, result.ordinal)}] ${result.label}`);
208
+ if (result.diagnostic !== '')
209
+ this.evidence.info(result.diagnostic);
210
+ this.captured(this.evidence, 'info', 'stdout', result.stdout, incomplete);
211
+ this.captured(this.evidence, 'info', 'stderr', result.stderr, incomplete);
212
+ }
213
+ /**
214
+ * Writes one captured channel of a command into a channel of the policy, labelled and line by line.
215
+ * @param logger - The channel the capture is written to.
216
+ * @param level - The level the capture is written at.
217
+ * @param channel - The stream the capture came from.
218
+ * @param content - Everything the stream accumulated.
219
+ * @param incomplete - Whether the capture stopped because the process never ended.
220
+ * @returns void
221
+ *
222
+ * @remarks An empty channel is not labelled: a label over nothing is noise, and a reader who sees no
223
+ * label knows there was nothing there. Each line is a call of its own, so the wrapping of a line
224
+ * longer than the render width applies to it alone and never to the whole capture.
225
+ */
226
+ captured(logger, level, channel, content, incomplete) {
227
+ if (content === '')
228
+ return;
229
+ logger[level](`${channel}:${incomplete ? ' (incomplete)' : ''}`);
230
+ content.split(/\r?\n/).forEach(line => logger[level](line));
231
+ }
232
+ /**
233
+ * Announces the command the stream now belongs to, once per command and not once per line.
234
+ * @param identity - The step the command runs in.
235
+ * @param ordinal - The position of the command inside its task, starting at 1.
236
+ * @returns void
237
+ */
238
+ announce(identity, ordinal) {
239
+ const who = OutputPolicy.identity(identity, ordinal);
240
+ if (this.vAnnounced === who)
241
+ return;
242
+ this.vAnnounced = who;
243
+ this.shown().info(`&C7[${who}]`);
244
+ }
245
+ /**
246
+ * The mode a run asked for out of the two flags that can conflict, where a silence wins over an addition.
247
+ * @param info - What the run asked for.
248
+ * @returns The mode of the run.
249
+ *
250
+ * @remarks The precedence lives here and not in the parser on purpose: a combination of flags is a
251
+ * thing a user types, not a thing a parser has an opinion about, and a mode that a parser rejected
252
+ * would leave a user with no way to say what they meant.
253
+ */
254
+ static verbosity(info) {
255
+ if (info.silent)
256
+ return 'silent';
257
+ if (info.verbose)
258
+ return 'verbose';
259
+ return 'default';
260
+ }
261
+ /**
262
+ * The renderer of the channels that are shown: a decorated line paints its head and its rails inside
263
+ * the width of the line, and an undecorated one wraps its content in the whole width.
264
+ * @param decoration - Whether the run decorates its output.
265
+ * @returns The renderer of the shown channels.
266
+ *
267
+ * @remarks The renderer asks the width of the terminal of the run through the columns callback the
268
+ * logger was built with, so a line never reaches further than the terminal that reads it, and the
269
+ * decoration lives inside that width instead of widening the line. That is why a decorated line wraps
270
+ * its content earlier than an undecorated one does, and why turning the decoration off changes what is
271
+ * drawn around the content and never reaches wider than the same terminal either.
272
+ */
273
+ static compose(decoration) {
274
+ if (decoration === 'on')
275
+ return {};
276
+ return OutputPolicy.plain();
277
+ }
278
+ /**
279
+ * The renderer of a channel that carries content and nothing else: no timestamp, level nor name, and
280
+ * no separator either, which is what keeps a transcript greppable and free of the group it was written in.
281
+ * @returns The renderer of a plain channel.
282
+ */
283
+ static plain() {
284
+ return {
285
+ timestamp: false,
286
+ level: false,
287
+ name: false,
288
+ messageFormat: '{line}'
289
+ };
290
+ }
291
+ /**
292
+ * The visible identity of a command: the position it holds inside its own task, qualified by the
293
+ * position of the step it runs in only when the pipeline has more than one of them.
294
+ * @param identity - The step the command runs in.
295
+ * @param ordinal - The position of the command inside its task, starting at 1.
296
+ * @returns The identity of the command.
297
+ */
298
+ static identity(identity, ordinal) {
299
+ return identity.step === null ? `C${ordinal}` : `S${identity.step} · C${ordinal}`;
300
+ }
301
+ /**
302
+ * The label of a command thinned to what identifies it: the executable of a program or the first word
303
+ * of a script, cut to the width a line can carry and closed with an ellipsis when it does not fit.
304
+ * @param label - The human readable form of the command, whole.
305
+ * @returns The label as it is shown.
306
+ */
307
+ static label(label) {
308
+ const head = label.trim().split(/\s+/)[0];
309
+ return head.length <= OutputPolicy.LABEL_LENGTH ? head : `${head.slice(0, OutputPolicy.LABEL_LENGTH - 1)}…`;
310
+ }
311
+ /**
312
+ * How a command ended, in the few words a marker line carries: why there is no result at all, or the
313
+ * status or the signal of the process when there is one.
314
+ * @param result - The result of the command.
315
+ * @returns The way the command ended.
316
+ */
317
+ static reason(result) {
318
+ if (result.reason === 'timeout')
319
+ return 'timed out';
320
+ if (result.reason === 'stopped')
321
+ return 'stopped';
322
+ if (result.reason === 'shell')
323
+ return 'shell exited';
324
+ if (result.reason === 'spawn')
325
+ return 'could not be started';
326
+ if (result.reason === 'protocol')
327
+ return 'no status reported';
328
+ if (result.signal !== null)
329
+ return `signal ${result.signal}`;
330
+ return `exit ${result.code}`;
331
+ }
332
+ /**
333
+ * The result line of a command that ended as it was asked to, which says so about the command and not
334
+ * about the step it belongs to.
335
+ * @param who - The visible identity of the command.
336
+ * @returns The result line of the command.
337
+ */
338
+ static completed(who) { return `&C2✔ ${who} completed`; }
339
+ /**
340
+ * The result line of a command that failed, told apart from one that never had a result to report.
341
+ * @param who - The visible identity of the command.
342
+ * @param result - The result of the command.
343
+ * @returns The result line of the command.
344
+ */
345
+ static verdict(who, result) {
346
+ if (result.reason !== null)
347
+ return `&C3⊘ ${who} ${OutputPolicy.reason(result)}`;
348
+ return `&C1✘ ${who} failed`;
349
+ }
350
+ /**
351
+ * The single line a silent run shows about a command that failed: the marker, who the command was, what
352
+ * it was and how it ended, with nothing of what it printed.
353
+ * @param who - The visible identity of the command.
354
+ * @param result - The result of the command.
355
+ * @returns The line about the command.
356
+ */
357
+ static terse(who, result) {
358
+ if (result.reason !== null)
359
+ return `&C3⊘ ${who} ${OutputPolicy.reason(result)} ${OutputPolicy.label(result.label)}`;
360
+ return `&C1✘ ${who} failed ${OutputPolicy.label(result.label)} · ${OutputPolicy.reason(result)}`;
361
+ }
362
+ }
363
+ export default OutputPolicy;
364
+ //# sourceMappingURL=OutputPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OutputPolicy.js","sourceRoot":"","sources":["../../src/task/OutputPolicy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,MAAyB,MAAM,gBAAgB,CAAC;AAKvD,MAAM,OAAO,YAAY;IACrB,yEAAyE;IAClE,MAAM,CAAU,YAAY,GAAW,EAAE,CAAC;IAEjC,MAAM,CAAS;IAE/B,mGAAmG;IAChF,MAAM,CAAS;IACf,QAAQ,CAAS;IAEjB,UAAU,CAAyB;IACnC,WAAW,CAA0B;IAExD,2GAA2G;IACjG,UAAU,GAAkB,IAAI,CAAC;IAE3C;;;;;;;;;;;;;;;OAeG;IACH,YAAmB,IAAuB;QACtC,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,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