drupal-project icon indicating copy to clipboard operation
drupal-project copied to clipboard

How to make dependencies from internal package composer.json file available in project scope composer.json?

Open drupality opened this issue 10 years ago • 2 comments

Hi,

Kudos for this great tool.

The thing is that I have some custom Features mods that I want to reuse between projects. To add custom dependency to project I run:

composer require drupal/my_features_package

Inside my_features_package I have some Features based module + composer.json file. In composer.json file I've added some contrib deps (required by those mods of course), e.g:

   "require": {
        "drupal/ctools": "^3.0",
        "drupal/media_entity": "^1.5",
    }

This is working, I mean those mods are fetched, but in project composer.json file (site/composer.json) I have no info about this mods. Only about my custom package.

Is this possible to configure composer to adding these deps to site/composer.json automatically?

I want to control mods versions per project and have ability to override package composer.json dependencies in project composer.json. But keep ability to download contrib mods automatically upon composer require command.

drupality avatar Nov 30 '16 12:11 drupality

Thats a question that you should ask the composer developers. But as far as I know, there is no way to automatically add dependencies to your root composer.json.

PatrickBauer avatar Nov 30 '16 12:11 PatrickBauer

ok, thanks for the feedback, so I'll move my question.

drupality avatar Nov 30 '16 13:11 drupality