Skip to content

feat: add create theme flag - #1560

Open
Anne (Ant1gua) wants to merge 1 commit into
feat/extension-createfrom
feat/theme-command
Open

Anne (Ant1gua) wants to merge 1 commit into
feat/extension-createfrom
feat/theme-command

Conversation

@Ant1gua

@Ant1gua Anne (Ant1gua) commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

[Completely AI generated summary]

This pull request adds first-class support for generating both plugin and theme scaffolding for Shopware extensions. It refactors the scaffolding logic to distinguish between plugin and theme types, introduces new theme templates, and ensures the correct files are created for each extension type. The tests are expanded to cover these scenarios, including validation for unsupported types.

Extension type support and scaffolding logic:

  • The Create function now selects the appropriate scaffolding function (CreatePluginFiles or CreateThemeFiles) based on the extension type, and returns an error for unsupported types [1] [2].
  • New functions and templates are added to generate the correct set of files for themes, including themeScaffoldingFiles, CreateThemeFiles, and new stub files for theme scaffolding [1] [2] [3] [4] [5] [6] [7].

Testing improvements:

  • Tests are updated to check that both plugin and theme scaffolding generate the correct files and content, and that unsupported extension types are rejected without creating directories [1] [2] [3].

Internal refactoring:

  • The scaffolding logic is refactored to separate plugin and theme file lists, and the internal data structure (scaffoldData) is extended to include an AssetName field for use in theme templates.

These changes ensure that extension generation is robust, type-safe, and extensible for future extension types.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 29257096-5f16-4709-85ff-a816a588b757

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@@ -0,0 +1,22 @@
{
"name": "{{ .ClassName }}",
"author": "Shopware AG",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look right 👀 , I would expect to be asked about this

Comment on lines +5 to +7
"license": "MIT",
"require": {
"shopware/core": "~6.7.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my previous comments in the parent PR .

Additional note: does a theme not have a version in their composer.json?

@@ -0,0 +1,21 @@
{
"name": "{{ .ComposerName }}",
"description": "Theme skeleton plugin",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the plugin generator used the name as the description, I would suggest staying consistent with that

"description": "{{ .ComposerName }}",

},
{
Path: filepath.Join(
"src/Resources/app/storefront/dist/storefront/js",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: More of a question from my side: is this build asset file really needed? I would expect the developer to run e.g. theme compilation afterwards anyway, so why should we ship an empty build asset? 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just had another idea: does it make sense to put all theme files in a subfolder theme and same for the plugin files? Then we don't have template files named like theme_composer and composer as well as a better overview what scaffolding belongs to which type of extension 🤔

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants