Skip to content

Commit

Permalink
OP-291: Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hmfilar committed Jul 19, 2024
1 parent 5e7c0e0 commit 52b2787
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 81 deletions.
68 changes: 17 additions & 51 deletions doc/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,76 +9,42 @@
1. *We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.*

```bash
$ composer require bitbag/wishlist-plugin
composer require bitbag/wishlist-plugin
```

2. Add plugin dependencies to your `config/bundles.php` file:
```php
// config/bundles.php

return [
...

BitBag\SyliusWishlistPlugin\BitBagSyliusWishlistPlugin::class => ['all' => true],
];
```

3. Import required config in your `config/packages/_sylius.yaml` file:
```yaml
# config/packages/_sylius.yaml

imports:
...

- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/config.yml" }
```
4. Import routing in your `config/routes.yaml` file:
2. Override `OrderItemController`

```yaml
# config/routes.yaml
sylius_order:
resources:
order_item:
classes:
controller: BitBag\SyliusWishlistPlugin\Controller\OrderItemController

bitbag_sylius_wishlist_plugin:
resource: "@BitBagSyliusWishlistPlugin/Resources/config/routing.yml"
```

5. Clear application cache by using command:
3. Clear application cache by using command:

```bash
$ bin/console cache:clear
bin/console cache:clear
```

6. Update your database

First, please run legacy-versioned migrations by using command:

```bash
$ bin/console doctrine:migrations:migrate
```

After migration, please create a new diff migration and run it:
4. Update your database

```bash
$ bin/console doctrine:migrations:diff
$ bin/console doctrine:migrations:migrate
bin/console doctrine:migrations:migrate
```

**Note:** If you are running it on production, add the `-e prod` flag to this command.

**Note:** If you are updating this plugin from version 1.4.x you need to run:
5. Please add plugin templates into your project:

```bash
$ bin/console doctrine:migrations:version BitBag\\SyliusWishlistPlugin\\Migrations\\Version20201029161558 --add --no-interaction
cp -R vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/Product templates/bundles/SyliusShopBundle
cp vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/_header.html.twig templates/bundles/SyliusShopBundle
cp vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/_logo.html.twig templates/bundles/SyliusShopBundle
```

7. Please add plugin templates into your project:
```bash
$ cp -R vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/Product templates/bundles/SyliusShopBundle
$ cp vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/_header.html.twig templates/bundles/SyliusShopBundle
$ cp vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/_logo.html.twig templates/bundles/SyliusShopBundle
```

8. Add plugin assets to your project
6. Add plugin assets to your project

We recommend you to use Webpack (Encore), for which we have prepared four different instructions on how to add this plugin's assets to your project:

Expand All @@ -97,7 +63,7 @@ However, if you are not using Webpack, here are instructions on how to add optim
## Asynchronous Messenger case

In case you use asynchronous Messenger transport by default, there is a need to configure all Wishlist commands to sync transport.
You can do this by configuring the `WishlistSyncCommandInterface` interface to sync transport (as presented on code listing below).
You can do this by configuring the `WishlistSyncCommandInterface` interface to sync transport (as presented on code listing below).

```yaml
# config/packages/messenger.yaml
Expand Down
2 changes: 1 addition & 1 deletion doc/01.5-non-webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
1. Install plugin assets using:

```bash
$ bin/console assets:install
bin/console assets:install
```

2. Add twig inclusions in your templates:
Expand Down
8 changes: 4 additions & 4 deletions doc/03-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

Run the below command to see what Symfony services are shared with this plugin:
```bash
$ bin/console debug:container | grep bitbag_sylius_wishlist_plugin
bin/console debug:container | grep bitbag_sylius_wishlist_plugin
```

### List of parameters you can override in your parameters.yml(.dist) file
```bash
$ bin/console debug:container --parameters | grep bitbag
$ bin/console debug:container --parameters | grep wishlist
```
bin/console debug:container --parameters | grep bitbag
bin/console debug:container --parameters | grep wishlist
```
24 changes: 12 additions & 12 deletions doc/04-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@
Clone this repository, go to the plugin root directory and run

```bash
$ composer install
$ cd tests/Application
composer install
cd tests/Application
```

If needed, create `.env.local` file with the correct configuration for your environment in the `tests/Application` directory. <br>
Then run the following commands from `tests/Application`:

```bash
$ bin/console doctrine:database:create
$ bin/console doctrine:schema:create
$ bin/console sylius:fixtures:load
$ bin/console assets:install --symlink
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):
```bash
$ cp package.json.\~1.12.dist package.json
cp package.json.\~1.12.dist package.json
```

Then:

```bash
$ yarn install
$ yarn dev
yarn install
yarn dev
```

You're ready to start coding 🎉
Expand All @@ -48,7 +48,7 @@ You're ready to start coding 🎉
To start the development server, from the `tests/Application` directory run:

```bash
$ symfony server:start
symfony server:start
```

and then you should get information about the server address and port (usually http://localhost:8000). <br>
Expand All @@ -60,9 +60,9 @@ If you don't already have Symfony CLI, here's how to install it: https://symfony
To start working on frontend, from the `tests/Application` directory run:

```bash
$ yarn watch
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`. <br> <br> You also shouldn't add assets to this folder manually because **they will be removed automatically**
> **⚠ 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`. <br> <br> You also shouldn't add assets to this folder manually because **they will be removed automatically**
26 changes: 13 additions & 13 deletions doc/05-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
## Testing

```bash
$ composer install
$ cd tests/Application
composer install
cd tests/Application
```

Copy `package.json.~1.xx.dist` file to `package.json` for specific version of Sylius (example for 1.12.0):
```bash
$ cp package.json.\~1.12.dist package.json
cp package.json.\~1.12.dist package.json
```

Then:

```bash
$ yarn install
$ yarn dev
$ APP_ENV=test bin/console assets:install public
$ APP_ENV=test bin/console doctrine:schema:create
$ cd ../..
$ APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
$ open https://localhost:8080
$ vendor/bin/behat
$ vendor/bin/phpspec run
```
yarn install
yarn dev
APP_ENV=test bin/console assets:install public
APP_ENV=test bin/console doctrine:schema:create
cd ../..
APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
open https://localhost:8080
vendor/bin/behat
vendor/bin/phpspec run
```

0 comments on commit 52b2787

Please sign in to comment.