-
Notifications
You must be signed in to change notification settings - Fork 0
Development commands
This page documents commands and other useful info for local development work on this project.
These commands need to be run on initial install of the project, and also must be re-run whenever there are changes to the relevant files. To avoid any issues, you should run all of these every time you pull down a new code change.
# install backend components
composer install
# install frontend components
yarn install
# update database schema
symfony console doctrine:migrations:migrate
# rebuild the icon font
yarn icons
For local development, the most useful command is symfony server:start -d
. This starts a local web server as well as some other background processes for automatic rebuilding/processing for the website. If you prefer, you can pass the --no-workers
flag to only run the web server with no other background processes. You can drop the -d
flag if you want to run in the foreground instead of the background.
Here are the commands to run the additional background processes separately (if you used the --no-workers
flag):
-
yarn encore dev --watch
– automatically rebuild JS/CSS assets with Webpack Encore -
symfony console messenger:consume async --time-limit=3600
– runs a messenger worker (for processing newly-uploaded documents)
This is all configured in the .symfony.local.yaml
file in the project's root folder. See Symfony docs for more info.
Use these commands to test the code and check for problems:
-
vendor/bin/phpstan analyze
– analyze code for possible bugs -
vendor/bin/rector
– automatically refactor code (may use--dry-run
first) -
vendor/bin/php-cs-fixer fix
– automatically fix coding style (may use--dry-run
first) -
php bin/phpunit
– run the test suite
The pre-commit script automatically will do a dry run of all these commands, and will abort the commit if any of them fail. Make sure you have the pre-commit hook enabled if you are making commits; see Setup#Pre-commit hook.