Installing Sandbox Modules
Composer install of Sandbox modules
If the Sandbox module has a composer.json file that include ` “type”: “drupal-module”,` you can add it as a vcs repository entry to your composer.json “repositories” array:
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "vcs",
"url": "git@git.drupal.org:sandbox/username-12345678.git"
}
],
Check the available versions with composer show (where drupal/foo is the package name defined in the Sandbox project’s composer.json):
composer show drupal/foo --all
Then use composer require drupal/foo:1.0.x-dev to install the module (replace the version string).
Sandbox modules without a composer.json
It is still possible to use Composer to install Sandbox modules that don’t have their own composer.json file, but you must add the repository to your own composer.json to be able to do this. This is an example showing how to install MegaChriz’s Feeds Dev module:
add the following to the “repositories” section of your composer.json:
"drupal/feeds_dev": {
"type": "package",
"package": {
"name": "drupal/feeds_dev",
"type": "drupal-module",
"version": "1.x-dev",
"source": {
"url": "git@git.drupal.org:sandbox/megachriz-2950698.git",
"type": "git",
"reference": "8.x-1.x"
}
}
}
and then on the command line:
composer require drupal/feeds_dev:1.x-dev
If you want to work on the module in an instance, you can add the --prefer-source switch and this will check out the repository.
composer require drupal/feeds_dev:1.x-dev --prefer-source