This is the main Drupal core issue for the Composer initiative: https://www.drupal.org/about/strategic-initiatives/composer (From this proposal: #2958021: Proposal: Composer Support in Core initiative)
Note that the Composer initiative has its own d.o project, but this is mainly a place to store meeting notes: https://www.drupal.org/project/composer_initiative
Problem/Motivation
Make an official method for starting a Drupal site with composer.
Current releases of Drupal do not have an easy way to make use of Composer-based dependencies. Some contrib modules require that Composer be used to install them.
Proposed resolution
Add a composer kickstart template, along with supporting packages and change the build process to utilize them.
This means that the 'tarball' version of core that the user downloads from Drupal.org will have been built using Composer, and will not break when they need to use Composer to manage it.
Roadmap
- We need a way to handle the 'scaffolding' of files so we can build a product with composer:
#2982684: Add a composer scaffolding plugin to core - We need to reconfigure drupal core to leverage that scaffold plugin.
#3067645: Add core scaffold assets to drupal/core's composer.json extra field - But first we must remove the wikimedia merge plugin because it interferes with our plan, and causes many other problematic issues
#2912387: Stop using wikimedia/composer-merge-plugin - Once core is setup such that a template can take advantage of it, we'll need to create the template files that packaging can use to generate tarballs that mimic the existing tarballs drupal.org provides.
#2982680: Add composer-ready project templates to Drupal core - In order to do that, however, we'll need to be able to have a known set of locked dependencies that core 'ships' with, and rely on that
#3076600: Create drupal/core-recommended metapackage - And We will also need to make sure that all of the existing safeguards are in place and our 'webroot drupal' doesn't ship with test files.
#3057094: Add Composer vendor/ hardening plugin to core - Once all of that is in place, we'll modify drupal.org's packaging to build the tarball from the template instead of the git clone.
#3071726: Package tarballs using composer template if available - Once the above is complete, we'll have a solid milestone that will mean all future drupal installations will be able to start with a composer ready tarball or be able to use an officially sanctioned way to start a drupal project.
- We'll need to ensure we've got good tools for converting existing sites to get everybody on the same path moving forward:
#3047468: Create a tool to convert a non-Composer-based Drupal to a Composer-based one - Various minor cleanups/bug fixes/DX/UX improvements
- #3084298: Make composer installer paths consistent between drupal/drupal and the project templates
- #3084326: Install .editorconfig and .gitattributes at the project root
- #3082866: composer complains "Skipped installation of bin bin/composer for package composer/composer: file not found in package"
- #3085075: Add '-s dev' to Composer Project Template documentation so instructions work w/out a stable release
- #3082958: Add gitignore(s) to Composer-ready project templates
- #3082983: Decide what to "suggest" in Composer Project Templates
- #3064990: Prompt users when adding new requirements with scaffolded assets
Documentation Updates
We will need to inform the users about all of these features
- Update the user guide and documentation guides for sitebuilders
https://www.drupal.org/project/user_guide/issues/3086656 - Update documentation for developers
[ ISSUE PLACEHOLDER ] - Create a change record that discusses the differences between the dev repository and the built product(?)
[ CHANGERECORD PLACEHOLDER ] - This issue probably has more nooks and crannies we can look for composer doc info.
#2912410: Create a list of Composer topics that need documentation - Another request for docs/instructions:
#3012129: Add composer-based install instructions to the Drupal project page - #3086655: Add composer instructions to INSTALL.txt
- #3000374: Improve Composer update workflow in UPDATE.txt
Testing Updates
In order to prove that a lot of this stuff works, we need to add a new test type to the infra for build and upgrade types of tests.
- So we'll need to add the new testing type
#3031379: Add a new test type to do real update testing - Then we'll need to create tests
#2984031: Create Build Tests For Composer and Drupal - Finally, we'll need to have the testing infrastructure execute our tests
[ DRUPALCI ISSUE PLACEHOLDER ]
User interface changes
None
API changes
None
Data model changes
None
Build changes
None
Comments
Comment #2
MixologicComment #3
MixologicComment #4
MixologicComment #5
mile23Woot!
Comment #6
MixologicComment #7
MixologicUpdate:
There have been forks created for each of the main components that we'd like to see put into core and subtree split back out.
https://github.com/drupal/drupal-project-legacy is the template project
https://github.com/drupal/drupal-scaffold is the scaffolding plugin, adjusted to make an exact replica of core.
https://github.com/drupal/drupal-core-strict is the core strict plugin (for now, we may utilize another methodology for getting consistent dependencies)
https://travis-ci.org/drupal/drupal-project-legacy is evidence of a test showing where we're at so far.
Comment #8
MixologicThese forks are wired up to packagist, with the intention that they will be overwritten by the subtree splits once these are moved into core, or deleted/renamed etc.
You can currently see what happens when you
composer create project drupal/drupal-project-legacy SuperAwesomeTest 8.6.x-devThat might not get you a working drupal, since it does look like there's still some issues with the component autoloading.
Comment #9
manuel garcia commentedExciting :D
composer create-project drupal/drupal-project-legacy SuperAwesomeTest 8.6.x-devThere was a missing dash on #8, for those wanting to copy paste the command to try things :)
Comment #10
MixologicUgh. I've made that mistake a number of times in testing things.
Comment #11
webflo commentedComment #13
MixologicComment #14
gábor hojtsyComment #16
mile23New child issue: #3047468: Create a tool to convert a non-Composer-based Drupal to a Composer-based one
Comment #17
mile23New child issue: #3057094: Add Composer vendor/ hardening plugin to core
Comment #18
xjmComment #19
mile23Making the IS a little less terse.
Comment #20
andypostComment #21
MixologicComment #22
MixologicRoadmap overhaul.
Comment #23
MixologicComment #24
MixologicComment #25
MixologicComment #26
MixologicComment #27
MixologicComment #28
MixologicComment #29
MixologicArbitrary edit to refresh the statuses.
Comment #30
Mixologicagain.
Comment #31
Mixologic.
Comment #32
greg.1.anderson commented#3071703: Remove composer/installer rule for drupal/core in root composer.json file was closed as unnecessary, so I removed it from the roadmap.
Comment #33
MixologicComment #34
MixologicComment #35
greg.1.anderson commentedAdded #3084369: Look up scaffold [web-root] from installation location of drupal/core to issue summary.
Comment #36
MixologicComment #37
MixologicComment #38
MixologicComment #39
MixologicComment #40
MixologicComment #42
mile23Somewhat low-priority spit and polish: #3087482: Add 'next steps' info to Composer installation output
Comment #44
andypostComment #50
andypostLooks like only 2 issues from summary make sense now