- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs about need for drush section in composer.json are incomplete #5244
Comments
I attempted a fix in #5249. Missing the composer.json bits causes a notice. Use -vvv to see it. Usually the command still works tho. |
Please post again here or open a PR if more edits are needed. |
How is command discovery meant to work in a custom module which isn't installed with Composer and so doesn't have a composer.json file? |
Ah, I do get the warning you mentioned for a custom module:
(But [info] is maybe not strong enough?) Is Drush inspecting /DRUPALROOT/modules/custom/*/composer.json files rather than asking Composer for them? It would be helpful if the docs said this explicitly, as my assumption was that it would go via Composer, to which custom modules are invisible. |
Drush does not support a site that doesnt use Composer. Hasn't for several years. Commands might happen to work for such a module but its not supported. |
I think you've misunderstood me -- the site uses Composer to install Drupal and contrib modules. But we have modules in web/modules/custom/ which are our own custom code. They're not installed with Composer because they're committed to the codebase repo. Some of these modules declare Drush commands. Should they just have a dummy composer.json consisting only of this? --
|
Thats correct. I think a couple more keys are needed for a valid composer.json file. |
I can confirm that the dummy composer as I posted above works for Drush:
has replaced the warning I pasted in my earlier comment. This is not really intuitive -- it's guessable, but as a developer it leaves me thinking 'Is this REALLY the right thing to do here?' It could really do to be documented. |
Drush doesn't complain, and Composer won't ever see it AFAICT, since it's not inside a Composer package. |
Existing document
https://www.drush.org/latest/commands/ says:
What are you attempting to do
Write custom commands
In what way is the existing documentation unclear or incomplete
What should the documentation say instead?
To the best of your ability, explain what additional information would allow you to complete your task. If you already know what the documentation should say, please consider submitting a documentation pull request instead.
The text was updated successfully, but these errors were encountered: