Skip to content

Commit

Permalink
OP-232 - configure plugin skeleton for sulu plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszWojdalowicz committed Feb 8, 2024
1 parent 3ad0d41 commit 9f1ead4
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 371 deletions.
2 changes: 1 addition & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ default:
FriendsOfBehat\SymfonyExtension:
bootstrap: tests/Application/config/bootstrap.php
kernel:
class: Tests\Acme\SyliusExamplePlugin\Application\Kernel
class: Tests\BitBag\SyliusSuluPlugin\Application\Kernel

FriendsOfBehat\VariadicExtension: ~

Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "sylius/plugin-skeleton",
"name": "bitbag/sulu-plugin",
"type": "sylius-plugin",
"description": "Acme example plugin for Sylius.",
"keywords": [
"sylius",
"sylius-plugin"
"sylius-plugin",
"sylius-sulu-cms"
],
"description": "Sulu CMS plugin for Sylius applications.",
"license": "MIT",
"require": {
"php": "^8.0",
Expand Down Expand Up @@ -64,8 +65,8 @@
},
"autoload": {
"psr-4": {
"Acme\\SyliusExamplePlugin\\": "src/",
"Tests\\Acme\\SyliusExamplePlugin\\": "tests/"
"BitBag\\SyliusSuluPlugin\\": "src/",
"Tests\\BitBag\\SyliusSuluPlugin\\": "tests/"
}
},
"autoload-dev": {
Expand Down
9 changes: 6 additions & 3 deletions config/services.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?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"
>
<services>
<service id="Acme\SyliusExamplePlugin\Controller\GreetingController" autowire="true" autoconfigure="true" public="true" />
<!-- Put your services here -->

</services>
</container>
13 changes: 0 additions & 13 deletions config/shop_routing.yml
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
# Delete these routes and define your own shop routes here

acme_sylius_example_static_welcome:
path: /static-welcome/{name}
defaults:
_controller: Acme\SyliusExamplePlugin\Controller\GreetingController::staticallyGreetAction
name: ~

acme_sylius_example_dynamic_welcome:
path: /dynamic-welcome/{name}
defaults:
_controller: Acme\SyliusExamplePlugin\Controller\GreetingController::dynamicallyGreetAction
name: ~
17 changes: 0 additions & 17 deletions features/dynamically_greeting_a_customer.feature

This file was deleted.

42 changes: 0 additions & 42 deletions features/running_a_sylius_feature.feature

This file was deleted.

17 changes: 0 additions & 17 deletions features/statically_greeting_a_customer.feature

This file was deleted.

4 changes: 2 additions & 2 deletions phpspec.yml.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
suites:
main:
namespace: Acme\SyliusExamplePlugin
psr4_prefix: Acme\SyliusExamplePlugin
namespace: BitBag\SyliusSuluPlugin
psr4_prefix: BitBag\SyliusSuluPlugin
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
colors="true"
bootstrap="tests/Application/config/bootstrap.php">
<testsuites>
<testsuite name="AcmeSyliusExamplePlugin Test Suite">
<testsuite name="BitbagSyliusSuluPlugin Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Acme\SyliusExamplePlugin;
namespace BitBag\SyliusSuluPlugin;

use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait;
use Symfony\Component\HttpKernel\Bundle\Bundle;

final class AcmeSyliusExamplePlugin extends Bundle
final class BitBagSyliusSuluPlugin extends Bundle
{
use SyliusPluginTrait;

Expand Down
33 changes: 0 additions & 33 deletions src/Controller/GreetingController.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Acme\SyliusExamplePlugin\DependencyInjection;
namespace BitBag\SyliusSuluPlugin\DependencyInjection;

use Sylius\Bundle\CoreBundle\DependencyInjection\PrependDoctrineMigrationsTrait;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension;
Expand All @@ -11,7 +11,7 @@
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

final class AcmeSyliusExampleExtension extends AbstractResourceExtension implements PrependExtensionInterface
final class BitBagSyliusSuluExtension extends AbstractResourceExtension implements PrependExtensionInterface
{
use PrependDoctrineMigrationsTrait;

Expand All @@ -35,7 +35,7 @@ protected function getMigrationsNamespace(): string

protected function getMigrationsDirectory(): string
{
return '@AcmeSyliusExamplePlugin/migrations';
return '@BitBagSyliusSuluPlugin/Migrations';
}

protected function getNamespacesOfMigrationsExecutedBefore(): array
Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Acme\SyliusExamplePlugin\DependencyInjection;
namespace BitBag\SyliusSuluPlugin\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
Expand All @@ -14,7 +14,7 @@ final class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('acme_sylius_example_plugin');
$treeBuilder = new TreeBuilder('bitbag_sylius_sulu_plugin');
$rootNode = $treeBuilder->getRootNode();

return $treeBuilder;
Expand Down
8 changes: 0 additions & 8 deletions templates/dynamic_greeting.html.twig

This file was deleted.

5 changes: 0 additions & 5 deletions templates/static_greeting.html.twig

This file was deleted.

4 changes: 2 additions & 2 deletions tests/Application/.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ APP_SECRET=EDITME
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=mysql://[email protected]/acme_sylius_example_plugin_%kernel.environment%?serverVersion=5.7
DATABASE_URL=mysql://[email protected]/bitbag_sulu_sylius_plugin_%kernel.environment%?serverVersion=5.7
###< doctrine/doctrine-bundle ###

###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=acme_plugin_development
JWT_PASSPHRASE=YOUR_SECRET_PASSPHRASE
###< lexik/jwt-authentication-bundle ###

###> symfony/mailer ###
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/.env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
APP_SECRET='ch4mb3r0f5ecr3ts'

KERNEL_CLASS='Tests\Acme\SyliusExamplePlugin\Application\Kernel'
KERNEL_CLASS='Tests\BitBag\SyliusSuluPlugin\Application\Kernel'

###> symfony/messenger ###
# Sync transport turned for testing env for the ease of testing
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Tests\Acme\SyliusExamplePlugin\Application;
namespace Tests\BitBag\SyliusSuluPlugin\Application;

use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel;
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

use Tests\Acme\SyliusExamplePlugin\Application\Kernel;
use Tests\BitBag\SyliusSuluPlugin\Application\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true],
Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true],
Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true],
Acme\SyliusExamplePlugin\AcmeSyliusExamplePlugin::class => ['all' => true],
BitBag\SyliusSuluPlugin\BitBagSyliusSuluPlugin::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true],
Expand Down
9 changes: 0 additions & 9 deletions tests/Application/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +0,0 @@
acme_sylius_example_shop:
resource: "@AcmeSyliusExamplePlugin/config/shop_routing.yml"
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$

acme_sylius_example_admin:
resource: "@AcmeSyliusExamplePlugin/config/admin_routing.yml"
prefix: /admin
3 changes: 2 additions & 1 deletion tests/Application/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

declare(strict_types=1);

use Tests\Acme\SyliusExamplePlugin\Application\Kernel;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;
use Tests\BitBag\SyliusSuluPlugin\Application\Kernel;


require dirname(__DIR__) . '/config/bootstrap.php';

Expand Down
Loading

0 comments on commit 9f1ead4

Please sign in to comment.