Prioritise all project composer.json config values over the defaults
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3536151. --> Reported by: [andrewbelcher](https://www.drupal.org/user/655282) Related to !386 !384 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p><a href="https://github.com/ddev/ddev-drupal-contrib">https://github.com/ddev/ddev-drupal-contrib</a> uses <a href="https://git.drupalcode.org/project/gitlab_templates/-/blob/main/scripts/expand_composer_json.php?ref_type=heads"><code>scripts/expand_composer_json.php</code></a> for expanding out the module's <code>composer.json</code> into a project (it is specifically aiming to mirror what's done in CI).</p> <p>When merging, the default comes first, meaning <code>extra.installer-paths</code> is ordered default then project. This means that you cannot override the location of a specific module, as the <code>type:drupal-module</code> definition comes first.</p> <p>This would be helpful in <code>ddev-drupal-contrib</code> as it allows you to have a module pull in other ecosystem modules and have easy access to phpunit, linting etc.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Add a specific module installer location (e.g. add a dependency to <code>web/modules/custom</code>), use <code>expand_composer_json.php</code> and run <code>composer install</code>. The module will be in <code>web/modules/contrib</code>.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>As per the precedent set for <a href="https://git.drupalcode.org/project/gitlab_templates/-/blob/main/scripts/expand_composer_json.php?ref_type=heads#L83"><code>repositories</code></a>, do an explicit merge for installer paths in the opposite order.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Implement it.</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>N/A</p> <h3 id="summary-api-changes">API changes</h3> <p>Change in order, but restores what I think would be expected.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>N/A</p> > Related issue: [Issue #3562253](https://www.drupal.org/node/3562253) > Related issue: [Issue #3564186](https://www.drupal.org/node/3564186)
issue