drush icon indicating copy to clipboard operation
drush copied to clipboard

Register some core commands in Drush application

Open Chi-teck opened this issue 3 years ago • 2 comments

That would make a bit easier for developers to use them.

Also it would be possible to run those commands from any location within Drupal directory when Drush launcher is installed.

https://git.drupalcode.org/project/drupal/-/tree/9.5.x/core/lib/Drupal/Core/Command

I think the following commands are worth to be registred in Drush.

  1. GenerateTheme
  2. Server
  3. QuickStart
  4. Server

Chi-teck avatar Jul 31 '22 15:07 Chi-teck

I see some value, but I worry about support. Its confusing for feature requests and bug reports to come into Drush project but be unable to act on them. Also the commands are unlikely to be documented as well as native Drush commands.

weitzman avatar Sep 05 '22 04:09 weitzman

Also, you've listed server twice, and thats a dupe of runserver, right?

Quickstart was in drush core for years but got booted as compound commands like that are hard to maintain.

generateTheme overlaps with DCG so lets figure out what to do there.

weitzman avatar Sep 05 '22 04:09 weitzman

The tentative plan is to bring GenerateTheme into Drush but not the others. We will also stop showing DCG generate theme at same time. No timetable on this.

weitzman avatar Nov 10 '22 13:11 weitzman

What do you think about adding some configuration items that would allow users to extend the PSR-4 namespace discovery to include other namespaces? We could default to all classes in the namespace, but allow for an optional filter. We could default to including only GenerateTheme if the config item is not set. I know there is a certain downside to having too much config, but on the flip side, I feel reluctant to hardcode just one core command.

If there is interest in this approach, I'll make a PR.

greg-1-anderson avatar Nov 10 '22 15:11 greg-1-anderson

I dont think enough users would configure it. At that point, just use the command directly (i.e. not via Drush).

weitzman avatar Nov 10 '22 16:11 weitzman

Actually, moving core theme generator under drush generate namespace would be tricky. generate-theme has quite a lot of own options that would become available to all generators if we support them. Also some of them may overlap with global Drush options.

I think it's not worth the effort. I vote for closing this issue.

Chi-teck avatar Nov 11 '22 04:11 Chi-teck

DCG probably needs to drop own "generate theme" command in favor of the one from Drupal core. Closing this for now.

Chi-teck avatar May 23 '23 11:05 Chi-teck