- Merge request !38Issue #3217553: Add drush command for generating subtheme → (Merged) created by abyss
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:51pm 21 June 2023 - 🇺🇦Ukraine abyss
Hi @VladimirAus, I added a command for drush that allows you to generate subthemes with it.
Also, please add to the documentation an example of how to call this command from console.
drush --include="web/themes/contrib/bootstrap5" bootstrap5:subtheme
- 🇮🇳India ravi kant Jaipur
Not sure what is requirement of drush command because An option is available in theme for generate theme.
1. Navigate to /admin/appearance/settings/bootstrap5
2. Fill Subtheme location, Subtheme name and Subtheme machine name in the theme subtheme section and create.This is generating a subtheme very easily and without error.
- Status changed to Needs work
over 1 year ago 1:58pm 4 July 2023 - 🇦🇺Australia VladimirAus Brisbane, Australia
Thanks @Abyss. Good start, but command is not visible. I found few issues:
Commands
folder should be undersrc
. Seeother modules as an example.- Use dependency injection instead of
\Drupal::...
. See fullphpcs
log below. - Update README.
phpcs log
FILE: /Users/tesboss/_PROJECTS/drupal/bootstrap5/Commands/bootstrap5/SubthemeCommands.php --------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE --------------------------------------------------------------------------------------------- 45 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead 45 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead ---------------------------------------------------------------------------------------------
- Status changed to Needs review
about 1 year ago 11:37am 14 October 2023 - 🇺🇦Ukraine abyss
@VladimirAus, sorry for the long answer.
In this case, we can't add dependency injection as there is a problem with it in Drupal at the moment.
Also, it doesn't make sense for us to move Commands under src, since we use autoloader to load the drush command.
You can find more detailed information here:
https://kporras07.com/blog/creating-drush-commands-inside-theme
https://github.com/drush-ops/drush/issues/4685Also updated the description in README.md.
- 🇨🇦Canada optasy
I tested this and I was able to create the B5 Subtheme, I had to run this command for that
drush --include="web/themes/contrib/bootstrap5" bootstrap5:subtheme --subtheme-name="B5 subtheme"
Sadly, the drush B5 command is not available if I don't use the --include option, and I had to clear cache because the new subtheme wasn't available at /admin/appearance right after I ran the drush command.
- 🇺🇦Ukraine abyss
@OPTASY, could you please describe this problem in more detail?
I made a sub theme with the command and without any additional movements after reloading the theme list page, I can see it. - Status changed to RTBC
12 months ago 6:55pm 28 November 2023 - Status changed to Needs work
8 months ago 10:55am 16 March 2024 - 🇦🇺Australia VladimirAus Brisbane, Australia
Structure is not according to Drupal standard:
- Commands should be moved to src folder from
Commands/bootstrap5/SubthemeCommands.php
tosrc/Commands/SubthemeCommands.php
- namespace should be
Drupal\bootstrap5\Commands
instead ofnamespace Drush\Commands\Commands;
- Commands should be moved to src folder from
- 🇦🇺Australia VladimirAus Brisbane, Australia
VladimirAus → changed the visibility of the branch 3.0.x to hidden.
- Status changed to Needs review
8 months ago 1:07pm 16 March 2024 - 🇦🇺Australia VladimirAus Brisbane, Australia
Based on this Drush issue and Drush command generator I update the branch.
- Status changed to RTBC
8 months ago 10:22am 17 March 2024 -
VladimirAus →
committed 480311be on 3.0.x authored by
Abyss →
Issue #3217553 by Abyss, VladimirAus, ravi kant, OPTASY, bobi-mel,...
-
VladimirAus →
committed 480311be on 3.0.x authored by
Abyss →
- Status changed to Fixed
8 months ago 12:20am 22 March 2024 -
VladimirAus →
committed 480311be on 4.0.x authored by
Abyss →
Issue #3217553 by Abyss, VladimirAus, ravi kant, OPTASY, bobi-mel,...
-
VladimirAus →
committed 480311be on 4.0.x authored by
Abyss →
Automatically closed - issue fixed for 2 weeks with no activity.