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

[Maintenance] Configuration Files Reorganization and Changing Their Extensions #460

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 14 additions & 4 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,33 @@
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" }
+ - { resource: '@SyliusRefundPlugin/config/config.yaml' }
```

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.
Expand Down
4 changes: 2 additions & 2 deletions config/app/config.yml → config/config.yaml
Original file line number Diff line number Diff line change
@@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion config/app/integrations.php → config/integrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};
4 changes: 2 additions & 2 deletions config/routing.yml → config/routes.yaml
Original file line number Diff line number Diff line change
@@ -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})?$
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/legacy_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

```yaml
imports:
- { resource: "@SyliusRefundPlugin/config/app/config.yml" }
- { resource: "@SyliusRefundPlugin/config/config.yaml" }
```
1. Import routing:
1. Import routes:

````yaml
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
````yaml
```yaml

sylius_refund:
resource: "@SyliusRefundPlugin/config/routing.yml"
sylius_refund:
resource: "@SyliusRefundPlugin/config/routes.yaml"
````

1. Apply migrations to your database:

```bash
Expand Down
1 change: 0 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
$containerConfigurator->skip([
VisibilityRequiredFixer::class => ['*Spec.php'],
InlineDocCommentDeclarationSniff::class . '.MissingVariable',
'src/Resources/config/**',
'**/var/*',
]);

Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ parameters:
- 'src/DependencyInjection/Configuration.php'

# Test dependencies
- 'tests/Application/app/**.php'
- 'tests/Application/src/**.php'

ignoreErrors:
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/config/packages/sylius_refund.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
imports:
- { resource: "@SyliusRefundPlugin/config/app/config.yml" }
- { resource: "@SyliusRefundPlugin/config/config.yaml" }
2 changes: 1 addition & 1 deletion tests/Application/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sylius_refund:
resource: "@SyliusRefundPlugin/config/routing.yml"
resource: "@SyliusRefundPlugin/config/routes.yaml"
Loading