bap72190 / composer-importer
Import/update composer file with contrib modules from an outdated site.
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: >=5.6
- composer-plugin-api: ^2.0
- composer/semver: ^3
- symfony/finder: ^3.4
- symfony/yaml: ^3.4
- webflo/drupal-finder: ^1.1
- webmozart/path-util: ^2.3
Requires (Dev)
- alchemy/zippy: ^0.4.8
- composer/composer: ^2.0
- phpunit/phpunit: ^5.7
- satooshi/php-coveralls: ^2.0
- squizlabs/php_codesniffer: ^3.2
README
Composer Importer is a Composer plugin that can import all contrib modules from an existing Drupal site already using composer into the composer file. This is useful when the composer file doesn't get used properly and modules end up being installed outside composer.
This project was created based on the work by grasmash/composerize-drupal
Installation
composer global require bap72190/composer-importer
Usage:
cd path/to/drupal/project/repo
composer ci --composer-root=[repo-root] --drupal-root=[drupal-root]
The [composer-root]
should be the root directory of your project, where existing composer.json file is located.
The [drupal-root]
should be the Drupal root, where index.php
is located.
Options
--composer-root
: Specifies the root directory of your project wherecomposer.json
will be generated. This should be the root of your Git repository, where.git
is located.--drupal-root
: Specifies the Drupal root directory whereindex.php
is located.--no-update
: Preventscomposer update
from being automatically run aftercomposer.json
is generated.--exact-versions
: Will cause Drupal core and contributed projects (modules, themes, profiles) to be be required with exact verions constraints incomposer.json
, rather than using the default caret operator. E.g., adrupal/core
would be required as8.4.4
rather than^8.4.4
. This prevents projects from being updated. It is not recommended as a long-term solution, but may help you convert to using Composer more easily by reducing the size of the change to your project.