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 */
|
||||
|
||||
var webpack = require('webpack');
|
||||
var webpack = require('webpack')
|
||||
|
||||
module.exports = function createWebpackConfig(_options) {
|
||||
var config;
|
||||
var options = _options || {};
|
||||
var env = options.env || 'development';
|
||||
var config
|
||||
var options = _options || {}
|
||||
var env = options.env || 'development'
|
||||
|
||||
config = {
|
||||
context: options.context,
|
||||
@ -39,9 +39,9 @@ module.exports = function createWebpackConfig(_options) {
|
||||
resolve: {
|
||||
extensions: ['', '.js'],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
config.output.filename = options.filename;
|
||||
config.output.filename = options.filename
|
||||
|
||||
if (options.minify) {
|
||||
config.plugins.push(
|
||||
@ -54,8 +54,8 @@ module.exports = function createWebpackConfig(_options) {
|
||||
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 eslint = require('gulp-eslint')
|
||||
var mocha = require('gulp-mocha')
|
||||
var nsp = require('gulp-nsp')
|
||||
var rimraf = require('rimraf')
|
||||
var webpack = require('webpack-stream')
|
||||
|
||||
@ -31,10 +30,6 @@ gulp.task('static', () =>
|
||||
.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:node', () =>
|
||||
@ -52,7 +47,10 @@ gulp.task('test:karma', done => {
|
||||
})
|
||||
|
||||
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', () => {
|
||||
@ -93,5 +91,5 @@ gulp.task('build:clean', ['clean'], done => {
|
||||
gulp.start('build', done)
|
||||
})
|
||||
|
||||
gulp.task('prepublish', ['nsp', 'build:clean'])
|
||||
gulp.task('prepublish', ['build:clean'])
|
||||
gulp.task('default', ['static', 'test'])
|
||||
|
@ -19,7 +19,9 @@ function resolveUpdates(updates, object) {
|
||||
let updatedValue = value
|
||||
|
||||
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
|
||||
} else if (typeof value === 'function') {
|
||||
@ -72,9 +74,8 @@ function update(updates, object, ...args) {
|
||||
return updates
|
||||
}
|
||||
|
||||
const defaultedObject = typeof object === 'undefined' || object === null
|
||||
? {}
|
||||
: object
|
||||
const defaultedObject =
|
||||
typeof object === 'undefined' || object === null ? {} : object
|
||||
|
||||
const resolvedUpdates = resolveUpdates(updates, defaultedObject)
|
||||
|
||||
|
@ -8,11 +8,11 @@ const wildcard = '*'
|
||||
function reducePath(acc, key) {
|
||||
if (key === wildcard) {
|
||||
return value =>
|
||||
(Object.prototype.hasOwnProperty.call(value, wildcard)
|
||||
Object.prototype.hasOwnProperty.call(value, wildcard)
|
||||
? // If we actually have wildcard as a property, update that
|
||||
update({ [wildcard]: acc }, value)
|
||||
: // Otherwise map over all properties
|
||||
map(acc, value))
|
||||
map(acc, value)
|
||||
}
|
||||
|
||||
return { [key]: acc }
|
||||
|
@ -48,7 +48,6 @@
|
||||
"gulp-babel": "^6.1.1",
|
||||
"gulp-eslint": "^3.0.1",
|
||||
"gulp-mocha": "^2.0.0",
|
||||
"gulp-nsp": "^2.0.0",
|
||||
"karma": "^0.13.3",
|
||||
"karma-babel-preprocessor": "^6.0.1",
|
||||
"karma-chrome-launcher": "^0.2.0",
|
||||
|
@ -1,20 +1,16 @@
|
||||
/*eslint-disable */
|
||||
var babel = require('babel');
|
||||
var babel = require("babel");
|
||||
|
||||
module.exports = function(wallaby) {
|
||||
return {
|
||||
files: [
|
||||
'lib/**/*.js',
|
||||
],
|
||||
tests: [
|
||||
'test/**/*-spec.js',
|
||||
],
|
||||
files: ["lib/**/*.js"],
|
||||
tests: ["test/**/*-spec.js"],
|
||||
compilers: {
|
||||
'**/*.js': wallaby.compilers.babel({babel: babel, stage: 1}),
|
||||
"**/*.js": wallaby.compilers.babel({ babel: babel, stage: 1 })
|
||||
},
|
||||
env: {
|
||||
type: 'node',
|
||||
type: "node"
|
||||
},
|
||||
testFramework: 'mocha',
|
||||
testFramework: "mocha"
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user