Skip to content

feat: add dependency updater command#222

Open
Morgy93 wants to merge 6 commits into
mainfrom
add-dependency-updater
Open

feat: add dependency updater command#222
Morgy93 wants to merge 6 commits into
mainfrom
add-dependency-updater

Conversation

@Morgy93

@Morgy93 Morgy93 commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Fixes #204

This pull request introduces a new CLI command for updating Node.js dependencies of Magento themes and improves documentation and workflow coverage for this feature. The main changes include the implementation of the mageforge:dependencies:update command, comprehensive documentation for its usage and behavior, and integration into the compatibility workflow.

New CLI Command for Dependency Updates:

  • Added mageforge:dependencies:update command (src/Console/Command/Dependencies/UpdateCommand.php) to update Node.js dependencies for one or more themes, supporting interactive and non-interactive usage, wildcards, dry-run, and updating to latest versions.
  • Introduced DependencyUpdateResult enum to standardize the result of dependency update operations (src/Service/DependencyUpdateResult.php).

Documentation Updates:

  • Updated docs/commands_reference.md to add the new command to the overview table, provide a detailed reference section, and include it in the quick list of commands. [1] [2] [3]

Workflow Enhancements:

  • Extended .github/workflows/magento-compatibility.yml to test the new command and its alias, ensuring coverage in CI. [1] [2]
  • Annotated GitHub Actions steps with version comments for clarity and maintainability.

Copilot AI review requested due to automatic review settings July 5, 2026 19:58
@github-actions github-actions Bot added documentation Improvements or additions to documentation Feature Command Config labels Jul 5, 2026
@Morgy93 Morgy93 force-pushed the add-dependency-updater branch from d82fac4 to 99edb00 Compare July 5, 2026 20:00

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.

Pull request overview

This PR adds a new MageForge CLI workflow to update theme-owned Node.js dependencies (including Hyvä/Tailwind theme layouts), backed by a new DependencyUpdater service and enhancements to NodePackageManager, plus command reference documentation updates.

Changes:

  • Added mageforge:dependencies:update CLI command with dry-run and --latest (force/pin) update modes.
  • Introduced DependencyUpdater service to locate theme-owned package.json locations and orchestrate safe vs latest updates.
  • Extended NodePackageManager with outdated parsing and dependency-type-aware install flags; added/updated unit tests and docs.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Unit/Service/NodePackageManagerTest.php Adds coverage for parsing npm outdated JSON output and new update/install helper methods.
tests/Unit/Service/DependencyUpdaterTest.php Adds unit tests for the new updater service across dry-run/latest/vendor/no-package scenarios.
tests/Unit/Console/Command/Dependencies/UpdateCommandTest.php Adds unit tests for the new CLI command’s argument/option handling and summary output.
src/Service/NodePackageManager.php Adds normalized npm outdated parsing plus npm update and dependency-type-aware installs.
src/Service/DependencyUpdater.php New service coordinating dependency updates across theme package directories with safety checks.
src/etc/di.xml Registers the new CLI command with Magento’s command list.
src/Console/Command/Dependencies/UpdateCommand.php Implements the new mageforge:dependencies:update command, including interactive selection and summaries.
docs/commands_reference.md Documents the new command, options, behavior, and adds it to command listings.

Comment thread tests/Unit/Service/DependencyUpdaterTest.php
Comment thread src/etc/di.xml
Comment thread src/Service/DependencyUpdater.php
Copilot AI review requested due to automatic review settings July 5, 2026 20:02

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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread tests/Unit/Service/DependencyUpdaterTest.php
Comment thread src/Service/DependencyUpdater.php
@dermatz

dermatz commented Jul 6, 2026

Copy link
Copy Markdown
Member

@Morgy93 is lumaand magento base supported ?package.json in magento root btw. Skipped if no luma is in use 🤔

@github-actions github-actions Bot added the CI/CD label Jul 6, 2026
Copilot AI review requested due to automatic review settings July 6, 2026 20:30

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread src/Service/DependencyUpdater.php
@Morgy93

Morgy93 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

@Morgy93 is lumaand magento base supported ?package.json in magento root btw. Skipped if no luma is in use 🤔

Yes, since luma has no own dependencies, there is a fallback to the root package.json.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature-Request: dependencies updater

3 participants