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

Add mercuryseries/inertia-bundle recipe #1517

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
39de963
Add mercuryseries/inertia-bundle recipe
mercuryseries May 29, 2023
da117f2
fix version issue
mercuryseries May 29, 2023
cb4fbd1
fix indentation issue
mercuryseries May 29, 2023
e5e03ee
Remove ::class typo
mercuryseries May 29, 2023
e04c8ad
Switch to 0.2
mercuryseries May 29, 2023
90a9386
Fix wrong bundle extension
mercuryseries May 29, 2023
7c8bc97
Fix wrong AbstractController namespace
mercuryseries May 29, 2023
a041f99
Switch to 0.4
mercuryseries May 29, 2023
d02afb6
Switch to 0.1
mercuryseries May 29, 2023
adc4971
Trigger ci
mercuryseries May 29, 2023
5cddb9b
Fix typo
mercuryseries May 29, 2023
56ef0fd
Update config/routes.yaml to add csrf config
mercuryseries May 29, 2023
7834a25
Keep only MercurySeries\Bundle\InertiaBundle\MercurySeriesInertiaBund…
mercuryseries May 29, 2023
6040c13
fix typo
mercuryseries May 29, 2023
4645609
Move files to package
mercuryseries May 30, 2023
7bb596d
Update post-install.txt
mercuryseries May 30, 2023
826cd17
fix invalid json file
mercuryseries May 30, 2023
443ffff
Update post-install.txt
mercuryseries May 30, 2023
17a398d
trigger deployment
mercuryseries May 30, 2023
fd21602
trigger deployment
mercuryseries May 30, 2023
121a9ca
trigger deployment
mercuryseries May 30, 2023
083fc87
trigger deployment
mercuryseries May 30, 2023
9f02090
Update post-install.txt
mercuryseries May 30, 2023
a162936
Update post-install.txt
mercuryseries May 30, 2023
76140d7
Support Symfony 5
mercuryseries May 30, 2023
2cf91cc
Remove requires
mercuryseries May 30, 2023
dd6a6de
Remove warn_if_missing
mercuryseries May 30, 2023
77a8580
Add warn_if_missing false
mercuryseries May 30, 2023
32f4334
Add config/routes/inertia.yaml
mercuryseries May 30, 2023
b10d64f
explicit null
mercuryseries May 30, 2023
b8976ca
better text
mercuryseries May 30, 2023
24f1906
better text
mercuryseries May 30, 2023
1cbe24f
better text
mercuryseries May 30, 2023
ab3daa0
comment out domain
mercuryseries May 30, 2023
05d4106
move route config logic to bundle
mercuryseries May 30, 2023
4039ee9
update post-install.txt
mercuryseries Jun 19, 2023
06ead9d
renaming to bundler
mercuryseries Jun 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mercuryseries_inertia:
ssr:
enabled: false
url: 'http://127.0.0.1:13714/render'
bundle: '%kernel.project_dir%/public/build-ssr/ssr.js'
# bundle: '%kernel.project_dir%/public/build-ssr/ssr.js'

# |--------------------------------------------------------------------------
# | CSRF Protection
Expand All @@ -33,6 +33,6 @@ mercuryseries_inertia:
csrf_cookie:
expire: 0
path: /
# domain: null
domain: ~
secure: true
sameSite: lax
19 changes: 19 additions & 0 deletions mercuryseries/inertia-bundle/0.1/config/routes/inertia.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# If you use PHP attributes
# controllers:
# resource:
# path: ../../src/Controller/
# namespace: App\Controller
# type: attribute
# defaults:
# csrf:
# create: true
# require: ['POST', 'PUT', 'PATCH', 'DELETE']

# If you use annotations
# controllers:
# resource: ../../src/Controller/
# type: annotation
# defaults:
# csrf:
# create: true
# require: ['POST', 'PUT', 'PATCH', 'DELETE']
Copy link
Member

Choose a reason for hiding this comment

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

You only need one of these - iirc, type: annotations will work for both.

However, if I'm understanding this correctly, then what you are REALLY doing is just adding the defaults: csrf: part to the user's existing route import, right? In that case, my previous comment was wrong... and you may indeed need to use add-lines to add this to the existing config/routes.yaml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @weaverryan for the feedback. Really appreciated!
I finally decided to handle this on the bundle side. So I think it can be merged now.

18 changes: 1 addition & 17 deletions mercuryseries/inertia-bundle/0.1/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,5 @@
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
"gitignore": ["/%PUBLIC_DIR%/build-ssr/"],
"add-lines": [
{
"file": "config/routes.yaml",
"content": " defaults:\n csrf:\n create: true\n require:\n - 'POST'\n - 'PUT'\n - 'PATCH'\n - 'DELETE'",
"position": "after_target",
"target": "type: attribute",
"warn_if_missing": false
},
{
"file": "config/routes/annotations.yaml",
"content": " defaults:\n csrf:\n create: true\n require:\n - 'POST'\n - 'PUT'\n - 'PATCH'\n - 'DELETE'",
"position": "after_target",
"target": "type: annotation",
"warn_if_missing": false
}
]
"gitignore": ["/%PUBLIC_DIR%/build-ssr/"]
}