From 6c6a13fb8aee046921166ec5f8410009f1744dcb Mon Sep 17 00:00:00 2001 From: LitoMore Date: Fri, 28 Jun 2019 17:57:22 +0800 Subject: [PATCH] Upgrade `opn` to `open` --- lib/routes/help.js | 4 ++-- package-lock.json | 9 +++++++++ package.json | 2 +- test/route-help.js | 8 ++++---- 4 files changed, 16 insertions(+), 7 deletions(-) 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..bb213095 100644 --- a/package.json +++ b/package.json @@ -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", 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); }); }); });