Skip to content

Commit

Permalink
Merge pull request #42 from BitBagCommerce/feature/OP-121
Browse files Browse the repository at this point in the history
Sylius 1.12 support
  • Loading branch information
senghe authored Apr 6, 2023
2 parents 2f6ef0d + 6e3ace9 commit efbb3b6
Show file tree
Hide file tree
Showing 46 changed files with 295 additions and 549 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,16 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.4, 7.3, 8.0]
symfony: [^4.4, ^5.2]
sylius: [~1.9.0, ~1.10.0, ~1.11.0]
php: [8.0]
symfony: [^5.4, ^6.0]
sylius: [~1.11.0, ~1.12.0]
node: [14.19]
mysql: [5.7]
mysql: [5.7, 8.0]

exclude:
-
php: 7.3
mysql: 8.0
-
sylius: ~1.9.0
php: 8.0
-
sylius: ~1.10.0
php: 7.3
sylius: ~1.11.0
symfony: ^6.0
-
sylius: ~1.11.0
php: 7.3
Expand Down Expand Up @@ -149,7 +143,7 @@ jobs:
name: Prepare test application assets
run: |
(cd tests/Application && bin/console assets:install public -vvv)
(cd tests/Application && yarn build)
(cd tests/Application && yarn encore dev)
-
name: Prepare test application cache
run: (cd tests/Application && bin/console cache:warmup -vvv)
Expand Down
18 changes: 8 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"description": "Bonus points plugin for Sylius.",
"license": "MIT",
"require": {
"php": "^7.3 || ^8.0",
"sylius/sylius": "~1.9.0 || ~1.10.0 || ~1.11.0"
"php": "^8.0",
"sylius/sylius": "~1.11.0 || ~1.12.0"
},
"require-dev": {
"symfony/webpack-encore-bundle": "^1.14",
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"dmore/behat-chrome-extension": "^1.3",
Expand All @@ -23,7 +24,6 @@
"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": ">2.0.0-alpha.0 ^2.0@dev",
"lakion/mink-debug-extension": "^2.0.0",
"phpspec/phpspec": "^7.0",
"phpstan/extension-installer": "^1.0",
Expand All @@ -32,14 +32,12 @@
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"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.6.4",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"polishsymfonycommunity/symfony-mocker-container": "^1.0"
},
"prefer-stable": true,
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/assets/admin/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './js';
import './scss/main.scss';
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions src/Resources/assets/shop/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './js';
import './scss/main.scss';
import '../../public/admin/app'
Empty file.
Empty file.
11 changes: 6 additions & 5 deletions tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Routing\RouteCollectionBuilder;

final class Kernel extends BaseKernel
Expand Down Expand Up @@ -58,7 +59,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
}
}

protected function configureRoutes(RouteCollectionBuilder $routes): void
protected function configureRoutes(RoutingConfigurator $routes): void
{
foreach ($this->getConfigurationDirectories() as $confDir) {
$this->loadRoutesConfiguration($routes, $confDir);
Expand Down Expand Up @@ -87,11 +88,11 @@ private function loadContainerConfiguration(LoaderInterface $loader, string $con
$loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob');
}

private function loadRoutesConfiguration(RouteCollectionBuilder $routes, string $confDir): void
private function loadRoutesConfiguration(RoutingConfigurator $routes, string $confDir): void
{
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS);
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS);
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS);
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/Application/assets/admin/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'sylius/bundle/AdminBundle/Resources/private/entry';
1 change: 1 addition & 0 deletions tests/Application/assets/shop/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'sylius/bundle/ShopBundle/Resources/private/entry';
2 changes: 1 addition & 1 deletion tests/Application/config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
} else {
// load all the .env files
(new Dotenv(true))->loadEnv(dirname(__DIR__) . '/.env');
(new Dotenv())->loadEnv(dirname(__DIR__) . '/.env');
}

$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
Expand Down
7 changes: 6 additions & 1 deletion tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/

declare(strict_types=1);

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
Expand Down
9 changes: 0 additions & 9 deletions tests/Application/config/packages/security_checker.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Application/config/packages/staging/swiftmailer.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Application/config/packages/test/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
framework:
test: ~
session:
storage_id: session.storage.mock_file
handler_id: ~
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
framework:
test: ~
session:
storage_id: session.storage.mock_file
handler_id: ~
7 changes: 7 additions & 0 deletions tests/Application/config/packages/webpack_encore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
webpack_encore:
output_path: '%kernel.project_dir%/public/build/default'
builds:
shop: '%kernel.project_dir%/public/build/shop'
admin: '%kernel.project_dir%/public/build/admin'
cs_shop: '%kernel.project_dir%/public/build/bitbag/cs/shop'
cs_admin: '%kernel.project_dir%/public/build/bitbag/cs/admin'
2 changes: 1 addition & 1 deletion tests/Application/config/routes/sylius_shop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ sylius_shop_default_locale:
path: /
methods: [GET]
defaults:
_controller: sylius.controller.shop.locale_switch:switchAction
_controller: sylius.controller.shop.locale_switch::switchAction
8 changes: 0 additions & 8 deletions tests/Application/config/sylius/1.10/bundles.php

This file was deleted.

148 changes: 0 additions & 148 deletions tests/Application/config/sylius/1.10/packages/security.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions tests/Application/config/sylius/1.11/bundles.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/

declare(strict_types=1);

return [
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
];
17 changes: 17 additions & 0 deletions tests/Application/config/sylius/1.12/bundles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/

declare(strict_types=1);

return [
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
];
Loading

0 comments on commit efbb3b6

Please sign in to comment.