I'm very new to composer, I've only used it to install the occasional necessary library for our D8 projects. At each Drupal update I normally run
drush up drupal
Which (among other things) replaces the vendor folder and composer.json, so on sites with library dependencies, I need to re-run
composer require [library]
Aware of the touted benefits of Composer as a dependency manager, I want to use composer to maintain our Drupal projects. However I've run into issues, namely that
or composer update drupal/core --with-dependencies both give me "Nothing to install or update". After some reading, I found this resource https://github.com/drupal-composer/drupal-project. With this unzip, if I run
I get the correct latest version of Drupal installed in ./web. But when I use the yaml from the template composer.json file in my own composer.json file I still get "Nothing to install or update".
My folder structure is identical to the .zip distribution, so /core and /vendor and /sites etc are all in the same folder, so I have obviously adjusted the composer.json file according. But it doesn't matter what I do, I just get "Nothing to install or update" "Nothing to install or update" "Nothing to install or update"
So, I'm beginning to think that composer update with or without dependencies REQUIRES YOU TO HAVE INSTALL THE DRUPAL 8 PROJECT WITH COMPOSER TO BEGIN WITH.
Is that right? If so, then I can move on. If not then I need to know what I'm doing wrong. Right now it's not a big deal and I can manage the update process, but it seems each new project requires more and more non-core libraries, so I know composer will save me a lot of time in the future.
TL;DR - Can someone give me a kickstart to configuring my EXISTING, WORKING PRODUCTION SITES so I can use composer to update them, the usual ReadMe's don't seem to work properly with sites that weren't also installed with composer.