wunderio/lando-drupal

Split the base file to extensions eg lando-drupal-node

Closed this issue · 4 comments

Sometimes project does not need Node but currently it's installed. It adds extra overhead plus it currently gives error because package.json is missing and it tries to run npm install.

Could we do something like this:

  1. Move node to separate repository
  2. Create bare minimum .lando.node.yml file
  3. Merge the .lando.node.yml to .lando.base.yml with:
    yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' file1.yml file2.yml > merged.yml

More info at:
Node extension repo https://github.com/wunderio/lando-drupal-node
Issue at Node extension https://github.com/wunderio/lando-drupal-node/issues

Requirements

  1. It has be fairly easy to use
  2. It has to work right away after you clone your project and start lando - can't figure out how to do it so that .lando.base.yml and .lando/core would not be committed to code. So I guess we need to update readme on this.

Currently implemented features

lando load-wunderio-lando-drupal-extensions node
lando unload-wunderio-lando-drupal-extensions node

List of implemented extensions:
node

I had chat with Fede and he proposed those plugins could be part of this projects.. eg in extensions or plugins folder. He proposed bash script with prompt that will build the base file. I'm also thinking of adding some new parameter to .lando.yml file that installs those.

Plan is to add extensions like node by adding this to .lando.yml

wunderio:
  extensions:
    - node
    - another_thing

And then running lando rebuild that will compile our custom node setup from vendor/wunderio/lando-drupal/extensions folder and merge the changes with yw tool to .lando.base.yml

I think there's still issue that you can't

git clone your-project
lando start

If you do that you'll get the bare minimum .lando.yml setup you have. We should add 1 more essential bit to your local .lando.yml - some check that if .lando-base.yml is missing, it'll download it.

I don't see any other way to keep the steps to 2 - clone and lando start than to commit .lando.base.yml and update it together with composer updates. We can still keep the .lando/core updating ignored.