diff --git a/.travis.yml b/.travis.yml index 7ab9c76a..a28f5d42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: node_js node_js: + - 12 - 10 - 8 - - 6 before_install: - npm install --global npm@latest after_success: diff --git a/lib/completion/completer.js b/lib/completion/completer.js index 17926d13..b80ee0d6 100644 --- a/lib/completion/completer.js +++ b/lib/completion/completer.js @@ -94,7 +94,7 @@ class Completer { const flag = help.flags[key]; if (flag.alias) { - alias.push(Object.assign({}, flag, {name: flag.alias})); + alias.push({...flag, name: flag.alias}); } flag.name = key; diff --git a/lib/routes/help.js b/lib/routes/help.js index 50436d41..860d9343 100644 --- a/lib/routes/help.js +++ b/lib/routes/help.js @@ -1,6 +1,6 @@ 'use strict'; const inquirer = require('inquirer'); -const opn = require('opn'); +const open = require('open'); module.exports = app => { app.insight.track('yoyo', 'help'); @@ -31,6 +31,6 @@ module.exports = app => { return; } - opn(answer.whereTo); + open(answer.whereTo); }); }; diff --git a/package-lock.json b/package-lock.json index eebfabb9..4fb8643a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7370,6 +7370,14 @@ "mimic-fn": "^1.0.0" } }, + "open": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/open/-/open-6.3.0.tgz", + "integrity": "sha512-6AHdrJxPvAXIowO/aIaeHZ8CeMdDf7qCyRNq8NwJpinmCdXhz+NZR7ie1Too94lpciCDsG+qHGO9Mt0svA4OqA==", + "requires": { + "is-wsl": "^1.1.0" + } + }, "open-editor": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/open-editor/-/open-editor-1.2.0.tgz", @@ -7385,6 +7393,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", "integrity": "sha1-ZIcVZchjh18FLP31PT48ta21Oxw=", + "dev": true, "requires": { "is-wsl": "^1.1.0" } diff --git a/package.json b/package.json index 8f4db1dc..a9bfcf4d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "yo-complete": "lib/completion/index.js" }, "engines": { - "node": ">=6" + "node": ">=8" }, "scripts": { "postinstall": "yodoctor", @@ -57,7 +57,7 @@ "lodash": "^4.17.10", "meow": "^3.0.0", "npm-keyword": "^5.0.0", - "opn": "^5.3.0", + "open": "^6.3.0", "package-json": "^5.0.0", "parse-help": "^1.0.0", "read-pkg-up": "^4.0.0", @@ -108,6 +108,9 @@ "mocha" ] } - ] + ], + "rules": { + "promise/prefer-await-to-then": 0 + } } } diff --git a/test/route-help.js b/test/route-help.js index 7ff88197..9efb8eb2 100644 --- a/test/route-help.js +++ b/test/route-help.js @@ -12,9 +12,9 @@ describe('help route', () => { this.homeRoute = sinon.spy(); this.router = new Router(sinon.stub(), this.insight); this.router.registerRoute('home', this.homeRoute); - this.opn = sinon.stub(); + this.open = sinon.stub(); const helpRoute = proxyquire('../lib/routes/help', { - opn: this.opn + open: this.open }); this.router.registerRoute('help', helpRoute); }); @@ -42,8 +42,8 @@ describe('help route', () => { const url = 'http://yeoman.io'; this.sandbox.stub(inquirer, 'prompt').returns(Promise.resolve({whereTo: url})); return this.router.navigate('help').then(() => { - sinon.assert.calledWith(this.opn, url); - sinon.assert.calledOnce(this.opn); + sinon.assert.calledWith(this.open, url); + sinon.assert.calledOnce(this.open); }); }); });