Skip to content

feat(theme): show Hyvä version in build summary - #301

Open
dermatz wants to merge 2 commits into
mainfrom
feature/hyva-version-in-build-summary
Open

dermatz wants to merge 2 commits into
mainfrom
feature/hyva-version-in-build-summary

Conversation

@dermatz

@dermatz dermatz commented Nov 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Appends the installed Hyvä version as compact grey secondary text in the mageforge:theme:build (frontend:build) summary when building a Hyvä theme (e.g. ✅ Vendor/theme: Built successfully using HyvaThemes builder (Hyvä 1.5.5)).
  • Detects Hyvä themes both directly (HyvaThemes builder / Hyva/*) and via their inheritance chain (e.g. child themes extending a custom Hyvä base that build via the TailwindCSS builder), while leaving non-Hyvä themes unchanged and omitting the suffix if no numeric Composer version can be resolved.
  • Includes hyva-themes/magento2-default-theme-csp in HyvaVersionDetector before falling back to hyva-themes/magento2-theme-module.

Verification

  • ddev phpunit --coverage (864 tests, 81.09% line coverage)
  • ddev infection (85% Covered Code MSI)
  • ddev phpcs, ddev phpstan, ddev mago lint, ddev mago fmt --check, ddev mago analyze
  • trunk check
  • Live DDEV check: ddev magento frontend:build Magento/luma Hyva/default

Append the installed Hyvä version as subtle secondary context in the mageforge:theme:build summary for Hyvä themes and child themes inheriting from Hyvä, and include hyva-themes/magento2-default-theme-csp in version detection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 11:02
@github-actions github-actions Bot added documentation Improvements or additions to documentation Feature Command labels Nov 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues blocking the Hyvä version summary enhancement.

No open issues 🎉

What changed in this PR

Enhances MageForge’s theme-build summary with the installed Hyvä version for direct and inherited Hyvä themes, while leaving non-Hyvä summaries unchanged.

Changes:

  • Adds a grey Hyvä version suffix when a numeric version is available.
  • Detects Hyvä through builders and theme ancestry, and checks the CSP default-theme package before the theme-module fallback.
  • Adds unit coverage and updates the command reference.
File Description
tests/​Unit/​Service/​Hyva/​HyvaVersionDetectorTest.php Tests CSP version detection and precedence over the theme module.
tests/​Unit/​Console/​Command/​Theme/​BuildCommandTest.php Tests direct and inherited Hyvä summaries, non-Hyvä output and unknown versions.
src/​Service/​Hyva/​HyvaVersionDetector.php Adds the CSP default-theme package to version lookup.
src/​Console/​Command/​Theme/​BuildCommand.php Detects Hyvä ancestry and renders version-aware build summaries.
docs/​commands_reference.md Documents the Hyvä version in build summaries.

Review effort: Balanced

Use is_string() narrowing on filter_input(INPUT_SERVER) in AbstractCommand::getServerVar() so Mago 1.61 does not treat the return type as plain string, and remove the unused int return value on BuildCommand::displayAvailableThemes().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the changes adding Hyvä versions to theme build summaries.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Command documentation Improvements or additions to documentation Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants