Skip to content

[SyliusResourceBundle] Update routing configuration - #1831

Merged
symfony-recipes-bot merged 2 commits into
symfony:mainfrom
loic425:update-resource-loader
Sep 1, 2025
Merged

[SyliusResourceBundle] Update routing configuration#1831
symfony-recipes-bot merged 2 commits into
symfony:mainfrom
loic425:update-resource-loader

Conversation

@loic425

@loic425 loic425 commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

@symfony-recipes-bot
symfony-recipes-bot enabled auto-merge (squash) July 9, 2025 09:22
@github-actions

github-actions Bot commented Jul 9, 2025

Copy link
Copy Markdown

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-1831/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1831/index.json
  2. Install the package(s) related to this recipe:

    composer req symfony/flex
    composer req 'sylius/resource-bundle:^1.13'
  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/resource-bundle

1.6 vs 1.9
diff --git a/sylius/resource-bundle/1.6/config/packages/sylius_resource.yaml b/sylius/resource-bundle/1.9/config/packages/sylius_resource.yaml
index df27a441..6b42a484 100644
--- a/sylius/resource-bundle/1.6/config/packages/sylius_resource.yaml
+++ b/sylius/resource-bundle/1.9/config/packages/sylius_resource.yaml
@@ -3,6 +3,11 @@ sylius_resource:
     # Override default settings
     #settings:
 
+    # Configure the mapping for your resources
+    mapping:
+        paths:
+            - '%kernel.project_dir%/src/Entity'
+
     # Configure your resources
     resources:
         #app.book:
diff --git a/sylius/resource-bundle/1.9/config/routes/sylius_resource.yaml b/sylius/resource-bundle/1.9/config/routes/sylius_resource.yaml
new file mode 100644
index 00000000..0c8ade2c
--- /dev/null
+++ b/sylius/resource-bundle/1.9/config/routes/sylius_resource.yaml
@@ -0,0 +1,7 @@
+sylius_crud_routes:
+    resource: 'sylius.routing.loader.crud_routes_attributes'
+    type: service
+
+sylius_routes:
+    resource: 'sylius.routing.loader.routes_attributes'
+    type: service
1.9 vs 1.12
diff --git a/sylius/resource-bundle/1.9/config/packages/sylius_resource.yaml b/sylius/resource-bundle/1.12/config/packages/sylius_resource.yaml
index 6b42a484..495a5096 100644
--- a/sylius/resource-bundle/1.9/config/packages/sylius_resource.yaml
+++ b/sylius/resource-bundle/1.12/config/packages/sylius_resource.yaml
@@ -1,4 +1,4 @@
-# @see https://github.com/Sylius/SyliusResourceBundle/blob/master/docs/index.md
+# @see https://stack.sylius.com/resource/index
 sylius_resource:
     # Override default settings
     #settings:
diff --git a/sylius/resource-bundle/1.9/manifest.json b/sylius/resource-bundle/1.12/manifest.json
index a26e89c8..a38eab72 100644
--- a/sylius/resource-bundle/1.9/manifest.json
+++ b/sylius/resource-bundle/1.12/manifest.json
@@ -6,6 +6,7 @@
         "Sylius\\Bundle\\ResourceBundle\\SyliusResourceBundle": ["all"]
     },
     "copy-from-recipe": {
-        "config/": "%CONFIG_DIR%/"
+        "config/": "%CONFIG_DIR%/",
+        "src/": "%SRC_DIR%/"
     }
 }
diff --git a/sylius/resource-bundle/1.12/src/Entity/.gitignore b/sylius/resource-bundle/1.12/src/Entity/.gitignore
new file mode 100644
index 00000000..e69de29b
1.12 vs 1.13
diff --git a/sylius/resource-bundle/1.12/config/routes/sylius_resource.yaml b/sylius/resource-bundle/1.13/config/routes/sylius_resource.yaml
index 0c8ade2c..6744c22b 100644
--- a/sylius/resource-bundle/1.12/config/routes/sylius_resource.yaml
+++ b/sylius/resource-bundle/1.13/config/routes/sylius_resource.yaml
@@ -1,7 +1,3 @@
-sylius_crud_routes:
-    resource: 'sylius.routing.loader.crud_routes_attributes'
-    type: service
-
-sylius_routes:
-    resource: 'sylius.routing.loader.routes_attributes'
+sylius_resource_loader:
+    resource: 'sylius.symfony.routing.loader.resource'
     type: service

@@ -0,0 +1,15 @@
# @see https://github.com/Sylius/SyliusResourceBundle/blob/master/docs/index.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust this URL as currently it leads to 404.
image

@@ -0,0 +1,12 @@
{
"container": {
"locale": "en"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking just in case, is locale necessary for resource standalone usage?

@loic425 loic425 Jul 9, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have removed that dependency on 1.14 branch. So we will be able to remove that when it will be stable

auto-merge was automatically disabled August 29, 2025 07:31

Head branch was pushed to by a user without write access

@loic425
loic425 force-pushed the update-resource-loader branch from 09499f9 to 06ed711 Compare August 29, 2025 07:31
@symfony-recipes-bot
symfony-recipes-bot enabled auto-merge (squash) August 29, 2025 07:32
@@ -1,4 +1,4 @@
# @see https://github.com/Sylius/SyliusResourceBundle/blob/master/docs/index.md
# @see https://docs.sylius.com/sylius-stack/resource/index

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still waiting for Magda answer for the right link between this one and https://stack.sylius.com/resource/index

@loic425
loic425 marked this pull request as draft August 29, 2025 07:33
auto-merge was automatically disabled August 29, 2025 07:33

Pull request was converted to draft

@loic425
loic425 force-pushed the update-resource-loader branch from 06ed711 to 0c44628 Compare September 1, 2025 09:50
@loic425
loic425 marked this pull request as ready for review September 1, 2025 09:51
@loic425 loic425 closed this Sep 1, 2025
@loic425 loic425 reopened this Sep 1, 2025
@symfony-recipes-bot
symfony-recipes-bot enabled auto-merge (squash) September 1, 2025 09:51
Comment thread sylius/resource-bundle/1.13/config/packages/sylius_resource.yaml Outdated
@symfony-recipes-bot
symfony-recipes-bot merged commit a73eb7b into symfony:main Sep 1, 2025
1 of 2 checks passed
@loic425
loic425 deleted the update-resource-loader branch September 1, 2025 10:03
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.

3 participants