Attempting to upgrade to node LTS (#585)

* Attempting to upgrade to node LTS

* Updating travis config to node
This commit is contained in:
kevgliss 2016-12-13 08:50:12 -08:00 committed by GitHub
parent 03d5a6cfe1
commit 2d6aa620b4
3 changed files with 47 additions and 69 deletions

View File

@ -3,7 +3,7 @@ sudo: required
dist: trusty dist: trusty
node_js: node_js:
- "4.2" - "6.2.0"
addons: addons:
postgresql: "9.4" postgresql: "9.4"

View File

@ -1,13 +1,12 @@
'use strict';
var gulp = require('gulp'), var gulp = require('gulp'),
minifycss = require('gulp-minify-css'), minifycss = require('gulp-minify-css'),
concat = require('gulp-concat'), concat = require('gulp-concat'),
less = require('gulp-less'), less = require('gulp-less'),
gulpif = require('gulp-if'), gulpif = require('gulp-if'),
order = require('gulp-order'),
gutil = require('gulp-util'), gutil = require('gulp-util'),
rename = require('gulp-rename'),
foreach = require('gulp-foreach'), foreach = require('gulp-foreach'),
debug = require('gulp-debug'),
path =require('path'), path =require('path'),
merge = require('merge-stream'), merge = require('merge-stream'),
del = require('del'), del = require('del'),
@ -89,9 +88,9 @@ gulp.task('dev:styles', function () {
.pipe(gulpif(isBootswatchFile, foreach(function (stream, file) { .pipe(gulpif(isBootswatchFile, foreach(function (stream, file) {
var themeName = path.basename(path.dirname(file.path)), var themeName = path.basename(path.dirname(file.path)),
content = replaceAll(baseContent, '$theme$', themeName), content = replaceAll(baseContent, '$theme$', themeName),
file = string_src('bootstrap-' + themeName + '.less', content); file2 = string_src('bootstrap-' + themeName + '.less', content);
return file; return file2;
}))) })))
.pipe(less()) .pipe(less())
.pipe(gulpif(isBootstrapFile, foreach(function (stream, file) { .pipe(gulpif(isBootstrapFile, foreach(function (stream, file) {
@ -101,7 +100,7 @@ gulp.task('dev:styles', function () {
// http://stackoverflow.com/questions/21719833/gulp-how-to-add-src-files-in-the-middle-of-a-pipe // http://stackoverflow.com/questions/21719833/gulp-how-to-add-src-files-in-the-middle-of-a-pipe
// https://github.com/gulpjs/gulp/blob/master/docs/recipes/using-multiple-sources-in-one-task.md // https://github.com/gulpjs/gulp/blob/master/docs/recipes/using-multiple-sources-in-one-task.md
return merge(stream, gulp.src(['.tmp/styles/font-awesome.css', '.tmp/styles/lemur.css'])) return merge(stream, gulp.src(['.tmp/styles/font-awesome.css', '.tmp/styles/lemur.css']))
.pipe(concat('style-' + themeName + ".css")); .pipe(concat('style-' + themeName + '.css'));
}))) })))
.pipe(plumber()) .pipe(plumber())
.pipe(concat('styles.css')) .pipe(concat('styles.css'))
@ -113,7 +112,7 @@ gulp.task('dev:styles', function () {
// http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript // http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript
function escapeRegExp(string) { function escapeRegExp(string) {
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
} }
function replaceAll(string, find, replace) { function replaceAll(string, find, replace) {
@ -123,7 +122,7 @@ function replaceAll(string, find, replace) {
function string_src(filename, string) { function string_src(filename, string) {
var src = require('stream').Readable({ objectMode: true }); var src = require('stream').Readable({ objectMode: true });
src._read = function () { src._read = function () {
this.push(new gutil.File({ cwd: "", base: "", path: filename, contents: new Buffer(string) })); this.push(new gutil.File({ cwd: '', base: '', path: filename, contents: new Buffer(string) }));
this.push(null); this.push(null);
}; };
return src; return src;
@ -144,26 +143,18 @@ gulp.task('build:extras', function () {
function injectHtml(isDev) { function injectHtml(isDev) {
return gulp.src('lemur/static/app/index.html') return gulp.src('lemur/static/app/index.html')
.pipe( .pipe(
inject(gulp.src(bowerFiles({ base: 'app' }), { inject(gulp.src(bowerFiles({ base: 'app' })), {
read: false
}), {
starttag: '<!-- inject:bower:{{ext}} -->', starttag: '<!-- inject:bower:{{ext}} -->',
addRootSlash: false, addRootSlash: false,
ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null
}) })
) )
.pipe(inject(gulp.src(['lemur/static/app/angular/**/*.js'], { .pipe(inject(gulp.src(['lemur/static/app/angular/**/*.js']), {
read: false
}), {
read: false,
starttag: '<!-- inject:{{ext}} -->', starttag: '<!-- inject:{{ext}} -->',
addRootSlash: false, addRootSlash: false,
ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null
})) }))
.pipe(inject(gulp.src(['.tmp/styles/**/*.css'], { .pipe(inject(gulp.src(['.tmp/styles/**/*.css']), {
read: false
}), {
read: false,
starttag: '<!-- inject:{{ext}} -->', starttag: '<!-- inject:{{ext}} -->',
addRootSlash: false, addRootSlash: false,
ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null
@ -171,7 +162,6 @@ function injectHtml(isDev) {
.pipe( .pipe(
gulpif(!isDev, gulpif(!isDev,
inject(gulp.src('lemur/static/dist/ngviews/ngviews.min.js'), { inject(gulp.src('lemur/static/dist/ngviews/ngviews.min.js'), {
read: false,
starttag: '<!-- inject:ngviews -->', starttag: '<!-- inject:ngviews -->',
addRootSlash: false addRootSlash: false
}) })
@ -203,18 +193,12 @@ gulp.task('build:html', ['dev:styles', 'dev:scripts', 'build:ngviews', 'build:in
var jsFilter = filter('**/*.js'); var jsFilter = filter('**/*.js');
var cssFilter = filter('**/*.css'); var cssFilter = filter('**/*.css');
var assets = useref.assets();
return gulp.src('.tmp/index.html') return gulp.src('.tmp/index.html')
.pipe(assets)
.pipe(rev()) .pipe(rev())
.pipe(jsFilter) .pipe(jsFilter)
.pipe(ngAnnotate()) .pipe(ngAnnotate())
.pipe(jsFilter.restore())
.pipe(cssFilter) .pipe(cssFilter)
.pipe(csso()) .pipe(csso())
.pipe(cssFilter.restore())
.pipe(assets.restore())
.pipe(useref()) .pipe(useref())
.pipe(revReplace()) .pipe(revReplace())
.pipe(gulp.dest('lemur/static/dist')) .pipe(gulp.dest('lemur/static/dist'))

View File

@ -6,55 +6,49 @@
"url": "git://github.com/netflix/lemur.git" "url": "git://github.com/netflix/lemur.git"
}, },
"dependencies": { "dependencies": {
"del": "^0.1.3", "del": "^2.2.2",
"gulp-concat": "^2.4.1", "gulp-concat": "^2.4.1",
"gulp-debug": "^1.0.1", "gulp-foreach": "0.1.0",
"gulp-foreach": "0.0.1", "gulp-if": "^2.0.2",
"gulp-if": "^1.2.5",
"gulp-less": "^3.0.3", "gulp-less": "^3.0.3",
"gulp-minify-css": "^0.3.10", "gulp-minify-css": "^1.2.4",
"gulp-order": "^1.1.1",
"gulp-rename": "^1.2.0",
"gulp-util": "^3.0.1", "gulp-util": "^3.0.1",
"merge-stream": "^0.1.6", "merge-stream": "^1.0.1",
"browser-sync": "^2.3.1", "browser-sync": "^2.3.1",
"gulp": "^3.8.11", "gulp": "^3.8.11",
"gulp-autoprefixer": "^0.0.8", "gulp-autoprefixer": "^3.1.1",
"gulp-cache": "^0.2.0", "gulp-cache": "^0.4.5",
"gulp-csso": "^0.2.9", "gulp-csso": "^2.0.0",
"gulp-filter": "^1.0.0", "gulp-filter": "^4.0.0",
"gulp-flatten": "^0.0.2", "gulp-flatten": "^0.3.1",
"gulp-imagemin": "^0.6.2", "gulp-imagemin": "^3.1.1",
"gulp-inject": "~1.0.1", "gulp-inject": "~4.1.0",
"gulp-jshint": "^1.10.0", "gulp-jshint": "^2.0.4",
"gulp-load-plugins": "^0.5.3", "gulp-load-plugins": "^1.4.0",
"gulp-minify-html": "~0.1.4", "gulp-minify-html": "~1.0.6",
"gulp-ng-annotate": "~0.5.2", "gulp-ng-annotate": "~2.0.0",
"gulp-ng-html2js": "~0.1.7", "gulp-ng-html2js": "~0.2.2",
"gulp-notify": "^2.2.0", "gulp-notify": "^2.2.0",
"gulp-plumber": "^0.6.4", "gulp-plumber": "^1.1.0",
"gulp-print": "^1.1.0", "gulp-print": "^2.0.1",
"gulp-protractor": "0.0.12", "gulp-protractor": "3.0.0",
"gulp-replace": "~0.5.3", "gulp-replace": "~0.5.3",
"gulp-replace-task": "~0.1.0", "gulp-replace-task": "~0.11.0",
"gulp-rev": "^1.0.0", "gulp-rev": "^7.1.2",
"gulp-rev-replace": "^0.3.0", "gulp-rev-replace": "^0.4.3",
"gulp-serve": "~0.3.0", "gulp-serve": "~1.4.0",
"gulp-size": "^1.0.0", "gulp-size": "^2.1.0",
"gulp-uglify": "^0.3.1", "gulp-uglify": "^2.0.0",
"gulp-useref": "^0.6.0", "gulp-useref": "^3.1.2",
"http-proxy": "~1.11.1", "http-proxy": "~1.16.2",
"jshint-stylish": "^1.0.0", "jshint-stylish": "^2.2.1",
"karma-jasmine": "^0.1.5", "karma-jasmine": "^1.1.0",
"main-bower-files": "^1.0.2", "main-bower-files": "^2.13.1",
"require-dir": "~0.3.0", "require-dir": "~0.3.0",
"streamqueue": "^0.1.1", "streamqueue": "^1.1.1",
"uglify-save-license": "^0.4.1", "uglify-save-license": "^0.4.1",
"karma": "~0.13.2", "karma": "~1.3.0",
"bower": "~1.4.1" "bower": "~1.8.0"
},
"engines": {
"node": ">=0.10.0"
}, },
"scripts": { "scripts": {
"postinstall": "node_modules/.bin/bower install --allow-root --config.interactive=false", "postinstall": "node_modules/.bin/bower install --allow-root --config.interactive=false",
@ -66,6 +60,6 @@
}, },
"devDependencies": { "devDependencies": {
"jshint": "^2.8.0", "jshint": "^2.8.0",
"karma-chrome-launcher": "^0.2.0" "karma-chrome-launcher": "^2.0.0"
} }
} }