Skip to content
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
32 changes: 32 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
**/*.log
**/*.md
**/*.php~
**/._*
**/.dockerignore
**/.DS_Store
**/.git/
**/.gitattributes
**/.github
**/.gitignore
**/.gitkeep
**/.gitmodules
**/.idea
**/Dockerfile
**/Thumbs.db
**/docker-compose*.yaml
**/docker-compose*.yml
.editorconfig
.php_cs.cache
.travis.yml
composer.phar
docker/mysql/data/
etc/build/*
node_modules/
var/*
vendor/
public/assets/
public/build/
public/bundles/
public/css/
public/js/
public/media/
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.1", "8.2", "8.3"]
symfony: ["5.4.*", "6.4.*"]
php: ["8.2", "8.3"]
symfony: ["^6.4", "^7.1"]
node: ["20.x"]
mysql: ["8.0"]

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor/
/var/
/node_modules/
/composer.lock

Expand All @@ -11,6 +12,7 @@
/behat.yml
/phpspec.yml
/phpunit.xml
/compose.override.yml
.phpunit.result.cache

# Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project
Expand Down
67 changes: 67 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.PHONY: run

DOCKER_COMPOSE ?= docker compose
DOCKER_USER ?= "$(shell id -u):$(shell id -g)"
ENV ?= "dev"

init:
@make -s docker-compose-check
@if [ ! -e compose.override.yml ]; then \
cp compose.override.dist.yml compose.override.yml; \
fi
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php composer install --no-interaction --no-scripts --no-plugins
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm nodejs
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) up -d

run:
@make -s up

debug:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) -f compose.yml -f compose.override.yml -f compose.debug.yml up -d

up:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) up -d

down:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) down

clean:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) down -v

php-shell:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) exec php sh

node-shell:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm -i nodejs sh

node-watch:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm -i nodejs "npm run watch"

docker-compose-check:
@$(DOCKER_COMPOSE) version >/dev/null 2>&1 || (echo "Please install docker compose binary or set DOCKER_COMPOSE=\"docker-compose\" for legacy binary" && exit 1)
@echo "You are using \"$(DOCKER_COMPOSE)\" binary"
@echo "Current version is \"$$($(DOCKER_COMPOSE) version)\""

database-init:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:database:create -n --if-not-exists
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:migrations:migrate -n

database-reset:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:database:drop -n --force --if-exists
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:database:create -n
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:migrations:migrate -n

load-fixtures:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console sylius:fixtures:load -n

phpstan:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/phpstan analyse -c phpstan.neon

ecs:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/ecs check src

phpunit:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/phpunit

behat:
@ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/behat
File renamed without changes.
1 change: 1 addition & 0 deletions assets/shop/entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './js/greetings';
3 changes: 3 additions & 0 deletions assets/shop/js/greetings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setTimeout(function () {
document.getElementById('greeting').innerHTML = document.getElementById('greeting').dataset.greeting;
}, 1000);
2 changes: 2 additions & 0 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ default:
validate_certificate: false
panther:
panther:
options:
webServerDir: '%paths.base%/tests/Application/public'
manager_options:
connection_timeout_in_ms: 5000
request_timeout_in_ms: 120000
Expand Down
2 changes: 1 addition & 1 deletion bin/create_node_symlink.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
exec(sprintf('mklink /J %s %s 2> NUL', NODE_MODULES_FOLDER_NAME, PATH_TO_NODE_MODULES), $output, $returnCode);
$success = $returnCode === 0;
if (!$success) {
echo '> Failed o create the required symlink' . PHP_EOL;
echo '> Failed o create the required symlink' . PHP_EOL;
exit(2);
}
}
Expand Down
72 changes: 72 additions & 0 deletions compose.override.dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
services:
php:
image: ghcr.io/sylius/sylius-php:8.3-fixuid-xdebug-alpine
user: ${DOCKER_USER:-1000:1000}
depends_on:
mysql:
condition: service_healthy
environment:
# You can move these environment variables to your .env.local file
APP_ENV: ${ENV:-prod}
APP_SECRET: EDITME
DATABASE_URL: "mysql://root@mysql/sylius_%kernel.environment%"
MAILER_DSN: smtp://mailhog:1025
MESSENGER_TRANSPORT_DSN: doctrine://default
SYLIUS_MESSENGER_TRANSPORT_MAIN_DSN: doctrine://default
SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN: doctrine://default?queue_name=main_failed
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN: doctrine://default?queue_name=catalog_promotion_removal
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN: doctrine://default?queue_name=catalog_promotion_removal_failed
SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_DSN: sync://
SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_FAILED_DSN: sync://
PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC}
XDEBUG_MODE: debug
XDEBUG_CONFIG: >-
client_host=host.docker.internal
client_port=9003
# This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
# Then PHPStorm will use the corresponding path mappings
PHP_IDE_CONFIG: serverName=sylius
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- .:/srv/sylius:rw,cached
# if you develop on Linux, you may use a bind-mounted host directory instead
# - ./var:/srv/sylius/var:rw
- ./public:/srv/sylius/public:rw,delegated
# if you develop on Linux, you may use a bind-mounted host directory instead
# - ./public/media:/srv/sylius/public/media:rw
- public-media:/srv/sylius/public/media:rw
mysql:
volumes:
- mysql-data:/var/lib/mysql:rw
ports:
- "3306:3306"
nginx:
environment:
WORKING_DIR: /srv/sylius/tests/Application
volumes:
- .:/srv/sylius:ro
# if you develop on Linux, you may use a bind-mounted host directory instead
# - ./public/media:/srv/sylius/public/media:ro
ports:
- "80:80"
nodejs:
image: node:${NODE_VERSION:-20}-alpine
user: ${DOCKER_USER:-1000:1000}
working_dir: /srv/sylius
entrypoint: [ "/bin/sh","-c" ]
command:
- |
cd tests/Application
yarn install
yarn build
volumes:
- .:/srv/sylius:rw,cached
- ./public:/srv/sylius/public:rw,delegated
mailhog:
ports:
- "8025:8025"

volumes:
mysql-data:
public-media:
22 changes: 22 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
services:
php:
image: ghcr.io/sylius/sylius-php:8.3-alpine
mysql:
image: mysql:8.4
platform: linux/amd64
healthcheck:
test: '/usr/bin/mysql --execute "SHOW databases;"'
timeout: 3s
interval: 1s
retries: 10
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
cap_add:
- SYS_NICE # prevent "mbind: Operation not permitted" errors
nginx:
image: ghcr.io/sylius/sylius-nginx:latest
depends_on:
- php
mailhog:
# do not use in production!
image: mailhog/mailhog:latest
76 changes: 39 additions & 37 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,60 @@
],
"license": "MIT",
"require": {
"php": "^8.0",
"php": "^8.2",
"php-http/message-factory": "^1.1",
"psr/http-factory": "^1.0",
"symfony/webpack-encore-bundle": "^1.15",
"sylius/sylius": "^1.11.2 || ^1.12 || ^1.13",
"webmozart/glob": "^4.3"
"psr/http-factory": "^1.1",
"sylius/sylius": "~2.0.0",
"webmozart/glob": "^4.7"
},
"require-dev": {
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"dbrekelmans/bdi": "^1.1",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-debug-extension": "^2.0.0",
"friends-of-behat/mink-extension": "^2.4",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"mikey179/vfsstream": "^1.6",
"phpspec/phpspec": "^7.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.8.1",
"behat/behat": "^3.19",
"behat/mink-selenium2-driver": "^1.7",
"dbrekelmans/bdi": "^1.4",
"dmore/behat-chrome-extension": "^1.4",
"dmore/chrome-mink-driver": "^2.9.3",
"friends-of-behat/mink": "^1.11",
"friends-of-behat/mink-browserkit-driver": "^1.6.2",
"friends-of-behat/mink-debug-extension": "^2.1.0",
"friends-of-behat/mink-extension": "^2.7.5",
"friends-of-behat/page-object-extension": "^0.3.2",
"friends-of-behat/suite-settings-extension": "^1.1",
"friends-of-behat/symfony-extension": "^2.6",
"friends-of-behat/variadic-extension": "^1.6",
"mikey179/vfsstream": "^1.6.12",
"phpspec/phpspec": "^7.6",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^1.12.25",
"phpstan/phpstan-doctrine": "1.3.69",
"phpstan/phpstan-strict-rules": "^1.3.0",
"phpstan/phpstan-webmozart-assert": "^1.2.0",
"phpunit/phpunit": "^10.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"robertfausk/behat-panther-extension": "^1.1",
"sylius-labs/coding-standard": "^4.2",
"phpstan/phpstan-strict-rules": "^1.6.2",
"phpstan/phpstan-webmozart-assert": "^1.2.11",
"phpunit/phpunit": "^10.5.46",
"polishsymfonycommunity/symfony-mocker-container": "^1.0.8",
"robertfausk/behat-panther-extension": "^1.2",
"slevomat/coding-standard": "~8.22.1",
"squizlabs/php_codesniffer": "^3.0",
"sylius-labs/coding-standard": "^4.4",
"sylius-labs/suite-tags-extension": "^0.2",
"symfony/browser-kit": "^5.4 || ^6.4",
"symfony/debug-bundle": "^5.4 || ^6.4",
"symfony/dotenv": "^5.4 || ^6.4",
"symfony/flex": "^2.4",
"symfony/intl": "^5.4 || ^6.4",
"symfony/web-profiler-bundle": "^5.4 || ^6.4",
"vimeo/psalm": "^5.24"
"symfony/browser-kit": "^6.4 || ^7.1",
"symfony/debug-bundle": "^6.4 || ^7.1",
"symfony/dotenv": "^6.4 || ^7.1",
"symfony/flex": "^2.5",
"symfony/intl": "^6.4 || ^7.1",
"symfony/web-profiler-bundle": "^6.4 || ^7.1",
"vimeo/psalm": "^5.26.1"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false,
"php-http/discovery": false,
"phpstan/extension-installer": true,
"symfony/flex": true
}
},
"extra": {
"branch-alias": {
"dev-master": "1.13-dev"
"dev-master": "1.2.0-dev"
}
},
"autoload": {
Expand Down Expand Up @@ -89,7 +91,7 @@
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
"COMPOSER_AUDIT_ABANDONED=ignore composer audit": "script"
}
}
}
1 change: 0 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

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');
Expand Down
22 changes: 0 additions & 22 deletions package.json

This file was deleted.

Loading