From 5e3c1cc84f010cbf0d15a9027b7e52c78bc73199 Mon Sep 17 00:00:00 2001 From: A-312 Date: Tue, 13 Aug 2019 14:58:40 +0200 Subject: [PATCH 01/10] Fix README sentence --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0156ed4..4835e87 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Source:[Why choose terser?](https://github.com/terser-js/terser/blob/master/READ ## Why choose `gulp-terser-js` -This plugins display formatted error: +This plugin displays formatted error: ![error screenshot](https://i.imgur.com/eZUpLmB.png) From c1a2fb4a286d28081e666ee35fad351cc409e4c1 Mon Sep 17 00:00:00 2001 From: A-312 Date: Tue, 13 Aug 2019 14:59:25 +0200 Subject: [PATCH 02/10] Improve information part --- README.md | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 4835e87..8112125 100644 --- a/README.md +++ b/README.md @@ -18,30 +18,6 @@ This plugin displays formatted error: ![error screenshot](https://i.imgur.com/eZUpLmB.png) -## Information - - - - - - - - - - - - - - - - - - - - - -
Packagegulp-terser-js
DescriptionTerser-js plugin for gulp
Node VersionRecommanded >= 8.0.0
Terser VersionRecommanded v3.14+
Gulp Version3.x
- ## Installation ``` @@ -124,3 +100,11 @@ function printLESSError(error) { this.emit('end') } ``` + +## Version + +| Description | gulp-terser-js | +| -------------- | -------------- | +| Node Version | >= 8.0.0 | +| Terser Version | 3.14+ | +| Gulp Version | >= 3.X | From 3ea50e5dbffedf3469f5e30cb2b5872c1f21cca5 Mon Sep 17 00:00:00 2001 From: A-312 Date: Tue, 13 Aug 2019 15:48:23 +0200 Subject: [PATCH 03/10] Move index.js --- index.js => bin/index.js | 0 package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename index.js => bin/index.js (100%) diff --git a/index.js b/bin/index.js similarity index 100% rename from index.js rename to bin/index.js diff --git a/package.json b/package.json index 584ddb1..86db522 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "gulp-terser-js", "version": "4.1.1", "description": "A Terser-js plugin for Gulp", - "main": "index.js", + "main": "bin/index.js", "repository": { "type": "git", "url": "git://github.com/A-312/gulp-terser-js.git" From a63bf7dcfd65b9c489496a7a44adcca5bf0f7b65 Mon Sep 17 00:00:00 2001 From: A-312 Date: Tue, 13 Aug 2019 23:04:00 +0200 Subject: [PATCH 04/10] eslint --- bin/index.js | 99 ++++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/bin/index.js b/bin/index.js index f9ff78e..e3a0096 100644 --- a/bin/index.js +++ b/bin/index.js @@ -1,87 +1,88 @@ -const through2 = require("through2"), - assign = require("object-assign"), - PluginError = require("plugin-error"), - applySourceMap = require("vinyl-sourcemaps-apply"); +const through2 = require('through2') +const assign = require('object-assign') +const PluginError = require('plugin-error') +const applySourceMap = require('vinyl-sourcemaps-apply') -const terser = require("terser"); +const terser = require('terser') function gulpTerser(options) { // Mixes in default options. - const opts = assign({}, {}, options); + const opts = assign({}, {}, options) return through2.obj(function(file, enc, next) { if (file.isNull()) { - return next(null, file); + return next(null, file) } if (file.isStream()) { - return next(new PluginError('gulp-terser', 'Streaming not supported')); + return next(new PluginError('gulp-terser', 'Streaming not supported')) } - const str = file.contents.toString(); - let build = {}; + const str = file.contents.toString() + let build = {} // Bootstrap source maps if (file.sourceMap) { - opts.sourceMap = {}; - opts.sourceMap.filename = file.sourceMap.file; + opts.sourceMap = {} + opts.sourceMap.filename = file.sourceMap.file } if (file.sourceMap && file.sourceMap.file) { - build[file.sourceMap.file] = str; + build[file.sourceMap.file] = str } else { - build = str; + build = str } - const res = terser.minify(build, opts); + const res = terser.minify(build, opts) if (res.error) { - res.error.filePath = file.path; - res.error.fileContent = (typeof build === "string") ? build : build[res.error.filename]; + res.error.filePath = file.path + res.error.fileContent = (typeof build === 'string') ? build : build[res.error.filename] - return next(printError(new PluginError('gulp-terser', res.error))); + return next(printError(new PluginError('gulp-terser', res.error))) } - file.contents = new (Buffer.from || Buffer)(res.code); // source-map + file.contents = new (Buffer.from || Buffer)(res.code) // eslint-disable-line node/no-deprecated-api if (file.sourceMap && res.map) { - applySourceMap(file, res.map); + applySourceMap(file, res.map) } - return next(null, file); - }); -}; - -module.exports = gulpTerser + return next(null, file) + }) +} function alignLine(num, text, longer, maxsize) { - let maxlength = process.stdout.columns - 1; - num = num + Array(longer - (num + "").length).join(" "); - maxlength -= num.length + 3; - console.log("\033[36m" + num + " |\033[00m " + text.slice(0, (maxsize < maxlength) ? maxlength : maxsize)); + let maxlength = process.stdout.columns - 1 + const spaces = num + Array(longer - (num + '').length).join(' ') + maxlength -= spaces.length + 3 + console.log('\x1B[36m' + spaces + ' |\x1B[00m ' + text.slice(0, (maxsize < maxlength) ? maxlength : maxsize)) } -gulpTerser.printError = function printError(error) { - if (!error.fileContent || (error.line === undefined && error.col === undefined)) - return console.error(error.stack || error); - - const fileContent = error.fileContent; - const lines = fileContent.replace(/\t/g, " ").split("\n"), - more = (error.line + " ").length, - col = error.col + 1, - pos = (more + 2) + fileContent.split("\n")[error.line - 1].replace(/[^\t]/g, "").length * 3 + parseInt(col); - - console.log(`\nError with ${error.plugin} :`); - for (let i = error.line - 5; i < error.line; i++) { - if (lines[i]) { - alignLine(i + 1, lines[i], more, pos); - } - } +function printError(error) { + if (!error.fileContent || (error.line === undefined && error.col === undefined)) { + return console.error(error.stack || error) + } + + const fileContent = error.fileContent + const lines = fileContent.replace(/\t/g, ' ').split('\n') + const more = (error.line + ' ').length + const col = error.col + 1 + const pos = (more + 2) + fileContent.split('\n')[error.line - 1].replace(/[^\t]/g, '').length * 3 + parseInt(col) + + console.log(`\nError with ${error.plugin} :`) + for (let i = error.line - 5; i < error.line; i++) { + if (lines[i]) { + alignLine(i + 1, lines[i], more, pos) + } + } - console.log(Array(pos).join(" ") + "\033[91m^\033[00m"); - console.log("(" + error.name + ") " + error.message + " (line : \033[96m" + error.line + "\033[00m, col : \033[96m" + col + "\033[00m)."); - console.log(`in : ${error.filePath}\n`); + console.log(Array(pos).join(' ') + '\x1B[91m^\x1B[00m') + console.log('(' + error.name + ') ' + error.message + ' (line : \x1B[96m' + error.line + '\x1B[00m, col : \x1B[96m' + col + '\x1B[00m).') + console.log(`in : ${error.filePath}\n`) - return error; + return error } +gulpTerser.printError = printError +module.exports = gulpTerser From 89547bdf0d071a589627534569ae6d75178646da Mon Sep 17 00:00:00 2001 From: A-312 Date: Tue, 13 Aug 2019 23:07:31 +0200 Subject: [PATCH 05/10] Setup travis (add test and eslint) --- .eslintignore | 6 ++ .eslintrc.yml | 13 ++++ .gitattributes | 2 - .gitignore | 7 +- .travis.yml | 67 ++++++++++++++++-- README.md | 4 +- package.json | 50 ++++++++------ test/.eslintrc.yml | 2 + test/cmd.js | 105 +++++++++++++++++++++++++++++ test/expect/script-with-error.json | 8 +++ test/expect/to-be-one/a.txt | 1 + test/expect/to-be-one/b.txt | 1 + test/fixtures/script-with-error.js | 5 ++ test/fixtures/to-be-one/a.js | 3 + test/fixtures/to-be-one/b.js | 3 + 15 files changed, 247 insertions(+), 30 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.yml delete mode 100644 .gitattributes create mode 100644 test/.eslintrc.yml create mode 100644 test/cmd.js create mode 100644 test/expect/script-with-error.json create mode 100644 test/expect/to-be-one/a.txt create mode 100644 test/expect/to-be-one/b.txt create mode 100644 test/fixtures/script-with-error.js create mode 100644 test/fixtures/to-be-one/a.js create mode 100644 test/fixtures/to-be-one/b.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..7378a76 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +coverage +node_modules +temp +test/expect +test/fixtures +.output \ No newline at end of file diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..1f7450d --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,13 @@ +root: true +extends: standard +rules: + no-param-reassign: error + no-shadow: error + space-before-function-paren: + - error + - anonymous: never + named: never + asyncArrow: always + no-multiple-empty-lines: + - error + - { "max": 2 } \ No newline at end of file diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index dfe0770..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/.gitignore b/.gitignore index b512c09..8f1f0dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ -node_modules \ No newline at end of file +node_modules/ +*.sublime-workspace +*.sublime-project +package-lock.json +.nyc_output/ +.output/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index efd29ce..6b790a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,63 @@ -sudo: false - language: node_js node_js: - - "8.0.0" - - "10.0.0" - - "11.0.0" - - "11.6.0" + - "8.0" + - "8.15" + - "9.11" + - "stable" + - "lts/*" +matrix: + fast_finish: true +sudo: false +cache: + directories: + - node_modules +before_install: + # Configure npm + - | + # Skip updating shrinkwrap / lock + npm config set shrinkwrap false + # Setup Node.js version-specific dependencies + - | + # eslint for linting + # - remove on Node.js < 6 + if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then + node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \ + grep -E '^eslint(-|$)' | \ + xargs npm rm --save-dev + fi + - | + # mocha for testing + # - use 3.x for Node.js < 4 + # - use 5.x for Node.js < 6 + if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then + npm install --save-dev mocha@3.5.3 + elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then + npm install --save-dev mocha@5.2.0 + fi + - | + # supertest for http calls + # - use 2.0.0 for Node.js < 4 + # - use 3.4.2 for Node.js < 6 + if [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 4 ]]; then + npm install --save-dev supertest@2.0.0 + elif [[ "$(cut -d. -f1 <<< "$TRAVIS_NODE_VERSION")" -lt 6 ]]; then + npm install --save-dev supertest@3.4.2 + fi + # Update Node.js modules + - | + # Prune and rebuild node_modules + if [[ -d node_modules ]]; then + npm prune + npm rebuild + fi +script: + # Run test script + - npm run test-ci + # Run linting + - | + # Run linting, depending on eslint install + if [[ -n "$(npm -ps ls eslint)" ]]; then + npm run-script lint + fi +after_script: + - npm run coverage diff --git a/README.md b/README.md index 8112125..b1c3400 100644 --- a/README.md +++ b/README.md @@ -106,5 +106,5 @@ function printLESSError(error) { | Description | gulp-terser-js | | -------------- | -------------- | | Node Version | >= 8.0.0 | -| Terser Version | 3.14+ | -| Gulp Version | >= 3.X | +| Terser Version | 4.1.4+ | +| Gulp Version | >= 4.X | diff --git a/package.json b/package.json index 86db522..4221fbd 100644 --- a/package.json +++ b/package.json @@ -3,35 +3,47 @@ "version": "4.1.1", "description": "A Terser-js plugin for Gulp", "main": "bin/index.js", + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "mocha --reporter spec --check-leaks test/", + "coverage": "nyc mocha --reporter spec && nyc report --reporter=text-lcov | coveralls" + }, "repository": { "type": "git", "url": "git://github.com/A-312/gulp-terser-js.git" }, - "engines": { - "node": ">=0.10.0" - }, + "files": [ + "bin/", + "README.md", + "CHANGELOG.md", + "LICENSE" + ], + "author": "A-312", "keywords": [ "gulpplugin", "gulp", "terser" ], "license": "MIT", - "dependencies": { - "terser": "^3.14.0", - "object-assign": "^4.0.1", - "plugin-error": "^0.1.2", - "through2": "^2.0.0", - "vinyl-sourcemaps-apply": "^0.2.0" - }, - "bugs": { - "url": "https://github.com/A-312/gulp-terser-js/issues" - }, "homepage": "https://github.com/A-312/gulp-terser-js#readme", - "directories": { - "test": "test" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "dependencies": { + "object-assign": "^4.1.1", + "plugin-error": "^1.0.1", + "terser": "^4.1.4", + "through2": "^3.0.1", + "vinyl-sourcemaps-apply": "^0.2.1" }, - "author": "a-312" + "devDependencies": { + "gulp": "^4.0.2", + "coveralls": "3.0.5", + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "6.1.4", + "nyc": "14.1.1" + } } diff --git a/test/.eslintrc.yml b/test/.eslintrc.yml new file mode 100644 index 0000000..9808c3b --- /dev/null +++ b/test/.eslintrc.yml @@ -0,0 +1,2 @@ +env: + mocha: true diff --git a/test/cmd.js b/test/cmd.js new file mode 100644 index 0000000..8ed39b4 --- /dev/null +++ b/test/cmd.js @@ -0,0 +1,105 @@ +const assert = require('assert') + +const path = require('path') +const fs = require('fs') + +const gulp = require('gulp') +const terser = require('../') + +const srcOptions = { + cwd: path.resolve(__dirname), + base: path.resolve(__dirname) +} + +const outputFolder = path.resolve(__dirname, '.output') + +deleteFolderRecursive(outputFolder) +fs.mkdirSync(outputFolder) + +describe('gulp-terser-js(1)', function() { + describe('default usage', function() { + const get = (filepath) => fs.readFileSync(path.resolve(__dirname, filepath)).toString() + + describe('can run terser', function() { + it('should run terser', function(done) { + const stream = gulp.src('fixtures/to-be-one/*.js', srcOptions) + .pipe(terser({ + mangle: { + toplevel: true + } + })).on('error', function(err) { + done(err) + }) + .pipe(gulp.dest(outputFolder)) + + stream.on('end', function() { + done() + }) + }) + + + it('should have the expected result', function() { + const result = { + a: get('.output/fixtures/to-be-one/a.js'), + b: get('.output/fixtures/to-be-one/b.js') + } + + const expect = { + a: get('expect/to-be-one/a.txt'), + b: get('expect/to-be-one/b.txt') + } + + assert.strictEqual(result.a, expect.a, 'should be the same output with a.txt') + assert.strictEqual(result.a, expect.a, 'should be the same output with b.txt') + }) + + + it('should catch error', function(done) { + const logfn = console.log + const logstore = [] + + let error = null + + console.log = function() { + logstore.push([].join.call(arguments, ',')) + } + + const stream = gulp.src('fixtures/script-with-error.js', srcOptions) + .pipe(terser({ + mangle: { + toplevel: true + } + })).on('error', function(err) { + console.log = logfn + error = err + this.emit('end') + }) + .pipe(gulp.dest(outputFolder)) + + stream.on('end', function() { + assert.strictEqual(error.message, 'Unexpected token: operator (&&)', 'is the expected error') + const expect = JSON.parse(get('expect/script-with-error.json')) + // if you want check the current log use : + // console.log(JSON.stringify(logstore)) + assert.strictEqual(logstore.join(''), expect.join(''), 'is the expected error') + done() + }) + }) + }) + }) +}) + + +function deleteFolderRecursive(folderpath) { + if (fs.existsSync(folderpath)) { + fs.readdirSync(folderpath).forEach(function(file, index) { + var curPath = folderpath + '/' + file + if (fs.lstatSync(curPath).isDirectory()) { // recurse + deleteFolderRecursive(curPath) + } else { // delete file + fs.unlinkSync(curPath) + } + }) + fs.rmdirSync(folderpath) + } +} diff --git a/test/expect/script-with-error.json b/test/expect/script-with-error.json new file mode 100644 index 0000000..9db9c74 --- /dev/null +++ b/test/expect/script-with-error.json @@ -0,0 +1,8 @@ +[ + "\nError with gulp-terser :", + "\u001b[36m1 |\u001b[00m function main() {\r", + "\u001b[36m2 |\u001b[00m &&&&&&&&&();\r", + " \u001b[91m^\u001b[00m", + "(SyntaxError) Unexpected token: operator (&&) (line : \u001b[96m2\u001b[00m, col : \u001b[96m3\u001b[00m).", + "in : E:\\GitHub\\gulp-terser-js\\test\\fixtures\\script-with-error.js\n" +] \ No newline at end of file diff --git a/test/expect/to-be-one/a.txt b/test/expect/to-be-one/a.txt new file mode 100644 index 0000000..deb544b --- /dev/null +++ b/test/expect/to-be-one/a.txt @@ -0,0 +1 @@ +function o(){console.log("A")} \ No newline at end of file diff --git a/test/expect/to-be-one/b.txt b/test/expect/to-be-one/b.txt new file mode 100644 index 0000000..f64e76d --- /dev/null +++ b/test/expect/to-be-one/b.txt @@ -0,0 +1 @@ +function o(){console.log("B")} \ No newline at end of file diff --git a/test/fixtures/script-with-error.js b/test/fixtures/script-with-error.js new file mode 100644 index 0000000..5d2ec0e --- /dev/null +++ b/test/fixtures/script-with-error.js @@ -0,0 +1,5 @@ +function main() { + &&&&&&&&&(); +} + +main(); \ No newline at end of file diff --git a/test/fixtures/to-be-one/a.js b/test/fixtures/to-be-one/a.js new file mode 100644 index 0000000..d3add75 --- /dev/null +++ b/test/fixtures/to-be-one/a.js @@ -0,0 +1,3 @@ +function A() { + console.log('A') +} \ No newline at end of file diff --git a/test/fixtures/to-be-one/b.js b/test/fixtures/to-be-one/b.js new file mode 100644 index 0000000..ec6fd86 --- /dev/null +++ b/test/fixtures/to-be-one/b.js @@ -0,0 +1,3 @@ +function B() { + console.log('B') +} \ No newline at end of file From 9796b1b1f9801264f0fdd101bfc956cd0cce2dfa Mon Sep 17 00:00:00 2001 From: A-312 Date: Tue, 13 Aug 2019 23:09:05 +0200 Subject: [PATCH 06/10] Add CHANGELOG.md --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..05673b0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,33 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + +## [5.0.0] - 2019-08-13 +### Changed + +- Update dependencies version (Terser is now on 4.1.4) #8 +- Add test, coverage in travis #8 + + +## [4.1.1] - 2019-08-13 +### Fix + +- Fix printError and improve readme(caused by #3) #5 + +### Added + +- Add API for printError: `require('gulp-terser-js').printError` #5 + + +## [4.1.0] - 2019-08-09 +### Added + +- Add printError #3 + +[5.0.0]: https://github.com/A-312/gulp-terser-js/releases/tag/5.0.0 +[4.1.1]: https://github.com/A-312/gulp-terser-js/releases/tag/4.1.1 +[4.1.0]: https://github.com/A-312/gulp-terser-js/releases/tag/4.1.0 From b2e861b8f13dc149c832562feddc4d5cd5757a50 Mon Sep 17 00:00:00 2001 From: A-312 Date: Tue, 13 Aug 2019 23:26:32 +0200 Subject: [PATCH 07/10] Fixtures will support all OS with EOL support --- bin/index.js | 5 +++-- test/cmd.js | 5 +++-- test/expect/script-with-error.json | 7 +++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/index.js b/bin/index.js index e3a0096..807380f 100644 --- a/bin/index.js +++ b/bin/index.js @@ -2,6 +2,7 @@ const through2 = require('through2') const assign = require('object-assign') const PluginError = require('plugin-error') const applySourceMap = require('vinyl-sourcemaps-apply') +const os = require('os') const terser = require('terser') @@ -64,10 +65,10 @@ function printError(error) { } const fileContent = error.fileContent - const lines = fileContent.replace(/\t/g, ' ').split('\n') + const lines = fileContent.replace(/\t/g, ' ').split(os.EOL) const more = (error.line + ' ').length const col = error.col + 1 - const pos = (more + 2) + fileContent.split('\n')[error.line - 1].replace(/[^\t]/g, '').length * 3 + parseInt(col) + const pos = (more + 2) + fileContent.split(os.EOL)[error.line - 1].replace(/[^\t]/g, '').length * 3 + parseInt(col) console.log(`\nError with ${error.plugin} :`) for (let i = error.line - 5; i < error.line; i++) { diff --git a/test/cmd.js b/test/cmd.js index 8ed39b4..b7db212 100644 --- a/test/cmd.js +++ b/test/cmd.js @@ -80,8 +80,9 @@ describe('gulp-terser-js(1)', function() { assert.strictEqual(error.message, 'Unexpected token: operator (&&)', 'is the expected error') const expect = JSON.parse(get('expect/script-with-error.json')) // if you want check the current log use : - // console.log(JSON.stringify(logstore)) - assert.strictEqual(logstore.join(''), expect.join(''), 'is the expected error') + // console.log(JSON.stringify(logstore, 0, 4)) + // console.log(JSON.stringify(expect, 0, 4)) + assert.strictEqual(logstore.slice(0, -1).join(''), expect.join(''), 'is the expected error') done() }) }) diff --git a/test/expect/script-with-error.json b/test/expect/script-with-error.json index 9db9c74..c2cedbf 100644 --- a/test/expect/script-with-error.json +++ b/test/expect/script-with-error.json @@ -1,8 +1,7 @@ [ "\nError with gulp-terser :", - "\u001b[36m1 |\u001b[00m function main() {\r", - "\u001b[36m2 |\u001b[00m &&&&&&&&&();\r", + "\u001b[36m1 |\u001b[00m function main() {", + "\u001b[36m2 |\u001b[00m &&&&&&&&&();", " \u001b[91m^\u001b[00m", - "(SyntaxError) Unexpected token: operator (&&) (line : \u001b[96m2\u001b[00m, col : \u001b[96m3\u001b[00m).", - "in : E:\\GitHub\\gulp-terser-js\\test\\fixtures\\script-with-error.js\n" + "(SyntaxError) Unexpected token: operator (&&) (line : \u001b[96m2\u001b[00m, col : \u001b[96m3\u001b[00m)." ] \ No newline at end of file From 59deb1b09948dd7054ca8a73610518a2472099c8 Mon Sep 17 00:00:00 2001 From: A-312 Date: Wed, 14 Aug 2019 00:59:06 +0200 Subject: [PATCH 08/10] Change version to 5.0.0 --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05673b0..cc55c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [5.0.0] - 2019-08-13 +## [5.0.0] - 2019-08-14 ### Changed - Update dependencies version (Terser is now on 4.1.4) #8 diff --git a/package.json b/package.json index 4221fbd..00996d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-terser-js", - "version": "4.1.1", + "version": "5.0.0", "description": "A Terser-js plugin for Gulp", "main": "bin/index.js", "scripts": { From 57e1f0125cc3798a6a1e399240b5f3e5af899586 Mon Sep 17 00:00:00 2001 From: A-312 Date: Wed, 14 Aug 2019 00:59:37 +0200 Subject: [PATCH 09/10] Eslint support for node v12 --- .travis.yml | 4 ++-- README.md | 2 +- package.json | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b790a0..09508e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: node_js node_js: - - "8.0" + - "8.10" - "8.15" - "9.11" - - "stable" - "lts/*" + - "stable" matrix: fast_finish: true sudo: false diff --git a/README.md b/README.md index b1c3400..777da09 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,6 @@ function printLESSError(error) { | Description | gulp-terser-js | | -------------- | -------------- | -| Node Version | >= 8.0.0 | +| Node Version | >= 8.10.0 | | Terser Version | 4.1.4+ | | Gulp Version | >= 4.X | diff --git a/package.json b/package.json index 00996d1..4c40114 100644 --- a/package.json +++ b/package.json @@ -36,14 +36,14 @@ }, "devDependencies": { "gulp": "^4.0.2", - "coveralls": "3.0.5", - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", + "coveralls": "3.0.6", + "eslint": "6.1.0", + "eslint-config-standard": "13.0.1", + "eslint-plugin-import": "2.18.2", + "eslint-plugin-node": "9.1.0", + "eslint-plugin-promise": "4.2.1", "eslint-plugin-standard": "4.0.0", - "mocha": "6.1.4", + "mocha": "6.2.0", "nyc": "14.1.1" } } From 437d82285c77acfbb4b1d59abe01b26a81020963 Mon Sep 17 00:00:00 2001 From: A-312 Date: Wed, 14 Aug 2019 01:48:15 +0200 Subject: [PATCH 10/10] eslint doesn't work with node v12 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 09508e8..1027017 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ node_js: - "8.15" - "9.11" - "lts/*" - - "stable" matrix: fast_finish: true sudo: false