Drupal is a registered trademark of Dries Buytaert

twig_to_sdc

No security coverage
View on drupal.org

This codegen tool simplifies the conversion of existing Twig components into SDC compatible components, saving time and reducing manual effort. By analyzing the provided Twig code, the tool automatically generates the .component.yml file, eliminating the need for manual setup entirely.

While the tool streamlines the conversion process, it might not cover every scenario perfectly. Some props or specific cases may need a little extra attention, which is why we recommend reviewing the generated files to ensure everything fits your unique project requirements.

Think of Twig to SDC as a helpful assistant that takes care of the heavy lifting, while you fine-tune the details where needed.

Demo

Usage

  1. Run the Drush command:
    drush twig_to_sdc:generate /path/to/directory
  2. The tool will generate a .component.yml file in the same location as each Twig file.
  3. Review the generated `.component.yml` files, test them in your environment, and adjust them as needed.

Key features

  • AI-Powered annotation
  • Comprehensive twig template parsing
  • Structured .component.yml generation

Activity

Total releases
1
First release
Dec 2024
Latest release
1 year ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Dec 6, 2024