webgriffe / sylius-upgrade-plugin
Helps you upgrade your Sylius app to a new version.
Installs: 80 179
Dependents: 0
Suggesters: 0
Security: 0
Stars: 12
Watchers: 4
Forks: 1
Open Issues: 4
Type:sylius-plugin
Requires
- php: ^8.0
- php-http/message-factory: ^1.1
- psr/http-factory: ^1.0
- sylius/sylius: ^1.11.2 || ^1.12 || ^1.13
- symfony/webpack-encore-bundle: ^1.15
- webmozart/glob: ^4.3
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dbrekelmans/bdi: ^1.1
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- mikey179/vfsstream: ^1.6
- phpspec/phpspec: ^7.2
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^1.8.1
- phpstan/phpstan-doctrine: 1.3.69
- phpstan/phpstan-strict-rules: ^1.3.0
- phpstan/phpstan-webmozart-assert: ^1.2.0
- phpunit/phpunit: ^10.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- robertfausk/behat-panther-extension: ^1.1
- sylius-labs/coding-standard: ^4.2
- sylius-labs/suite-tags-extension: ^0.2
- symfony/browser-kit: ^5.4 || ^6.4
- symfony/debug-bundle: ^5.4 || ^6.4
- symfony/dotenv: ^5.4 || ^6.4
- symfony/flex: ^2.4
- symfony/intl: ^5.4 || ^6.4
- symfony/web-profiler-bundle: ^5.4 || ^6.4
- vimeo/psalm: ^5.24
This package is auto-updated.
Last update: 2024-11-15 15:04:47 UTC
README
Upgrade Plugin
This plugin helps you to upgrade your Sylius app to a new version.
Table of Contents
Requirements
- PHP
^8.0
- Sylius
^1.11.2 || ^1.12 || ^1.13
Installation
-
Run
composer require --dev webgriffe/sylius-upgrade-plugin
-
Add the plugin to the
config/bundles.php
file:Webgriffe\SyliusUpgradePlugin\WebgriffeSyliusUpgradePlugin::class => ['dev' => true, 'test' => true],
Usage
All features are implemented as console commands.
Template changes
bin/console webgriffe:upgrade:template-changes <from-version> <to-version> [--theme=PATH_TO_YOUR_THEME] [--legacy]
Print a list of template files (with extension .html.twig) that changed between two given Sylius versions and that have been overridden in your project: in root "templates" folder and/or in a custom theme.
You have to specify both the versions from and to you want to compute the changes.
There are two optional parameters:
- --theme=PATH_TO_YOUR_THEME, specify the theme folder in which to search for changed files. The path must be relative to the kernel.project_dir of your project. You can specify multiple themes by repeating the --theme parameter, see the related example in the proper section below;
- --legacy, use legacy theme folder structure. From v2.0 of the SyliusThemeBundle the theme folder structure has changed. The old structure has been deprecated and will be removed in v3.0 as stated here.
Examples
-
List of templates that changed between Sylius v1.8.4 and v1.8.8 and that were overridden in your root templates folder:
bin/console webgriffe:upgrade:template-changes v1.8.4 v1.8.8
-
List of templates that changed between Sylius v1.8.8 and v1.9.3 and that were overridden in your root templates folder and/or in your my-website-theme folder:
bin/console webgriffe:upgrade:template-changes v1.8.8 v1.9.3 --theme=themes/my-website-theme
-
Like the previous example, but it computes changes for multiple themes, one of which is in the vendor folder:
bin/console webgriffe:upgrade:template-changes v1.8.8 v1.9.3 --theme=themes/my-website-theme --theme=themes/my-other-theme --theme=vendor/acme/my-vendor-theme
Decorated services changes
bin/console webgriffe:upgrade:service-changes <from-version> <to-version> [--theme=PATH_TO_YOUR_THEME] [--legacy]
Print a list of services that changed between two given Sylius versions and that have been decorated/overridden in your project.
You have to specify both the versions from and to you want to compute the changes.
There are two optional parameters:
- --namespace-prefix=NAMESPACE-PREFIX, the first part of the namespace of your app services, like "App" in "App\Calculator\PriceCalculator". Default: "App".
- --alias-prefix=ALIAS-PREFIX, the first part of the alias of your app services, like "app" in "app.calculator.price". Default: "app".
Examples
-
List of services that changed between Sylius v1.11.0 and v1.13.0 and that were decorated in your project:
bin/console webgriffe:upgrade:service-changes v1.11.0 v1.13.0
-
List of services that changed between Sylius v1.11.0 and v1.13.0 and that were decorated in your project but with custom namespace and alias prefixes:
bin/console webgriffe:upgrade:service-changes v1.11.0 v1.13.0 --namespace-prefix="Webgriffe" --alias-prefix="webgriffe"
Contributing
To contribute to this plugin clone this repository, create a branch for your feature or bugfix, do your changes and then make sure al tests are passing.
```bash
$ (cd tests/Application && yarn install)
$ (cd tests/Application && yarn build)
$ (cd tests/Application && APP_ENV=test bin/console assets:install public)
$ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create)
$ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)
```
To be able to setup a plugin's database, remember to configure you database credentials in tests/Application/.env
and tests/Application/.env.test
.
Running plugin tests
-
PHPUnit
vendor/bin/phpunit
-
PHPSpec
vendor/bin/phpspec run
-
Static Analysis
-
Psalm
vendor/bin/psalm
-
PHPStan
vendor/bin/phpstan analyse
-
-
Coding Standard
vendor/bin/ecs check
License
This plugin is under the MIT license. See the complete license in the LICENSE file.
Credits
Developed by Webgriffe®.