From 2d6aa620b4f951ab2747bb9b9e85e6165ba19ecd Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 13 Dec 2016 08:50:12 -0800 Subject: [PATCH] Attempting to upgrade to node LTS (#585) * Attempting to upgrade to node LTS * Updating travis config to node --- .travis.yml | 2 +- gulp/build.js | 36 +++++++----------------- package.json | 78 ++++++++++++++++++++++++--------------------------- 3 files changed, 47 insertions(+), 69 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27d5a946..5e39c8c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: required dist: trusty node_js: - - "4.2" + - "6.2.0" addons: postgresql: "9.4" diff --git a/gulp/build.js b/gulp/build.js index 494bc8a4..37573f68 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -1,13 +1,12 @@ +'use strict'; + var gulp = require('gulp'), minifycss = require('gulp-minify-css'), concat = require('gulp-concat'), less = require('gulp-less'), gulpif = require('gulp-if'), - order = require('gulp-order'), gutil = require('gulp-util'), - rename = require('gulp-rename'), foreach = require('gulp-foreach'), - debug = require('gulp-debug'), path =require('path'), merge = require('merge-stream'), del = require('del'), @@ -89,9 +88,9 @@ gulp.task('dev:styles', function () { .pipe(gulpif(isBootswatchFile, foreach(function (stream, file) { var themeName = path.basename(path.dirname(file.path)), 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(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 // 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'])) - .pipe(concat('style-' + themeName + ".css")); + .pipe(concat('style-' + themeName + '.css')); }))) .pipe(plumber()) .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 function escapeRegExp(string) { - return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); + return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'); } function replaceAll(string, find, replace) { @@ -123,7 +122,7 @@ function replaceAll(string, find, replace) { function string_src(filename, string) { var src = require('stream').Readable({ objectMode: true }); 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); }; return src; @@ -144,26 +143,18 @@ gulp.task('build:extras', function () { function injectHtml(isDev) { return gulp.src('lemur/static/app/index.html') .pipe( - inject(gulp.src(bowerFiles({ base: 'app' }), { - read: false - }), { + inject(gulp.src(bowerFiles({ base: 'app' })), { starttag: '', addRootSlash: false, ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null }) ) - .pipe(inject(gulp.src(['lemur/static/app/angular/**/*.js'], { - read: false - }), { - read: false, + .pipe(inject(gulp.src(['lemur/static/app/angular/**/*.js']), { starttag: '', addRootSlash: false, ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null })) - .pipe(inject(gulp.src(['.tmp/styles/**/*.css'], { - read: false - }), { - read: false, + .pipe(inject(gulp.src(['.tmp/styles/**/*.css']), { starttag: '', addRootSlash: false, ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null @@ -171,7 +162,6 @@ function injectHtml(isDev) { .pipe( gulpif(!isDev, inject(gulp.src('lemur/static/dist/ngviews/ngviews.min.js'), { - read: false, starttag: '', addRootSlash: false }) @@ -203,18 +193,12 @@ gulp.task('build:html', ['dev:styles', 'dev:scripts', 'build:ngviews', 'build:in var jsFilter = filter('**/*.js'); var cssFilter = filter('**/*.css'); - var assets = useref.assets(); - return gulp.src('.tmp/index.html') - .pipe(assets) .pipe(rev()) .pipe(jsFilter) .pipe(ngAnnotate()) - .pipe(jsFilter.restore()) .pipe(cssFilter) .pipe(csso()) - .pipe(cssFilter.restore()) - .pipe(assets.restore()) .pipe(useref()) .pipe(revReplace()) .pipe(gulp.dest('lemur/static/dist')) diff --git a/package.json b/package.json index daa056aa..66539f3a 100644 --- a/package.json +++ b/package.json @@ -6,55 +6,49 @@ "url": "git://github.com/netflix/lemur.git" }, "dependencies": { - "del": "^0.1.3", + "del": "^2.2.2", "gulp-concat": "^2.4.1", - "gulp-debug": "^1.0.1", - "gulp-foreach": "0.0.1", - "gulp-if": "^1.2.5", + "gulp-foreach": "0.1.0", + "gulp-if": "^2.0.2", "gulp-less": "^3.0.3", - "gulp-minify-css": "^0.3.10", - "gulp-order": "^1.1.1", - "gulp-rename": "^1.2.0", + "gulp-minify-css": "^1.2.4", "gulp-util": "^3.0.1", - "merge-stream": "^0.1.6", + "merge-stream": "^1.0.1", "browser-sync": "^2.3.1", "gulp": "^3.8.11", - "gulp-autoprefixer": "^0.0.8", - "gulp-cache": "^0.2.0", - "gulp-csso": "^0.2.9", - "gulp-filter": "^1.0.0", - "gulp-flatten": "^0.0.2", - "gulp-imagemin": "^0.6.2", - "gulp-inject": "~1.0.1", - "gulp-jshint": "^1.10.0", - "gulp-load-plugins": "^0.5.3", - "gulp-minify-html": "~0.1.4", - "gulp-ng-annotate": "~0.5.2", - "gulp-ng-html2js": "~0.1.7", + "gulp-autoprefixer": "^3.1.1", + "gulp-cache": "^0.4.5", + "gulp-csso": "^2.0.0", + "gulp-filter": "^4.0.0", + "gulp-flatten": "^0.3.1", + "gulp-imagemin": "^3.1.1", + "gulp-inject": "~4.1.0", + "gulp-jshint": "^2.0.4", + "gulp-load-plugins": "^1.4.0", + "gulp-minify-html": "~1.0.6", + "gulp-ng-annotate": "~2.0.0", + "gulp-ng-html2js": "~0.2.2", "gulp-notify": "^2.2.0", - "gulp-plumber": "^0.6.4", - "gulp-print": "^1.1.0", - "gulp-protractor": "0.0.12", + "gulp-plumber": "^1.1.0", + "gulp-print": "^2.0.1", + "gulp-protractor": "3.0.0", "gulp-replace": "~0.5.3", - "gulp-replace-task": "~0.1.0", - "gulp-rev": "^1.0.0", - "gulp-rev-replace": "^0.3.0", - "gulp-serve": "~0.3.0", - "gulp-size": "^1.0.0", - "gulp-uglify": "^0.3.1", - "gulp-useref": "^0.6.0", - "http-proxy": "~1.11.1", - "jshint-stylish": "^1.0.0", - "karma-jasmine": "^0.1.5", - "main-bower-files": "^1.0.2", + "gulp-replace-task": "~0.11.0", + "gulp-rev": "^7.1.2", + "gulp-rev-replace": "^0.4.3", + "gulp-serve": "~1.4.0", + "gulp-size": "^2.1.0", + "gulp-uglify": "^2.0.0", + "gulp-useref": "^3.1.2", + "http-proxy": "~1.16.2", + "jshint-stylish": "^2.2.1", + "karma-jasmine": "^1.1.0", + "main-bower-files": "^2.13.1", "require-dir": "~0.3.0", - "streamqueue": "^0.1.1", + "streamqueue": "^1.1.1", "uglify-save-license": "^0.4.1", - "karma": "~0.13.2", - "bower": "~1.4.1" - }, - "engines": { - "node": ">=0.10.0" + "karma": "~1.3.0", + "bower": "~1.8.0" }, "scripts": { "postinstall": "node_modules/.bin/bower install --allow-root --config.interactive=false", @@ -66,6 +60,6 @@ }, "devDependencies": { "jshint": "^2.8.0", - "karma-chrome-launcher": "^0.2.0" + "karma-chrome-launcher": "^2.0.0" } -} +} \ No newline at end of file