raffaelecarelle / shopware-plugin-skeleton-generator
A tool to generate a standardized skeleton structure for developing Shopware plugins, enabling developers to quickly start and streamline the development process.
Installs: 197
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 0
Type:shopware-platform-plugin
pkg:composer/raffaelecarelle/shopware-plugin-skeleton-generator
Requires
- roave/better-reflection: ^6.54
- shopware/administration: ~v6.6.0
- shopware/core: ~v6.6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- frosh/shopware-rector: ^0.5
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0.1
- phpstan/phpstan-phpunit: ^2.0.4
- phpstan/phpstan-strict-rules: ^2.0.3
- phpunit/phpunit: ^11.4.2
- shopwarelabs/phpstan-shopware: ^0.1.3
README
The Shopware Plugin Skeleton Generator is a powerful tool designed to streamline the development process for Shopware plugins. It quickly generates a clean, standardized skeleton structure for your plugin, providing essential files, directories, and configurations. This helps developers save time, maintain best practices, and focus on building custom functionality for Shopware-based eCommerce solutions. Whether you're a beginner or an experienced Shopware developer, this generator is an excellent starting point for your plugin projects.
Installation
This tool is intended to be used as a development dependency in your Shopware project.
-
Require with Composer:
composer require --dev raffaelecarelle/shopware-plugin-skeleton-generator
-
Refresh, Install and Activate the plugin:
bin/console plugin:refresh bin/console plugin:install ShopwarePluginSkeletonGenerator --activate
Usage
Generate a Plugin
The main command is plugin:skeleton:generate. It takes the fully qualified plugin name as an argument and has several options to customize the generated skeleton.
Arguments:
fullyQualifiedPluginName: (Required) The fully qualified class name for your plugin (e.g.,MyVendor\MyPlugin).
Options:
--static: Generate a static plugin.--headless: Generate a plugin compatible with headless projects (omits the Storefront module).--additionalBundle=<name>: Create an additional bundle for specific sections likeStorefront,Administration,Core, etc. Can be used multiple times.--append: Update an existing plugin by adding one or more bundles specified with--additionalBundle.--config: Generate aconfig.xmlfile for the plugin.
Examples
Generate a new basic plugin:
bin/console plugin:skeleton:generate MyVendor\\MyAwesomePlugin
Generate a new static plugin:
bin/console plugin:skeleton:generate MyVendor\\MyStaticPlugin --static
Generate a new headless plugin:
bin/console plugin:skeleton:generate MyVendor\\MyHeadlessPlugin --headless
Generate a plugin with additional bundles:
bin/console plugin:skeleton:generate MyVendor\\MyMultiBundlePlugin --additionalBundle=Core --additionalBundle=Administration
Add new bundles to an existing plugin:
bin/console plugin:skeleton:generate MyVendor\\MyMultiBundlePlugin --append --additionalBundle=Elasticsearch
Generate a plugin with a configuration file:
bin/console plugin:skeleton:generate MyVendor\\MyConfigurablePlugin --config
Development Commands
This project uses Docker and a Makefile to simplify the development workflow.
make setup: Builds the Docker containers and installs Composer dependencies. Run this first.make start: Starts the Docker containers in the background.make sh: Opens a shell (zsh) inside the PHP container.make composer-update: Runscomposer updateinside the container.make pre-commit: Runs all quality checks: Rector, CS-Fixer, PHPStan, and PHPUnit.make rector: Runs Rector to apply automated code refactoring.make cs-fix: Runs PHP-CS-Fixer to fix coding standards.make phpstan: Runs PHPStan for static analysis.make tests: Runs the PHPUnit test suite.