Skip to content

refactor(@angular/cli): separate the version command's analysis logic from logging #30813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clydin
Copy link
Member

@clydin clydin commented Jul 31, 2025

Refactors the version command's output generation for better readability and maintainability. This also allows other parts of the CLI to gather the version info programmatically, if needed.

The key changes include:

  • Extracting the output formatting logic from the run method into a new private formatVersionInfo function.
  • Introducing a VersionInfo interface to provide a clear data structure for the version details.
  • Moving the ASCII art logo to a module-level constant to separate presentation from logic.
  • Relocating the gatherVersionInfo function, VersionInfo interface, and related constants to a new version-info.ts file to better organize the code.

… from logging

Refactors the `version` command's output generation for better readability and maintainability.
This also allows other parts of the CLI to gather the version info programmatically, if needed.

The key changes include:
- Extracting the output formatting logic from the `run` method into a new private `formatVersionInfo` function.
- Introducing a `VersionInfo` interface to provide a clear data structure for the version details.
- Moving the ASCII art logo to a module-level constant to separate presentation from logic.
- Relocating the `gatherVersionInfo` function, `VersionInfo` interface, and related constants to a new `version-info.ts` file to better organize the code.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Jul 31, 2025
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/cli target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant