Skip to content

feat: add npm-check command to check outdated packages and vulnerabil…#184

Draft
dermatz wants to merge 3 commits into
mainfrom
feat/npm-check-command
Draft

feat: add npm-check command to check outdated packages and vulnerabil…#184
dermatz wants to merge 3 commits into
mainfrom
feat/npm-check-command

Conversation

@dermatz
Copy link
Copy Markdown
Member

@dermatz dermatz commented May 13, 2026

This pull request introduces a new CLI command for checking npm dependencies and vulnerabilities in Magento themes, along with supporting service methods and workflow integration. The main focus is to provide developers with a convenient way to identify and address outdated npm packages and security issues for theme development.

Key changes include:

New Command: Theme npm-check

  • Added a new command mageforge:theme:npm-check (with aliases m:t:nc and frontend:npm-check) that checks npm dependencies for outdated packages and vulnerabilities in Magento themes. This command supports interactive theme selection, displays results in tables, and offers to run npm update --latest and npm audit fix interactively. (src/Console/Command/Theme/NpmCheckCommand.php)
  • Registered the new command in the Magento dependency injection configuration. (src/etc/di.xml)

Node Package Manager Service Enhancements

  • Added methods to NodePackageManager for:
    • Retrieving outdated npm packages as an array (getOutdatedPackages)
    • Running npm update --latest (runNpmUpdate)
    • Retrieving npm audit vulnerability counts (getAuditResults)
    • Running npm audit fix (runAuditFix)
      These methods are used by the new command for programmatic npm checks and fixes. (src/Service/NodePackageManager.php)

CI Workflow Updates

  • Updated the GitHub Actions workflow to test the new command and its aliases, ensuring the CLI help for mageforge:theme:npm-check, m:t:nc, and frontend:npm-check is available and correct. (.github/workflows/magento-compatibility.yml) [1] [2]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant