From 340d70658bdd3e35921d95ba90a3f616b1b99850 Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Tue, 8 Aug 2023 15:38:15 -0400 Subject: [PATCH 1/2] revert(chosen): remove composer-merge-plugin Due to an issue with Pantheon and the now deprecated use of composer-merge-plugin, we are removing references to it's use in order to provide another fix for this. References: - https://www.drupal.org/node/3069730 - https://git.drupalcode.org/project/chosen/-/blob/4.0.x/README.txt --- composer.json | 13 +------------ web/profiles/custom/yalesites_profile/composer.json | 12 +----------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index cc7e2021a2..b73f9cbd8f 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,6 @@ "drupal/core-recommended": "^9.2", "drush/drush": "^11 || ^12", "pantheon-systems/drupal-integrations": "^9", - "wikimedia/composer-merge-plugin": "^2.1", "yalesites-org/yalesites_profile": "*" }, "require-dev": { @@ -94,14 +93,6 @@ "composer-exit-on-patch-failure": true, "patchLevel": { "drupal/core": "-p2" - }, - "allow-plugins": { - "JJJ/chosen": true - }, - "merge-plugin": { - "include": [ - "web/modules/contrib/chosen/composer.libraries.json" - ] } }, "config": { @@ -115,9 +106,7 @@ "composer/installers": true, "cweagans/composer-patches": true, "drupal/core-composer-scaffold": true, - "drupal/console-extend-plugin": true, - "wikimedia/composer-merge-plugin": true, - "oomphinc/composer-installers-extender": true + "drupal/console-extend-plugin": true } }, "scripts": { diff --git a/web/profiles/custom/yalesites_profile/composer.json b/web/profiles/custom/yalesites_profile/composer.json index 5e238d8aba..a2e583b759 100644 --- a/web/profiles/custom/yalesites_profile/composer.json +++ b/web/profiles/custom/yalesites_profile/composer.json @@ -82,19 +82,12 @@ "drupal/webform": "^6.2@beta", "drupal/wingsuit_companion": "^2.0@RC", "yalesites-org/atomic": "1.17.0", - "oomphinc/composer-installers-extender": "^2.0", - "wikimedia/composer-merge-plugin": "^2.1", "yalesites-org/yale_cas": "^1.0" }, "minimum-stability": "dev", "prefer-stable": true, "config": { - "sort-packages": true, - "allow-plugins": { - "composer/installers": true, - "oomphinc/composer-installers-extender": true, - "wikimedia/composer-merge-plugin": true - } + "sort-packages": true }, "extra": { "enable-patching": true, @@ -102,9 +95,6 @@ "patchLevel": { "drupal/core": "-p2" }, - "installer-paths": { - "../../../../web/core": ["type:drupal-core"] - }, "patches": { "drupal/layout_paragraphs": { "save close tweaks": "https://git.drupalcode.org/project/layout_paragraphs/-/merge_requests/80.patch" From 2aef510fb2dc77e413bacfa28312ecbfc58c0ef2 Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Tue, 8 Aug 2023 15:48:01 -0400 Subject: [PATCH 2/2] fix(chosen): use installer-plugin to place chosenJS In order for chosen to work in Drupal, it must reside in ./web/libraries/chosen. This allows composer to utilize the installer-paths to accomplish this. Co-authoried-by: @vinmassaro --- composer.json | 8 +++++++- web/profiles/custom/yalesites_profile/composer.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b73f9cbd8f..9596e909a0 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "drupal/core-composer-scaffold": "^9.2", "drupal/core-recommended": "^9.2", "drush/drush": "^11 || ^12", + "oomphinc/composer-installers-extender": "^2.0", "pantheon-systems/drupal-integrations": "^9", "yalesites-org/yalesites_profile": "*" }, @@ -57,6 +58,7 @@ "[project-root]/.gitattributes": false } }, + "installer-types": ["npm-asset"], "installer-paths": { "web/core": [ "type:drupal-core" @@ -87,6 +89,9 @@ ], "web/private/scripts/quicksilver/{$name}/": [ "type:quicksilver-script" + ], + "web/libraries/chosen": [ + "jjj/chosen" ] }, "enable-patching": true, @@ -106,7 +111,8 @@ "composer/installers": true, "cweagans/composer-patches": true, "drupal/core-composer-scaffold": true, - "drupal/console-extend-plugin": true + "drupal/console-extend-plugin": true, + "oomphinc/composer-installers-extender": true } }, "scripts": { diff --git a/web/profiles/custom/yalesites_profile/composer.json b/web/profiles/custom/yalesites_profile/composer.json index a2e583b759..9d1018c94e 100644 --- a/web/profiles/custom/yalesites_profile/composer.json +++ b/web/profiles/custom/yalesites_profile/composer.json @@ -81,6 +81,7 @@ "drupal/upgrade_status": "^3.18", "drupal/webform": "^6.2@beta", "drupal/wingsuit_companion": "^2.0@RC", + "jjj/chosen": "^2.2", "yalesites-org/atomic": "1.17.0", "yalesites-org/yale_cas": "^1.0" },