Browse Source

chore: upgrade packages

Gerald 8 years ago
parent
commit
6b79c60801
4 changed files with 11 additions and 8 deletions
  1. 4 2
      package.json
  2. 4 4
      scripts/i18n.js
  3. 2 2
      scripts/string.js
  4. 1 0
      src/injected/index.js

+ 4 - 2
package.json

@@ -30,7 +30,7 @@
     "eslint": "^4.6.1",
     "eslint-config-airbnb-base": "^12.0.0",
     "eslint-import-resolver-webpack": "^0.8.3",
-    "eslint-plugin-html": "^3.2.1",
+    "eslint-plugin-html": "^4.0.1",
     "eslint-plugin-import": "^2.7.0",
     "extract-text-webpack-plugin": "^3.0.0",
     "fancy-log": "^1.3.2",
@@ -42,13 +42,15 @@
     "html-webpack-plugin": "^2.30.1",
     "husky": "^0.14.3",
     "js-yaml": "^3.9.1",
+    "plugin-error": "^1.0.0",
     "postcss-loader": "^2.0.6",
     "postcss-scss": "^1.0.2",
     "precss": "^2.0.0",
     "svg-sprite-loader": "^3.5.1",
-    "svgo": "^0.7.2",
+    "svgo": "^1.0.3",
     "tape": "^4.8.0",
     "through2": "^2.0.3",
+    "vinyl": "^2.1.0",
     "vue-loader": "^13.0.4",
     "vue-style-loader": "^3.0.1",
     "vue-template-compiler": "^2.4.2",

+ 4 - 4
scripts/i18n.js

@@ -1,7 +1,8 @@
 const fs = require('fs');
 const path = require('path');
 const util = require('util');
-const gutil = require('gulp-util');
+const Vinyl = require('vinyl');
+const PluginError = require('plugin-error');
 const through = require('through2');
 const yaml = require('js-yaml');
 
@@ -111,8 +112,7 @@ class Locales {
       const data = this.getData(lang, options);
       const locale = this.data[lang];
       const out = locale.dump(data, options);
-      return new gutil.File({
-        base: '',
+      return new Vinyl({
         path: out.path,
         contents: new Buffer(out.data),
       });
@@ -159,7 +159,7 @@ function extract(options) {
 
   function bufferContents(file, enc, cb) {
     if (file.isNull()) return cb();
-    if (file.isStream()) return this.emit('error', new gutil.PluginError('VM-i18n', 'Stream is not supported.'));
+    if (file.isStream()) return this.emit('error', new PluginError('VM-i18n', 'Stream is not supported.'));
     const extname = path.extname(file.path);
     const type = types[extname];
     type && extract(file.contents, type);

+ 2 - 2
scripts/string.js

@@ -1,10 +1,10 @@
-const gutil = require('gulp-util');
+const PluginError = require('plugin-error');
 const through = require('through2');
 
 module.exports = function (handle) {
   return through.obj(function (file, enc, cb) {
     if (file.isNull()) return cb();
-    if (file.isStream()) return this.emit('error', new gutil.PluginError('VM-json', 'Stream is not supported.'));
+    if (file.isStream()) return this.emit('error', new PluginError('VM-json', 'Stream is not supported.'));
     if (handle) file.contents = new Buffer(handle(String(file.contents), file));
     cb(null, file);
   });

+ 1 - 0
src/injected/index.js

@@ -7,6 +7,7 @@ import initialize from './content';
   if (window.VM) return;
   window.VM = 1;
 
+  // eslint-disable-next-line camelcase
   const { VM_initializeWeb } = window;
 
   function initBridge() {