From e270e7e180c3b23a4e27ff9eb2a427abda5a3041 Mon Sep 17 00:00:00 2001 From: Dariusz Rup Date: Fri, 17 Jan 2025 11:20:03 +0100 Subject: [PATCH] OP-312 - redesign cms plugin - update composer.json and packets --- composer.json | 78 ++++++++++++------- tests/Application/Kernel.php | 11 +-- tests/Application/config/bundles.php | 22 +++--- .../Application/config/packages/_sylius.yaml | 4 +- .../config/packages/http_discovery.yaml | 10 +++ .../config/symfony/6.x/bundles.php | 5 ++ 6 files changed, 79 insertions(+), 51 deletions(-) create mode 100644 tests/Application/config/packages/http_discovery.yaml create mode 100644 tests/Application/config/symfony/6.x/bundles.php diff --git a/composer.json b/composer.json index 4d334066..1e2f5f05 100644 --- a/composer.json +++ b/composer.json @@ -9,47 +9,66 @@ "description": "CMS plugin for Sylius applications.", "license": "MIT", "require": { - "php": "^8.1", - "sylius/sylius": "^1.12.0 || ^1.13.0", + "php": "^8.2", + "sylius/sylius": "~2.0", "league/csv": "^9.1", "friendsofsymfony/ckeditor-bundle": "^2.0", - "symfony/webpack-encore-bundle": "^1.12" + "symfony/webpack-encore-bundle": "^2.1", + "sylius/calendar": "^0.5.0", + "sylius/grid-bundle": "^1.13.0", + "sylius/twig-extra": "^0.5", + "sylius/twig-hooks": "^0.5", + "symfony/stimulus-bundle": "^2.12", + "symfony/ux-autocomplete": "^2.17", + "symfony/ux-live-component": "^2.20", + "symfony/ux-twig-component": "^2.20", + "symfony/workflow": "^7.2", + "willdurand/hateoas-bundle": "2.5.0" }, "require-dev": { - "behat/behat": "^3.7", - "behat/mink-selenium2-driver": "~1.6.0", + "behat/behat": "^3.14", + "behat/mink-selenium2-driver": "1.6", + "bitbag/coding-standard": "^3.0.0", + "dmore/behat-chrome-extension": "^1.4", + "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.1", + "friends-of-behat/symfony-extension": "^2.6", + "friends-of-behat/variadic-extension": "^1.6", + "gedmo/doctrine-extensions": "^3.9", + "lchrusciel/api-test-case": "^4.1 || ^5.0", + "league/flysystem-bundle": "^3.3", + "nelmio/alice": "^3.10", + "nyholm/psr7": "^1.8", + "phpspec/phpspec": "^7.0", + "phpunit/phpunit": "^9.5", + "polishsymfonycommunity/symfony-mocker-container": "^1.0", + "robertfausk/behat-panther-extension": "^1.1", + "sylius-labs/coding-standard": "^4.4", + "sylius-labs/suite-tags-extension": "~0.2", + "sylius/mailer-bundle": "^1.8 || ^2.0@beta", + "sylius/sylius-rector": "^2.0", + "symfony/browser-kit": "^6.4 || ^7.1", + "symfony/debug-bundle": "^6.4 || ^7.1", + "symfony/dependency-injection": "^6.4 || ^7.1", + "symfony/dotenv": "^6.4 || ^7.1", + "symfony/http-client": "^6.4 || ^7.1", + "symfony/intl": "^6.4 || ^7.1", + "symfony/web-profiler-bundle": "^6.4 || ^7.1", + "symfony/profiler-pack": "^1.0", "dbrekelmans/bdi": "^1.1", - "bitbag/coding-standard": "^3.0", - "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", "instaclick/php-webdriver": "^1.4", - "lchrusciel/api-test-case": "^4.1 || ^5.0", "matthiasnoback/symfony-config-test": "^5.1", - "phpspec/phpspec": "^7.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.8.1", "phpstan/phpstan-doctrine": "^1.3", "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", - "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/intl": "^5.4 || ^6.4", - "symfony/runtime": "^5.4 || ^6.4", - "symfony/web-profiler-bundle": "^5.4 || ^6.4" + "symfony/runtime": "^5.4 || ^6.4" }, "suggest": { "stefandoorn/sitemap-plugin": "^2.2" @@ -73,7 +92,8 @@ "dealerdirect/phpcodesniffer-composer-installer": false, "phpstan/extension-installer": false, "symfony/flex": false, - "symfony/runtime": true + "symfony/runtime": true, + "php-http/discovery": true } }, "extra": { diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index bb9ad982..451beb91 100755 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -58,15 +58,11 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); $container->setParameter('container.dumper.inline_class_loader', true); $confDir = $this->getProjectDir() . '/config'; - $syliusDir = $this->getProjectDir() . '/config/sylius/' . SyliusKernel::MAJOR_VERSION . '.' . SyliusKernel::MINOR_VERSION; $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{packages}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); - if (is_dir($syliusDir)) { - $loader->load($syliusDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); - } $loader->load($confDir . '/{api_resources}/*' . self::CONFIG_EXTS, 'glob'); } @@ -135,11 +131,8 @@ private function registerBundlesFromFile(string $bundlesFile): iterable private function getConfigurationDirectories(): iterable { yield $this->getProjectDir() . '/config'; - $syliusConfigDir = $this->getProjectDir() . '/config/sylius/' . SyliusKernel::MAJOR_VERSION . '.' . SyliusKernel::MINOR_VERSION; - if (is_dir($syliusConfigDir)) { - yield $syliusConfigDir; - } - $symfonyConfigDir = $this->getProjectDir() . '/config/symfony/' . BaseKernel::MAJOR_VERSION . '.' . BaseKernel::MINOR_VERSION; + + $symfonyConfigDir = $this->getProjectDir() . '/config/symfony/' . BaseKernel::MAJOR_VERSION . 'x'; if (is_dir($symfonyConfigDir)) { yield $symfonyConfigDir; } diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index 2de3afe7..acc2f75f 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -3,12 +3,13 @@ declare(strict_types=1); return [ + FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], + Sylius\CmsPlugin\SyliusCmsPlugin::class => ['all' => true], Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true], Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true], Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true], @@ -31,11 +32,6 @@ Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true], Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true], Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], - winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], - Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], - Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true], - JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], - FOS\RestBundle\FOSRestBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], @@ -53,13 +49,19 @@ Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true], - ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Sylius\Behat\Application\SyliusTestPlugin\SyliusTestPlugin::class => ['test' => true, 'test_cached' => true], + ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], - SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], - FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], - Sylius\CmsPlugin\SyliusCmsPlugin::class => ['all' => true], + Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true], + Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], + Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true], + Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true], + Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], + Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true], + Symfony\UX\Icons\UXIconsBundle::class => ['all' => true], + Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true] ]; diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 612c68af..bb9008d4 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -1,10 +1,8 @@ imports: - { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" } - + - { resource: "@SyliusPayumBundle/Resources/config/app/config.yaml" } - { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" } - - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } - - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } - { resource: "../parameters.yaml" } diff --git a/tests/Application/config/packages/http_discovery.yaml b/tests/Application/config/packages/http_discovery.yaml new file mode 100644 index 00000000..8be5f3d8 --- /dev/null +++ b/tests/Application/config/packages/http_discovery.yaml @@ -0,0 +1,10 @@ +services: + Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory' + + http_discovery.psr17_factory: + class: Http\Discovery\Psr17Factory diff --git a/tests/Application/config/symfony/6.x/bundles.php b/tests/Application/config/symfony/6.x/bundles.php new file mode 100644 index 00000000..5c41e0f4 --- /dev/null +++ b/tests/Application/config/symfony/6.x/bundles.php @@ -0,0 +1,5 @@ + ['all' => true], +];