mediacurrent / theme_generator_8

Yeoman generator for Drupal Themes - lets you quickly set up a Drupal 8 theme with sensible defaults and best practices.
MIT License
100 stars 25 forks source link

Evaluating Generator Foundation - Possibly moving away from Yeoman #113

Closed rlahoda closed 2 years ago

rlahoda commented 3 years ago

The current setup in the Theme Generator uses Yeoman for putting together the final theme. This issue is to discuss the possibility of replacing Yeoman with another technology option.

Challenges With Yeoman

Yeoman is a powerful scaffolding tool that can be used to create deep, complex sites and structures. There are a lot of features and capabilities within the tool that are not being utilized because they're outside of the needs of the Theme Generator. The software is not something that is commonly used or known within Mediacurrent which results in a significant knowledge gap when maintaining the generator. There are significant breaking updates to Yeoman that should be implemented, but would require a much deeper knowledge of the package to be able to implement.

Functional Needs of the Theme Generator

To my knowledge, the process for running the Theme Generator results in the following flow:

  1. Initiate the generator run command
  2. npm install is run on generator-required packages
  3. Choose a name for the generated theme
  4. Choose a description for the theme
  5. Choose which optional components will be installed
  6. The directory structure is created
  7. The appropriate files/folders are inserted into their locations based on what was selected
  8. Import statements and theme required files are renamed based on theme machine name
  9. npm install is run on theme-required packages
  10. Generator files are cleaned up as needed

What Does Yeoman Provide?

In the list of what happens listed above, many of the actions happening are fairly straightforward:

It would appear that only a few actual things are happening that Yeoman provides outside of what could be accomplished from simply cloning a repository:

Alternatives

As of now I haven't had time to research alternatives specifically. However, the functionality of replacing placeholder text and renaming the files are both possible with simple task runners such as Gulp, which is already in use throughout the organization. Having to run npm install as a part of the process doesn't seem like a significant request of whoever is running the generator.

Requirements

Any replacement solution would need to, at minimum:

mariohernandez commented 3 years ago

Hey @rlahoda thanks for providing context on this. At this time I think we should keep things as they are. In addition to creating the theme Yeoman also provides the ability to create new components which not only creates the respective directory and files, but it also creates Drupal libraries and attach them to the components.

I don't thing the current workflow is perfect but since we have no immediate need to replace it nor we have another solution to replace it with, we can close this issue and keep an eye to see if something better emerges in the future. I appreciate the initiative on trying to improve our current workflow.