This project is not covered by Drupal’s security advisory policy.
This is an example module, explaining step by step how you can create
your own drush generate command.
Workings with drush 10.x
Do not enable this module in production environment!
Example:
drush generate gnform
BACKGROUND:
---------------------
This module was inspired by Louis Nagtegaal - article and Jacob Rockowitz - module.
As Louis mentioned in his article:
For Drupal site builders, drush is the Swiss army knife that can be used for a wide range of purposes, from simply clearing the cache to updating translations or even installing a complete new site.
In the more recent versions of drush, a command was added that makes drush also interesting for Drupal developers.
This command, generate, makes it easy to generate boilerplate code for modules, plugins, services and much more.
And it is even possible to extend existing custom (or contrib) modules with a generator.
The generate command use chi-teck/drupal-code-generator-library.
What I really like about the Drush Generate command is that it allows you to generate specific templates based on user answers, those questions usually include the machine name of the module you want to add the code to, the machine name of the plugin that is created, which services you want to inject or which routes you want to add, etc...
After some research and due to the lack of documentation on how to create your own drush generate command, I decided to create a custom module explaining in detail how you can generate your custom code using the drush generate feature.
I will use Examples for Developers module as an example.
GOAL
------------
Developers can learn how to generate custom blueprint templates
by experimenting with those examples, and adapt them for their own use.
How can you help?
------------------
I'm glad you asked:
Most of all, we need you to file an issue every time you find an error or ambiguity or something that could be presented better.
* We need additional examples.
* We need reviews, corrections, and improvements to existing code.
* We need improvements in the documentation.
Project information
- Project categories: Developer tools
- Created by baach on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

