localgovdrupal / localgov_project

Project template for Drupal 10 sites built with the LocalGov Drupal distribution.
https://localgovdrupal.org
GNU General Public License v2.0
10 stars 8 forks source link

Making composer install /vendor/bin in the usual place and providing … #143

Closed finnlewis closed 4 months ago

finnlewis commented 9 months ago

…a link for /bin.

finnlewis commented 9 months ago

@gregharvey - recreated your pull request here!

Just discussing this in Merge Monday.

We'll need to make sure that Lando and Ddev still work nicely, so update lines like:

https://github.com/localgovdrupal/localgov_project/blob/3.x/.lando.dist.yml#L79

And/or we add a sym link from /bin to /vendor/bin

@Adnan-cds mentions it is quicker to type when on a server.

@andybroomfield points out that people are unlikely to pull in updates to this repo.

I'll take a look at DDEV and lando and update the pull request as needed.

stephen-cox commented 9 months ago

I have to admit that I'm used to having these things in a bin dir. Now Drush Launcher no longer works, I've started typing the path to drush and vendor/ is another 7 characters to type.

As the composer.json file in this repo is just s starter then people can easily change the bin location to their preference in production installs.

All just my personal preference, but I would vote against this change.

gregharvey commented 9 months ago

At the end of the day I don't really mind, but you're making your project different from all the other composer installed projects, so it will break any standard Drupal CI until whoever is trying to set it up realises what's going on. I find it an odd decision to be deliberately different when there is a standard.

gregharvey commented 9 months ago

PS - @finnlewis thanks for doing that, sorry I dragged my bum!

rupertj commented 9 months ago

@gregharvey I'd argue /vendor/bin isn't a standard, it's just the default. I'm also one of the people who likes to relocate the bin dir to /bin. It's partly from also working on Symfony projects, where the console's at /bin/console by default, but also because every other project I work on at the moment is already set up like that. I think you might find that it's a more popular choice than you think :)

IMO if you want to script drush, you should look for it at /vendor/drush/drush/drush, because that's the one place it's always guaranteed to be.

finnlewis commented 8 months ago

Maybe we can get composer to symlink vendor/bin to bin to cater for both cases?

finnlewis commented 4 months ago

Just updated this pull request, in discussion with @andybroomfield

Acquia require the bin directory to be in vendor/bin, so I think this makes sense to stick with the default.

The symlink from bin to vendor/bin seems to work for drush inside Lando container.

Just testing ddev too.

finnlewis commented 4 months ago

Merged. If the symlink becomes an issue, we can deal with it.