feat: add create theme flag - #1560
Anne (Ant1gua) wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
| @@ -0,0 +1,22 @@ | |||
| { | |||
| "name": "{{ .ClassName }}", | |||
| "author": "Shopware AG", | |||
There was a problem hiding this comment.
this doesn't look right 👀 , I would expect to be asked about this
| "license": "MIT", | ||
| "require": { | ||
| "shopware/core": "~6.7.0" |
There was a problem hiding this comment.
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", | |||
There was a problem hiding this comment.
the plugin generator used the name as the description, I would suggest staying consistent with that
| }, | ||
| { | ||
| Path: filepath.Join( | ||
| "src/Resources/app/storefront/dist/storefront/js", |
There was a problem hiding this comment.
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? 🤔
There was a problem hiding this comment.
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 🤔
[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:
Createfunction now selects the appropriate scaffolding function (CreatePluginFilesorCreateThemeFiles) based on the extension type, and returns an error for unsupported types [1] [2].themeScaffoldingFiles,CreateThemeFiles, and new stub files for theme scaffolding [1] [2] [3] [4] [5] [6] [7].Testing improvements:
Internal refactoring:
scaffoldData) is extended to include anAssetNamefield for use in theme templates.These changes ensure that extension generation is robust, type-safe, and extensible for future extension types.