Build on node 8, 10 and latest and install latest yarn (#79)
* Update packages to fix build * Remove nsp, it is deprecated
This commit is contained in:
parent
3d1fd9e9cb
commit
eb4868775a
@ -1,12 +1,12 @@
|
|||||||
'use strict'; // eslint-disable-line
|
"use strict"; // eslint-disable-line
|
||||||
/* eslint no-var:0, func-names:0, import/no-extraneous-dependencies:0 */
|
/* eslint no-var:0, func-names:0, import/no-extraneous-dependencies:0 */
|
||||||
|
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack')
|
||||||
|
|
||||||
module.exports = function createWebpackConfig(_options) {
|
module.exports = function createWebpackConfig(_options) {
|
||||||
var config;
|
var config
|
||||||
var options = _options || {};
|
var options = _options || {}
|
||||||
var env = options.env || 'development';
|
var env = options.env || 'development'
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
context: options.context,
|
context: options.context,
|
||||||
@ -39,9 +39,9 @@ module.exports = function createWebpackConfig(_options) {
|
|||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['', '.js'],
|
extensions: ['', '.js'],
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
|
|
||||||
config.output.filename = options.filename;
|
config.output.filename = options.filename
|
||||||
|
|
||||||
if (options.minify) {
|
if (options.minify) {
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
@ -54,8 +54,8 @@ module.exports = function createWebpackConfig(_options) {
|
|||||||
warnings: false,
|
warnings: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return config;
|
return config
|
||||||
};
|
}
|
||||||
|
12
gulpfile.js
12
gulpfile.js
@ -7,7 +7,6 @@ var gulp = require('gulp')
|
|||||||
var babel = require('gulp-babel')
|
var babel = require('gulp-babel')
|
||||||
var eslint = require('gulp-eslint')
|
var eslint = require('gulp-eslint')
|
||||||
var mocha = require('gulp-mocha')
|
var mocha = require('gulp-mocha')
|
||||||
var nsp = require('gulp-nsp')
|
|
||||||
var rimraf = require('rimraf')
|
var rimraf = require('rimraf')
|
||||||
var webpack = require('webpack-stream')
|
var webpack = require('webpack-stream')
|
||||||
|
|
||||||
@ -31,10 +30,6 @@ gulp.task('static', () =>
|
|||||||
.pipe(eslint.failAfterError())
|
.pipe(eslint.failAfterError())
|
||||||
)
|
)
|
||||||
|
|
||||||
gulp.task('nsp', cb => {
|
|
||||||
nsp({ package: path.join(__dirname, 'package.json') }, cb)
|
|
||||||
})
|
|
||||||
|
|
||||||
gulp.task('test', ['test:karma', 'test:node'])
|
gulp.task('test', ['test:karma', 'test:node'])
|
||||||
|
|
||||||
gulp.task('test:node', () =>
|
gulp.task('test:node', () =>
|
||||||
@ -52,7 +47,10 @@ gulp.task('test:karma', done => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('babel', () =>
|
gulp.task('babel', () =>
|
||||||
gulp.src('lib/**/*.js').pipe(babel()).pipe(gulp.dest('dist'))
|
gulp
|
||||||
|
.src('lib/**/*.js')
|
||||||
|
.pipe(babel())
|
||||||
|
.pipe(gulp.dest('dist'))
|
||||||
)
|
)
|
||||||
|
|
||||||
gulp.task('watch', () => {
|
gulp.task('watch', () => {
|
||||||
@ -93,5 +91,5 @@ gulp.task('build:clean', ['clean'], done => {
|
|||||||
gulp.start('build', done)
|
gulp.start('build', done)
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('prepublish', ['nsp', 'build:clean'])
|
gulp.task('prepublish', ['build:clean'])
|
||||||
gulp.task('default', ['static', 'test'])
|
gulp.task('default', ['static', 'test'])
|
||||||
|
@ -19,7 +19,9 @@ function resolveUpdates(updates, object) {
|
|||||||
let updatedValue = value
|
let updatedValue = value
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!Array.isArray(value) && value !== null && typeof value === 'object'
|
!Array.isArray(value) &&
|
||||||
|
value !== null &&
|
||||||
|
typeof value === 'object'
|
||||||
) {
|
) {
|
||||||
updatedValue = update(value, object[key]) // eslint-disable-line no-use-before-define
|
updatedValue = update(value, object[key]) // eslint-disable-line no-use-before-define
|
||||||
} else if (typeof value === 'function') {
|
} else if (typeof value === 'function') {
|
||||||
@ -72,9 +74,8 @@ function update(updates, object, ...args) {
|
|||||||
return updates
|
return updates
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultedObject = typeof object === 'undefined' || object === null
|
const defaultedObject =
|
||||||
? {}
|
typeof object === 'undefined' || object === null ? {} : object
|
||||||
: object
|
|
||||||
|
|
||||||
const resolvedUpdates = resolveUpdates(updates, defaultedObject)
|
const resolvedUpdates = resolveUpdates(updates, defaultedObject)
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@ const wildcard = '*'
|
|||||||
function reducePath(acc, key) {
|
function reducePath(acc, key) {
|
||||||
if (key === wildcard) {
|
if (key === wildcard) {
|
||||||
return value =>
|
return value =>
|
||||||
(Object.prototype.hasOwnProperty.call(value, wildcard)
|
Object.prototype.hasOwnProperty.call(value, wildcard)
|
||||||
? // If we actually have wildcard as a property, update that
|
? // If we actually have wildcard as a property, update that
|
||||||
update({ [wildcard]: acc }, value)
|
update({ [wildcard]: acc }, value)
|
||||||
: // Otherwise map over all properties
|
: // Otherwise map over all properties
|
||||||
map(acc, value))
|
map(acc, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { [key]: acc }
|
return { [key]: acc }
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
"gulp-babel": "^6.1.1",
|
"gulp-babel": "^6.1.1",
|
||||||
"gulp-eslint": "^3.0.1",
|
"gulp-eslint": "^3.0.1",
|
||||||
"gulp-mocha": "^2.0.0",
|
"gulp-mocha": "^2.0.0",
|
||||||
"gulp-nsp": "^2.0.0",
|
|
||||||
"karma": "^0.13.3",
|
"karma": "^0.13.3",
|
||||||
"karma-babel-preprocessor": "^6.0.1",
|
"karma-babel-preprocessor": "^6.0.1",
|
||||||
"karma-chrome-launcher": "^0.2.0",
|
"karma-chrome-launcher": "^0.2.0",
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
/*eslint-disable */
|
/*eslint-disable */
|
||||||
var babel = require('babel');
|
var babel = require("babel");
|
||||||
|
|
||||||
module.exports = function(wallaby) {
|
module.exports = function(wallaby) {
|
||||||
return {
|
return {
|
||||||
files: [
|
files: ["lib/**/*.js"],
|
||||||
'lib/**/*.js',
|
tests: ["test/**/*-spec.js"],
|
||||||
],
|
|
||||||
tests: [
|
|
||||||
'test/**/*-spec.js',
|
|
||||||
],
|
|
||||||
compilers: {
|
compilers: {
|
||||||
'**/*.js': wallaby.compilers.babel({babel: babel, stage: 1}),
|
"**/*.js": wallaby.compilers.babel({ babel: babel, stage: 1 })
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
type: 'node',
|
type: "node"
|
||||||
},
|
},
|
||||||
testFramework: 'mocha',
|
testFramework: "mocha"
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user