Skip to content

Commit 0d764d7

Browse files
authored
Merge pull request #23 from BitBagCommerce/UC-23
[UC-23] Remove GA4 and DataFeed plugins from composer.json dependency
2 parents 0fe2055 + def1eab commit 0d764d7

File tree

15 files changed

+14
-280
lines changed

15 files changed

+14
-280
lines changed

UPGRADE.md

Lines changed: 7 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,11 @@
1-
# UPGRADE FROM `v1.3.X` TO `v1.4.0`
1+
# UPGRADE FROM `1.0` TO `1.1`
22

3-
First step is upgrading Sylius with composer
3+
### Dependencies
44

5-
- `composer require sylius/sylius:~1.4.0`
5+
1. Removed `bitbag/google-analytics-4-plugin` dependency (see “Behavioral changes”).
6+
2. Removed `bitbag/sylius-feed-plugin` dependency (see “Behavioral changes”).
67

7-
### Test application database
8+
### Behavioral changes
89

9-
#### Migrations
10-
11-
If you provide migrations with your plugin, take a look at following changes:
12-
13-
* Change base `AbstractMigration` namespace to `Doctrine\Migrations\AbstractMigration`
14-
* Add `: void` return types to both `up` and `down` functions
15-
16-
#### Schema update
17-
18-
If you don't use migrations, just run `(cd tests/Application && bin/console doctrine:schema:update --force)` to update the test application's database schema.
19-
20-
### Dotenv
21-
22-
* `composer require symfony/dotenv:^4.2 --dev`
23-
* Follow [Symfony dotenv update guide](https://symfony.com/doc/current/configuration/dot-env-changes.html) to incorporate required changes in `.env` files structure. Remember - they should be done on `tests/Application/` level! Optionally, you can take a look at [corresponding PR](https://github.com/Sylius/PluginSkeleton/pull/156/) introducing these changes in **PluginSkeleton** (this PR also includes changes with Behat - see below)
24-
25-
Don't forget to clear the cache (`tests/Application/bin/console cache:clear`) to be 100% everything is loaded properly.
26-
27-
### Test application kernel
28-
29-
The kernel of the test application needs to be replaced with this [file](https://github.com/Sylius/PluginSkeleton/blob/1.4/tests/Application/Kernel.php).
30-
The location of the kernel is: `tests/Application/Kernel.php` (replace the content with the content of the file above).
31-
The container cleanup method is removed in the new version and keeping it will cause problems with for example the `TagAwareAdapter` which will call `commit()` on its pool from its destructor. If its pool is `TraceableAdapter` with pool `ArrayAdapter`, then the pool property of `TraceableAdapter` will be nullified before the destructor is executed and cause an error.
32-
33-
---
34-
35-
### Behat
36-
37-
If you're using Behat and want to be up-to-date with our configuration
38-
39-
* Update required extensions with `composer require friends-of-behat/symfony-extension:^2.0 friends-of-behat/page-object-extension:^0.3 --dev`
40-
* Remove extensions that are not needed yet with `composer remove friends-of-behat/context-service-extension friends-of-behat/cross-container-extension friends-of-behat/service-container-extension --dev`
41-
* Update your `behat.yml` - look at the diff [here](https://github.com/Sylius/Sylius-Standard/pull/322/files#diff-7bde54db60a6e933518d8b61b929edce)
42-
* Add `SymfonyExtensionBundle` to your `tests/Application/config/bundles.php`:
43-
```php
44-
return [
45-
//...
46-
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true],
47-
];
48-
```
49-
* If you use our Travis CI configuration, follow [these changes](https://github.com/Sylius/PluginSkeleton/pull/156/files#diff-354f30a63fb0907d4ad57269548329e3) introduced in `.travis.yml` file
50-
* Create `tests/Application/config/services_test.yaml` file with the following code and add these your own Behat services as well:
51-
```yaml
52-
imports:
53-
- { resource: "../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" }
54-
```
55-
* Remove all `__symfony__` prefixes in your Behat services
56-
* Remove all `<tag name="fob.context_service" />` tags from your Behat services
57-
* Make your Behat services public by default with `<defaults public="true" />`
58-
* Change `contexts_services ` in your suite definitions to `contexts`
59-
* Take a look at [SymfonyExtension UPGRADE guide](https://github.com/FriendsOfBehat/SymfonyExtension/blob/master/UPGRADE-2.0.md) if you have any more problems
60-
61-
### Phpstan
62-
63-
* Fix the container XML path parameter in the `phpstan.neon` file as done [here](https://github.com/Sylius/PluginSkeleton/commit/37fa614dbbcf8eb31b89eaf202b4bd4d89a5c7b3)
64-
65-
# UPGRADE FROM `v1.2.X` TO `v1.4.0`
66-
67-
Firstly, check out the [PluginSkeleton 1.3 upgrade guide](https://github.com/Sylius/PluginSkeleton/blob/1.4/UPGRADE-1.3.md) to update Sylius version step by step.
68-
To upgrade to Sylius 1.4 follow instructions from [the previous section](https://github.com/Sylius/PluginSkeleton/blob/1.4/UPGRADE-1.4.md#upgrade-from-v13x-to-v140) with following changes:
69-
70-
### Doctrine migrations
71-
72-
* Change namespaces of copied migrations to `Sylius\Migrations`
73-
74-
### Dotenv
75-
76-
* These changes are not required, but can be done as well, if you've changed application directory structure in `1.2.x` to `1.3` update
77-
78-
### Behat
79-
80-
* Add `\FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle()` to your bundles lists in `tests/Application/AppKernel.php` (preferably only in `test` environment)
81-
* Import Sylius Behat services in `tests/Application/config/config_test.yml` and your own Behat services as well:
82-
```yaml
83-
imports:
84-
- { resource: "../../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" }
85-
```
86-
* Specify test application's kernel path in `behat.yml`:
87-
```yaml
88-
FriendsOfBehat\SymfonyExtension:
89-
kernel:
90-
class: AppKernel
91-
path: tests/Application/app/AppKernel.php
92-
```
93-
94-
95-
# UPGRADE FROM `v1.2.X` TO `v1.3.0`
96-
97-
## Application
98-
99-
* Run `composer require sylius/sylius:~1.3.0 --no-update`
100-
101-
* Add the following code in your `behat.yml(.dist)` file:
102-
103-
```yaml
104-
default:
105-
extensions:
106-
FriendsOfBehat\SymfonyExtension:
107-
env_file: ~
108-
```
109-
110-
* Incorporate changes from the following files into plugin's test application:
111-
112-
* [`tests/Application/package.json`](https://github.com/Sylius/PluginSkeleton/blob/1.3/tests/Application/package.json) ([see diff](https://github.com/Sylius/PluginSkeleton/pull/134/files#diff-726e1353c14df7d91379c0dea6b30eef))
113-
* [`tests/Application/.babelrc`](https://github.com/Sylius/PluginSkeleton/blob/1.3/tests/Application/.babelrc) ([see diff](https://github.com/Sylius/PluginSkeleton/pull/134/files#diff-a2527d9d8ad55460b2272274762c9386))
114-
* [`tests/Application/.eslintrc.js`](https://github.com/Sylius/PluginSkeleton/blob/1.3/tests/Application/.eslintrc.js) ([see diff](https://github.com/Sylius/PluginSkeleton/pull/134/files#diff-396c8c412b119deaa7dd84ae28ae04ca))
115-
116-
* Update PHP and JS dependencies by running `composer update` and `(cd tests/Application && yarn upgrade)`
117-
118-
* Clear cache by running `(cd tests/Application && bin/console cache:clear)`
119-
120-
* Install assets by `(cd tests/Application && bin/console assets:install web)` and `(cd tests/Application && yarn build)`
121-
122-
* optionally, remove the build for PHP 7.1. in `.travis.yml`
10+
1. If you don’t provide an alternative to `bitbag/google-analytics-4-plugin`, you lose automatic dataLayer pushes for Google Analytics 4.
11+
2. No product feed is generated by default.

composer.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@
66
"license": "MIT",
77
"require": {
88
"php": "^8.1",
9-
"bitbag/coding-standard": "^3.0",
10-
"bitbag/google-analytics-4-plugin": "^1.0",
119
"sylius/sylius": "~1.13.0",
10+
"symfony/amqp-messenger": "^5.4 || ^6.4 || ^7.0",
1211
"symfony/messenger": "^5.4 || ^6.4",
13-
"symfony/webpack-encore-bundle": "^1.15",
14-
"ext-openssl": "*",
15-
"bitbag/sylius-feed-plugin": "~0.2",
16-
"symfony/amqp-messenger": "^5.4 || ^6.4 || ^7.0"
12+
"symfony/webpack-encore-bundle": "^1.15"
1713
},
1814
"require-dev": {
1915
"behat/behat": "^3.6.1",
2016
"behat/mink-selenium2-driver": "^1.4",
17+
"bitbag/coding-standard": "^3.0",
2118
"dbrekelmans/bdi": "^1.1",
2219
"dmore/behat-chrome-extension": "^1.3",
2320
"dmore/chrome-mink-driver": "^2.7",
@@ -38,7 +35,6 @@
3835
"phpunit/phpunit": "^10.5",
3936
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
4037
"robertfausk/behat-panther-extension": "^1.1",
41-
"setono/sylius-feed-plugin": "dev-master",
4238
"sylius-labs/coding-standard": "^4.2",
4339
"sylius-labs/suite-tags-extension": "^0.2",
4440
"symfony/browser-kit": "^5.4 || ^6.4",

config/bundles.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22

33
return [
44
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
5-
Setono\SyliusFeedPlugin\SetonoSyliusFeedPlugin::class => ['all' => true],
6-
Setono\DoctrineORMBatcherBundle\SetonoDoctrineORMBatcherBundle::class => ['all' => true],
7-
Spinbits\SyliusGoogleAnalytics4Plugin\SpinbitsSyliusGoogleAnalytics4Plugin::class => ['all' => true],
85
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
96
];

config/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ imports:
1212
- { resource: "events.yaml" }
1313
- { resource: "monolog.yaml" }
1414
- { resource: "packages/*" }
15-
16-
- { resource: "@SetonoSyliusFeedPlugin/Resources/config/app/config.yaml" }

config/packages/uid.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/routes.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
setono_sylius_feed:
2-
resource: "@SetonoSyliusFeedPlugin/Resources/config/routing.yaml"
3-
41
bitbag_user_com_customer_agreements_endpoint:
52
path: /user-com/customer-agreements
63
controller: bit_bag.sylius_user_com_plugin.controller.user_com_agreements_controller

doc/installation.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
2. Add required environment variables to your `.env` file:
77
```dotenv
88
USER_COM_FRONTEND_API_KEY=""
9-
GOOGLE_ANALYTICS_TAG=""
109
USER_COM_ENCRYPTION_KEY=your-32-character-long-key
1110
USER_COM_ENCRYPTION_IV=your-16-character-long-iv
1211
MESSENGER_USER_COM_ASYNCHRONOUS_DSN=""
@@ -16,11 +15,7 @@
1615
return [
1716
...
1817
BitBag\SyliusUserComPlugin\BitBagSyliusUserComPlugin::class => ['all' => true],
19-
Spinbits\SyliusGoogleAnalytics4Plugin\SpinbitsSyliusGoogleAnalytics4Plugin::class => ['all' => true],
2018
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
21-
Setono\SyliusFeedPlugin\SetonoSyliusFeedPlugin::class => ['all' => true],
22-
Setono\DoctrineORMBatcherBundle\SetonoDoctrineORMBatcherBundle::class => ['all' => true],
23-
//Sylius grid bundle should be under Setono\SyliusFeedPlugin\SetonoSyliusFeedPlugin
2419
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
2520
...
2621
];
@@ -51,21 +46,15 @@
5146
```
5247
5348
>`UserComApiAwareTrait` contains mapping for annotations and for attributes which are required by UserCom integration. If you're using xml mapping, you should add mapping for those properties in your `Channel.orm.xml` file.
54-
55-
7. Take advantage of channel based configuration of GoogleAnalyticsPlugin by adding :
56-
```yaml
57-
spinbits_sylius_google_analytics4:
58-
id: "%env(GOOGLE_ANALYTICS_TAG)%"
59-
enabled: true
60-
```
61-
8. Compile assets
49+
50+
7. Compile assets
6251
```bash
6352
yarn install && yarn build
6453
```
65-
9. Add API credentials and GTM to your channel configuration in admin panel. If you decided to extend different object, please make sure that API credentials are set.
54+
8. Add API credentials and GTM to your channel configuration in admin panel. If you decided to extend different object, please make sure that API credentials are set.
6655
![Channel configuration](../doc/user_com_configuration.png)
6756
68-
10. Configure consumer to run in supervisor:
57+
9. Configure consumer to run in supervisor:
6958
```bash
7059
bin/console messenger:consume user_com_asynchronous
7160
```

src/BitBagSyliusUserComPlugin.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,13 @@
44

55
namespace BitBag\SyliusUserComPlugin;
66

7-
use BitBag\SyliusUserComPlugin\DependencyInjection\LogoutSubscriberPass;
87
use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait;
9-
use Symfony\Component\DependencyInjection\ContainerBuilder;
108
use Symfony\Component\HttpKernel\Bundle\Bundle;
119

1210
final class BitBagSyliusUserComPlugin extends Bundle
1311
{
1412
use SyliusPluginTrait;
1513

16-
public function build(ContainerBuilder $container): void
17-
{
18-
$container->addCompilerPass(new LogoutSubscriberPass());
19-
}
20-
2114
public function getPath(): string
2215
{
2316
return \dirname(__DIR__);

src/DTO/Event/Logout.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/DependencyInjection/LogoutSubscriberPass.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)