Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Add symfony/webpack-encore-bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
wbloszyk committed Jul 10, 2020
1 parent 584de8a commit efaf91c
Show file tree
Hide file tree
Showing 64 changed files with 17,326 additions and 39 deletions.
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,15 @@
/build

### Composer
/composer.lock
/composer.lock

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
/builds_configs/sonata_admin_adminlte2/node_modules/
/builds_configs/sonata_admin_adminlte3/node_modules/
/builds_configs/sonata_page_bootstrap_3/node_modules/
/builds_configs/sonata_page_bootstrap_4/node_modules/
###< symfony/webpack-encore-bundle ###
99 changes: 77 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,92 @@
Sonata respects the symfony’s conventions about contributing to the code. So before going further please review the [contributing documentation of Symfony](http://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request).
Sonata Standard Edition
=======================

## Reporting bugs
What's inside?
--------------

If you happen to find a bug, we kindly request you to report it. However, before submitting it, please:
Sonata Standard Edition comes pre-configured with the following bundles:

* Check the [project documentation available online](https://sonata-project.org/bundles/)
* Bundles from Symfony Standard distribution
* Sonata Admin Bundles: Admin and Doctrine ORM Admin
* Sonata Ecommerce Bundles: Payment, Customer, Invoice, Order and Product
* Sonata Foundation Bundles: Notification, Formatter, Intl, Cache, Seo and Easy Extends
* Sonata Feature Bundles: Page, Media, News, User, Block, Timeline
* Api Bundles: FOSRestBundle, BazingaHateoasBundle, NelmioApiDocBundle and JMSSerializerBundle

Then, if it appears that it’s a real bug, you may report it using Github by following these 3 points:
Installation
------------

* Check if the bug is not already reported!
* A clear title to resume the issue
* A description of the workflow needed to reproduce the bug,
### Download sandbox files by one of possible examples

> _NOTE:_ Don’t hesitate giving as much information as you can (OS, PHP version extensions …)
Curl:

## Sending a Pull Request
curl -L github https://github.com/sonata-project/sandbox-build/archive/master.tar.gz | tar xzv
cd sandbox

When you send a PR, just make sure that:
Git:

* You add valid test cases.
* Tests are green.
* The related documentation is up-to-date.
* Also don't forget to add a comment when you update a PR with a ping to the maintainer (``@username``), so he/she will get a notification.
git clone https://github.com/sonata-project/sandbox.git
cd sandbox
git checkout master

### Prepare configuration

## Contributing to the documentation
* Copy configuration file: ``cp .env .env.local``
* Edit ``.env.local`` to configure own environment

You need to install the python tool to check and validate the sphinx syntax:
### Load fixtures data

pip install -r Resources/doc/requirements.txt
vendor/bin/phing

* You should be ready to go ...

and you can check the documentation with the command:
Vagrant Installation
--------------------

cd Resources/doc/
rm -rf _build && sphinx-build -W -b html -d _build/doctrees . _build/html
* vagrant up --provision --provider=virtualbox (Vagrant is going to get the environnement, install it for you and load sonata sample data)
* Configure your host ``sudo nano /etc/hosts`` and add this line ``192.168.33.99 sonata.local``
* Open your browser [here][link_sonata]

The html will be available in the ``_build/html`` folder.

Run
---

If you are running PHP 7.2 or above, you can use symfony to start the demo:

symfony server:start --port=9090

Now open your browser and go to http://localhost:9090/

Tests
-----

### Functional testing

To run the Behat tests, copy the default configuration file and adjust the base_url to your needs

* Copy configuration file: ``cp behat.yml.dist behat.yml``
* Edit it ``behat.yml``

You can now run the tests suite by using the following command:

bin/qa_behat.sh

To get more informations about Behat, feel free to check [the official documentation][link_behat].


### Unit testing

To run the sandbox test suites, you can run the command:

vendor/bin/simple-phpunit

You can also run the whole sonata-project bundles test suites by using the following command:

bin/qa_client_ci.sh

Enjoy!

[link_behat]: http://docs.behat.org "the official Behat documentation"
[link_vagrant]: http://www.vagrantup.com/downloads.html "Download Vagrant"
[link_virtualbox]: https://www.virtualbox.org/wiki/Downloads "Download VirtualBox"
[link_sonata]: http://sonata.local "Sonata"
29 changes: 29 additions & 0 deletions CONTRIBUTING_WEBPACK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Contributing webpack encore
===========================

### webpack configuration

You can find configuration for each build under `builds_configs` directory. This structure will allow use diffrence
configuration for each layouts.

```
cd ./builds_configs/sonata_admin_adminlte2
yarn install // to install node_modules
yarn encore dev // to generate files under `public/build/sonata_admin
```

### templates and css frameworks

Symfony allow override templates by using templates ([see more][link_symfony_templates]). Use it for testing your change.
Before create PR move this file to used framework, for example `templates/bootstrap3`. You can also add other css frameworks
and templates for them.

### Links:

- [webpack encore dev-kit issue][link_issue]
- [symfony webpack guide][link_symfony_webpack]


[link_issue]: https://github.com/sonata-project/dev-kit/issues/779 "webpack encore dev-kit issue"
[link_symfony_webpack]: https://symfony.com/doc/current/frontend.html#webpack-encore "symfony webpack encore"
[link_symfony_templates]: https://symfony.com/doc/current/bundles/override.html "symfony override templates"
3 changes: 3 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-color: lightgray;
}
14 changes: 14 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)
import '../css/app.css';

// Need jQuery? Install it with "yarn add jquery", then uncomment to import it.
// import $ from 'jquery';

console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
Loading

0 comments on commit efaf91c

Please sign in to comment.