Skip to content
This repository has been archived by the owner on Jan 18, 2018. It is now read-only.

Commit

Permalink
Switched to Elixir for asset management
Browse files Browse the repository at this point in the history
Closes #167.

Signed-off-by: Graham Campbell <graham@alt-three.com>
  • Loading branch information
Joshua Wilson authored and GrahamCampbell committed Aug 10, 2015
1 parent 04a0b43 commit ef615a3
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 125 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.env
phpunit.xml
vendor
node_modules
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -11,7 +11,7 @@ install:
- travis_retry composer install --no-interaction --prefer-source

before_script:
- travis_retry php artisan asset:generate --env=testing
- travis_retry gulp

script:
- bash -c 'if [ "$TRAVIS_PHP_VERSION" == "hhvm" ]; then vendor/bin/phpunit; fi;'
Expand Down
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -38,9 +38,9 @@ Version 0.8 is currently more stable than this version (0.9), and is available o
6. Finally, setup an [Apache VirtualHost](http://httpd.apache.org/docs/current/vhosts/examples.html) to point to the "public" folder.
* For development, you can simply run `php artisan serve`
7. Additionally, you may to setup some of Bootstrap CMS's other features (see below).
* Some things, like [caching](#setting-up-caching) and [queuing](#setting-up-queing), are disabled out of the box
* Some things, like [caching](#setting-up-caching) and [queuing](#setting-up-queuing), are disabled out of the box
* This is to allow Bootstrap CMS to work with minimal setup
* Also note, without caching asset generation will cause page load delay - to reduce this, I have turned off minification in `config/asset.php` by default
* For use in production run `gulp --production` to minify assets. See [relevant docs](http://laravel.com/docs/5.0/elixir).


## Setting Up Queuing
Expand All @@ -58,9 +58,7 @@ Note that caching will not work with Laravel's `file` or `database` cache driver

1. Choose your poison - I'd recommend [Redis](http://redis.io).
2. Enter your cache server details into `config/cache.php`.
3. You will probably want to enabled minification in `config/asset.php`.
4. Setting the driver to array will effectively disable caching if you don't want the overhead.

3. Setting the driver to array will effectively disable caching if you don't want the overhead.

## Setting Up Themes

Expand Down
1 change: 0 additions & 1 deletion app/Providers/AppServiceProvider.php
Expand Up @@ -38,7 +38,6 @@ public function boot()
{
$this->setupBlade();

require __DIR__.'/../assets.php';
require __DIR__.'/../listeners.php';
}

Expand Down
61 changes: 0 additions & 61 deletions app/assets.php

This file was deleted.

5 changes: 0 additions & 5 deletions composer.json
Expand Up @@ -10,10 +10,6 @@
}
],
"repositories": [
{
"type": "vcs",
"url": "https://github.com/BootstrapCMS/Asset"
},
{
"type": "vcs",
"url": "https://github.com/BootstrapCMS/Sentry"
Expand All @@ -23,7 +19,6 @@
"php": ">=5.5.0",
"laravel/framework": "5.0.*",
"illuminate/html": "5.0.*",
"lightgear/asset": "~2.0",
"fideloper/proxy": "~3.0",
"graham-campbell/exceptions": "~1.0",
"graham-campbell/core": "~2.0",
Expand Down
2 changes: 0 additions & 2 deletions config/app.php
Expand Up @@ -144,7 +144,6 @@
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'McCool\LaravelAutoPresenter\LaravelAutoPresenterServiceProvider',
'Lightgear\Asset\AssetServiceProvider',
'Cartalyst\Sentry\SentryServiceProvider',
'Fideloper\Proxy\TrustedProxyServiceProvider',
'GrahamCampbell\Core\CoreServiceProvider',
Expand Down Expand Up @@ -210,7 +209,6 @@
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Asset' => 'Lightgear\Asset\Facades\Asset',

],

Expand Down
45 changes: 0 additions & 45 deletions config/asset.php

This file was deleted.

33 changes: 33 additions & 0 deletions gulpfile.js
@@ -0,0 +1,33 @@
//disable gulp notifications to avoid issues with gulp-notify on Homestead VMs
process.env.DISABLE_NOTIFIER = true

var elixir = require('laravel-elixir');
//
stylesPath = 'public/assets/styles/';
scriptsPath = 'public/assets/scripts/';

elixir.config.css.outputFolder = stylesPath;
elixir.config.js.outputFolder = scriptsPath;
//disable source maps
elixir.config.sourcemaps = false;
/*
* This is the Elixir gulpfile. It is used by Bootstrap CMS for asset management.
*/
elixir(function (mix) {
//Bootstrap themes
mix.copy('resources/assets/css/bootstrap.*.min.css', stylesPath);
mix.styles(['bootstrap.min.css'], stylesPath + 'bootstrap.default.min.css');
mix.styles(['bootstrap.min.css', 'bootstrap-theme.min.css'], stylesPath + 'bootstrap.legacy.min.css');

//BoostrapCMS styles (custom style sheets used site-wide may be added to the array below).
mix.styles(['cms-main.css'], stylesPath + 'cms-main.css');

//BootstrapCMS scripts
mix.scripts(['cms-timeago.js', 'cms-restfulizer.js', 'cms-carousel.js', 'cms-alerts.js'], scriptsPath + 'cms-main.js');
mix.scripts(['cms-picker.js'], scriptsPath + 'cms-picker.js');
mix.scripts(['cms-comment-core.js', 'cms-comment-edit.js', 'cms-comment-delete.js', 'cms-comment-create.js', 'cms-comment-fetch.js', 'cms-comment-main.js'], scriptsPath + 'cms-comment.js');

//maximebf/DebugBar assets
mix.copy('vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/highlightjs/styles/github.css', stylesPath + 'debugbar.css')
mix.copy('vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/highlightjs/highlight.pack.js', scriptsPath + 'debugbar.js')
});
10 changes: 10 additions & 0 deletions package.json
@@ -0,0 +1,10 @@
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^3.0.0",
"bootstrap-sass": "^3.0.0"
}
}
2 changes: 1 addition & 1 deletion resources/views/events/create.blade.php
Expand Up @@ -39,5 +39,5 @@
<script>
js_datetime_format = '<?= Config::get("date.js_format"); ?>';
</script>
{!! Asset::scripts('picker') !!}
{!! HTML::script('/assets/scripts/cms-picker.js') !!}
@stop
2 changes: 1 addition & 1 deletion resources/views/events/edit.blade.php
Expand Up @@ -58,5 +58,5 @@
<script>
js_datetime_format = '<?= Config::get("date.js_format"); ?>';
</script>
{!! Asset::scripts('picker') !!}
{!! HTML::script('/assets/scripts/cms-picker.js') !!}
@stop
2 changes: 1 addition & 1 deletion resources/views/partials/footer.blade.php
Expand Up @@ -25,7 +25,7 @@
{!! HTML::script('//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js') !!}
{!! HTML::script('//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.1/jquery.timeago.min.js') !!}
{!! HTML::script('//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js') !!}
{!! Asset::scripts('main') !!}
{!! HTML::script('/assets/scripts/cms-main.js') !!}
@section('js')
@show
@if (Config::get('analytics.google'))
Expand Down
4 changes: 3 additions & 1 deletion resources/views/partials/header.blade.php
Expand Up @@ -4,7 +4,9 @@

{!! HTML::style('//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css') !!}
{!! HTML::style('//cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.3/animate.min.css') !!}
{!! Asset::styles('main') !!}
{!! HTML::style('/assets/styles/cms-main.css') !!}
{!! HTML::style('/assets/styles/bootstrap.'.Config::get('theme.name','default').'.min.css') !!}

@section('css')
@show

Expand Down
2 changes: 1 addition & 1 deletion resources/views/posts/show.blade.php
Expand Up @@ -152,5 +152,5 @@
var cmsCommentInterval = {!! Config::get('cms.commentfetch') !!};
var cmsCommentTime = {!! Config::get('cms.commenttrans') !!};
</script>
{!! Asset::scripts('comment') !!}
{!! HTML::script('assets/scripts/cms-comment.js') !!}
@stop

0 comments on commit ef615a3

Please sign in to comment.