Problem/Motivation
In order to fix support for core in composer, we need to add a composer kickstart template to core that becomes the starting point for all future drupal sites.
The https://github.com/drupal-composer/drupal-project has shown that this is the best practice method for starting drupal sites using composer, and should be used as a basis for what this looks like.
Proposed resolution
- Two templates will be provided: a "recommended" template modeled after drupal-composer/drupal-project, and a "legacy" template modeled after the existing tarball downloads.
- The project templates will be split out from core using the existing subtree splitter, and will exist on packagist.org and github.com.
- These templates *are not meant to be upgraded*. They are intended to initially set up a drupal site, but should be free from any implied features.
- The initial effort is *not meant* to make it easier/faster/better to get a site up and running over a bare tarball. (i.e. patches/docroots/webroot/security fixes etc). Those features can be added later, in an additional template.
- The "legacy" template is expressly designed to change absolutely nothing about what the filesystem structure and layout looks like. When you run
composer create-project drupal/legacy-project
, it should mirror *exactly* what you get when youdownload the current tarball from drupal.orggit clone and composer install the git repository (although there will of necessity be minor differences in certain files, such as composer.json and composer.lock).
Remaining tasks
- [X] #2982684: Add a composer scaffolding plugin to core
- [X] Plan to support multiple templates. (Just put them in a directory)
- [X] Decide naming convention for templates. (drupal/recommended-project and drupal/legacy-project)
- [X] Decide where it's physically located inside of the directory tree. (composer/Templates)
- [X] Decide how to test this, and what the bar is for success vs failure. (Just test 'composer install' to start.)
- [X] Submit a patch that takes all of the above into account.
- [X] Write a change record.
- [X] Add documentation to drupal.org.
- [X] Remove .gitignore from the project template for now, pending discussion in follow-on issue (see below).
- [X] Make a follow-on issue to decide what to do about the .gitignore file long-term. (#3082958: Add gitignore(s) to composer-ready project templates)
- [X] Make a follow-on issue to decide what to put in the "suggests" section. (#3082983: Decide what to "suggest" in Composer Project Templates)
- [X] Make a follow-on issue to strip wikimedia/composer-merge-plugin from drupal/core-recommended. (drupalorg-infrastructure/package-generator#1)
- [X] Determine whether the Composer-managed layout causes Drupal to use more memory. (Memory requirement increase not due to Composer, per #3082985: Determine whether Composer project templates require more RAM to install Drupal)
Follow-on tasks
- Improve testing leveraging #2984031: Create Build Tests For Composer and Drupal
- Build Drupal download tarballs from the legacy template project #3082470: Update drupal/drupal tarball generator
- Update Composer documentation once Drupal is sufficiently ready #3082601: Update Composer documentation once Drupal 8.8.0 is sufficiently ready
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
Drupal.org now provides "starter" Composer project templates that can be used to start new Composer-managed sites.
- Use
composer create-project drupal/recommended-project
to create a site where the Drupal root has been relocated into aweb
subdirectory. - Use
composer create-project drupal/legacy-project
to create a site where the Drupal root is n the top-level directory, with thevendor
folder.