Clone this repository, go to the plugin root directory and run
composer install
cd tests/ApplicationIf needed, create .env.local file with the correct configuration for your environment in the tests/Application directory.
Then run the following commands from tests/Application:
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console sylius:fixtures:load
bin/console assets:install --symlinkCopy package.json.~1.xx.dist file to package.json for specific version of Sylius (example for 1.12.0):
cp package.json.\~1.12.dist package.jsonThen:
yarn install
yarn devYou're ready to start coding 🎉
To start the development server, from the tests/Application directory run:
symfony server:startand then you should get information about the server address and port (usually http://localhost:8000).
If you don't already have Symfony CLI, here's how to install it: https://symfony.com/download
To start working on frontend, from the tests/Application directory run:
yarn watchIt's an infinite process, which will watch your changes in the assets folder and (re)build them. So all of your frontend changes should be done in {root}/src/Resources/assets directory. We have configured two independent entry points that should not be combined - shop for the storefront and admin for the admin panel.
⚠ Note: Before every commit, you should type the
yarn distcommand from the plugin root directory to rebuild dist assets, which are located in{root}/src/Resources/public.
You also shouldn't add assets to this folder manually because they will be removed automatically
To test plugin with docker You can use:
$ docker-compose up
$ docker-compose exec -it app composer install
$ docker-compose exec -it app yarn install
$ docker-compose exec -it -w /app/tests/Application app bin/console d:d:c
$ docker-compose exec -it -w /app/tests/Application app bin/console d:s:c
$ docker-compose exec -it -w /app/tests/Application app bin/console sy:fi:lo -qThis should make sure test app from docker container is up and running.