Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sylius Recipes Enhancements #1724

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

Rafikooo
Copy link
Contributor

@Rafikooo Rafikooo commented Dec 9, 2024

Q A
License MIT

Continuation of: #1723

Copy link

github-actions bot commented Dec 9, 2024

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1724/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1724/index.json
  2. Install the package(s) related to this recipe:

    composer req symfony/flex
    composer req 'sylius/invoicing-plugin:^1.0' 'sylius/paypal-plugin:^2.0' 'sylius/refund-plugin:^0.4'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

sylius/invoicing-plugin

0.5 vs 1.0
diff --git a/sylius/invoicing-plugin/0.5/config/packages/sylius_invoicing.yaml b/sylius/invoicing-plugin/1.0/config/packages/sylius_invoicing.yaml
index 0075ab3b..93b2ba94 100644
--- a/sylius/invoicing-plugin/0.5/config/packages/sylius_invoicing.yaml
+++ b/sylius/invoicing-plugin/1.0/config/packages/sylius_invoicing.yaml
@@ -1,2 +1,2 @@
 imports:
-    - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" }
+    - { resource: "@SyliusInvoicingPlugin/config/config.yaml" }
diff --git a/sylius/invoicing-plugin/0.5/config/routes/sylius_invoicing.yaml b/sylius/invoicing-plugin/1.0/config/routes/sylius_invoicing.yaml
index b8fbd60f..912e9ac3 100644
--- a/sylius/invoicing-plugin/0.5/config/routes/sylius_invoicing.yaml
+++ b/sylius/invoicing-plugin/1.0/config/routes/sylius_invoicing.yaml
@@ -1,9 +1,2 @@
-sylius_invoicing_plugin_admin:
-    resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/admin_invoicing.yml"
-    prefix: /admin
-
-sylius_invoicing_plugin_shop:
-    resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/shop_invoicing.yml"
-    prefix: /{_locale}
-    requirements:
-        _locale: ^[a-z]{2}(?:_[A-Z]{2})?$
+sylius_invoicing:
+    resource: "@SyliusInvoicingPlugin/config/routes.yaml"

sylius/paypal-plugin

1.7 vs 2.0
diff --git a/sylius/paypal-plugin/1.7/config/packages/sylius_paypal.yaml b/sylius/paypal-plugin/2.0/config/packages/sylius_paypal.yaml
index c9d4372e..9a0676b0 100644
--- a/sylius/paypal-plugin/1.7/config/packages/sylius_paypal.yaml
+++ b/sylius/paypal-plugin/2.0/config/packages/sylius_paypal.yaml
@@ -1,2 +1,2 @@
 imports:
-    - { resource: "@SyliusPayPalPlugin/Resources/config/config.yaml" }
+    - { resource: "@SyliusPayPalPlugin/config/config.yaml" }
diff --git a/sylius/paypal-plugin/1.7/config/routes/sylius_paypal.yaml b/sylius/paypal-plugin/2.0/config/routes/sylius_paypal.yaml
index 91042446..a531c2f6 100644
--- a/sylius/paypal-plugin/1.7/config/routes/sylius_paypal.yaml
+++ b/sylius/paypal-plugin/2.0/config/routes/sylius_paypal.yaml
@@ -1,12 +1,2 @@
-sylius_paypal_admin:
-    resource: "@SyliusPayPalPlugin/Resources/config/admin_routing.yml"
-    prefix: /%sylius_admin.path_name%
-
-sylius_paypal_shop:
-    resource: "@SyliusPayPalPlugin/Resources/config/shop_routing.yaml"
-    prefix: /{_locale}
-    requirements:
-        _locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$
-
-sylius_paypal_webhook:
-    resource: "@SyliusPayPalPlugin/Resources/config/webhook_routing.yaml"
+sylius_paypal:
+    resource: "@SyliusPayPalPlugin/config/routes.yaml"
diff --git a/sylius/paypal-plugin/1.7/manifest.json b/sylius/paypal-plugin/2.0/manifest.json
index a991d882..271c34fd 100644
--- a/sylius/paypal-plugin/1.7/manifest.json
+++ b/sylius/paypal-plugin/2.0/manifest.json
@@ -4,5 +4,14 @@
     },
     "copy-from-recipe": {
         "config/": "%CONFIG_DIR%/"
-    }
+    },
+    "add-lines": [
+        {
+            "file": "config/packages/fos_rest.yaml",
+            "position": "after_target",
+            "warn_if_missing": true,
+            "target": "fos_rest:",
+            "content": "    ###> sylius/paypal-plugin ###\n    exception: true\n    view:\n        formats:\n            json: true\n            xml:  true\n        empty_content: 204\n    format_listener:\n        rules:\n            - { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }\n            - { path: '^/', stop: true }\n    ###< sylius/paypal-plugin ###\n"
+        }
+    ]
 }

@diimpp
Copy link
Member

diimpp commented Dec 9, 2024

@Rafikooo please move fos_rest config to a separate file from the previous PR.

image

@Rafikooo
Copy link
Contributor Author

Rafikooo commented Dec 9, 2024

@Rafikooo please move fos_rest config to a separate file from the previous PR.

image

Hey @diimpp,

Could you explain why this is important?

The reason we proposed combining it into a single file is to prevent potential issues. For example, placing this configuration in a separate file, such as fos_rest.yaml, could potentially overwrite someone’s existing configuration. Or perhaps you meant placing it in a file like sylius_fos_rest.yaml to make the configuration more explicit? Wdyt?

@Rafikooo Rafikooo force-pushed the new-sylius-recipes-amend branch 3 times, most recently from 3e288ba to 0266abb Compare December 11, 2024 12:17
@Rafikooo Rafikooo marked this pull request as ready for review December 11, 2024 12:18
@Rafikooo Rafikooo changed the title Add Sylius PayPal Plugin 1.7 Recipe and Revert Sylius RefundPlugin 0.4 Sylius Recipes Enhancements Dec 11, 2024
@Rafikooo Rafikooo force-pushed the new-sylius-recipes-amend branch from 0266abb to 9162c5c Compare December 11, 2024 12:24
@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) December 11, 2024 12:25
auto-merge was automatically disabled December 11, 2024 17:38

Head branch was pushed to by a user without write access

@Rafikooo Rafikooo force-pushed the new-sylius-recipes-amend branch from 9162c5c to b38d6c2 Compare December 11, 2024 17:38
@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) December 11, 2024 17:39
diimpp
diimpp previously approved these changes Dec 11, 2024
@diimpp
Copy link
Member

diimpp commented Dec 11, 2024

Merge is blocked due sylius/refund recipe added for unreleased version -- 2.0

auto-merge was automatically disabled December 11, 2024 19:46

Head branch was pushed to by a user without write access

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) December 11, 2024 19:46
@symfony-recipes-bot symfony-recipes-bot merged commit e95e19b into symfony:main Dec 11, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants