Closed mikkeschiren closed 8 years ago
Problem I still need to figure out how to solve is for instance when installing a contrib module that has a dependency on drupal core module in the profile, that I still not know how to solve right now.
The solution I have is to add the dependency as a replace, like:
"replace": {
"drupal/drupal": "*",
"drupal/locale": "*"
},
Or, just to not have the contrib in the profile at all - just put them in sites/all instead...
Thats because skipped the drupal core depedency by adding drupal/drupal to the replace section. You could add any other core module to the replace section as well.
Here is another workaround. Override the drupal/drupal package definition and declare it as metapackage.
{
"name": "d7-composer/d7-composer",
"description": "A demo Composer project",
"repositories": [
{
"type": "composer",
"url": "https://raw.githubusercontent.com/webflo/d7/master/packages.json"
},
{
"type": "composer",
"url": "http://drupal-packagist.webflo.io/"
},
{
"type": "package",
"package": {
"name": "jquery/jquery.ui",
"version": "1.10.4",
"type": "drupal-library",
"dist": {
"url": "http://jqueryui.com/resources/download/jquery-ui-1.10.4.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name":"drupal/imagesloaded",
"version": "master",
"type": "drupal-library",
"source": {
"url": "http://github.com/desandro/imagesloaded.git",
"type": "git",
"reference": "master"
}
}
}
],
"require": {
"drupal/drupal": "*",
"drupal/features": "7.2.2",
"drupal/wysiwyg": "7.2.2",
"drupal/ctools": "7.1.4",
"drupal/views": "7.3.8",
"drupal/i18n": "7.1.12",
"jquery/jquery.ui": "1.10.4",
"composer/installers": "~1.0",
"netresearch/composer-patches-plugin": "~1.0"
},
"require-dev": {
"drupal/imagesloaded": "dev-master#0e68c8ea901cdec8844d4ceca2df8efb8a7a75a5"
},
"extra": {
"installer-paths": {
"modules/contrib/{$name}/": ["type:drupal-module"],
"libraries/{$name}/": ["type:drupal-library"]
}
},
"config": {
"vendor-dir": "vendor",
"component-dir": "libraries"
},
"authors": [
{
"name": "Mikke Schrén",
"email": "mikke.schiren@wunderkraut.com"
}
]
}
https://raw.githubusercontent.com/webflo/d7/master/packages.json overrides the package definition von drupal-packagist.webflo.io
I think the metapackage proposal from @webflo is the right way to go.
The drupal-composer organization could provide a reference metapackage for this use case and link to it from the documentation.
We added replace links to drupal/drupal
for D7 a while ago.
Hi,
I tried drupal 7 and composer this week (with help from some of you), and just wanted to share some of the results of composer.json examples.
First a couple of words about the workflow I use (that is the same as Wunderkraut Sweden, where I work). First of all we have normaly a platform repo, the platform is usually only a normal drupal-core installation, second we have a profile with all contrib and custom stuff in (we dont use sites/all). We work with profiles, because of that matches we workflow perfectly when we use aegir for deployment.
My example profile is called d7-composer-example-profile and is just a dummy profile, and just sharing the stuff here if somebody is interested.
Composer.son for the platform (normaly in /srv/www/project-name):
Second the profile (normaly in /srv/www/project-name/profiles/profile-name)