stefandoorn / SyliusUpgradePlugin

This plugin helps you to upgrade your Sylius app to a new version.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrade Plugin

This plugin helps you to upgrade your Sylius app to a new version.

Build Status

Table of Contents

Requirements

  • PHP ^7.4 || ^8.0
  • Sylius ^1.9 || ^1.10 || ^1.11

Installation

  1. Run composer require --dev webgriffe/sylius-upgrade-plugin ^0.3.0

  2. 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 has 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

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®.

About

This plugin helps you to upgrade your Sylius app to a new version.


Languages

Language:PHP 89.4%Language:JavaScript 6.1%Language:Shell 4.0%Language:Twig 0.5%