]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Upgrade dev dependencies to reduce vulnerabilities (#5840)
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Sun, 18 Nov 2018 08:33:34 +0000 (09:33 +0100)
committerGitHub <noreply@github.com>
Sun, 18 Nov 2018 08:33:34 +0000 (09:33 +0100)
gulpfile.js
package.json
src/platforms/platform.dom.js
test/specs/core.controller.tests.js
test/specs/core.plugin.tests.js

index d8872df0e3129c558fd060083b958ed9049e3603..06229d6f89c6ea0f35e0363f453a2fd5e51ba0c5 100644 (file)
@@ -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.
@@ -233,7 +233,7 @@ function moduleSizesTask() {
 }
 
 function watchTask() {
-  return gulp.watch('./src/**', ['build']);
+  return gulp.watch('./src/**', gulp.parallel('build'));
 }
 
 function serverTask() {
index 30e365f7467910e4b2525864ab88d7387691fe6c..b8c72f99afbae9621703844e63197b322ef7f2eb 100644 (file)
     "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"
index a882d22a537d1ed4417749326eb2d4cc544900ac..549ec1a1ca43884a333ab16db4093375c6fbf60c 100644 (file)
@@ -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;
                        }
@@ -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];
index 1ca699bc13254497c54827c8bb2e465dca1616c5..cf9eb30a22bd75410519647f8b794ad866438c4a 100644 (file)
@@ -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();
index 3a9e908a38d1955782c6ab6edc82890fc4aa071b..977f607a7c9f5cd90d19a18b1edb0b22dec2ae42 100644 (file)
@@ -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;
                });