ddev-drupal-contrib
ddev-drupal-contrib copied to clipboard
Could not understand preferred installation method for optional dependencies
Its unclear how to add optional dependencies.
I wanted to test the 'ai' module which has a number of optional dependencies (e.g. 'suggest' in composer.json or other sub-module dependencies enforced by hook_requirements in submodules).
The readme does not make it clear how to do this. I am happy to open a PR to update the readme, but wanted to check if this is the preferred approach:
Once:
- Clone drupal/recommend-project
ddev exec wget https://raw.githubusercontent.com/drupal/recommended-project/refs/heads/11.x/composer.json(or e.g. 10.x) - Remove require-dev drupal/core-dev (since that is already part of install instructions)
ddev composer remove drupal/core-dev
Every time you install an additional optional dependency:
- Install desired modules e.g.
ddev composer require drupal/ai_provider_openai --dev --prefer-source - Run
ddev poser - Remove the dependency on 'self' from the contrib folder so it does not conflict with the symlinked version in the root
ddev exec rm -rf web/modules/contrib/ai
(of course making these commands more generic like PROJECT_NAME to match current docs)