drupal-scaffold
drupal-scaffold copied to clipboard
Test composer install with lock file
I'm not certain this is a bug but when running composer install
for the first time on a project that has drupal-scaffold as a dependency then I would expect that drupal-scaffold by triggered. PluginTest::testComposerInstallAndUpdate confirms that having a composer.json
file on it's on and running composer install
will result in drupal-scaffold automatically being triggered. If, however, you have a composer.lock file present then composer install
isn't sufficient to trigger drupal-scaffold.
I have added a test to prove this. But, it may be the expected behaviour, I'm not sure. If I run composer drupal-scaffold
after composer install
then my code is as I would expect it to be after running composer install
for the first time.
Hi, would say it is the expected behaviour because we recommend that people commit the scaffold to their repository. The goal is to avoid any magic in CI environments which have a lock file but not vendor folder in most cases. drupal-scaffold updates the scaffold files if you update drupal core. You can change the behaviour by simply adding composer drupal-scaffold
to the post install command in your own composer.json
In your README it is a bit unclear for me. You seem to only be recommending committing the scaffold to the repository when using a dev branch of drupal core but we are using a tagged release. We would prefer not to commit any code to our repo that is available from another source.
If you want I could extend this test to cover the expected behaviour and follow up composer install
with composer drupal-scaffold
otherwise feel free to close. I just thought it would be easier to explain my issue with a failing test.
Great work on this project.