szeidler / composer-drupal-unused
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: ^8.1
- composer-plugin-api: ^2.0
- symfony/yaml: ^6.0 || ^7.0
Requires (Dev)
- composer/composer: ^2.0
- phpunit/phpunit: ^10.0 || ^11.5
- squizlabs/php_codesniffer: ^3.11
This package is auto-updated.
Last update: 2025-02-16 19:44:05 UTC
README
The Composer Drupal Unused package returns a list of Drupal Composer Packages that are not installed in your Drupal installation.
This plugin does not require a fully installed and boostrapped Drupal installation. It just parses the composer.json
and typical configuration files in Drupal.
Requirements
- PHP 8.1 or greater
- Composer
Installation
Add Composer Drupal Unused as a composer dependency.
composer require szeidler/composer-drupal-unused:^1.0
or global
composer global require szeidler/composer-drupal-unused:^1.0
Usage
List unused Drupal packages
composer unused-drupal-packages
The command accepts the following options.
--config-dir
Define the path to your config directory. Defaults toconfig/sync
.--remove
Removes the identified unused packages from composer.lock and composer.json.
The command will list up Drupal packages that are declared as root level dependencies your composer.json, but not enabled in Drupal.
It will look up the core.extension.yml
from the given Drupal Configuration Management directory. In addition it
will look up config_split
config files to see if a module is conditionally enabled.
Remove option
You should be careful using the plugin using the --remove
function. Always review the changes. There might be edge
cases where the Composer package name does not match the Drupal module machine name. The script would identify the
package as unused and therefore delete it.
Credits
Stephan Zeidler for Ramsalt Lab AS
License
The MIT License (MIT)