feat: add dependency updater command#222
Open
Morgy93 wants to merge 6 commits into
Open
Conversation
d82fac4 to
99edb00
Compare
Contributor
There was a problem hiding this comment.
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:updateCLI command with dry-run and--latest(force/pin) update modes. - Introduced
DependencyUpdaterservice to locate theme-ownedpackage.jsonlocations and orchestrate safe vs latest updates. - Extended
NodePackageManagerwith 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. |
Member
|
@Morgy93 is lumaand magento base supported ?package.json in magento root btw. Skipped if no luma is in use 🤔 |
Collaborator
Author
Yes, since luma has no own dependencies, there is a fallback to the root package.json. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:updatecommand, comprehensive documentation for its usage and behavior, and integration into the compatibility workflow.New CLI Command for Dependency Updates:
mageforge:dependencies:updatecommand (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.DependencyUpdateResultenum to standardize the result of dependency update operations (src/Service/DependencyUpdateResult.php).Documentation Updates:
docs/commands_reference.mdto 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:
.github/workflows/magento-compatibility.ymlto test the new command and its alias, ensuring coverage in CI. [1] [2]