- Issue created by @ultimike
- πΊπΈUnited States chrisfromredfin Portland, Maine
marking as stable blocker for now, though I may change this to beta blocker sooner than later.
- πΊπΈUnited States ultimike Florida, USA
After discussions with one of the Recipe leads, it was determined that we should be including both
/project-root/recipes
and/project-root/web/recipes
.I've updated the issue summary.
-mike
- πΊπΈUnited States ultimike Florida, USA
Doh! Never mind - I think the plugin already does this!
In Drupal 10 and and 11, it searches the project-root's "recipes/" directory.
From a code comment:
// The recipe system requires that all non-core recipes be located next to each // other, in the same directory.
So, no "custom" or "contrib" directories allowed.
When I do a
composer require somevendor/somerecipe
(where the project's composer.json has "type": "drupal-recipe", where is the Composer configuration that installs this dependency in the project root's "recipes" directory? (using a Drupal 11.0.7 site based on the drupal/recommended-project Composer template.) This is a bit of a mystery.Sidenote: I have noticed that the 11.x drupal/recommended-project Composer template includes
"recipes/{$name}": ["type:drupal-recipe"]
.Finally, in the Project Browser recipes plugin, there is this bit of code that uses information from Composer to figure out which directories Project Browser searches for recipes:
// If any recipes have been installed by Composer, also search there. The // recipe system requires that all non-core recipes be located next to each // other, in the same directory. $contrib_recipe_names = InstalledVersions::getInstalledPackagesByType(Recipe::COMPOSER_PROJECT_TYPE); if ($contrib_recipe_names) { $path = InstalledVersions::getInstallPath($contrib_recipe_names[0]); $path = $this->fileSystem->realpath($path); $search_in[] = dirname($path); }
Bottom line - nothing to see here, closing this issue, leaving this information for those that are curious.
-mike
- πΊπΈUnited States ultimike Florida, USA
Regarding
When I do a composer require somevendor/somerecipe (where the project's composer.json has "type": "drupal-recipe", where is the Composer configuration that installs this dependency in the project root's "recipes" directory? (using a Drupal 11.0.7 site based on the drupal/recommended-project Composer template.) This is a bit of a mystery.
Credit to @ctrladel for figuring out that recent versions of composer/installers has this gem:
https://github.com/composer/installers/blob/main/src/Composer/Installers/DrupalInstaller.php
Mystery solved!
-mike
- πΊπΈUnited States ultimike Florida, USA
One other thought on this - as things currently stand, Project Browser will only work with recipes that are installed with Composer. If you download/create a recipe into a project, Project Browser won't find it (unless you've previously used Composer to require an additional recipe to the same directory.)