From b7030c909df54432b374eea2165143f2c2277b59 Mon Sep 17 00:00:00 2001 From: Roderik van der Veer Date: Thu, 17 Apr 2014 10:49:15 +0200 Subject: [PATCH] Move bower configs to the generator and update+fix the bower dependencies --- Generator/LayoutGenerator.php | 10 ++++++++++ .../skeleton/layout/bower/.bowerrc | 3 +++ .../skeleton/layout/bower/bower.json | 17 +++++++++++++++++ .../skeleton/layout/grunt/Gruntfile.js | 4 ++-- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 Resources/SensioGeneratorBundle/skeleton/layout/bower/.bowerrc create mode 100644 Resources/SensioGeneratorBundle/skeleton/layout/bower/bower.json diff --git a/Generator/LayoutGenerator.php b/Generator/LayoutGenerator.php index 31e54fc3..7c1c634c 100644 --- a/Generator/LayoutGenerator.php +++ b/Generator/LayoutGenerator.php @@ -31,6 +31,7 @@ public function generate(BundleInterface $bundle, $rootDir) $this->rootDir = $rootDir; $this->generateGruntFiles(); + $this->generateBowerFiles(); $this->generateAssets(); $this->generateTemplate(); } @@ -45,6 +46,15 @@ private function generateGruntFiles() $this->assistant->writeLine('Generating grunt configuration : OK'); } + /** + * Generate the bower configuration files. + */ + private function generateBowerFiles() + { + $this->renderFiles($this->skeletonDir.'/bower/', $this->rootDir, array('bundle' => $this->bundle), true); + $this->assistant->writeLine('Generating bower configuration : OK'); + } + /** * Generate the public asset files. */ diff --git a/Resources/SensioGeneratorBundle/skeleton/layout/bower/.bowerrc b/Resources/SensioGeneratorBundle/skeleton/layout/bower/.bowerrc new file mode 100644 index 00000000..518150e9 --- /dev/null +++ b/Resources/SensioGeneratorBundle/skeleton/layout/bower/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "web/vendor/" +} diff --git a/Resources/SensioGeneratorBundle/skeleton/layout/bower/bower.json b/Resources/SensioGeneratorBundle/skeleton/layout/bower/bower.json new file mode 100644 index 00000000..41eba2ed --- /dev/null +++ b/Resources/SensioGeneratorBundle/skeleton/layout/bower/bower.json @@ -0,0 +1,17 @@ +{ + "name": "{{ bundle.getName() }}", + "version": "1.0.0", + "dependencies": { + "sass-bootstrap": "~3.0", + "bourbon": "~3.1", + "jquery": "~1.11", + "cupcake": "~1.6", + "html5shiv": "~3.7", + "socialite-js": "v2.0", + "flexslider": "latest", + "fitvids": "~1.1", + "svgeezy": "~1.0", + "jquery-placeholder": "~2.0", + "fancybox": "~2.1" + } +} diff --git a/Resources/SensioGeneratorBundle/skeleton/layout/grunt/Gruntfile.js b/Resources/SensioGeneratorBundle/skeleton/layout/grunt/Gruntfile.js index 8127dc2c..0d02ce41 100644 --- a/Resources/SensioGeneratorBundle/skeleton/layout/grunt/Gruntfile.js +++ b/Resources/SensioGeneratorBundle/skeleton/layout/grunt/Gruntfile.js @@ -130,11 +130,11 @@ module.exports = function (grunt) { }, files: { 'web/frontend/.temp/js/vendors.min.js': [ - 'web/vendor/jquery/jquery.js', + 'web/vendor/jquery/dist/jquery.js', 'web/vendor/sass-bootstrap/js/modal.js', 'web/vendor/flexslider/jquery.flexslider.js', 'web/vendor/fitvids/jquery.fitvids.js', - 'web/vendor/socialite/socialite.js', + 'web/vendor/socialite-js/socialite.js', 'web/vendor/fancybox/source/jquery.fancybox.js', 'web/vendor/cupcake/js/navigation/jquery.navigation.js', ]