Skip to content

A small CLI tool to check missing dependency declarations in the composer.json and module.xml

Notifications You must be signed in to change notification settings

run-as-root/Magento-2-Dependency-Checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Integrity checker

Package allows to run static analysis on Magento 2 Module Packages to provide an integrity check of package.

Supported tools:

  • Composer.json package dependencies checker - check *.xml, *.js, *.php and *.phtml on a subject if other packages used inside and check if corresponding module/package is declared as required in composer.json.
  • Module.xml dependencies checker - analyse if packages' etc/module.xml file contains in 'sequence' section all Magento 2 modules which classes are used in *.xml, *.js, *.php and *.phtml files of the package.
  • Package structure checker - verify if all newly added Magento 2 modules has a proper structure with all required files.

Standalone Installation

  1. Add your access token to auth.json (see how to create access token).
composer config --global --auth gitlab-token.gitlab.com {ACCESS_TOKEN}
  1. Install project from gitlab repository
composer create-project run_as_root/integrity-checker --repository-url="{\"type\": \"vcs\", \"url\": \"[email protected]:oleksandr.kravchuk1/integrity-checker.git\"}" -s dev integrity-checker dev-development --remove-vcs

Package Installation

  1. Add Gitlab repository to list of available repositories for your project composer.json
composer config repositories.integrity-checker '{"type": "vcs", "url": "[email protected]:oleksandr.kravchuk1/integrity-checker.git"}'
  1. Add your access token to auth.json (see how to create access token).
composer config --global --auth gitlab-token.gitlab.com {ACCESS_TOKEN}
  1. Change packages minimum stability to dev (required during development only.
composer config minimum-stability dev 
  1. Install package via composer
composer require --dev run_as_root/integrity-checker dev-development

Usage

Dependencies Checker

bin/dependencies {magento root} {folder} {folder2} {folder3}

{magento root} - path to Magento 2 project root directory. Tool require composer.lock to be defined. All packages inside {folder}'s will be recognized by composer.json file. {folder} - expected to be relative inside the magento root folder. Dependencies check will be run for composer.json and etc/module.xml together.

Module Structure Checker

bin/structure {magento root} {folder} {folder2} {folder3}

{magento root} - path to Magento 2 project root directory. Tool collects all packages in {folder} by registration.php files. For each module it compares current structure with Standard structure and print diff, if Standard structure was not followed.

Standard package structure:

docs
src
  etc
    module.xml
README.md
composer.json
registration.php

About

A small CLI tool to check missing dependency declarations in the composer.json and module.xml

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages