Skip to content

Commit 37fe9b7

Browse files
author
Joe Alves
committed
Updated some packages and implemented OS notifications for linting and SASS errors
1 parent e536951 commit 37fe9b7

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

generated/gulpfile.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
'use strict';
2-
31
// All used modules.
4-
var babel = require('gulp-babel');
52
var gulp = require('gulp');
3+
var babel = require('gulp-babel');
64
var runSeq = require('run-sequence');
75
var plumber = require('gulp-plumber');
86
var concat = require('gulp-concat');
@@ -17,6 +15,7 @@ var eslint = require('gulp-eslint');
1715
var mocha = require('gulp-mocha');
1816
var karma = require('karma').server;
1917
var istanbul = require('gulp-istanbul');
18+
var notify = require('gulp-notify');
2019

2120
// Development tasks
2221
// --------------------------------------------------------------
@@ -33,6 +32,9 @@ gulp.task('reloadCSS', function () {
3332
gulp.task('lintJS', function () {
3433

3534
return gulp.src(['./browser/js/**/*.js', './server/**/*.js'])
35+
.pipe(plumber({
36+
errorHandler: notify.onError('Linting FAILED! Check your gulp process.')
37+
}))
3638
.pipe(eslint())
3739
.pipe(eslint.format())
3840
.pipe(eslint.failOnError());
@@ -81,10 +83,15 @@ gulp.task('testBrowserJS', function (done) {
8183
});
8284

8385
gulp.task('buildCSS', function () {
86+
87+
var sassCompilation = sass();
88+
sassCompilation.on('error', console.error.bind(console));
89+
8490
return gulp.src('./browser/scss/main.scss')
85-
.pipe(sass({
86-
errLogToConsole: true
91+
.pipe(plumber({
92+
errorHandler: notify.onError('SASS processing failed! Check your gulp process.')
8793
}))
94+
.pipe(sassCompilation)
8895
.pipe(rename('style.css'))
8996
.pipe(gulp.dest('./public'));
9097
});
@@ -110,8 +117,6 @@ gulp.task('seedDB', function () {
110117

111118
});
112119

113-
// --------------------------------------------------------------
114-
115120
// Production tasks
116121
// --------------------------------------------------------------
117122

@@ -134,8 +139,6 @@ gulp.task('buildJSProduction', function () {
134139

135140
gulp.task('buildProduction', ['buildCSSProduction', 'buildJSProduction']);
136141

137-
// --------------------------------------------------------------
138-
139142
// Composed tasks
140143
// --------------------------------------------------------------
141144

@@ -149,13 +152,14 @@ gulp.task('build', function () {
149152

150153
gulp.task('default', function () {
151154

152-
livereload.listen();
153155
gulp.start('build');
154156

157+
// Run when anything inside of browser/js changes.
155158
gulp.watch('browser/js/**', function () {
156159
runSeq('buildJS', 'reload');
157160
});
158161

162+
// Run when anything inside of browser/scss changes.
159163
gulp.watch('browser/scss/**', function () {
160164
runSeq('buildCSS', 'reloadCSS');
161165
});
@@ -171,4 +175,6 @@ gulp.task('default', function () {
171175
// Run browser testing when a browser test file changes.
172176
gulp.watch('tests/browser/**/*', ['testBrowserJS']);
173177

178+
livereload.listen();
179+
174180
});

generated/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"postinstall": "gulp build"
99
},
1010
"dependencies": {
11-
"angular": "^1.4.0",
11+
"angular": "^1.5.0-beta.0",
1212
"angular-bootstrap": "^0.12.0",
1313
"angular-mocks": "^1.4.0",
1414
"angular-ui-router": "^0.2.15",
@@ -31,12 +31,13 @@
3131
"gulp-minify-css": "^0.4.6",
3232
"gulp-mocha": "^2.0.0",
3333
"gulp-ng-annotate": "^0.5.2",
34+
"gulp-notify": "^2.2.0",
3435
"gulp-plumber": "^0.6.6",
3536
"gulp-rename": "^1.2.0",
3637
"gulp-sass": "^2.0.4",
3738
"gulp-sourcemaps": "^1.3.0",
3839
"gulp-uglify": "^1.1.0",
39-
"karma": "^0.12.31",
40+
"karma": "^0.13.14",
4041
"karma-chai": "^0.1.0",
4142
"karma-coverage": "^0.2.7",
4243
"karma-mocha": "^0.1.10",

0 commit comments

Comments
 (0)