Skip to content

Commit

Permalink
Set up bower and npm for great justice
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Winson committed Jul 4, 2015
1 parent fea97c0 commit 03947f0
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
bower_components/
public/
34 changes: 34 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "solar-watt",
"version": "0.0.0",
"homepage": "https://github.com/sushack/solar-watt",
"authors": [
"Alex Winson <[email protected]>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": "~1.4.0",
"angular-ui-router": "~0.2.14",
"lodash": "~3.8.0",
"restangular": "~1.5.1",
"angular-loading-bar": "~0.7.1",
"bootstrap": "~3.3.4",
"angular-bootstrap": "~0.13.0",
"angular-carousel": "~0.3.10",
"angular-ui-select2": "~0.0.5",
"moment": "~2.10.3",
"angular-moment": "~0.10.1",
"angular-timeago": "~0.1.12",
"ngtoast": "~1.5.4"
},
"resolutions": {
"angular": "~1.4.0"
}
}
118 changes: 118 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*jslint node: true */
(function() {
'use strict';
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var livereload = require('gulp-livereload');
var del = require('del');
var templateCache = require('gulp-angular-templatecache');
var foreman = require('gulp-foreman');

gulp.task('clean', function() {
return del(['public']);
});
gulp.task('scripts', function() {
return gulp.src([
'!solarwatt/**/*.spec.js',
'solarwatt/auth/auth.module.js',
'solarwatt/auth/auth.factory.js',
'solarwatt/**/*.module.js',
'solarwatt/**/*.controller.js',
'solarwatt/**/*.js',
'solarwatt/app.js'
])
.pipe(concat('main.js'))
.pipe(gulp.dest('public/javascripts'))
.pipe(rename({
suffix: '.min'
})).pipe(uglify())
.pipe(gulp.dest('public/javascripts'));
});
gulp.task('template_cache', function() {
return gulp.src('solarwatt/**/*.html')
.pipe(templateCache({
module: 'solarwatt.templates',
standalone: true
}))
.pipe(gulp.dest('public/javascripts'));
});

gulp.task('favicon', function() {
return gulp.src('favicon.ico')
.pipe(gulp.dest('public'));
});

gulp.task('select2_images', function() {
return gulp.src([
'bower_components/select2/select2.png',
'bower_components/select2/select2-spinner.gif',
])
.pipe(gulp.dest('public/stylesheets'));
});

gulp.task('vendor_images', ['favicon', 'select2_images']);
gulp.task('vendor_js', function() {
return gulp.src(
[
'bower_components/jquery/dist/jquery.js',
'bower_components/select2/select2.js',
'bower_components/angular/angular.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
'bower_components/lodash/lodash.js',
'bower_components/restangular/dist/restangular.js',
'bower_components/angular-loading-bar/build/loading-bar.js',
'bower_components/angular-bootstrap/ui-bootstrap.js',
'bower_components/angular-touch/angular-touch.js',
'bower_components/angular-carousel/dist/angular-carousel.js',
'bower_components/angular-sanitize/angular-sanitize.js',
'bower_components/angular-ui-select2/src/select2.js',
'bower_components/moment/moment.js',
'bower_components/angular-moment/angular-moment.js',
'bower_components/angular-timeago/src/timeAgo.js',
'bower_components/ngtoast/dist/ngToast.js'
])
.pipe(concat('vendor.js'))
.pipe(gulp.dest('public/javascripts'));
});
gulp.task('vendor_css', function() {
return gulp.src(
[
'bower_components/bootstrap/dist/css/bootstrap.css',
'bower_components/angular-loading-bar/build/loading-bar.css',
'bower_components/angular-bootstrap/ui-bootstrap-csp.css',
'bower_components/angular-carousel/dist/angular-carousel.css',
'bower_components/select2/select2.css',
'bower_components/ngtoast/dist/ngToast.css',
'bower_components/ngtoast/dist/ngToast-animations.css'
])
.pipe(concat('vendor.css'))
.pipe(gulp.dest('public/stylesheets'));
});
gulp.task('vendor_css_map', function() {
return gulp.src(
[
'bower_components/bootstrap/dist/css/bootstrap.css.map',
'bower_components/angular-carousel/dist/angular-carousel.css.map'
])
.pipe(gulp.dest('public/stylesheets'));
});
gulp.task('vendor_components', ['vendor_js', 'vendor_css', 'vendor_css_map', 'vendor_images']);
gulp.task('watch', function() {
// Watch .js files
gulp.watch('solarwatt/**/*.js', ['scripts']);
gulp.watch('solarwatt/**/*.html', ['template_cache']);
// Create LiveReload server
livereload.listen();
// Watch any files in dist/, reload on change
gulp.watch(['public/**']).on('change', livereload.changed);
gulp.watch(['views/**']).on('change', livereload.changed);

//foreman();
});
gulp.task('build', ['vendor_components', 'scripts', 'template_cache']);
gulp.task('default', ['watch', 'build']);
gulp.task('heroku:production', ['build']);
return gulp;
})();
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "solar-watt",
"version": "1.0.0",
"description": ":sun:",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/sushack/solar-watt.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/sushack/solar-watt/issues"
},
"homepage": "https://github.com/sushack/solar-watt",
"scripts": {
"start": "node ./bin/www",
"postinstall": "bower install && gulp build"
},
"dependencies": {
"bower": "^1.4.1",
"del": "^1.2.0",
"gulp": "^3.9.0",
"gulp-angular-templatecache": "^1.6.0",
"gulp-concat": "^2.5.2",
"gulp-foreman": "^0.1.2",
"gulp-livereload": "^3.8.0",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^1.2.0"
}
}

0 comments on commit 03947f0

Please sign in to comment.