From 3e27a207ad59590135f05029e47af6b3db2308fd Mon Sep 17 00:00:00 2001 From: Omar Lopesino Date: Tue, 10 Dec 2024 15:32:15 +0100 Subject: [PATCH 1/3] Allow aljibe-installed sites to be able to install recipes --- aljibe-kickstart/composer.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/aljibe-kickstart/composer.json b/aljibe-kickstart/composer.json index 442edf1..8ad9e44 100644 --- a/aljibe-kickstart/composer.json +++ b/aljibe-kickstart/composer.json @@ -11,6 +11,10 @@ } ], "repositories": [ + { + "type": "vcs", + "url": "https://github.com/woredeyonas/Drupal-Recipe-Unpack.git" + }, { "type": "composer", "url": "https://packages.drupal.org/8" @@ -41,7 +45,8 @@ "metadrop/drupal-artifact-builder": "^1.4" }, "require-dev": { - "metadrop/drupal-dev": "^2.0.0" + "metadrop/drupal-dev": "^2.0.0", + "ewcomposer/unpack": "dev-master", }, "conflict": { "drupal/drupal": "*" @@ -69,11 +74,20 @@ "drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold" }, "extra": { + "patches": { + "drupal/core": { + "Stream wrappers not registered when installing module's default config - https://www.drupal.org/project/drupal/issues/3416735": "https://git.drupalcode.org/project/drupal/-/merge_requests/10421.diff", + "Allow recipe command to write to the container ensuring that cache does not be cleared after a recipe installs a module - https://www.drupal.org/project/drupal/issues/3315694": "patches/drupal-core-3315694-1.patch" + } + }, "drupal-scaffold": { "locations": { "web-root": "./web" } }, + "installer-types": [ + "drupal-recipe" + ], "installer-paths": { "web/core": ["type:drupal-core"], "web/libraries/{$name}": ["type:drupal-library"], @@ -83,7 +97,10 @@ "drush/Commands/contrib/{$name}": ["type:drupal-drush"], "web/modules/custom/{$name}": ["type:drupal-custom-module"], "web/profiles/custom/{$name}": ["type:drupal-custom-profile"], - "web/themes/custom/{$name}": ["type:drupal-custom-theme"] + "web/themes/custom/{$name}": ["type:drupal-custom-theme"], + "web/recipes/{$name}": [ + "type:drupal-recipe" + ] }, "dev-files": { "bin": [ From 2acd47a53ce52e069ca285e77ec7722cb850b761 Mon Sep 17 00:00:00 2001 From: Omar Lopesino Date: Tue, 10 Dec 2024 15:51:03 +0100 Subject: [PATCH 2/3] Fix composer.json and patches needed to support to recipes --- aljibe-kickstart/composer.json | 6 ++++-- .../patches/drupal-core-3315694-1.patch | 13 +++++++++++++ .../patches/drupal-core-3416735-1.patch | 13 +++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 aljibe-kickstart/patches/drupal-core-3315694-1.patch create mode 100644 aljibe-kickstart/patches/drupal-core-3416735-1.patch diff --git a/aljibe-kickstart/composer.json b/aljibe-kickstart/composer.json index 8ad9e44..106b541 100644 --- a/aljibe-kickstart/composer.json +++ b/aljibe-kickstart/composer.json @@ -46,7 +46,7 @@ }, "require-dev": { "metadrop/drupal-dev": "^2.0.0", - "ewcomposer/unpack": "dev-master", + "ewcomposer/unpack": "dev-master" }, "conflict": { "drupal/drupal": "*" @@ -67,7 +67,9 @@ "liborm85/composer-vendor-cleaner": true, "metadrop/composer-comments": true, "php-http/discovery": true, - "liborm85/composer-vendor-cleaner": true + "tbachert/spi": true, + "mxr576/ddqg-composer-audit": true, + "ewcomposer/unpack": true } }, "scripts": { diff --git a/aljibe-kickstart/patches/drupal-core-3315694-1.patch b/aljibe-kickstart/patches/drupal-core-3315694-1.patch new file mode 100644 index 0000000..c95e4f2 --- /dev/null +++ b/aljibe-kickstart/patches/drupal-core-3315694-1.patch @@ -0,0 +1,13 @@ +diff --git a/core/lib/Drupal/Core/Recipe/RecipeCommand.php b/core/lib/Drupal/Core/Recipe/RecipeCommand.php +index 3040e40960..6d6f496ada 100644 +--- a/core/lib/Drupal/Core/Recipe/RecipeCommand.php ++++ b/core/lib/Drupal/Core/Recipe/RecipeCommand.php +@@ -192,7 +192,7 @@ private function rollBackToCheckpoint(Checkpoint $checkpoint): void { + * Exception thrown if kernel does not boot. + */ + protected function boot() { +- $kernel = new DrupalKernel('prod', $this->classLoader); ++ $kernel = new DrupalKernel('prod', $this->classLoader, FALSE); + $kernel::bootEnvironment(); + $kernel->setSitePath($this->getSitePath()); + Settings::initialize($kernel->getAppRoot(), $kernel->getSitePath(), $this->classLoader); diff --git a/aljibe-kickstart/patches/drupal-core-3416735-1.patch b/aljibe-kickstart/patches/drupal-core-3416735-1.patch new file mode 100644 index 0000000..893e556 --- /dev/null +++ b/aljibe-kickstart/patches/drupal-core-3416735-1.patch @@ -0,0 +1,13 @@ +diff --git a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php +index 1c08700dc69109ee3d9d6a3cfdbd2227b07cef34..93b7419d93fe718b711fabf2b12d785cb57b3e7c 100644 +--- a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php ++++ b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php +@@ -162,6 +162,8 @@ public function addStreamWrapper($service_id, $class, $scheme) { + 'type' => $class::getType(), + 'service_id' => $service_id, + ]; ++ ++ $this->registerWrapper($scheme, $class, $class::getType()); + } + + /** From f2559484863aba3c7522fad766c2725e0abc503f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20L=C3=B3pez?= Date: Wed, 11 Dec 2024 13:35:40 +0100 Subject: [PATCH 3/3] Recipes on Drupal 11 installation too. --- .../patches/drupal-core-3315694-1.patch | 0 .../patches/drupal-core-3416735-1.patch | 0 kickstart/d11/composer.json | 22 +++++++++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) rename {aljibe-kickstart => kickstart/common}/patches/drupal-core-3315694-1.patch (100%) rename {aljibe-kickstart => kickstart/common}/patches/drupal-core-3416735-1.patch (100%) diff --git a/aljibe-kickstart/patches/drupal-core-3315694-1.patch b/kickstart/common/patches/drupal-core-3315694-1.patch similarity index 100% rename from aljibe-kickstart/patches/drupal-core-3315694-1.patch rename to kickstart/common/patches/drupal-core-3315694-1.patch diff --git a/aljibe-kickstart/patches/drupal-core-3416735-1.patch b/kickstart/common/patches/drupal-core-3416735-1.patch similarity index 100% rename from aljibe-kickstart/patches/drupal-core-3416735-1.patch rename to kickstart/common/patches/drupal-core-3416735-1.patch diff --git a/kickstart/d11/composer.json b/kickstart/d11/composer.json index 7fadc3b..9836dc6 100644 --- a/kickstart/d11/composer.json +++ b/kickstart/d11/composer.json @@ -11,6 +11,10 @@ } ], "repositories": [ + { + "type": "vcs", + "url": "https://github.com/woredeyonas/Drupal-Recipe-Unpack.git" + }, { "type": "composer", "url": "https://packages.drupal.org/8" @@ -28,7 +32,8 @@ "metadrop/drupal-artifact-builder": "^1.4" }, "require-dev": { - "metadrop/drupal-dev": "^2.0.0" + "metadrop/drupal-dev": "^2.6.0", + "ewcomposer/unpack": "dev-master" }, "conflict": { "drupal/drupal": "*" @@ -50,6 +55,7 @@ "metadrop/composer-comments": true, "php-http/discovery": true, "tbachert/spi": true, + "ewcomposer/unpack": true, "mxr576/ddqg-composer-audit": true } }, @@ -57,11 +63,20 @@ "drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold" }, "extra": { + "patches": { + "drupal/core": { + "Stream wrappers not registered when installing module's default config - https://www.drupal.org/project/drupal/issues/3416735": "https://git.drupalcode.org/project/drupal/-/merge_requests/10421.diff", + "Allow recipe command to write to the container ensuring that cache does not be cleared after a recipe installs a module - https://www.drupal.org/project/drupal/issues/3315694": "patches/drupal-core-3315694-1.patch" + } + }, "drupal-scaffold": { "locations": { "web-root": "./web" } }, + "installer-types": [ + "drupal-recipe" + ], "installer-paths": { "web/core": ["type:drupal-core"], "web/libraries/{$name}": ["type:drupal-library"], @@ -71,7 +86,10 @@ "drush/Commands/contrib/{$name}": ["type:drupal-drush"], "web/modules/custom/{$name}": ["type:drupal-custom-module"], "web/profiles/custom/{$name}": ["type:drupal-custom-profile"], - "web/themes/custom/{$name}": ["type:drupal-custom-theme"] + "web/themes/custom/{$name}": ["type:drupal-custom-theme"], + "web/recipes/{$name}": [ + "type:drupal-recipe" + ] }, "dev-files": { "bin": [