diff --git a/core/dev-utils/open.js b/core/dev-utils/open.js index 7b40d799..f00793a5 100644 --- a/core/dev-utils/open.js +++ b/core/dev-utils/open.js @@ -1 +1 @@ -module.exports = require('opn') +module.exports = require('open') diff --git a/core/dev-utils/openBrowser.js b/core/dev-utils/openBrowser.js index 0e38882c..2c3d7943 100644 --- a/core/dev-utils/openBrowser.js +++ b/core/dev-utils/openBrowser.js @@ -3,10 +3,10 @@ var execSync = require('child_process').execSync; var spawn = require('cross-spawn'); -var opn = require('opn'); +var open = require('./open'); var colors = require('./colors'); -// https://github.com/sindresorhus/opn#app +// https://github.com/sindresorhus/open#app var OSX_CHROME = 'google chrome'; const Actions = Object.freeze({ @@ -18,7 +18,7 @@ const Actions = Object.freeze({ function getBrowserEnv() { // Attempt to honor this environment variable. // It is specific to the operating system. - // See https://github.com/sindresorhus/opn#app for documentation. + // See https://github.com/sindresorhus/open#app for documentation. const value = process.env.BROWSER; let action; if (!value) { @@ -80,18 +80,18 @@ function startBrowserProcess(browser, url) { } // Another special case: on OS X, check if BROWSER has been set to "open". - // In this case, instead of passing `open` to `opn` (which won't work), + // In this case, instead of passing `open` to `open` (which won't work), // just ignore it (thus ensuring the intended behavior, i.e. opening the system browser): // https://github.com/facebook/create-react-app/pull/1690#issuecomment-283518768 if (process.platform === 'darwin' && browser === 'open') { browser = undefined; } - // Fallback to opn + // Fallback to open // (It will always open new tab) try { var options = { app: browser }; - opn(url, options).catch(() => {}); // Prevent `unhandledRejection` error. + open(url, options).catch(() => {}); // Prevent `unhandledRejection` error. return true; } catch (err) { return false; diff --git a/core/dev-utils/package.json b/core/dev-utils/package.json index 8ef119b5..9576b40a 100644 --- a/core/dev-utils/package.json +++ b/core/dev-utils/package.json @@ -12,7 +12,7 @@ "dependencies": { "address": "^1.0.3", "cross-spawn": "^7.0.2", - "opn": "^5.4.0", + "open": "^7.0.4", "react-error-overlay": "^4.0.1", "sockjs-client": "^1.1.5", "strip-ansi": "5.2.0" diff --git a/yarn.lock b/yarn.lock index 3bd47dd3..15b75746 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5704,11 +5704,6 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -emojis-list@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" - integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== - encodeurl@~1.0.1, encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -8337,6 +8332,11 @@ is-directory@^0.3.1: resolved "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= +is-docker@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.0.0.tgz#2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b" + integrity sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ== + is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" @@ -11140,6 +11140,14 @@ open-editor@^1.2.0: line-column-path "^1.0.0" opn "^5.0.0" +open@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/open/-/open-7.0.4.tgz#c28a9d315e5c98340bf979fdcb2e58664aa10d83" + integrity sha512-brSA+/yq+b08Hsr4c8fsEW2CRzk1BmfN3SAK/5VCHQ9bdoZJ4qa/+AfR0xHjlbbZUyPkUHs1b8x1RqdyZdkVqQ== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + opencollective-postinstall@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" @@ -11150,7 +11158,7 @@ opener@^1.5.1: resolved "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed" integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA== -opn@^5.0.0, opn@^5.4.0, opn@^5.5.0: +opn@^5.0.0, opn@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" integrity sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==