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

  1. 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
  2. We need to reconfigure drupal core to leverage that scaffold plugin.
    #3067645: Add core scaffold assets to drupal/core's composer.json extra field
    1. 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
  3. 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
    1. 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
    2. 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
  4. 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
  5. 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.
  6. 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
  7. Various minor cleanups/bug fixes/DX/UX improvements
    1. #3084298: Make composer installer paths consistent between drupal/drupal and the project templates
    2. #3084326: Install .editorconfig and .gitattributes at the project root
    3. #3082866: composer complains "Skipped installation of bin bin/composer for package composer/composer: file not found in package"
    4. #3085075: Add '-s dev' to Composer Project Template documentation so instructions work w/out a stable release
    5. #3082958: Add gitignore(s) to Composer-ready project templates
    6. #3082983: Decide what to "suggest" in Composer Project Templates
    7. #3064990: Prompt users when adding new requirements with scaffolded assets

Documentation Updates

We will need to inform the users about all of these features

  1. Update the user guide and documentation guides for sitebuilders
    https://www.drupal.org/project/user_guide/issues/3086656
  2. Update documentation for developers
    [ ISSUE PLACEHOLDER ]
  3. Create a change record that discusses the differences between the dev repository and the built product(?)
    [ CHANGERECORD PLACEHOLDER ]
  4. 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
  5. Another request for docs/instructions:
    #3012129: Add composer-based install instructions to the Drupal project page
  6. #3086655: Add composer instructions to INSTALL.txt
  7. #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.

  1. So we'll need to add the new testing type
    #3031379: Add a new test type to do real update testing
  2. Then we'll need to create tests
    #2984031: Create Build Tests For Composer and Drupal
  3. 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

Mixologic created an issue. See original summary.

Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
mile23’s picture

Woot!

Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Update:

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.

Mixologic’s picture

These 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-dev

That might not get you a working drupal, since it does look like there's still some issues with the component autoloading.

manuel garcia’s picture

Exciting :D
composer create-project drupal/drupal-project-legacy SuperAwesomeTest 8.6.x-dev

There was a missing dash on #8, for those wanting to copy paste the command to try things :)

Mixologic’s picture

Ugh. I've made that mistake a number of times in testing things.

webflo’s picture

Issue tags: +Composer

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Mixologic’s picture

Issue summary: View changes
gábor hojtsy’s picture

Issue summary: View changes

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mile23’s picture

mile23’s picture

xjm’s picture

Priority: Normal » Major
mile23’s picture

Title: Add composer build support to core » [meta] Add composer build support to core
Issue summary: View changes

Making the IS a little less terse.

andypost’s picture

Mixologic’s picture

Mixologic’s picture

Issue summary: View changes

Roadmap overhaul.

Mixologic’s picture

Title: [meta] Add composer build support to core » [meta] Composer Initiative Phase 1: Add composer build support to core
Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes

Arbitrary edit to refresh the statuses.

Mixologic’s picture

Issue summary: View changes

again.

Mixologic’s picture

Issue summary: View changes

.

greg.1.anderson’s picture

Issue summary: View changes

#3071703: Remove composer/installer rule for drupal/core in root composer.json file was closed as unnecessary, so I removed it from the roadmap.

Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
greg.1.anderson’s picture

Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mile23’s picture

Version: 8.9.x-dev » 8.8.x-dev

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

andypost’s picture

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

Looks like only 2 issues from summary make sense now

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.