Problem/Motivation
The d.o subsystem that generates packagist metadata ignores composer.json of non modules/themes, and infers a wrong project type and requirements. See #2715435: Support for Drush extensions.
Steps to reproduce
In a Drupal 8.8 or above installation (where sebastian/exporter is not a core requirement), run composer require drupal/drush_entity and see that:
* sebastian/exporter is not downloaded
* drush_entity is placed in web/modules/contrib instead of drush/Commands/Contrib
Proposed resolution
As a workaround, add the project's .info.yml file. As stated in #2715435: Support for Drush extensions when the info file is present, the packaging subsystem merges the composer.json from the project with d.o defaults.
Remaining tasks
Add the project's .info.yml file.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
Not applicable.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3161968-9.patch | 306 bytes | suresh prabhu parkala |
| #5 | Implement_drush_info_file_3161968.patch | 832 bytes | Pooja Ganjage |
| #2 | Implement_info_file_3161968.patch | 558 bytes | Pooja Ganjage |
Comments
Comment #2
Pooja Ganjage commentedHi,
I am applying patch to add info file.
Kindly review this patch once.
Thanks.
Comment #3
Pooja Ganjage commentedComment #4
clemens.tolboomThe example in https://git.drupalcode.org/project/dev_modules/blob/HEAD/dev_modules.inf... mentioned in #2715435-11: Support for Drush extensions has no
Please make similar by removing the above and add the core_version_requirement
Comment #5
Pooja Ganjage commentedHi,
Attached the updated patch.
Kindly review this patch once.
Thanks.
Comment #6
Pooja Ganjage commentedComment #7
clemens.tolboom+ "drupal/core": "^8 || ^9",You added composer.json. Checking with https://git.drupalcode.org/project/dev_modules/-/blob/HEAD/composer.json that has no core requirements in it. Do you have some information/link why that is/must be added?
Comment #8
jonhattanWe don't want "drupal/core" requirement in composer.json, since drush extensions can be installed standalone/system-wide (out of a drupal installation), and is undesirable to have a copy of core in vendor/. Ref #2715435-8: Support for Drush extensions
FTR I'm leveraging drush_entity in https://www.drupal.org/project/drush_shrinkdb
Comment #9
suresh prabhu parkala commentedPlease review!
Comment #10
Pooja Ganjage commentedHi,
Here is an example for adding core_version_requirement in composer.json file.
https://www.drupal.org/project/entityqueue/issues/3111532.
May be you get some idea.
Comment #12
clemens.tolboom@Pooja Ganjage you probably missed @jonhattan answer. I was curious about your composer addition and reasoning.