| 507 | } |
| 508 | |
| 509 | export function createCliTextRenderer(options: CliTextRendererOptions): TranscriptRenderer { |
| 510 | const reporter = createCliProgressReporter(); |
| 511 | |
| 512 | return createCliTextProcessor({ |
| 513 | interactive: options.interactive, |
| 514 | suppressWarnings: options.suppressWarnings ?? false, |
| 515 | showTestTiming: options.showTestTiming ?? false, |
| 516 | filePathRenderStyle: options.filePathRenderStyle ?? 'list', |
| 517 | includeHeaderDetails: options.includeHeaderDetails ?? true, |
| 518 | includeNextSteps: options.includeNextSteps ?? true, |
| 519 | sink: { |
| 520 | clearTransient(): void { |
| 521 | reporter.clear(); |
| 522 | }, |
| 523 | updateTransient(message: string): void { |
| 524 | reporter.update(message); |
| 525 | }, |
| 526 | writeDurable(text: string): void { |
| 527 | process.stdout.write(`${formatCliTextBlock(text)}\n`); |
| 528 | }, |
| 529 | writeSection(text: string): void { |
| 530 | process.stdout.write(`\n${formatCliTextBlock(text)}\n`); |
| 531 | }, |
| 532 | }, |
| 533 | }); |
| 534 | } |
| 535 | |
| 536 | export function renderCliTextTranscript(input: CliTextTranscriptInput = {}): string { |
| 537 | let output = ''; |