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

Adjust codebase and structure for Sylius 2.0 #438

Merged
merged 4 commits into from
Nov 29, 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: 4 additions & 4 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 All @@ -32,7 +32,7 @@ jobs:

steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4

-
name: Setup PHP
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:

-
name: Upload Behat logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: Behat logs
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor/
/var/
/node_modules/
/composer.lock

Expand Down
9 changes: 0 additions & 9 deletions CONFLICTS.md

This file was deleted.

8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ phpspec:
phpstan:
vendor/bin/phpstan analyse

psalm:
vendor/bin/psalm

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

install:
Expand All @@ -24,9 +21,6 @@ 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

init: install backend frontend

ci: init phpstan psalm phpunit phpspec behat
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ To be able to set up a plugin's database, remember to configure you database cre
- Behat (non-JS scenarios)

```bash
vendor/bin/behat --strict --tags="~@javascript"
vendor/bin/behat --strict --tags="~@javascript&&~@mink:chromedriver"
```

- Behat (JS scenarios)
Expand All @@ -82,16 +82,10 @@ To be able to set up a plugin's database, remember to configure you database cre
4. Run Behat:

```bash
vendor/bin/behat --strict --tags="@javascript"
vendor/bin/behat --strict --tags="@javascript,@mink:chromedriver"
```

- Static Analysis

- Psalm

```bash
vendor/bin/psalm
```

- PHPStan

Expand Down
122 changes: 0 additions & 122 deletions UPGRADE.md

This file was deleted.

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';
File renamed without changes.
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
64 changes: 30 additions & 34 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,55 @@
],
"license": "MIT",
"require": {
"php": "^8.1",
"sylius/sylius": "~1.13.0",
"symfony/webpack-encore-bundle": "^1.15"
"php": "^8.2",
"sylius/sylius": "~2.0.0"
},
"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",
"behat/behat": "^3.16",
"dmore/behat-chrome-extension": "^1.4",
"dmore/chrome-mink-driver": "^2.9",
"friends-of-behat/mink": "^1.11",
"friends-of-behat/mink-browserkit-driver": "^1.6",
"friends-of-behat/mink-debug-extension": "^2.1",
"friends-of-behat/mink-extension": "^2.7",
"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",
"phpspec/phpspec": "^7.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.8.1",
"phpstan/phpstan-doctrine": "1.3.69",
"phpstan/phpstan-strict-rules": "^1.3.0",
"phpstan/phpstan-webmozart-assert": "^1.2.0",
"friends-of-behat/suite-settings-extension": "^1.1",
"friends-of-behat/symfony-extension": "^2.6",
"friends-of-behat/variadic-extension": "^1.6",
"nyholm/psr7": "^1.8",
"phpspec/phpspec": "^7.5",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^10.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"robertfausk/behat-panther-extension": "^1.1",
"sylius-labs/coding-standard": "^4.2",
"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",
"sylius-labs/coding-standard": "^4.4",
"sylius-labs/suite-tags-extension": "~0.2",
"sylius/sylius-rector": "^1.0",
"symfony/browser-kit": "^6.4 || ^7.1",
"symfony/debug-bundle": "^6.4 || ^7.1",
"symfony/dotenv": "^6.4 || ^7.1",
"symfony/flex": "^2.4",
"symfony/intl": "^5.4 || ^6.4",
"symfony/web-profiler-bundle": "^5.4 || ^6.4"
},
"conflict": {
"symfony/framework-bundle": "6.2.8"
"symfony/http-client": "^6.4 || ^7.1",
"symfony/intl": "^6.4 || ^7.1",
"symfony/web-profiler-bundle": "^6.4 || ^7.1",
"symfony/webpack-encore-bundle": "^2.2"
},
"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": "2.0-dev"
},
"symfony": {
"require": "^5.4 || ^6.4"
"require": "^6.4"
GSadee marked this conversation as resolved.
Show resolved Hide resolved
}
},
"autoload": {
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions config/app/twig_hooks/admin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sylius_twig_hooks:
hooks:
'sylius_admin.base#stylesheets':
custom_styles:
template: '@AcmeSyliusExamplePlugin/admin/shared/layout/base/styles.html.twig'
priority: -100

'sylius_admin.base#javascripts':
custom_scripts:
template: '@AcmeSyliusExamplePlugin/admin/shared/layout/base/scripts.html.twig'
priority: -100
20 changes: 20 additions & 0 deletions config/app/twig_hooks/shop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sylius_twig_hooks:
hooks:
'sylius_shop.base#stylesheets':
custom_styles:
template: '@AcmeSyliusExamplePlugin/shop/shared/layout/base/styles.html.twig'
priority: -100

'sylius_shop.base#javascripts':
custom_scripts:
template: '@AcmeSyliusExamplePlugin/shop/shared/layout/base/scripts.html.twig'
priority: -100

'app_shop.greeting.dynamic':
content:
template: '@AcmeSyliusExamplePlugin/shop/greeting/dynamic/content.html.twig'
priority: 0
'app_shop.greeting.static':
content:
template: '@AcmeSyliusExamplePlugin/shop/greeting/static/content.html.twig'
priority: 0
2 changes: 2 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: "app/twig_hooks/**/*.yaml" }
10 changes: 9 additions & 1 deletion config/services.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<container
xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
Comment on lines +4 to +6
Copy link
Member

Choose a reason for hiding this comment

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

Wrong indentation

>
<imports>
<import resource="services/**" />
</imports>

<services>
<service id="Acme\SyliusExamplePlugin\Controller\GreetingController" autowire="true" autoconfigure="true" public="true" />
<!-- Put your services here -->
Expand Down
File renamed without changes.
File renamed without changes.
Loading