diff --git a/gulpfile.js b/gulpfile.js index 855c935..def9898 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,7 +1,7 @@ const gulp = require('gulp'); const cssnano = require('cssnano') const gulpLoadPlugins = require('gulp-load-plugins') -const uglify = require('gulp-uglify-es').default; +const terser = require('terser'); const del = require('del'); const browserify = require('browserify'); const babelify = require('babelify'); @@ -118,7 +118,7 @@ gulp.task('scripts', () => { .pipe(source('app.js')) .pipe(buffer()) .pipe($.if(isDev, $.sourcemaps.init({ loadMaps: true }))) - .pipe(uglify({ compress: { drop_console: isProd, drop_debugger: isProd } })) + .pipe($.terser({ compress: { drop_console: isProd, drop_debugger: isProd } })) .pipe($.rename({ suffix: '.min' })) .pipe($.size({ showFiles: true, @@ -205,19 +205,19 @@ gulp.task('dist:chrome', (done) => { return merge( // copy images gulp.src(`${tmp.images}/**/*`) - .pipe(gulp.dest(dist.chrome.images)), + .pipe(gulp.dest(dist.chrome.images)), // copy scripts gulp.src(`${tmp.scripts}/**/*.{min.js,min.js.gz}`) - .pipe(gulp.dest(dist.chrome.scripts)), + .pipe(gulp.dest(dist.chrome.scripts)), // copy styles gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`) - .pipe(gulp.dest(dist.chrome.styles)), + .pipe(gulp.dest(dist.chrome.styles)), gulp.src(`${tmp.manifests}/chrome*`) - .pipe($.rename('manifest.json')) - .pipe(gulp.dest(dist.chrome.root)) + .pipe($.rename('manifest.json')) + .pipe(gulp.dest(dist.chrome.root)) ); }) @@ -225,19 +225,19 @@ gulp.task('dist:firefox', (done) => { return merge( // copy images gulp.src(`${tmp.images}/**/*`) - .pipe(gulp.dest(dist.firefox.images)), + .pipe(gulp.dest(dist.firefox.images)), // copy scripts gulp.src(`${tmp.scripts}/**/*.{min.js,min.js.gz}`) - .pipe(gulp.dest(dist.firefox.scripts)), + .pipe(gulp.dest(dist.firefox.scripts)), // copy styles gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`) - .pipe(gulp.dest(dist.firefox.styles)), + .pipe(gulp.dest(dist.firefox.styles)), gulp.src(`${tmp.manifests}/firefox*`) - .pipe($.rename('manifest.json')) - .pipe(gulp.dest(dist.firefox.root)) + .pipe($.rename('manifest.json')) + .pipe(gulp.dest(dist.firefox.root)) ); }) @@ -245,19 +245,19 @@ gulp.task('dist:opera', (done) => { return merge( // copy images gulp.src(`${tmp.images}/**/*`) - .pipe(gulp.dest(dist.opera.images)), + .pipe(gulp.dest(dist.opera.images)), // copy scripts gulp.src(`${tmp.scripts}/**/*.{min.js,min.js.gz}`) - .pipe(gulp.dest(dist.opera.scripts)), + .pipe(gulp.dest(dist.opera.scripts)), // copy styles gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`) - .pipe(gulp.dest(dist.opera.styles)), + .pipe(gulp.dest(dist.opera.styles)), gulp.src(`${tmp.manifests}/opera*`) - .pipe($.rename('manifest.json')) - .pipe(gulp.dest(dist.opera.root)) + .pipe($.rename('manifest.json')) + .pipe(gulp.dest(dist.opera.root)) ); }) diff --git a/package-lock.json b/package-lock.json index a464c27..db3fd62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5772,17 +5772,45 @@ } } }, - "gulp-uglify-es": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/gulp-uglify-es/-/gulp-uglify-es-2.0.0.tgz", - "integrity": "sha512-00KkawzjWdjPo1YfD1FXKijVxZkyr6YSwJ2cJQgD1fNKFZCFPNjGc5sTyzyW8tZns8FmZafgHMrg7LUDNvIQ5A==", + "gulp-terser": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gulp-terser/-/gulp-terser-1.4.0.tgz", + "integrity": "sha512-7df9leJna3WOmj76tYHxjpn7BSU+vmKVjVSd6bz3uLEyrzCfZI97KPhRcIabrSNzs0UY/UXTt+JwkxPw3sF85w==", "dev": true, "requires": { - "o-stream": "^0.2.2", + "is-promise": "^4.0.0", "plugin-error": "^1.0.1", - "terser": "^4.3.9", - "vinyl": "^2.2.0", + "terser": ">=4", + "through2": "^4.0.2", "vinyl-sourcemaps-apply": "^0.2.1" + }, + "dependencies": { + "is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "requires": { + "readable-stream": "3" + } + } } }, "gulp-zip": { @@ -7796,12 +7824,6 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, - "o-stream": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/o-stream/-/o-stream-0.2.2.tgz", - "integrity": "sha512-V3j76KU3g/Gyl8rpdi2z72rn5zguMvTCQgAXfBe3pxEefKqXmOUOD7mvx/mNjykdxGqDVfpSoo8r+WdrkWg/1Q==", - "dev": true - }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -9285,8 +9307,7 @@ "regenerator-runtime": { "version": "0.13.7", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", - "dev": true + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" }, "regenerator-transform": { "version": "0.14.5", @@ -10607,9 +10628,9 @@ } }, "terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.1.tgz", + "integrity": "sha512-yD80f4hdwCWTH5mojzxe1q8bN1oJbsK/vfJGLcPZM/fl+/jItIVNKhFIHqqR71OipFWMLgj3Kc+GIp6CeIqfnA==", "dev": true, "requires": { "commander": "^2.20.0", diff --git a/package.json b/package.json index c4db1e6..b07ea8a 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,9 @@ "email": "mail@serraniel.dev" }, "homepage": "https://github.com/Serraniel/AniwatchPlus#readme", - "dependencies": {}, + "dependencies": { + "regenerator-runtime": "^0.13.7" + }, "devDependencies": { "@babel/compat-data": "^7.11.0", "@babel/core": "^7.11.4", @@ -59,10 +61,11 @@ "gulp-sass": "^4.1.0", "gulp-size": "^3.0.0", "gulp-sourcemaps": "^2.6.5", - "gulp-uglify-es": "^2.0.0", + "gulp-terser": "^1.4.0", "gulp-zip": "^5.0.2", "merge-stream": "^2.0.0", "sass": "^1.26.10", + "terser": "^5.3.1", "vinyl-buffer": "^1.0.1", "vinyl-source-stream": "^2.0.0" } diff --git a/src/javascript/index.js b/src/javascript/index.js index 0eb81b4..0052b29 100644 --- a/src/javascript/index.js +++ b/src/javascript/index.js @@ -1,3 +1,5 @@ +import regeneratorRuntime from "regenerator-runtime"; + // core import { initCore } from './utils/aniwatchCore'; // helper diff --git a/src/manifests/chrome.manifest.json b/src/manifests/chrome.manifest.json index f4274d4..840d276 100644 --- a/src/manifests/chrome.manifest.json +++ b/src/manifests/chrome.manifest.json @@ -4,9 +4,6 @@ "version": "$version", "version_name": "$semanticVersion", "description": "$description", - "permissions": [ - "*://aniwatch.me/*" - ], "manifest_version": 2, "author": "$author", "homepage_url": "$homepageURL", diff --git a/src/manifests/firefox.manifest.json b/src/manifests/firefox.manifest.json index e301f42..d2d8ef7 100644 --- a/src/manifests/firefox.manifest.json +++ b/src/manifests/firefox.manifest.json @@ -3,9 +3,6 @@ "short_name": "$shortName", "version": "$version", "description": "$description", - "permissions": [ - "*://aniwatch.me/*" - ], "manifest_version": 2, "author": "$author", "developer": $developer, diff --git a/src/manifests/manifest.template.json b/src/manifests/manifest.template.json index 92d2b66..21a0f6d 100644 --- a/src/manifests/manifest.template.json +++ b/src/manifests/manifest.template.json @@ -4,9 +4,6 @@ "version": "0.1.0.0", "version_name": "0.1 Beta", "description": "Aniwatch Plus is an unofficial extension which provides several UI improvments for https://aniwatch.me.", - "permissions": [ - "*://aniwatch.me/*" - ], "manifest_version": 2, "author": "Serraniel", "developer": { diff --git a/src/manifests/opera.manifest.json b/src/manifests/opera.manifest.json index 333b31e..af4d166 100644 --- a/src/manifests/opera.manifest.json +++ b/src/manifests/opera.manifest.json @@ -4,9 +4,6 @@ "version": "$version", "version_name": "$semanticVersion", "description": "$description", - "permissions": [ - "*://aniwatch.me/*" - ], "manifest_version": 2, "author": "$author", "developer": $developer,