Skip to content

Commit

Permalink
Add encore-webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
wbloszyk committed Jul 1, 2020
1 parent 3e834f8 commit e0ab759
Show file tree
Hide file tree
Showing 71 changed files with 11,367 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ phpunit.xml
phpstan.neon
/.phpunit.result.cache
/docs/_build/
node_modules/

# clean up some non bower ready package
src/Resources/public/vendor/admin-lte/bootstrap
Expand Down
2 changes: 2 additions & 0 deletions .travis/install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ chmod u+x "${HOME}/bin/coveralls"
pecl install pcov

composer update --prefer-dist --no-interaction --prefer-stable ${COMPOSER_FLAGS}

make yarn-build
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,19 @@ endif
docs:
cd docs && sphinx-build -W -b html -d _build/doctrees . _build/html
.PHONY: docs

YARN ?= @docker run --rm -it -v ${PWD}:/usr/src/app -w /usr/src/app node:11-alpine yarn
yarn-install:
${YARN} install

yarn-watch:
${YARN} watch

yarn.lock:
$(MAKE) yarn-install

node_modules: yarn.lock
$(MAKE) yarn-install

yarn-build: yarn.lock node_modules
${YARN} build
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"symfony/twig-bridge": "^4.3",
"symfony/twig-bundle": "^4.3",
"symfony/validator": "^4.3",
"symfony/webpack-encore-bundle": "^1.7",
"twig/string-extra": "^3.0",
"twig/twig": "^2.12.1"
},
Expand Down
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"dependencies": {
"admin-lte": "~2.3.10",
"bootstrap": "^3.3",
"eonasdan-bootstrap-datetimepicker": "~3.1.3",
"bootstrap3-dialog": "^1.34",
"font-awesome": "^4.7",
"icheck": "^1.0",
"ionicons": "^4.5.5",
"jquery": "^2.2.3",
"jquery-form": "^4.0",
"jquery-slimscroll": "^1.3",
"jquery-ui": "^1.12.1",
"jquery.scrollto": "^1.4",
"masonry": "^0.0.2",
"masonry-layout": "^4.2",
"moment": "^2.10",
"node-sass": "^4.11.0",
"readmore-js": "^2.2.1",
"sass-loader": "^7.0.1",
"select2": "^3.5",
"select2-bootstrap-css": "^1.4",
"waypoints": "^4.0",
"x-editable": "^1.5"
},
"devDependencies": {
"@symfony/webpack-encore": "^0.27.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}
}
44 changes: 44 additions & 0 deletions src/DependencyInjection/Compiler/WebpackEntriesCompilerPass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sonata\AdminBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* @author Silas Joisten <[email protected]>
*/
final class WebpackEntriesCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
$configs = $container->getExtensionConfig('webpack_encore');

$entries = [];
foreach ($configs as $config) {
if (!isset($config['builds'])) {
continue;
}

$entries = array_merge($entries, $config['builds']);
}

if (!$entries) {
return;
}

$container->getDefinition('twig')
->addMethodCall('addGlobal', ['sonata_admin_webpack_entries', $entries]);
}
}
1 change: 1 addition & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public function getConfigTreeBuilder()
->booleanNode('sort_admins')->defaultFalse()->info('Auto order groups and admins by label or id')->end()
->booleanNode('confirm_exit')->defaultTrue()->end()
->booleanNode('js_debug')->defaultFalse()->end()
->booleanNode('use_webpack')->defaultFalse()->end()
->booleanNode('use_select2')->defaultTrue()->end()
->booleanNode('use_icheck')->defaultTrue()->end()
->booleanNode('use_bootlint')->defaultFalse()->end()
Expand Down
12 changes: 12 additions & 0 deletions src/Resources/public/dist/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entrypoints": {
"sonata_admin": {
"css": [
"/bundles/sonataadmin/dist/sonata_admin.css"
],
"js": [
"/bundles/sonataadmin/dist/sonata_admin.js"
]
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,671 changes: 2,671 additions & 0 deletions src/Resources/public/dist/images/fontawesome-webfont.912ec66d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions src/Resources/public/dist/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"dist/sonata_admin.css": "/bundles/sonataadmin/dist/sonata_admin.css",
"dist/sonata_admin.js": "/bundles/sonataadmin/dist/sonata_admin.js",
"dist/fonts/fontawesome-webfont.eot": "/bundles/sonataadmin/dist/fonts/fontawesome-webfont.674f50d2.eot",
"dist/fonts/fontawesome-webfont.woff2?v=4.7.0": "/bundles/sonataadmin/dist/fonts/fontawesome-webfont.af7ae505.woff2",
"dist/fonts/fontawesome-webfont.ttf?v=4.7.0": "/bundles/sonataadmin/dist/fonts/fontawesome-webfont.b06871f2.ttf",
"dist/fonts/fontawesome-webfont.woff?v=4.7.0": "/bundles/sonataadmin/dist/fonts/fontawesome-webfont.fee66e71.woff",
"dist/fonts/glyphicons-halflings-regular.woff2": "/bundles/sonataadmin/dist/fonts/glyphicons-halflings-regular.448c34a5.woff2",
"dist/fonts/glyphicons-halflings-regular.ttf": "/bundles/sonataadmin/dist/fonts/glyphicons-halflings-regular.e18bbf61.ttf",
"dist/fonts/glyphicons-halflings-regular.eot": "/bundles/sonataadmin/dist/fonts/glyphicons-halflings-regular.f4769f9b.eot",
"dist/fonts/glyphicons-halflings-regular.woff": "/bundles/sonataadmin/dist/fonts/glyphicons-halflings-regular.fa277232.woff",
"dist/fonts/ionicons.woff2?v=4.6.3": "/bundles/sonataadmin/dist/fonts/ionicons.96f1c901.woff2",
"dist/fonts/ionicons.woff?v=4.6.3": "/bundles/sonataadmin/dist/fonts/ionicons.99b86349.woff",
"dist/fonts/ionicons.eot?v=4.6.3": "/bundles/sonataadmin/dist/fonts/ionicons.a558ac78.eot",
"dist/fonts/ionicons.ttf?v=4.6.3": "/bundles/sonataadmin/dist/fonts/ionicons.ef4a9f28.ttf",
"dist/images/aero.png": "/bundles/sonataadmin/dist/images/aero.242eaf8c.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/blue.png": "/bundles/sonataadmin/dist/images/blue.4a709f8c.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/boxed-bg.jpg": "/bundles/sonataadmin/dist/images/boxed-bg.7799dece.jpg",
"dist/images/clear.png": "/bundles/sonataadmin/dist/images/clear.f4708630.png",
"dist/images/fontawesome-webfont.svg?v=4.7.0": "/bundles/sonataadmin/dist/images/fontawesome-webfont.912ec66d.svg",
"dist/images/glyphicons-halflings-regular.svg": "/bundles/sonataadmin/dist/images/glyphicons-halflings-regular.89889688.svg",
"dist/images/green.png": "/bundles/sonataadmin/dist/images/green.3b4856d9.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/grey.png": "/bundles/sonataadmin/dist/images/grey.c2cdcc76.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/ionicons.svg?v=4.6.3": "/bundles/sonataadmin/dist/images/ionicons.d6592091.svg",
"dist/images/loading.gif": "/bundles/sonataadmin/dist/images/loading.7b977607.gif",
"dist/images/minimal.png": "/bundles/sonataadmin/dist/images/minimal.5374dd98.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/orange.png": "/bundles/sonataadmin/dist/images/orange.e7333f83.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/pink.png": "/bundles/sonataadmin/dist/images/pink.375a3b19.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/purple.png": "/bundles/sonataadmin/dist/images/purple.e01e49af.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/red.png": "/bundles/sonataadmin/dist/images/red.7f62af20.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]",
"dist/images/select2-spinner.gif": "/bundles/sonataadmin/dist/images/select2-spinner.7b977607.gif",
"dist/images/select2.png": "/bundles/sonataadmin/dist/images/select2.2ca61b76.png",
"dist/images/select2x2.png": "/bundles/sonataadmin/dist/images/select2x2.49e3f006.png",
"dist/images/ui-icons_444444_256x240.png": "/bundles/sonataadmin/dist/images/ui-icons_444444_256x240.a4c733ec.png",
"dist/images/ui-icons_555555_256x240.png": "/bundles/sonataadmin/dist/images/ui-icons_555555_256x240.97136473.png",
"dist/images/ui-icons_777620_256x240.png": "/bundles/sonataadmin/dist/images/ui-icons_777620_256x240.208a2901.png",
"dist/images/ui-icons_777777_256x240.png": "/bundles/sonataadmin/dist/images/ui-icons_777777_256x240.73a1fd05.png",
"dist/images/ui-icons_cc0000_256x240.png": "/bundles/sonataadmin/dist/images/ui-icons_cc0000_256x240.0de3b517.png",
"dist/images/ui-icons_ffffff_256x240.png": "/bundles/sonataadmin/dist/images/ui-icons_ffffff_256x240.bf27228a.png",
"dist/images/yellow.png": "/bundles/sonataadmin/dist/images/yellow.0bd13b60.png",
"dist/images/[email protected]": "/bundles/sonataadmin/dist/images/[email protected]"
}
Loading

0 comments on commit e0ab759

Please sign in to comment.