localgov icon indicating copy to clipboard operation
localgov copied to clipboard

Rationalise dependencies in Localgov profile and the modules

Open andybroomfield opened this issue 2 years ago • 1 comments

Follow on from #624. I noticed on filing that issue that redirect, which is always downloaded when installing localgov is not actully a dependency on the profile but a composer dependency of localgov_core. However I don't see localgov_core or its sub modules enabling redirect. It strikes me as something the profile should offer.

$ composer why drupal/redirect
localgovdrupal/localgov_core 2.12.2 requires drupal/redirect (^1.6) 

We should agree some governance and tidy up of dependencies in modules and profile so they live and are enabled / declared optional in the right places. My preference would be

Profile

  • Composer Require and explicit dependancy on critical modules for the profile to work
  • Composer Require and enable agreed out the box modules
  • Composer Require but do not install optional modules

Modules

  • Composer Require and Explicit dependancy on modules needed for the module to work
  • Composer Suggest for optional modules that enhance functionlity

There is an open question on submodules, sometimes we still place the dependancies in the root composer, and other times we do not.

andybroomfield avatar Sep 08 '23 11:09 andybroomfield

This sounds sensible to me. Makes sense to include and enable Redirect in the profile; I suspect that was just an oversight in initial development.

There is an open question on submodules, sometimes we still place the dependencies in the root composer, and other times we do not.

Generally I think we should include the dependencies of submodules in the root composer.json. This is certainly necessary if the submodule is also enabled. It also provides guidance to whether something should be a submodule or not. If it has dependencies not related to the core module then there's an argument for it being a standalone module.

stephen-cox avatar Sep 20 '23 13:09 stephen-cox