Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static plugins improvement #4990

Conversation

raffaelecarelle
Copy link
Contributor

1. Why is this change necessary?

Easiest scafolding for project related plugin

2. What does this change do, exactly?

  • Allow PluginCreateCommand.php to create static plugins
  • Allow ThemeCreateCommand.php to create static themes

5. Checklist

  • I have rebased my changes to remove merge conflicts
  • I have written tests and verified that they fail without my change
  • I have created a changelog file with all necessary information about my changes
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfill them.

@raffaelecarelle raffaelecarelle requested a review from a team as a code owner October 6, 2024 13:10
Copy link

github-actions bot commented Oct 6, 2024

Warnings
⚠️ The Pull Request doesn't contain any changelog file

@raffaelecarelle
Copy link
Contributor Author

@shyim then...why not considering to include "custom/static-plugins" directory in PluginFinder and KernelPluginLoader?

Or it just do within another way?

@raffaelecarelle raffaelecarelle force-pushed the static-plugins-improvement branch from 59f51c3 to fe55835 Compare October 6, 2024 15:46
@shyim
Copy link
Member

shyim commented Oct 6, 2024

@raffaelecarelle static-plugins are intended to be loaded by Composer. Therefore, they are not considered manually

@raffaelecarelle
Copy link
Contributor Author

@raffaelecarelle static-plugins are intended to be loaded by Composer. Therefore, they are not considered manually

as I thought...But I think this change it would help anyway to create plugins or themes easier :)

feedback are welcome. thankyou!

@aragon999
Copy link
Contributor

As the static-plugins need the same structure as normal plugins, I guess this is useful. Although it might in general be better to work with (Symfony-)bundles, or directly in the src folder, but then the whole static-plugins should be removed altogether.

So I think as long as the static-plugins are present it might be reasonable to create "static plugins/themes" using the commands.

src/Core/Framework/Plugin/Command/PluginCreateCommand.php Outdated Show resolved Hide resolved
@@ -30,13 +30,15 @@ public function __construct(private readonly string $projectDir)
protected function configure(): void
{
$this
->addArgument('theme-name', InputArgument::OPTIONAL, 'Theme name');
->addArgument('theme-name', InputArgument::OPTIONAL, 'Theme name')
->addOption('static', null, null, 'Create Theme in custom/static-plugins folder');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
->addOption('static', null, null, 'Create Theme in custom/static-plugins folder');
->addOption('static', null, null, 'Theme will be created in the static-plugins folder');

@raffaelecarelle
Copy link
Contributor Author

As the static-plugins need the same structure as normal plugins, I guess this is useful. Although it might in general be better to work with (Symfony-)bundles, or directly in the src folder, but then the whole static-plugins should be removed altogether.

So I think as long as the static-plugins are present it might be reasonable to create "static plugins/themes" using the commands.

I think that too. Thank you

@AydinHassan AydinHassan self-assigned this Oct 7, 2024
@AydinHassan AydinHassan added hacktoberfest-accepted PR is accepted by us for Hacktoberfest Core labels Oct 7, 2024
@ghost ghost added the Scheduled label Oct 7, 2024
@AydinHassan
Copy link
Contributor

Thanks for the improvement @raffaelecarelle 🎉

flkasper pushed a commit to flkasper/shopware-shopware that referenced this pull request Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Core hacktoberfest-accepted PR is accepted by us for Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants