Skip to content

Commit 63b4c1a

Browse files
authored
Merge pull request #1420 from symfony/fix-readme
Update README to tell about all configurators
2 parents ee0904c + 165be41 commit 63b4c1a

File tree

1 file changed

+90
-2
lines changed

1 file changed

+90
-2
lines changed

README.rst

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ Symfony is smart enough to reverse those tasks when uninstalling and
9595
unconfiguring the dependencies.
9696

9797
There are several types of tasks, which are called **configurators**:
98-
``copy-from-recipe``, ``copy-from-package``, ``bundles``, ``env``, ``container``
99-
``composer-scripts``, ``gitignore``, and ``post-install-output``.
98+
``bundles``, ``container``, ``copy-from-recipe``, ``copy-from-package``, ``env``,
99+
``dotenv``, ``makefile``, ``composer-scripts``, ``composer-commands``,
100+
``gitignore``, ``dockerfile``, ``docker-compose``, ``add-lines``,
101+
and ``post-install-output``.
100102

101103
``bundles`` Configurator
102104
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -246,6 +248,43 @@ Don't remove or modify these separators.
246248
Use ``%generate(secret)%`` as the value of any environment variable to
247249
replace it with a cryptographically secure random value of 16 bytes.
248250

251+
``dotenv`` Configurator
252+
~~~~~~~~~~~~~~~~~~~~~~~
253+
254+
Very similar to the ``env`` configurator but allows targeting a specific dotenv
255+
file instead of just ``.env``.
256+
257+
.. code-block:: json
258+
259+
{
260+
"dotenv": {
261+
"local": {
262+
"SOME_VAR": "value"
263+
}
264+
}
265+
}
266+
267+
This recipe is converted into the following content appended to the
268+
``.env.local`` file:
269+
270+
.. code-block:: bash
271+
272+
###> your-recipe-name-here ###
273+
SOME_VAR=value
274+
###< your-recipe-name-here ###
275+
276+
``makefile`` Configurator
277+
~~~~~~~~~~~~~~~~~~~~~~~~~
278+
279+
Adds new tasks to the ``Makefile`` file stored in the root of the Symfony
280+
project. Unlike other configurators, there is no specific entry in the manifest
281+
file. Define tasks by creating a ``Makefile`` file at the root of the recipe
282+
directory (a ``PHP_EOL`` character is added after each line).
283+
284+
Similar to the ``env`` configurator, the contents are copied into the ``Makefile``
285+
file and wrapped with section separators (``###> your-recipe-name-here ###``)
286+
that must not be removed or modified.
287+
249288
``composer-scripts`` Configurator
250289
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251290

@@ -266,6 +305,54 @@ script (``php-script`` for PHP scripts, ``script`` for any shell script and
266305
}
267306
}
268307
308+
``composer-commands`` Configurator
309+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310+
311+
Registers scripts in the ``scripts`` section of the ``composer.json`` file
312+
to execute them manually when running ``composer run the-command``:
313+
314+
.. code-block:: json
315+
316+
{
317+
"composer-commands": {
318+
"test": "bin/phpunit"
319+
}
320+
}
321+
322+
See the `Composer documentation`_ for more information about the
323+
``scripts`` section of the ``composer.json`` file.
324+
325+
``dockerfile`` Configurator
326+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
327+
328+
Adds command lines to the ``Dockerfile``:
329+
330+
.. code-block:: json
331+
332+
{
333+
"dockerfile": [
334+
"RUN install-php-extensions pdo_pgsql"
335+
]
336+
}
337+
338+
``docker-compose`` Configurator
339+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
340+
341+
Adds lines to the main entries of docker compose files:
342+
343+
.. code-block:: json
344+
345+
{
346+
"docker-compose": {
347+
"compose.yml": {
348+
"services": [
349+
"database:",
350+
" image: postgres:${POSTGRES_VERSION:-16}-alpine",
351+
]
352+
}
353+
}
354+
}
355+
269356
``gitignore`` Configurator
270357
~~~~~~~~~~~~~~~~~~~~~~~~~~
271358

@@ -418,3 +505,4 @@ one used by ``symfony/framework-bundle``:
418505
.. _`contrib repository`: https://github.com/symfony/recipes-contrib
419506
.. _`Symfony Console styles and colors`: https://symfony.com/doc/current/console/coloring.html
420507
.. _`RECIPES.md`: https://github.com/symfony/recipes/blob/flex/main/RECIPES.md
508+
.. _`Composer documentation`: https://getcomposer.org/doc/articles/scripts.md#defining-scripts

0 commit comments

Comments
 (0)