From f5eaa6e5d7c6cd208ea5c9dcd60e873df1c65707 Mon Sep 17 00:00:00 2001 From: Pierre Rigal Date: Fri, 17 Jul 2015 10:10:40 +0200 Subject: [PATCH 1/8] Use bower to manage libs (angular, bootstrap, ...) --- bower.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 bower.json diff --git a/bower.json b/bower.json new file mode 100644 index 00000000..db2de226 --- /dev/null +++ b/bower.json @@ -0,0 +1,20 @@ +{ + "name": "starter-laravel", + "version": "0.1", + "homepage": "https://github.com/pierrerigal/starter-laravel-angular", + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "angular": "1.4.2", + "angular-route": "1.4.2", + "angular-resource": "1.4.2", + "ngstorage": "~0.3.7", + "bootstrap": "~3.3.5" + } +} \ No newline at end of file From 5a31df42b30d2eb42103b7f95bc05c3c2166b0c7 Mon Sep 17 00:00:00 2001 From: Pierre Rigal Date: Fri, 17 Jul 2015 10:11:58 +0200 Subject: [PATCH 2/8] Add livereload to Elixir recipe --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f45052ae..dbfdc8ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "devDependencies": { "gulp": "^3.8.8", - "laravel-elixir": "*" + "laravel-elixir": "*", + "laravel-elixir-livereload": "0.0.3" } } From 7a4e3ea0a6f23c620d81fe6bd87ec7460aa85121 Mon Sep 17 00:00:00 2001 From: Pierre Rigal Date: Fri, 17 Jul 2015 10:12:46 +0200 Subject: [PATCH 3/8] New gulpfile to handle bower components and livreload. --- gulpfile.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 43881b90..3151bbd1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,5 @@ var elixir = require('laravel-elixir'); - +require('laravel-elixir-livereload'); /* |-------------------------------------------------------------------------- | Elixir Asset Management @@ -20,7 +20,12 @@ elixir(function (mix) { 'style.css' ]) .scripts([ - 'libs/**/*.js', + '../../../bower_components/jquery/dist/jquery.js', + '../../../bower_components/angular/angular.js', + '../../../bower_components/ngstorage/ngStorage.js', + '../../../bower_components/angular-route/angular-route.js', + '../../../bower_components/angular-resource/angular-resource.js', + '../../../bower_components/bootstrap/dist/js/bootstrap.js', 'app.js', 'appRoutes.js', 'controllers/**/*.js', @@ -32,9 +37,10 @@ elixir(function (mix) { 'js/all.js' ]) .copy( - 'public/js/all.js.map', 'public/build/js/all.js.map' - ) + 'public/js/all.js.map', 'public/build/js/all.js.map' + ) .copy( - 'public/css/all.css.map', 'public/build/css/all.css.map' - ); + 'public/css/all.css.map', 'public/build/css/all.css.map' + ); + .livereload(); }); \ No newline at end of file From e39d8e0e17bec7b032f777eb4a02a0ed8a2930ed Mon Sep 17 00:00:00 2001 From: Pierre Rigal Date: Fri, 17 Jul 2015 10:16:14 +0200 Subject: [PATCH 4/8] Fix a bug with livereload --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 3151bbd1..25bfdfb7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -41,6 +41,6 @@ elixir(function (mix) { ) .copy( 'public/css/all.css.map', 'public/build/css/all.css.map' - ); + ) .livereload(); }); \ No newline at end of file From d9c67af43c37df510ad29d82017af3f23dddfc4b Mon Sep 17 00:00:00 2001 From: Pierre Rigal Date: Fri, 17 Jul 2015 10:17:52 +0200 Subject: [PATCH 5/8] Integrate Bootstrap from bower component folder. --- resources/assets/less/app.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/less/app.less b/resources/assets/less/app.less index 99be0764..11d0bf33 100644 --- a/resources/assets/less/app.less +++ b/resources/assets/less/app.less @@ -1,4 +1,4 @@ -@import "bootstrap/bootstrap"; +@import "../../../bower_components/bootstrap/less/bootstrap"; @btn-font-weight: 300; @font-family-sans-serif: "Roboto", Helvetica, Arial, sans-serif; From d51d4761e2f22aa2521ae5c00b599351822e9210 Mon Sep 17 00:00:00 2001 From: Pierre Rigal Date: Fri, 17 Jul 2015 10:18:21 +0200 Subject: [PATCH 6/8] Exclude bower_components folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9ceb7e73..263d176d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/bower_components /node_modules .env /public/css From 4ae1bec9812542b85848b60a421c0ba942790020 Mon Sep 17 00:00:00 2001 From: Pierre Rigal Date: Fri, 17 Jul 2015 10:21:54 +0200 Subject: [PATCH 7/8] Include livereload script --- resources/views/layout.blade.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/views/layout.blade.php b/resources/views/layout.blade.php index bd78c87b..2e291a78 100644 --- a/resources/views/layout.blade.php +++ b/resources/views/layout.blade.php @@ -38,6 +38,10 @@
- +@if ( Config::get('app.debug') ) + +@endif From c36e9732d6492eb6a33811373d1284a888c02f39 Mon Sep 17 00:00:00 2001 From: Pierre Rigal Date: Fri, 17 Jul 2015 10:23:38 +0200 Subject: [PATCH 8/8] Update README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44d0ca2f..688c6d68 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ This is a repo for a starter application for a Single Page Application featuring - Versioning of CSS and JS files (cache busting) - CSS and JS files will be included automatically - A whole ready CRUD architecture -- Comes with Bootstrap and AngularJS configured to work together at their best +- Comes with Bootstrap and AngularJS (via Bower) configured to work together at their best +- Livereload is enabled (cf https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei) - And more... have a try! ## Installation @@ -31,6 +32,9 @@ composer install --prefer-dist ``` npm install ``` +``` +bower install +``` ### Database Setup