Skip to content

Install scaffolded Drupal sites, and suggest the services a project talks to - #89

Merged
geodro merged 4 commits into
mainfrom
feat/suggest-services
Sep 25, 2026
Merged

geodro merged 4 commits into
mainfrom
feat/suggest-services

Conversation

@geodro

@geodro geodro commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

The Drupal definitions now declare an install block, so lerd's setup installs a freshly scaffolded site: it adds drush when it is missing, reads the connection lerd chose from .env and runs site:install. The Install site command runs the same script, which fixes it on every release, since it used to source .env for DB_* keys that newer releases no longer write there and handed drush an empty database URL.

Definitions also gain suggest_services, each entry a preset name and a reason lerd shows beside it. Drupal and TYPO3 offer Solr and Symfony offers Mercure unticked, and 31 new package files, plus Horizon, suggest the service a project talks to when it requires the package, from predis for Redis to Panther for Selenium and search_api_solr for Solr. A package that works with more than one service lists them as alternatives, most important first, and lerd puts forward the one the machine already runs: Redis or Valkey for predis, Horizon, Symfony's Redis transport and Drupal's Redis module, RustFS or LocalStack for the S3 adapter, Elasticsearch or OpenSearch for Drupal's connector.

Both keys are optional, and an older lerd ignores them. The binary side is lerd-env/lerd#1986.

Refs lerd-env/lerd#1985

A Drupal project scaffolded through lerd was not installed afterwards, and the Install site command could not do it either. It sourced .env for DB_DRIVER and friends, which newer releases no longer write there: until the installer has run, the connection lerd picked sits in .env under the settings.php array keys. drush got an empty database URL, and drupal/recommended-project does not ship drush at all, so the command was hidden on a fresh project anyway.

Every Drupal major now declares an install block that lerd's setup offers, ticked, while settings.php is missing. It adds drush when the project lacks it, reads the connection from .env in either key shape, older DB_* or the newer array keys, and runs site:install, with a file database handled on its own since it has no host or credentials. The Install site command runs the same script, in the definitions and in the drush package that overrides them.

A binary that predates the install block ignores it and keeps the Install site command, which now works on every release.

Refs lerd-env/lerd#1985
lerd's setup wizard can now offer presets a definition names under suggest_services, unticked when a framework names them and ticked when a package does, since a project requiring the package is using the service.

Drupal 9 to 11 and TYPO3 offer Solr and Symfony offers Mercure, the presets built for them that nothing pointed a project at. The package side covers the clients whose presence says which service a project needs: predis for Redis, the Meilisearch, Typesense, Elasticsearch and OpenSearch clients, the MongoDB driver, php-amqplib for RabbitMQ, pheanstalk for Beanstalkd, the Stripe SDK for stripe-mock, the Gotenberg client, the S3 flysystem adapter for RustFS, the ClickHouse client and the Pusher server for Soketi. Framework packages cover what those clients do not, Horizon, Dusk, Cashier and the Laravel MongoDB and RabbitMQ queue drivers, Symfony's Mercure bundle, Panther, the AMQP, Redis and Beanstalkd transports, Elastica, the MongoDB ODM, the Gotenberg and Meilisearch bundles, the Drupal Redis, Memcache, Elasticsearch and OpenSearch modules alongside search_api_solr, and EXT:solr on TYPO3.

An older lerd ignores the key, so nothing changes there.

Refs lerd-env/lerd#1985
@geodro
geodro requested a review from a team as a code owner September 25, 2026 12:24
Each suggestion is now a name and a reason, which lerd shows beside the suggestion so someone can tell whether it is for them: a project on Stripe's SDK or the S3 adapter may be talking to the hosted service, and the reason says what the local one would stand in for.

Packages that work with more than one service list them as alternatives, most important first, and lerd puts forward the one the machine already runs. predis, Horizon, Symfony's Redis transport and Drupal's Redis module take Redis or Valkey, the S3 adapter takes RustFS or LocalStack, and Drupal's Elasticsearch connector takes Elasticsearch or OpenSearch.

Refs lerd-env/lerd#1985
@geodro
geodro merged commit b968379 into main Sep 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant