diff --git a/README.md b/README.md index f50a8d76..c1f828d5 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,6 @@ From Administrator's point of view, every Refund request results in creating two bin/console doctrine:migrations:migrate ``` -1. Install assets: - - Add the following line to your `assets/admin/entrypoint.js` file: - - ```js - import '../../vendor/sylius/refund-plugin/assets/entrypoint'; - ``` - 1. Run `yarn encore dev` or `yarn encore production` 1. Default configuration assumes enabled PDF file generator. If you don't want to use that feature change your app configuration: diff --git a/UPGRADE-2.0.md b/UPGRADE-2.0.md index a484046b..24284199 100644 --- a/UPGRADE-2.0.md +++ b/UPGRADE-2.0.md @@ -24,12 +24,21 @@ bin/console doctrine:migrations:migrate --no-interaction ``` -1. The directories structure has been updated to the current Symfony recommendations: +1. As the assets have been reorganized, you need to update the way you import them in your application. + Add the following line to your `assets/admin/entrypoint.js` file: + + ```js + import '../../vendor/sylius/refund-plugin/assets/entrypoint'; + ``` + +1. The structures of the directories have been updated to follow the current Symfony recommendations: + - `@SyliusRefundPlugin/Resources/assets` -> `@SyliusRefundPlugin/assets` - `@SyliusRefundPlugin/Resources/config` -> `@SyliusRefundPlugin/config` - `@SyliusRefundPlugin/Resources/translations` -> `@SyliusRefundPlugin/translations` - `@SyliusRefundPlugin/Resources/views` -> `@SyliusRefundPlugin/templates` You need to adjust the import of configuration file in your end application: + ```diff imports: - - { resource: "@SyliusRefundPlugin/Resources/config/config.yml" } @@ -37,10 +46,11 @@ ``` And the routes configuration paths: + ```diff - sylius_refund: - - resource: "@SyliusRefundPlugin/Resources/config/routing.yml" - + resource: "@SyliusRefundPlugin/config/routing.yml" + sylius_refund: + - resource: "@SyliusRefundPlugin/Resources/config/routing.yml" + + resource: "@SyliusRefundPlugin/config/routes.yaml" ``` Adjust the paths to assets and templates if you are using them. diff --git a/config/app/config.yml b/config/config.yaml similarity index 97% rename from config/app/config.yml rename to config/config.yaml index 2d72c250..e5f52f57 100644 --- a/config/app/config.yml +++ b/config/config.yaml @@ -1,6 +1,6 @@ imports: - - { resource: "@SyliusRefundPlugin/config/app/twig_hooks/**/*.yaml" } - - { resource: "@SyliusRefundPlugin/config/app/integrations.php" } + - { resource: "@SyliusRefundPlugin/config/twig_hooks/**/*.yaml" } + - { resource: "@SyliusRefundPlugin/config/integrations.php" } parameters: sylius_refund.credit_memo_save_path: "%kernel.project_dir%/private/credit_memos/" diff --git a/config/app/integrations.php b/config/integrations.php similarity index 84% rename from config/app/integrations.php rename to config/integrations.php index 8dbdbd2a..bb7116aa 100644 --- a/config/app/integrations.php +++ b/config/integrations.php @@ -8,6 +8,6 @@ return static function (ContainerConfigurator $configurator, ContainerBuilder $container): void { if (class_exists(winzouStateMachineBundle::class)) { - $configurator->import('../integrations/winzou_state_machine.yaml'); + $configurator->import('integrations/winzou_state_machine.yaml'); } }; diff --git a/config/routing.yml b/config/routes.yaml similarity index 57% rename from config/routing.yml rename to config/routes.yaml index 3bb7c2fa..686426c7 100644 --- a/config/routing.yml +++ b/config/routes.yaml @@ -1,9 +1,9 @@ sylius_refund_admin: - resource: "@SyliusRefundPlugin/config/admin_routing.yml" + resource: "@SyliusRefundPlugin/config/routes/admin.yaml" prefix: '/%sylius_admin.path_name%' sylius_refund_shop: - resource: "@SyliusRefundPlugin/config/shop_routing.yml" + resource: "@SyliusRefundPlugin/config/routes/shop.yaml" prefix: /{_locale} requirements: _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ diff --git a/config/admin_routing.yml b/config/routes/admin.yaml similarity index 100% rename from config/admin_routing.yml rename to config/routes/admin.yaml diff --git a/config/shop_routing.yml b/config/routes/shop.yaml similarity index 100% rename from config/shop_routing.yml rename to config/routes/shop.yaml diff --git a/config/app/twig_hooks/admin/credit_memo/show.yaml b/config/twig_hooks/admin/credit_memo/show.yaml similarity index 100% rename from config/app/twig_hooks/admin/credit_memo/show.yaml rename to config/twig_hooks/admin/credit_memo/show.yaml diff --git a/config/app/twig_hooks/admin/order/refund/show.yaml b/config/twig_hooks/admin/order/refund/show.yaml similarity index 100% rename from config/app/twig_hooks/admin/order/refund/show.yaml rename to config/twig_hooks/admin/order/refund/show.yaml diff --git a/config/app/twig_hooks/admin/order/show.yaml b/config/twig_hooks/admin/order/show.yaml similarity index 100% rename from config/app/twig_hooks/admin/order/show.yaml rename to config/twig_hooks/admin/order/show.yaml diff --git a/config/app/twig_hooks/shop/account/order/show.yaml b/config/twig_hooks/shop/account/order/show.yaml similarity index 100% rename from config/app/twig_hooks/shop/account/order/show.yaml rename to config/twig_hooks/shop/account/order/show.yaml diff --git a/docs/legacy_installation.md b/docs/legacy_installation.md index 2a714625..3550afdc 100644 --- a/docs/legacy_installation.md +++ b/docs/legacy_installation.md @@ -19,15 +19,15 @@ ```yaml imports: - - { resource: "@SyliusRefundPlugin/config/app/config.yml" } + - { resource: "@SyliusRefundPlugin/config/config.yaml" } ``` -1. Import routing: +1. Import routes: ````yaml - sylius_refund: - resource: "@SyliusRefundPlugin/config/routing.yml" + sylius_refund: + resource: "@SyliusRefundPlugin/config/routes.yaml" ```` - + 1. Apply migrations to your database: ```bash diff --git a/ecs.php b/ecs.php index 4d179d7a..3fc32f75 100644 --- a/ecs.php +++ b/ecs.php @@ -18,7 +18,6 @@ $containerConfigurator->skip([ VisibilityRequiredFixer::class => ['*Spec.php'], InlineDocCommentDeclarationSniff::class . '.MissingVariable', - 'src/Resources/config/**', '**/var/*', ]); diff --git a/phpstan.neon b/phpstan.neon index cefe88bb..dd1b4c50 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -12,7 +12,6 @@ parameters: - 'src/DependencyInjection/Configuration.php' # Test dependencies - - 'tests/Application/app/**.php' - 'tests/Application/src/**.php' ignoreErrors: diff --git a/tests/Application/config/packages/sylius_refund.yaml b/tests/Application/config/packages/sylius_refund.yaml index ee42ca1f..5107d4fb 100644 --- a/tests/Application/config/packages/sylius_refund.yaml +++ b/tests/Application/config/packages/sylius_refund.yaml @@ -1,2 +1,2 @@ imports: - - { resource: "@SyliusRefundPlugin/config/app/config.yml" } + - { resource: "@SyliusRefundPlugin/config/config.yaml" } diff --git a/tests/Application/config/routes.yaml b/tests/Application/config/routes.yaml index 5a8d73d3..e7ea95e4 100644 --- a/tests/Application/config/routes.yaml +++ b/tests/Application/config/routes.yaml @@ -1,2 +1,2 @@ sylius_refund: - resource: "@SyliusRefundPlugin/config/routing.yml" + resource: "@SyliusRefundPlugin/config/routes.yaml"