Skip to content

Commit fc0d2f1

Browse files
authored
Merge pull request #15 from BitBagCommerce/OP-570-upgrade-to-1.14
OP-570 - Upgrade Sylius to 1.14
2 parents e764554 + e6074fa commit fc0d2f1

File tree

8 files changed

+155
-32
lines changed

8 files changed

+155
-32
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,11 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
php: ["8.0", "8.1", "8.2", "8.3"]
21+
php: ["8.1", "8.2", "8.3"]
2222
symfony: ["^5.4", "^6.4"]
23-
sylius: ["~1.12.0", "~1.13.0"]
23+
sylius: ["~1.14.0"]
2424
node: ["^18.0", "^20.0"]
2525
mysql: ["8.0"]
26-
exclude:
27-
- sylius: "~1.13.0"
28-
php: "8.0"
29-
- symfony: "^6.4"
30-
php: "8.0"
3126

3227
env:
3328
APP_ENV: test
@@ -117,7 +112,7 @@ jobs:
117112

118113
-
119114
name: Cache Yarn
120-
uses: actions/cache@v2
115+
uses: actions/cache@v4
121116
with:
122117
path: ${{ steps.yarn-cache.outputs.dir }}
123118
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ The complete installation guide can be found **[here](doc/installation.md).**
6969

7070
We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.
7171

72-
| Package | Version |
73-
|---------------|-----------------|
74-
| PHP | \>=8.0 |
75-
| sylius/sylius | 1.12.x - 1.13.x |
76-
| MySQL | \>= 5.7 |
77-
| NodeJS | \>= 18.x |
72+
| Package | Version |
73+
|---------------|----------|
74+
| PHP | \>=8.1 |
75+
| sylius/sylius | 1.14.x |
76+
| MySQL | \>= 5.7 |
77+
| NodeJS | \>= 18.x |
7878

7979

8080
---

UPGRADE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# BitBag SyliusDPDPlShippingExportPlugin
2+
3+
----
4+
# UPGRADE FROM v1.13 TO v1.14

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.0",
13+
"php": "^8.1",
14+
"ext-soap": "*",
1415
"bitbag/shipping-export-plugin": "^3.0",
1516
"msztorc/php-dpd-api": "^2.1",
16-
"sylius/sylius": "~1.12.0 || ~1.13.0",
17-
"symfony/webpack-encore-bundle": "^1.17",
18-
"ext-soap": "*"
17+
"sylius/sylius": "~1.14",
18+
"symfony/webpack-encore-bundle": "^1.17"
1919
},
2020
"require-dev": {
2121
"behat/behat": "^3.6.1",
@@ -31,6 +31,7 @@
3131
"friends-of-behat/suite-settings-extension": "^1.0",
3232
"friends-of-behat/symfony-extension": "^2.1",
3333
"friends-of-behat/variadic-extension": "^1.3",
34+
"league/flysystem-bundle": "2.4.0",
3435
"phpspec/phpspec": "^7.0",
3536
"phpstan/extension-installer": "^1.0",
3637
"phpstan/phpstan": "^1.10",
@@ -44,8 +45,8 @@
4445
"symfony/debug-bundle": "^5.4 || ^6.0",
4546
"symfony/dotenv": "^5.4 || ^6.0",
4647
"symfony/intl": "^5.4 || ^6.0",
47-
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
48-
"league/flysystem-bundle": "2.4.0"
48+
"symfony/profiler-pack": "^1.0",
49+
"symfony/web-profiler-bundle": "^5.4 || ^6.0"
4950
},
5051
"conflict": {
5152
"sylius/resource-bundle": "1.9.1 || 1.9.0",

doc/installation.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ ADDITIONAL
1313
## Requirements:
1414
We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.
1515

16-
| Package | Version |
17-
|---------------|-----------------|
18-
| PHP | \>=8.0 |
19-
| sylius/sylius | 1.12.x - 1.13.x |
20-
| MySQL | \>= 5.7 |
21-
| NodeJS | \>= 18.x |
16+
| Package | Version |
17+
|---------------|----------|
18+
| PHP | \>=8.1 |
19+
| sylius/sylius | 1.14.x |
20+
| MySQL | \>= 5.7 |
21+
| NodeJS | \>= 18.x |
2222

2323
## Composer:
2424
```bash
25-
composer require bitbag/dpd-pl-shipping-export-plugin
25+
composer require bitbag/dpd-pl-shipping-export-plugin --no-scripts
2626
```
2727

2828
## Basic configuration:
@@ -57,10 +57,6 @@ bitbag_shipping_export_plugin:
5757
```
5858

5959
### Update your database
60-
First, please run legacy-versioned migrations by using command:
61-
```bash
62-
bin/console doctrine:migrations:migrate
63-
```
6460

6561
After migration, please create a new diff migration and update database:
6662
```bash

tests/Application/config/bundles.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@
6767
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
6868
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
6969
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
70+
Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true],
7071
];
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
framework:
2-
profiler: { only_exceptions: false }
2+
profiler:
3+
enabled: true
4+
collect: true
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
security:
2+
enable_authenticator_manager: true
3+
providers:
4+
sylius_admin_user_provider:
5+
id: sylius.admin_user_provider.email_or_name_based
6+
sylius_api_admin_user_provider:
7+
id: sylius.admin_user_provider.email_or_name_based
8+
sylius_shop_user_provider:
9+
id: sylius.shop_user_provider.email_or_name_based
10+
sylius_api_shop_user_provider:
11+
id: sylius.shop_user_provider.email_or_name_based
12+
13+
password_hashers:
14+
Sylius\Component\User\Model\UserInterface: argon2i
15+
firewalls:
16+
admin:
17+
switch_user: true
18+
context: admin
19+
pattern: "%sylius.security.admin_regex%"
20+
provider: sylius_admin_user_provider
21+
form_login:
22+
provider: sylius_admin_user_provider
23+
login_path: sylius_admin_login
24+
check_path: sylius_admin_login_check
25+
failure_path: sylius_admin_login
26+
default_target_path: sylius_admin_dashboard
27+
use_forward: false
28+
use_referer: true
29+
enable_csrf: true
30+
csrf_parameter: _csrf_admin_security_token
31+
csrf_token_id: admin_authenticate
32+
remember_me:
33+
secret: "%env(APP_SECRET)%"
34+
path: "/%sylius_admin.path_name%"
35+
name: APP_ADMIN_REMEMBER_ME
36+
lifetime: 31536000
37+
remember_me_parameter: _remember_me
38+
logout:
39+
path: sylius_admin_logout
40+
target: sylius_admin_login
41+
42+
new_api_admin_user:
43+
pattern: "%sylius.security.new_api_admin_regex%/.*"
44+
provider: sylius_api_admin_user_provider
45+
stateless: true
46+
entry_point: jwt
47+
json_login:
48+
check_path: "%sylius.security.new_api_admin_route%/authentication-token"
49+
username_path: email
50+
password_path: password
51+
success_handler: lexik_jwt_authentication.handler.authentication_success
52+
failure_handler: lexik_jwt_authentication.handler.authentication_failure
53+
jwt: true
54+
55+
new_api_shop_user:
56+
pattern: "%sylius.security.new_api_shop_regex%/.*"
57+
provider: sylius_api_shop_user_provider
58+
stateless: true
59+
entry_point: jwt
60+
json_login:
61+
check_path: "%sylius.security.new_api_shop_route%/authentication-token"
62+
username_path: email
63+
password_path: password
64+
success_handler: lexik_jwt_authentication.handler.authentication_success
65+
failure_handler: lexik_jwt_authentication.handler.authentication_failure
66+
jwt: true
67+
68+
shop:
69+
switch_user: { role: ROLE_ALLOWED_TO_SWITCH }
70+
context: shop
71+
pattern: "%sylius.security.shop_regex%"
72+
provider: sylius_shop_user_provider
73+
form_login:
74+
success_handler: sylius.authentication.success_handler
75+
failure_handler: sylius.authentication.failure_handler
76+
provider: sylius_shop_user_provider
77+
login_path: sylius_shop_login
78+
check_path: sylius_shop_login_check
79+
failure_path: sylius_shop_login
80+
default_target_path: sylius_shop_homepage
81+
use_forward: false
82+
use_referer: true
83+
enable_csrf: true
84+
csrf_parameter: _csrf_shop_security_token
85+
csrf_token_id: shop_authenticate
86+
remember_me:
87+
secret: "%env(APP_SECRET)%"
88+
name: APP_SHOP_REMEMBER_ME
89+
lifetime: 31536000
90+
remember_me_parameter: _remember_me
91+
logout:
92+
path: sylius_shop_logout
93+
target: sylius_shop_homepage
94+
invalidate_session: false
95+
96+
dev:
97+
pattern: ^/(_(profiler|wdt)|css|images|js)/
98+
security: false
99+
100+
image_resolver:
101+
pattern: ^/media/cache/resolve
102+
security: false
103+
104+
access_control:
105+
- { path: "%sylius.security.admin_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] }
106+
- { path: "%sylius.security.admin_regex%/_partial", role: ROLE_NO_ACCESS }
107+
- { path: "%sylius.security.shop_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] }
108+
- { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS }
109+
110+
- { path: "%sylius.security.admin_regex%/login", role: PUBLIC_ACCESS }
111+
- { path: "%sylius.security.shop_regex%/login", role: PUBLIC_ACCESS }
112+
113+
- { path: "%sylius.security.shop_regex%/register", role: PUBLIC_ACCESS }
114+
- { path: "%sylius.security.shop_regex%/verify", role: PUBLIC_ACCESS }
115+
116+
- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
117+
- { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }
118+
119+
- { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS }
120+
- { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS }
121+
- { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS }
122+
- { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER }
123+
- { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS }
124+
- { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS }

0 commit comments

Comments
 (0)