Skip to content

Commit

Permalink
Add mercuryseries/inertia-bundle recipe (#1517)
Browse files Browse the repository at this point in the history
* Add mercuryseries/inertia-bundle recipe

* fix version issue

* fix indentation issue

* Remove ::class typo

* Switch to 0.2

* Fix wrong bundle extension

* Fix wrong AbstractController namespace

* Switch to 0.4

* Switch to 0.1

* Trigger ci

* Fix typo

* Update config/routes.yaml to add csrf config

* Keep only MercurySeries\Bundle\InertiaBundle\MercurySeriesInertiaBundle registration

* fix typo

* Move files to package

* Update post-install.txt

* fix invalid json file

* Update post-install.txt

* trigger deployment

* trigger deployment

* trigger deployment

* trigger deployment

* Update post-install.txt

* Update post-install.txt

* Support Symfony 5

* Remove requires

* Remove warn_if_missing

* Add warn_if_missing false

* Add config/routes/inertia.yaml

* explicit null

* better text

* better text

* better text

* comment out domain

* move route config logic to bundle

* update post-install.txt

* renaming to bundler
  • Loading branch information
mercuryseries authored Jun 19, 2023
1 parent 4b48699 commit 89b05a0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
mercuryseries_inertia:
# |--------------------------------------------------------------------------
# | Server-side Rendering
# |--------------------------------------------------------------------------
# |
# | These options configures if and how Inertia uses Server Side Rendering
# | to pre-render the initial visits made to your application's pages.
# |
# | You can specify a custom SSR bundle path, or omit it to let Inertia
# | try and automatically detect it for you.
# |
# | Do note that enabling these options will NOT automatically make SSR work,
# | as a separate rendering service needs to be available. To learn more,
# | please visit https://inertiajs.com/server-side-rendering
ssr:
enabled: false
url: 'http://127.0.0.1:13714/render'
# bundle: '%kernel.project_dir%/public/build-ssr/ssr.js'

# |--------------------------------------------------------------------------
# | CSRF Protection
# |--------------------------------------------------------------------------
# | CSRF (Cross-Site Request Forgery) protection is a security measure
# | to prevent malicious websites from making requests on behalf of users
# | without their consent.
# |
# | Inertia provides CSRF protection by configuring CSRF tokens and cookies.
# | The CSRF cookie is used to store the CSRF token, and it is sent with each
# | request made to the application. The CSRF token is verified on the server
# | side to ensure the authenticity of the request.
# |
# | To learn more, please visit https://inertiajs.com/csrf-protection
csrf_cookie:
expire: 0
path: /
# domain: null
secure: true
sameSite: lax
9 changes: 9 additions & 0 deletions mercuryseries/inertia-bundle/0.1/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"bundles": {
"MercurySeries\\Bundle\\InertiaBundle\\MercurySeriesInertiaBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
"gitignore": ["/%PUBLIC_DIR%/build-ssr/"]
}
10 changes: 10 additions & 0 deletions mercuryseries/inertia-bundle/0.1/post-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> Getting started using </><bg=blue;fg=white;options=bold>mercuryseries/inertia-bundle</><bg=blue;fg=white> </>
<bg=blue;fg=white> </>

<fg=blue;options=bold>Configure</> <fg=blue>your transformations:</>
1. React stack: <comment>symfony console inertia:install react --ssr --bundler=webpack</> for Webpack or <comment>symfony console inertia:install react --ssr --bundler=vite</> for Vite.
2. Vue stack: <comment>symfony console inertia:install vue --ssr --bundler=webpack</> for Webpack or <comment>symfony console inertia:install vue --ssr --bundler=vite</> for Vite.
3. Adjust the configuration in <comment>%CONFIG_DIR%/packages/mercuryseries_inertia.yaml</> according to your needs.
4. Start the development server: <comment>npm run dev-server</>.
5. Start coding into <comment>assets/js/pages/</>

0 comments on commit 89b05a0

Please sign in to comment.