ddev / ddev-drupal-contrib

DDEV integration for developing Drupal contrib projects
Apache License 2.0
62 stars 11 forks source link

Module machine name is not a valid project name #20

Closed mbomb007 closed 5 months ago

mbomb007 commented 5 months ago

The README says to run ddev config --project-name=[contrib module] --project-type=drupal10 --docroot=web --create-docroot --php-version=8.1. However, contrib modules often have underscores in the machine name, and that makes them invalid project names.

Example error:

Project name (ip_consumer_auth): 
ip_consumer_auth is not a valid project name. Please enter a project name in your configuration that will allow for a valid hostname. See https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames for valid hostname requirements

Could the documentation be improved, or could a wrapper be used that will automatically replace underscores with hyphens? Maybe that could be done in DDEV itself?

Also, as a suggestion, it would be nice if, when getting set up with a contrib project, if a .gitignore file could also be created that excludes the vendor and web folders and the .editorconfig and .gitattributes files. Maybe an optional line for excluding .ddev/ as well.

rfay commented 5 months ago

DDEV requires no underscores because internet hostnames don't allow underscores.

weitzman commented 5 months ago

Added doc. .gitignore generation is out of scope.

gitressa commented 5 months ago

If it does not have to be dashes, maybe include removing underscores as well, as an option?

Now

If your module has underscores in its name, replace them with hyphens.

Better?

Remove underscores in the module name, or replace with hyphens.

@mbomb007: Great idea with a .gitignore file, I created #25.