Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 2.44 KB

04-development.md

File metadata and controls

85 lines (57 loc) · 2.44 KB

BitBag SyliusWishlistPlugin

Plugin Development

Installation

Clone this repository, go to the plugin root directory and run

composer install
cd tests/Application

If 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 --symlink

Copy 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.json

Then:

yarn install
yarn dev

You're ready to start coding 🎉

Development

To start the development server, from the tests/Application directory run:

symfony server:start

and 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

Frontend

To start working on frontend, from the tests/Application directory run:

yarn watch

It'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 dist command 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

Docker

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 -q

This should make sure test app from docker container is up and running.