0

I have installed Drupal 9 with composer create-project drupal/recommended-project. I wish to upgrade to Drupal 10.

Upgrading a Composer-based site / Overview doesn't explain what to do, but I have found Upgrading a Composer-based site which does.

If I understand correctly, for typical (non-dev) versions, such as I have (according to recommended-project), this is the process:

cd example.com
composer update
chmod 777 web/sites/default
chmod 666 web/sites/default/*settings.php
chmod 666 web/sites/default/*services.yml
composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --update-with-dependencies --no-update
composer update
drush updatedb
chmod 755 web/sites/default
chmod 644 web/sites/default/*settings.php
chmod 644 web/sites/default/*services.yml

I understand most code but not the following command

composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --update-with-dependencies --no-update
composer update

What does this command do? It requires the recommended version of Drupal 10, so far so good, but what are the two other parts, what is a "scaffold" and "message" in this context and are these necessary?
When installing Drupal, I don't recall ever coming across these terms.


I first published a similar question in Drupal Answers Stack Exchange but was badly received there.
In the comment section, user:zsd wrote:

  • github.com/drupal/core-project-message This Composer plugin displays a configurable message after Composer installation processes have finished.
  • github.com/drupal/core-composer-scaffold This project provides a composer plugin for placing scaffold files (like index.php, update.php, …) from the drupal/core project into their desired location inside the web root. Only individual files may be scaffolded with this plugin.
tahaniau
  • 1
  • 1

1 Answers1

0

Due to the way composer works, drupal/core-recommended is everything you see in the web/core directory.

However, for Drupal to work, you need a number of files that are in your web directory ( things like robots.txt, .htaccess, index.php etc. ). Those are downloaded by the scaffold project ( you can even customize via composer.json if you want to omit some, which is extremely helpful for stuff that are not relevant to the specific installation. These files are meant to be in source-control as well ( looking at .htaccess and robots.txt mostly), which would defeat the purpose of having them in core.

        [..]
        "drupal-scaffold": {
            "file-mapping": {
                "[web-root]/.ht.router.php": false,
                "[web-root]/example.gitignore": false,
                "[web-root]/INSTALL.txt": false,
                "[web-root]/README.txt": false,
                "[web-root]/web.config": false,
                "[web-root]/README.md": false,
                "[web-root]/sites/README.txt": false,
                "[web-root]/modules/README.txt": false,
                "[web-root]/themes/README.txt": false,
                "[web-root]/sites/example.sites.php": false,
                "[web-root]/sites/example.settings.local.php": false,
                "[web-root]/sites/default/default.services.yml": false,
                "[web-root]/sites/default/default.settings.php": false
            },
            "locations": {
                "web-root": "web/"
            }
        },

The message project on the other hand is quite less needed - it simply displays the banners for sponsoring / support after a composer operation in your console. Does not install anything, but is required by some projects that are in search of sponsorship. Can also be customized through composer.json to not emit anything:

       [..]
        "drupal-core-project-message": {
            "include-keys": [
            ],
            "post-create-project-cmd-message": [
            ]
        }