Skip to content

refactor(cli): hierarchical indentation for styled CLI output#4786

Open
alexander-akait wants to merge 2 commits into
mainfrom
fix/renderer-hierarchical-indent
Open

refactor(cli): hierarchical indentation for styled CLI output#4786
alexander-akait wants to merge 2 commits into
mainfrom
fix/renderer-hierarchical-indent

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Jun 22, 2026

Copy link
Copy Markdown
Member

What this does

The styled help/info/version/configtest output introduced in #4779 prefixes a two-space gutter to every line. This makes the left margin uniform rather than meaningful.

This change makes the indentation hierarchical:

  • Column 0: branded headers (⬡ webpack …), dividers, command descriptions, the Usage: line, section titles (Options, Global options, …), status messages (///), and the footer.
  • Indented (two spaces): only content nested inside a section — envinfo rows, option/command lists, and the option-help rows.

So the indent now encodes hierarchy, and output that never went through the renderer (e.g. webpack / dev-server validation errors) keeps its own formatting untouched.

Before / after (info)

  ⬡ webpack info                 →   ⬡ webpack info
  ──────────────                     ──────────────
  System and environment …           System and environment …

  ⬡ System:                          ⬡ System:
  ──────────────                     ──────────────
  OS:   Linux …                        OS:   Linux …

Scope

  • Single source change: ~11 lines in webpack-cli.ts (the shared #ui* chrome helpers + the command-help description/usage lines).
  • Snapshots regenerated for the framed screens (help / info / version / configtest / CLI API).

Testing

  • Build ✅, lint ✅
  • build + serve + watch (473) pass with 0 snapshot changes — the change is contained to the framed screens; webpack/dev-server error output is unaffected.
  • help / info / version / configtest / CLI API suites pass with regenerated snapshots.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TgNXy9shNnZEnbCfsSbtiQ

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5650a43

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 22, 2026

Copy link
Copy Markdown

CLA Not Signed

One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via:

Co-authored-by: name <email>

Supported Co-authored-by: formats include:

  1. Anything <id+login@users.noreply.github.com> - it will locate your GitHub user by id part.
  2. Anything <login@users.noreply.github.com> - it will locate your GitHub user by login part.
  3. Anything <public-email> - it will locate your GitHub user by public-email part. Note that this email must be made public on Github.
  4. Anything <other-email> - it will locate your GitHub user by other-email part but only if that email was used before for any other CLA as a main commit author.
  5. login <any-valid-email> - it will locate your GitHub user by login part, note that login part must be at least 3 characters long.

Alternatively, if the co-author should not be included, remove the Co-authored-by: line from the commit message.

Please update your commit message(s) by doing git commit --amend and then git push [--force] and then request re-running CLA check via commenting on this pull request:

/easycla

The styled help/info/version/configtest output prefixed a two-space
gutter to every line. Move top-level lines (branded headers, dividers,
command descriptions, the Usage line, status messages and the footer) to
column 0, and keep the two-space indent only for content nested inside a
section (envinfo rows, option/command lists, option-help rows).

Indentation now encodes hierarchy instead of being a uniform left margin,
and output that never went through the renderer (webpack/dev-server
errors) is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgNXy9shNnZEnbCfsSbtiQ
@alexander-akait alexander-akait force-pushed the fix/renderer-hierarchical-indent branch from 4490aec to 15afe1c Compare June 22, 2026 15:56
@alexander-akait alexander-akait changed the title refactor(cli): hierarchical renderer indentation + inline renderer as methods refactor(cli): hierarchical indentation for styled CLI output Jun 22, 2026
@alexander-akait alexander-akait marked this pull request as ready for review June 22, 2026 15:56
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.43%. Comparing base (772330c) to head (5650a43).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4786   +/-   ##
=======================================
  Coverage   93.43%   93.43%           
=======================================
  Files          14       14           
  Lines        5419     5419           
  Branches      788      788           
=======================================
  Hits         5063     5063           
  Misses        354      354           
  Partials        2        2           
Files with missing lines Coverage Δ
packages/webpack-cli/src/webpack-cli.ts 96.95% <100.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 772330c...5650a43. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgNXy9shNnZEnbCfsSbtiQ
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.

2 participants