Skip to content

Commit bb388b9

Browse files
authored
Merge pull request #74 from BitBagCommerce/OP-557-Plugin-to-Sylius-2.0
Op 557 Update plugin to sylius 2.0
2 parents 7913ad0 + fdafe15 commit bb388b9

File tree

92 files changed

+676
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+676
-668
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php: ["8.1", "8.2", "8.3"]
25-
symfony: ["^5.4", "^6.0"]
26-
sylius: ["~1.12.0", "~1.13.0"]
27-
node: ["18.x", "20.x"]
28-
mysql: ["5.7", "8.0"]
29-
24+
php: [ "8.2", "8.3" ]
25+
symfony: [ "^7.1" ]
26+
sylius: [ "~2.0.0" ]
27+
node: [ "20.x" ]
28+
mysql: ["8.0"]
3029

3130
env:
3231
APP_ENV: test
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/shop/scss/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import url('_subscribe.scss');

bin/create_node_symlink.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
const NODE_MODULES_FOLDER_NAME = 'node_modules';
4+
const PATH_TO_NODE_MODULES = 'tests' . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR . 'node_modules';
5+
6+
/* cannot use `file_exists` or `stat` as gives false on symlinks if target path does not exist yet */
7+
if (@lstat(NODE_MODULES_FOLDER_NAME))
8+
{
9+
if (is_link(NODE_MODULES_FOLDER_NAME) || is_dir(NODE_MODULES_FOLDER_NAME)) {
10+
echo '> `' . NODE_MODULES_FOLDER_NAME . '` already exists as a link or folder, keeping existing as may be intentional.' . PHP_EOL;
11+
exit(0);
12+
} else {
13+
echo '> Invalid symlink `' . NODE_MODULES_FOLDER_NAME . '` detected, recreating...' . PHP_EOL;
14+
if (!@unlink(NODE_MODULES_FOLDER_NAME)) {
15+
echo '> Could not delete file `' . NODE_MODULES_FOLDER_NAME . '`.' . PHP_EOL;
16+
exit(1);
17+
}
18+
}
19+
}
20+
21+
/* try to create the symlink using PHP internals... */
22+
$success = @symlink(PATH_TO_NODE_MODULES, NODE_MODULES_FOLDER_NAME);
23+
24+
/* if case it has failed, but OS is Windows... */
25+
if (!$success && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
26+
/* ...then try a different approach which does not require elevated permissions and folder to exist */
27+
echo '> This system is running Windows, creation of links requires elevated privileges,' . PHP_EOL;
28+
echo '> and target path to exist. Fallback to NTFS Junction:' . PHP_EOL;
29+
exec(sprintf('mklink /J %s %s 2> NUL', NODE_MODULES_FOLDER_NAME, PATH_TO_NODE_MODULES), $output, $returnCode);
30+
$success = $returnCode === 0;
31+
if (!$success) {
32+
echo '> Failed o create the required symlink' . PHP_EOL;
33+
exit(2);
34+
}
35+
}
36+
37+
$path = @readlink(NODE_MODULES_FOLDER_NAME);
38+
/* check if link points to the intended directory */
39+
if ($path && realpath($path) === realpath(PATH_TO_NODE_MODULES)) {
40+
echo '> Successfully created the symlink.' . PHP_EOL;
41+
exit(0);
42+
}
43+
44+
echo '> Failed to create the symlink to `' . NODE_MODULES_FOLDER_NAME . '`.' . PHP_EOL;
45+
exit(3);

composer.json

Lines changed: 60 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,88 @@
55
"description": "MailChimp plugin for Sylius.",
66
"license": "MIT",
77
"require": {
8-
"php": " ^8.1",
9-
"sylius/sylius": "~1.12.0 || ~1.13.0",
8+
"sylius/sylius": "~2.0",
9+
"php": "^8.2",
10+
"dompdf/dompdf": "^2.0",
1011
"drewm/mailchimp-api": "^2.5.4",
11-
"ext-json": "*",
12-
"symfony/webpack-encore-bundle": "^1.16"
12+
"sylius/twig-extra": "^0.6",
13+
"sylius/twig-hooks": "^0.6",
14+
"symfony/stimulus-bundle": "^2.12",
15+
"symfony/ux-autocomplete": "^2.17",
16+
"symfony/ux-live-component": "^2.20",
17+
"symfony/ux-twig-component": "^2.20",
18+
"symfony/webpack-encore-bundle": "^2.1",
19+
"symfony/workflow": "^7.2"
1320
},
1421
"require-dev": {
15-
"behat/behat": "^3.7",
16-
"behat/mink-selenium2-driver": "~1.6.0",
17-
"dmore/behat-chrome-extension": "^1.3",
18-
"dmore/chrome-mink-driver": "^2.7",
19-
"friends-of-behat/mink": "^1.8",
20-
"friends-of-behat/mink-browserkit-driver": "^1.4",
21-
"friends-of-behat/mink-extension": "^2.4",
22+
"behat/behat": "^3.14",
23+
"behat/mink-selenium2-driver": "1.6",
24+
"bitbag/coding-standard": "^3.0.0",
25+
"dmore/behat-chrome-extension": "^1.4",
26+
"friends-of-behat/mink": "^1.11",
27+
"friends-of-behat/mink-browserkit-driver": "^1.6",
28+
"friends-of-behat/mink-debug-extension": "^2.1",
29+
"friends-of-behat/mink-extension": "^2.7",
2230
"friends-of-behat/page-object-extension": "^0.3",
23-
"friends-of-behat/suite-settings-extension": "^1.0",
24-
"friends-of-behat/symfony-extension": "^2.1",
25-
"friends-of-behat/variadic-extension": "^1.3",
26-
"lakion/mink-debug-extension": "^2.0.0",
31+
"friends-of-behat/suite-settings-extension": "^1.1",
32+
"friends-of-behat/symfony-extension": "^2.6",
33+
"friends-of-behat/variadic-extension": "^1.6",
34+
"gedmo/doctrine-extensions": "^3.9",
35+
"lchrusciel/api-test-case": "^4.1 || ^5.0",
36+
"league/flysystem-bundle": "^3.3",
37+
"matthiasnoback/symfony-config-test": "^5.1",
38+
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
39+
"nelmio/alice": "^3.10",
40+
"nyholm/psr7": "^1.8",
2741
"phpspec/phpspec": "^7.0",
28-
"phpstan/extension-installer": "^1.0",
2942
"phpunit/phpunit": "^9.5",
30-
"sylius-labs/coding-standard": "^4.0",
31-
"symfony/browser-kit": "^5.4 || ^6.0",
32-
"symfony/debug-bundle": "^5.4 || ^6.0",
33-
"symfony/dotenv": "^5.4 || ^6.0",
34-
"symfony/intl": "^5.4 || ^6.0",
35-
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
3643
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
37-
"vimeo/psalm": "^4.12",
38-
"composer/xdebug-handler": "^2.0",
39-
"bitbag/coding-standard": "^1.0.0 || ^2.0.0"
44+
"robertfausk/behat-panther-extension": "^1.1",
45+
"sylius-labs/coding-standard": "^4.4",
46+
"sylius-labs/suite-tags-extension": "~0.2",
47+
"sylius/mailer-bundle": "^1.8 || ^2.0@beta",
48+
"sylius/sylius-rector": "^2.0",
49+
"symfony/browser-kit": "^6.4 || ^7.1",
50+
"symfony/debug-bundle": "^6.4 || ^7.1",
51+
"symfony/dotenv": "^6.4 || ^7.1",
52+
"symfony/http-client": "^6.4 || ^7.1",
53+
"symfony/intl": "^6.4 || ^7.1",
54+
"symfony/web-profiler-bundle": "^6.4 || ^7.1",
55+
"symfony/profiler-pack": "^1.0"
4056
},
41-
"conflict": {
42-
"doctrine/orm": ">=2.15.2",
43-
"doctrine/persistence": "<3.0"
44-
},
45-
"prefer-stable": true,
4657
"autoload": {
4758
"psr-4": {
4859
"BitBag\\SyliusMailChimpPlugin\\": "src/",
4960
"Tests\\BitBag\\SyliusMailChimpPlugin\\": "tests/"
5061
}
5162
},
52-
5363
"autoload-dev": {
5464
"classmap": ["tests/Application/Kernel.php"]
5565
},
5666
"config": {
67+
"sort-packages": true,
5768
"allow-plugins": {
5869
"symfony/thanks": true,
5970
"composer/package-versions-deprecated": true,
6071
"dealerdirect/phpcodesniffer-composer-installer": true,
61-
"phpstan/extension-installer": true
72+
"phpstan/extension-installer": true,
73+
"php-http/discovery": true
74+
}
75+
},
76+
"scripts": {
77+
"post-install-cmd": [
78+
"php bin/create_node_symlink.php"
79+
],
80+
"post-update-cmd": [
81+
"php bin/create_node_symlink.php"
82+
],
83+
"post-create-project-cmd": [
84+
"php bin/create_node_symlink.php"
85+
]
86+
},
87+
"extra": {
88+
"symfony": {
89+
"require": "^7.1"
6290
}
6391
}
6492
}

0 commit comments

Comments
 (0)