besteadfast / carbon

Steadfast's starter project - Craft CMS, Vite, and DDEV
3 stars 2 forks source link

Figure out when to run `composer install` automatically #54

Open jakedohm opened 7 months ago

jakedohm commented 7 months ago

We currently have this issue a lot.

CleanShot 2023-11-07 at 12 17 55@2x

Where someone adds a Composer or NPM dependency to the project, and then someone else pulls down their work and is missing that dependency.

This goes hand in hand with the issue of when to pull the database, or apply Project Config changes.

Let's discuss!

DrewTJohnson commented 7 months ago

For the dependencies, I'm looking to see if we can include a script that watches the files for changes, then run the composer install command if something has changed.

I'm not sure about the db pull or project config changes.

jakedohm commented 7 months ago

Possible tricky changes:

  1. New project config files
  2. New database
  3. New composer files (json or lock)
  4. New yarn/NPM files (package.json or yarn.lock)

Note: might need to --force apply the project config, because it might be older but still have meaningful changes.

jakedohm commented 7 months ago

Note for anyone: see if someone has a blog post about this

jakedohm commented 5 months ago

Brandon Kelly's recommendation:

Each of your developers should be instructed to pay attention to that, click “Review”, and then click the “Apply changes only” button, before making any additional changes that will affect the project config.

Source: https://github.com/craftcms/cms/issues/7555