Skip to content

feat(cli): stream build command output with verbose() - #19

Merged
codad5 merged 1 commit into
mainfrom
feat/build-verbose
Oct 12, 2026
Merged

codad5 merged 1 commit into
mainfrom
feat/build-verbose

Conversation

@codad5

@codad5 codad5 commented Oct 12, 2026

Copy link
Copy Markdown
Owner

What

The packager can print a command's output while it runs.

Build::plugin(__DIR__)
    ->verbose()                       // every command: run(), composer(), scope(), make-pot
    ->run('npm ci', 'npm run build')
    ->zip();

Build::plugin(__DIR__)
    ->run('npm ci')                   // quiet
    ->runVerbose('npm run build')     // streamed
    ->zip();

Also wptoolkit-build package --verbose and "verbose": true in wptoolkit.json.

Why

Output was captured and shown only when a command failed, so a slow asset build looked hung and CI logs said nothing about what ran.

Behaviour

  • Default is unchanged: quiet.
  • Streamed line by line through the build's output channel, indented under the command ( | line). stderr is included.
  • Output is still captured and returned.
  • A failing command that was streamed repeats only its last 20 lines in the error (the rest was already printed); a quiet one still shows everything.
  • New StreamingCommandRunner interface extends CommandRunner, so existing runner implementations keep working; with one of those, verbose output is printed when the command ends.
  • A build-wide switch rather than an argument on run(), because run() is variadic and composer()/scope() run long commands too.

Tests

Written first, six of eight seen failing. They run real child processes: default quiet, verbose (stdout and stderr, ordering), runVerbose for one command, line-by-line callback, failure tail when streamed, full output when quiet, non-streaming runner fallback, config file. Liveness checked by hand: a line arrives two seconds before the next one the command prints.

🤖 Generated with Claude Code

Command output was captured and shown only on failure, so a slow asset
build looked hung. Build::verbose(), runVerbose(), --verbose and
"verbose": true print it line by line as it runs. A failure after
streaming repeats only the last 20 lines. StreamingCommandRunner extends
CommandRunner, so existing runners keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codad5
codad5 merged commit a64259e into main Oct 12, 2026
19 checks passed
@codad5
codad5 deleted the feat/build-verbose branch October 12, 2026 08:34
@codad5 codad5 mentioned this pull request Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant