Skip to content

Commit

Permalink
Upgrade dev dependencies to reduce vulnerabilities (chartjs#5840)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrunel authored Nov 18, 2018
1 parent 37ee53b commit e440887
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 42 deletions.
12 changes: 6 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ gulp.task('bower', bowerTask);
gulp.task('build', buildTask);
gulp.task('package', packageTask);
gulp.task('watch', watchTask);
gulp.task('lint', ['lint-html', 'lint-js']);
gulp.task('lint-html', lintHtmlTask);
gulp.task('lint-js', lintJsTask);
gulp.task('lint', gulp.parallel('lint-html', 'lint-js'));
gulp.task('docs', docsTask);
gulp.task('test', ['lint', 'unittest']);
gulp.task('size', ['library-size', 'module-sizes']);
gulp.task('server', serverTask);
gulp.task('unittest', unittestTask);
gulp.task('test', gulp.parallel('lint', 'unittest'));
gulp.task('library-size', librarySizeTask);
gulp.task('module-sizes', moduleSizesTask);
gulp.task('size', gulp.parallel('library-size', 'module-sizes'));
gulp.task('_open', _openTask);
gulp.task('dev', ['server', 'default']);
gulp.task('default', ['build', 'watch']);
gulp.task('default', gulp.parallel('build', 'watch'));
gulp.task('dev', gulp.parallel('server', 'default'));

/**
* Generates the bower.json manifest file which will be pushed along release tags.
Expand Down Expand Up @@ -233,7 +233,7 @@ function moduleSizesTask() {
}

function watchTask() {
return gulp.watch('./src/**', ['build']);
return gulp.watch('./src/**', gulp.parallel('build'));
}

function serverTask() {
Expand Down
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,42 @@
"url": "https://github.com/chartjs/Chart.js.git"
},
"devDependencies": {
"browserify": "^14.5.0",
"browserify": "^16.2.3",
"browserify-istanbul": "^3.0.1",
"bundle-collapser": "^1.3.0",
"child-process-promise": "^2.2.1",
"coveralls": "^3.0.0",
"eslint": "^4.9.0",
"eslint": "^5.9.0",
"eslint-config-chartjs": "^0.1.0",
"eslint-plugin-html": "^4.0.2",
"eslint-plugin-html": "^5.0.0",
"gitbook-cli": "^2.3.2",
"gulp": "3.9.x",
"gulp-concat": "~2.6.x",
"gulp-connect": "~5.0.0",
"gulp-eslint": "^4.0.0",
"gulp-file": "^0.3.0",
"gulp-htmllint": "^0.0.15",
"gulp-insert": "~0.5.0",
"gulp-replace": "^0.6.1",
"gulp-size": "~2.1.0",
"gulp": "^4.0.0",
"gulp-concat": "^2.6.0",
"gulp-connect": "^5.6.1",
"gulp-eslint": "^5.0.0",
"gulp-file": "^0.4.0",
"gulp-htmllint": "^0.0.16",
"gulp-insert": "^0.5.0",
"gulp-replace": "^1.0.0",
"gulp-size": "^3.0.0",
"gulp-streamify": "^1.0.2",
"gulp-uglify": "~3.0.x",
"gulp-util": "~3.0.x",
"gulp-zip": "~4.0.0",
"jasmine": "^2.8.0",
"jasmine-core": "^2.8.0",
"karma": "^1.7.1",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.0",
"gulp-zip": "^4.2.0",
"jasmine": "^3.3.0",
"jasmine-core": "^3.3.0",
"karma": "^3.1.1",
"karma-browserify": "^5.1.1",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-jasmine": "^2.0.0",
"karma-jasmine-html-reporter": "^1.4.0",
"merge-stream": "^1.0.1",
"pixelmatch": "^4.0.2",
"vinyl-source-stream": "^1.1.0",
"vinyl-source-stream": "^2.0.0",
"watchify": "^3.9.0",
"yargs": "^9.0.1"
"yargs": "^12.0.2"
},
"spm": {
"main": "Chart.js"
Expand Down
2 changes: 2 additions & 0 deletions src/platforms/platform.dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ var supportsEventListenerOptions = (function() {
var supports = false;
try {
var options = Object.defineProperty({}, 'passive', {
// eslint-disable-next-line getter-return
get: function() {
supports = true;
}
Expand Down Expand Up @@ -391,6 +392,7 @@ module.exports = {
// we can't use save() and restore() to restore the initial state. So make sure that at
// least the canvas context is reset to the default state by setting the canvas width.
// https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html
// eslint-disable-next-line no-self-assign
canvas.width = canvas.width;

delete canvas[EXPANDO_KEY];
Expand Down
16 changes: 2 additions & 14 deletions test/specs/core.controller.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,25 +949,13 @@ describe('Chart', function() {
var meta = chart.getDatasetMeta(0);
var point = meta.data[1];

var node = chart.canvas;
var rect = node.getBoundingClientRect();

var evt = new MouseEvent('mousemove', {
view: window,
bubbles: true,
cancelable: true,
clientX: rect.left + point._model.x,
clientY: 0
});

// Manually trigger rather than having an async test
node.dispatchEvent(evt);
jasmine.triggerMouseEvent(chart, 'mousemove', point);

// Check and see if tooltip was displayed
var tooltip = chart.tooltip;

expect(chart.lastActive).toEqual([point]);
expect(tooltip._lastActive).toEqual([]);
expect(tooltip._lastActive).toEqual([point]);

// Update and confirm tooltip is reset
chart.update();
Expand Down
2 changes: 2 additions & 0 deletions test/specs/core.plugin.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ describe('Chart.plugins', function() {

expect(plugin.hook).toHaveBeenCalled();
expect(plugin.hook.calls.first().args[1]).toEqual({a: 42});

delete Chart.defaults.global.plugins.a;
});


Expand Down

0 comments on commit e440887

Please sign in to comment.