drupal-composer / drupal-parse-composer

:mag: Components used in Drupal-Packagist to parse package information from drupal.org
10 stars 11 forks source link

Drupal as type: drupal-core #2

Closed davidbarratt closed 10 years ago

davidbarratt commented 10 years ago

Since Drupal 8 defines Drupal itself as type: drupal-core https://github.com/drupal/drupal/blob/8.0.x/composer.json perhaps it would be wise to do the same for Drupal 7?

Doing this would allow someone to use a custom installer for Drupal Core.

Thanks!

winmillwill commented 10 years ago

Firstly, thanks for the suggestion. I would have just done it and closed the issue, but I only just saw this and just got done putting up v0.2.0 of the static repository.

Since composer/installers doesn't use that type for placement, I believe you would have to write a custom installer that could just as easily act on packages named drupal/drupal. Also, even if composer/installers handled this or you wrote such an installer, you would have a problem where some composer packages are installed inside another. In this scenario, the update strategy for drupal is to remove drupal from whatever path it's at, which means removing everything inside it.

To sidestep this problem, I use drupal/tangler, and I recommend using that or a simple bash script for rendering a drupal application that is ready to bootstrap. As a knock-on benefit, it also knows how to put your custom code into the drupal project. Before I had drupal/tangler, I used composer/installers to put every drupal-* package in vendor/drupal/{type} and then cleared the current drupal root and copied them into place with the bash script.

All that said, I will likely make this change, or something similar. For example, symfony/symfony is a library and symfony/standard is a framework with some scaffolding in place. In some ways, we would be well-served to consider drupal/drupal a framework because it has a rigid directory structure and responds to requests out of the box. In other ways, that's exactly what makes it a pain to version drupal/drupal as a dependency and use a modern workflow. Similarly, if drupal/drupal were a library, it would be a very bad one indeed, so calling it anything else is probably preferable.

davidbarratt commented 10 years ago

Side note...

I created a custom installer so you can install anything, anywhere. https://github.com/davidbarratt/custom-installer

As long as Drupal is installed first (into a sub-directory), you can install modules, themes, sites, etc. into Drupal itself. :)

Thanks!