Skip to content

Commit 826654d

Browse files
committed
Align to Sylius PluginSkeleton 1.12
1 parent 5f8825f commit 826654d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+440
-270
lines changed

.docker/nginx/nginx.conf

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
user www-data;
2+
worker_processes auto;
3+
daemon off;
4+
pid /run/nginx.pid;
5+
6+
include /etc/nginx/modules-enabled/*.conf;
7+
8+
events {
9+
worker_connections 1024;
10+
}
11+
12+
http {
13+
include /etc/nginx/mime.types;
14+
default_type application/octet-stream;
15+
16+
server_tokens off;
17+
18+
client_max_body_size 64m;
19+
sendfile on;
20+
tcp_nodelay on;
21+
tcp_nopush on;
22+
23+
gzip_vary on;
24+
25+
access_log /var/log/nginx/access.log;
26+
error_log /var/log/nginx/error.log;
27+
28+
server {
29+
listen 80;
30+
31+
root /app/tests/Application/public;
32+
index index.php;
33+
34+
location / {
35+
try_files $uri /index.php$is_args$args;
36+
}
37+
38+
location ~ \.php$ {
39+
include fastcgi_params;
40+
41+
fastcgi_pass unix:/var/run/php8-fpm.sock;
42+
fastcgi_split_path_info ^(.+\.php)(/.*)$;
43+
44+
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
45+
fastcgi_param DOCUMENT_ROOT $realpath_root;
46+
}
47+
}
48+
}

.docker/php/php.ini

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[PHP]
2+
memory_limit=512M
3+
4+
[date]
5+
date.timezone=${PHP_DATE_TIMEZONE}

.editorconfig

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
# Change these settings to your own preference
9+
indent_style = space
10+
indent_size = 4
11+
12+
# We recommend you to keep these unchanged
13+
end_of_line = lf
14+
charset = utf-8
15+
trim_trailing_whitespace = true
16+
insert_final_newline = true
17+
18+
[*.feature]
19+
indent_style = space
20+
indent_size = 4
21+
22+
[*.js]
23+
indent_style = space
24+
indent_size = 2
25+
26+
[*.json]
27+
indent_style = space
28+
indent_size = 2
29+
30+
[*.md]
31+
indent_style = space
32+
indent_size = 4
33+
trim_trailing_whitespace = false
34+
35+
[*.neon]
36+
indent_style = space
37+
indent_size = 4
38+
39+
[*.php]
40+
indent_style = space
41+
indent_size = 4
42+
43+
[*.sh]
44+
indent_style = space
45+
indent_size = 4
46+
47+
[*.{yaml,yml}]
48+
indent_style = space
49+
indent_size = 4
50+
trim_trailing_whitespace = false
51+
52+
[.babelrc]
53+
indent_style = space
54+
indent_size = 2
55+
56+
[.gitmodules]
57+
indent_style = tab
58+
indent_size = 4
59+
60+
[.php_cs{,.dist}]
61+
indent_style = space
62+
indent_size = 4
63+
64+
[composer.json]
65+
indent_style = space
66+
indent_size = 4
67+
68+
[package.json]
69+
indent_style = space
70+
indent_size = 2
71+
72+
[phpspec.yml{,.dist}]
73+
indent_style = space
74+
indent_size = 4
75+
76+
[phpstan.neon]
77+
indent_style = space
78+
indent_size = 4
79+
80+
[phpunit.xml{,.dist}]
81+
indent_style = space
82+
indent_size = 4

.github/workflows/build.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ on:
1414

1515
jobs:
1616
tests:
17-
runs-on: ubuntu-18.04
17+
runs-on: ubuntu-latest
1818

1919
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"
2020

2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php: ["8.0"]
25-
symfony: ["5.4.*"]
26-
sylius: ["^1.11.2"]
27-
node: ["14.x"]
28-
mysql: ["8.0"]
24+
php: ["8.0", "8.1"]
25+
symfony: ["5.4.*", "^6.0"]
26+
sylius: ["^1.12"]
27+
node: ["18.x"]
28+
mysql: ["5.7", "8.0"]
2929

3030
env:
3131
APP_ENV: test
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
php-version: "${{ matrix.php }}"
4343
extensions: intl
44-
tools: symfony
44+
tools: flex,symfony
4545
coverage: none
4646

4747
-
@@ -91,11 +91,16 @@ jobs:
9191
restore-keys: |
9292
${{ runner.os }}-php-${{ matrix.php }}-composer-
9393
94+
-
95+
name: Configure global composer
96+
run: |
97+
composer global config --no-plugins allow-plugins.symfony/flex true
98+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.2.2"
99+
94100
-
95101
name: Restrict Symfony version
96102
if: matrix.symfony != ''
97103
run: |
98-
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
99104
composer config extra.symfony.require "${{ matrix.symfony }}"
100105
101106
-
@@ -106,6 +111,8 @@ jobs:
106111
-
107112
name: Install PHP dependencies
108113
run: composer install --no-interaction
114+
env:
115+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
109116

110117
-
111118
name: Get Yarn cache directory
@@ -135,7 +142,7 @@ jobs:
135142
name: Prepare test application assets
136143
run: |
137144
(cd tests/Application && bin/console assets:install public -vvv)
138-
(cd tests/Application && yarn build)
145+
(cd tests/Application && yarn build:prod)
139146
140147
-
141148
name: Prepare test application cache

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/vendor/
22
/node_modules/
33
/composer.lock
4-
.idea/
5-
package-lock.json
64

75
/etc/build/*
86
!/etc/build/.gitignore
@@ -13,3 +11,7 @@ package-lock.json
1311
/behat.yml
1412
/phpspec.yml
1513
/phpunit.xml
14+
15+
# Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project
16+
/.php-version
17+
/php.ini

Makefile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
phpunit:
2+
vendor/bin/phpunit
3+
4+
phpspec:
5+
vendor/bin/phpspec run --ansi --no-interaction -f dot
6+
7+
phpstan:
8+
vendor/bin/phpstan analyse
9+
10+
psalm:
11+
vendor/bin/psalm
12+
13+
behat-js:
14+
APP_ENV=test vendor/bin/behat --colors --strict --no-interaction -vvv -f progress
15+
16+
install:
17+
composer install --no-interaction --no-scripts
18+
19+
backend:
20+
tests/Application/bin/console sylius:install --no-interaction
21+
tests/Application/bin/console sylius:fixtures:load default --no-interaction
22+
23+
frontend:
24+
(cd tests/Application && yarn install --pure-lockfile)
25+
(cd tests/Application && GULP_ENV=prod yarn build)
26+
27+
behat:
28+
APP_ENV=test vendor/bin/behat --colors --strict --no-interaction -vvv -f progress
29+
30+
init: install backend frontend
31+
32+
ci: init phpstan psalm phpunit phpspec behat
33+
34+
integration: init phpunit behat
35+
36+
static: install phpspec phpstan psalm

composer.json

+26-20
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"require": {
1111
"php": "^8.0",
1212
"sandwich/vies-bundle": "^2.1",
13-
"sylius/sylius": "^1.11.2",
13+
"sylius/sylius": "^1.12",
14+
"sylius/mailer-bundle": "^1.8 || ^2.0",
15+
"symfony/webpack-encore-bundle": "^1.15",
1416
"webmozart/assert": "^1.9"
1517
},
1618
"require-dev": {
@@ -26,35 +28,34 @@
2628
"friends-of-behat/suite-settings-extension": "^1.0",
2729
"friends-of-behat/symfony-extension": "^2.1",
2830
"friends-of-behat/variadic-extension": "^1.3",
29-
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
30-
"phpspec/phpspec": "^7.0",
31+
"phpspec/phpspec": "^7.2",
3132
"phpstan/extension-installer": "^1.0",
32-
"phpstan/phpstan": "0.12.99",
33-
"phpstan/phpstan-doctrine": "0.12.33",
34-
"phpstan/phpstan-strict-rules": "^0.12.0",
35-
"phpstan/phpstan-webmozart-assert": "0.12.12",
33+
"phpstan/phpstan": "^1.8.1",
34+
"phpstan/phpstan-doctrine": "1.3.16",
35+
"phpstan/phpstan-strict-rules": "^1.3.0",
36+
"phpstan/phpstan-webmozart-assert": "^1.2.0",
3637
"phpunit/phpunit": "^9.5",
37-
"sensiolabs/security-checker": "^6.0",
38-
"sylius-labs/coding-standard": "^4.0",
39-
"symfony/browser-kit": "^5.4",
40-
"symfony/debug-bundle": "^5.4",
41-
"symfony/dotenv": "^5.4",
42-
"symfony/intl": "^5.4",
43-
"symfony/web-profiler-bundle": "^5.4",
44-
"vimeo/psalm": "4.7.1",
45-
"polishsymfonycommunity/symfony-mocker-container": "^1.0"
38+
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
39+
"sylius-labs/coding-standard": "^4.2",
40+
"symfony/browser-kit": "^5.4 || ^6.0",
41+
"symfony/debug-bundle": "^5.4 || ^6.0",
42+
"symfony/dotenv": "^5.4 || ^6.0",
43+
"symfony/flex": "^2.2.2",
44+
"symfony/intl": "^5.4 || ^6.0",
45+
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
46+
"vimeo/psalm": "4.27.0"
4647
},
4748
"config": {
4849
"sort-packages": true,
4950
"allow-plugins": {
51+
"dealerdirect/phpcodesniffer-composer-installer": false,
5052
"phpstan/extension-installer": true,
51-
"dealerdirect/phpcodesniffer-composer-installer": true,
52-
"symfony/thanks": true
53+
"symfony/flex": true
5354
}
5455
},
5556
"extra": {
5657
"branch-alias": {
57-
"dev-master": "1.11-dev"
58+
"dev-master": "1.12-dev"
5859
}
5960
},
6061
"autoload": {
@@ -80,6 +81,11 @@
8081
],
8182
"post-create-project-cmd": [
8283
"php bin/create_node_symlink.php"
83-
]
84+
],
85+
"auto-scripts": {
86+
"cache:clear": "symfony-cmd",
87+
"assets:install %PUBLIC_DIR%": "symfony-cmd",
88+
"security-checker security:check": "script"
89+
}
8490
}
8591
}

docker-compose.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
services:
2+
app:
3+
image: sylius/standard:1.11-traditional-alpine
4+
environment:
5+
APP_ENV: "dev"
6+
DATABASE_URL: "mysql://root:mysql@mysql/sylius_%kernel.environment%?charset=utf8mb4"
7+
# DATABASE_URL: "pgsql://root:postgres@postgres/sylius_%kernel.environment%?charset=utf8" # When using postgres
8+
PHP_DATE_TIMEZONE: "Europe/Warsaw"
9+
volumes:
10+
- ./:/app:delegated
11+
- ./.docker/php/php.ini:/etc/php8/php.ini:delegated
12+
- ./.docker/nginx/nginx.conf:/etc/nginx/nginx.conf:delegated
13+
ports:
14+
- 80:80
15+
depends_on:
16+
- mysql
17+
networks:
18+
- sylius
19+
20+
mysql:
21+
image: mysql:8.0
22+
platform: linux/amd64
23+
environment:
24+
MYSQL_ROOT_PASSWORD: mysql
25+
ports:
26+
- ${MYSQL_PORT:-3306}:3306
27+
networks:
28+
- sylius
29+
30+
# postgres:
31+
# image: postgres:14-alpine
32+
# environment:
33+
# POSTGRES_USER: root
34+
# POSTGRES_PASSWORD: postgres
35+
# ports:
36+
# - ${POSTGRES_PORT:-5432}:5432
37+
# networks:
38+
# - sylius
39+
40+
networks:
41+
sylius:
42+
driver: bridge

0 commit comments

Comments
 (0)