Skip to content

Commit

Permalink
Merge pull request #11 from mad-coders/feature/10
Browse files Browse the repository at this point in the history
[FEATURE] Make it compatible with Sylius 1.12 (resolves #10)
  • Loading branch information
plewandowski authored Apr 5, 2023
2 parents d03c5e9 + 9f17f5b commit 9995fc9
Show file tree
Hide file tree
Showing 74 changed files with 511 additions and 341 deletions.
48 changes: 48 additions & 0 deletions .docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
user www-data;
worker_processes auto;
daemon off;
pid /run/nginx.pid;

include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

server_tokens off;

client_max_body_size 64m;
sendfile on;
tcp_nodelay on;
tcp_nopush on;

gzip_vary on;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

server {
listen 80;

root /app/tests/Application/public;
index index.php;

location / {
try_files $uri /index.php$is_args$args;
}

location ~ \.php$ {
include fastcgi_params;

fastcgi_pass unix:/var/run/php8-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
}
}
5 changes: 5 additions & 0 deletions .docker/php/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[PHP]
memory_limit=512M

[date]
date.timezone=${PHP_DATE_TIMEZONE}
82 changes: 82 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.feature]
indent_style = space
indent_size = 4

[*.js]
indent_style = space
indent_size = 2

[*.json]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.neon]
indent_style = space
indent_size = 4

[*.php]
indent_style = space
indent_size = 4

[*.sh]
indent_style = space
indent_size = 4

[*.{yaml,yml}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[.babelrc]
indent_style = space
indent_size = 2

[.gitmodules]
indent_style = tab
indent_size = 4

[.php_cs{,.dist}]
indent_style = space
indent_size = 4

[composer.json]
indent_style = space
indent_size = 4

[package.json]
indent_style = space
indent_size = 2

[phpspec.yml{,.dist}]
indent_style = space
indent_size = 4

[phpstan.neon]
indent_style = space
indent_size = 4

[phpunit.xml{,.dist}]
indent_style = space
indent_size = 4
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,29 @@
/behat.yml
/phpspec.yml
/phpunit.xml

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem
###< lexik/jwt-authentication-bundle ###
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
phpunit:
vendor/bin/phpunit

phpspec:
vendor/bin/phpspec run --ansi --no-interaction -f dot

phpstan:
vendor/bin/phpstan analyse

psalm:
vendor/bin/psalm

behat-js:
APP_ENV=test vendor/bin/behat --colors --strict --no-interaction -vvv -f progress

install:
composer install --no-interaction --no-scripts

backend:
tests/Application/bin/console sylius:install --no-interaction
tests/Application/bin/console sylius:fixtures:load default --no-interaction

frontend:
(cd tests/Application && yarn install --pure-lockfile)
(cd tests/Application && GULP_ENV=prod yarn build)

behat:
APP_ENV=test vendor/bin/behat --colors --strict --no-interaction -vvv -f progress

dropdb:
tests/Application/bin/console doctrine:database:drop --if-exists --force

createdb:
tests/Application/bin/console doctrine:database:create --if-not-exists

init: createdb install backend frontend

reinit: dropdb init

ci: init phpstan psalm phpunit phpspec behat

integration: init phpunit behate

static: install phpspec phpstan psalm

serve:
(cd tests/Application && APP_ENV=dev symfony serve)
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@

## Requirements
| | Version |
| :--- | :--- |
| PHP | 7.4 | 8.0 |
| Sylius | 1.9, 1.10 |
| :--- |:--------|
| PHP | ^8.0 |
| Sylius | ^1.12 |

For Sylius 1.8 support check [Sylius Size Chart Plugin v1.0.x](https://github.com/mad-coders/sylius-sizechart-plugin/tree/1.0).
## Older releases
- For Sylius 1.8 support check [Sylius Size Chart Plugin v1.0.x](https://github.com/mad-coders/sylius-sizechart-plugin/tree/1.0).
- For Sylius 1.9, 1.10 support check [Sylius Size Chart Plugin v1.1.x](https://github.com/mad-coders/sylius-sizechart-plugin/tree/1.1).

## Screenshots
![store front](./docs/img/size_chart_store_front.png)
Expand Down
29 changes: 0 additions & 29 deletions azure-pipelines.yml

This file was deleted.

60 changes: 35 additions & 25 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"sylius/sylius": "~1.10.0 || ~1.9.0"
"php": "^8.0",
"sylius/sylius": "^1.12",
"sylius/mailer-bundle": "^1.8 || ^2.0@beta",
"symfony/webpack-encore-bundle": "^1.15"
},
"require-dev": {
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"bex/behat-screenshot": "^2.1",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
Expand All @@ -42,39 +43,43 @@
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
"phpspec/phpspec": "^7.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpspec/phpspec": "^7.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "0.12.85",
"phpstan/phpstan-doctrine": "0.12.33",
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpstan/phpstan": "^1.8.1",
"phpstan/phpstan-doctrine": "1.3.16",
"phpstan/phpstan-strict-rules": "^1.3.0",
"phpstan/phpstan-webmozart-assert": "^1.2.0",
"phpunit/phpunit": "^9.5",
"sensiolabs/security-checker": "^6.0",
"sylius-labs/coding-standard": "^4.0",
"symfony/browser-kit": "^4.4 || ^5.2",
"symfony/debug-bundle": "^4.4 || ^5.2",
"symfony/dotenv": "^4.4 || ^5.2",
"symfony/intl": "^4.4 || ^5.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
"vimeo/psalm": "4.7.1"
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"sylius-labs/coding-standard": "^4.2",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/flex": "^2.2.2",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"vimeo/psalm": "4.27.0"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false,
"phpstan/extension-installer": true,
"symfony/flex": true,
"symfony/thanks": true
}
},
"extra": {
"branch-alias": {
"dev-master": "1.10-dev"
}
},
"autoload": {
"psr-4": {
"Madcoders\\SyliusSizechartPlugin\\": "src/",
"Tests\\Madcoders\\SyliusSizechartPlugin\\": "tests/"
"Madcoders\\SyliusSizechartPlugin\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Madcoders\\SyliusSizechartPlugin\\": "tests/"
},
"classmap": [
"tests/Application/Kernel.php"
]
Expand All @@ -88,6 +93,11 @@
],
"post-create-project-cmd": [
"php bin/create_node_symlink.php"
]
],
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
}
}
}
2 changes: 0 additions & 2 deletions easy-coding-standard.yml

This file was deleted.

15 changes: 15 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Option;

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->import('vendor/sylius-labs/coding-standard/ecs.php');

$ecsConfig->parameters()->set(Option::SKIP, [
VisibilityRequiredFixer::class => ['*Spec.php'],
]);
};
1 change: 1 addition & 0 deletions node_modules
Loading

0 comments on commit 9995fc9

Please sign in to comment.