Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This tool helps convert existing Twig components into Drupal's SDC format by automatically generating the necessary configuration files. It analyzes your Twig code and creates `.component.yml` files, then you can review and adjust them for your specific needs.

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
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

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