From 20b862e1ca0da4481c2f085ee5561eb8ba60f635 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Tue, 14 Nov 2023 10:02:46 -0500 Subject: [PATCH 1/3] Update README.md --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 9756e14..7d2bad8 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,28 @@ We hit the same problem, again. At DrupalCon Portland we sat down and decided a See [Add a composer plugin that supports 'composer require-lenient' to support major version transitions](https://www.drupal.org/project/drupal/issues/3267143) +## Before +Imagine that you are using drupal/token and it is not yet compatible with Drupal 10. You try to upgrade to Drupal 10 via Composer! + +``` +composer require drupal/core-recommended:^10 drupal/core-composer-scaffold:^10 --with-all-dependencies +``` +![image](https://github.com/mglaman/composer-drupal-lenient/assets/539205/a4950149-a7ae-4d03-a786-716ebaa7dee0) + +Yikes! You are blocked. You don't want to go and fix the drupal/token module itself. How do you move forward? + +## After + +This thing to the rescue! Run a few commands to add this tool to your composer.json file, and then try again. + +``` +composer config repositories.lenient composer https://packages.drupal.org/lenient +composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/token"]' +composer require drupal/core-recommended:^10 drupal/core-composer-scaffold:^10 --with-all-dependencies +``` + +Voila! It's basically cheating and letting Composer "I know it's not technically compatible with Drupal 10, just download it anyway" + ## How This subscribes to `PluginEvents::PRE_POOL_CREATE` and filters packages. This is inspired by `symfony/flex`, but it does From 3447a127c996de6b9e6f044aa0be419b8c1f6d67 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Tue, 14 Nov 2023 10:09:15 -0500 Subject: [PATCH 2/3] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 7d2bad8..d48411f 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,11 @@ composer require drupal/core-recommended:^10 drupal/core-composer-scaffold:^10 - ``` Voila! It's basically cheating and letting Composer "I know it's not technically compatible with Drupal 10, just download it anyway" +There's one more step. You'll need to [patch the info.yml](https://docs.cweagans.net/composer-patches/usage/defining-patches/) file on the contributed module, drupal/token in this case, to ensure that the +module can remain installed to the Drupal database. It is *very* likely that this patch already exists in the module's issue queue. +You can add it with a single command: + + ## How From b881596607ffa606f4190b9c017a037de374c651 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Tue, 14 Nov 2023 10:09:57 -0500 Subject: [PATCH 3/3] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index d48411f..f318062 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,6 @@ composer require drupal/core-recommended:^10 drupal/core-composer-scaffold:^10 - Voila! It's basically cheating and letting Composer "I know it's not technically compatible with Drupal 10, just download it anyway" There's one more step. You'll need to [patch the info.yml](https://docs.cweagans.net/composer-patches/usage/defining-patches/) file on the contributed module, drupal/token in this case, to ensure that the module can remain installed to the Drupal database. It is *very* likely that this patch already exists in the module's issue queue. -You can add it with a single command: - - ## How