From 87f8496513071781f3da0faa8bfeb114307ace32 Mon Sep 17 00:00:00 2001 From: Trevor Brindle Date: Thu, 18 Jan 2018 09:32:50 -0500 Subject: [PATCH] fix: migrate from copy-paste to clipboardy - copy-paste uses a module sync-exec for older versions of node which has a known vulnerability - clipboardy also supports Android (Termux). Issue reported in CRA - https://github.com/facebookincubator/create-react-app/issues/3837 --- package.json | 2 +- src/envinfo.js | 4 ++-- yarn.lock | 37 ++++++++++++++++++++++++------------- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index b36b4e0..3d45bf0 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "reporting" ], "dependencies": { - "copy-paste": "^1.3.0", + "clipboardy": "^1.2.2", "glob": "^7.1.2", "minimist": "^1.2.0", "os-name": "^2.0.1", diff --git a/src/envinfo.js b/src/envinfo.js index 840b14b..d9f83b6 100755 --- a/src/envinfo.js +++ b/src/envinfo.js @@ -3,7 +3,7 @@ 'use strict'; var helpers = require('./helpers'); -var copypasta = require('copy-paste'); +var copypasta = require('clipboardy'); module.exports.helpers = helpers; module.exports.print = function print(options) { @@ -107,7 +107,7 @@ module.exports.print = function print(options) { log = log.join('\n'); if (options.clipboard) { - copypasta.copy(log); + copypasta.writeSync(log); } } diff --git a/yarn.lock b/yarn.lock index 246b50f..c46ec44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -55,6 +55,10 @@ ansi-styles@^3.0.0, ansi-styles@^3.1.0: dependencies: color-convert "^1.9.0" +arch@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.0.tgz#3613aa46149064b3c1f0607919bf1d4786e82889" + argparse@^1.0.7: version "1.0.9" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" @@ -171,6 +175,13 @@ cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" +clipboardy@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-1.2.2.tgz#2ce320b9ed9be1514f79878b53ff9765420903e2" + dependencies: + arch "^2.1.0" + execa "^0.8.0" + cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" @@ -219,14 +230,6 @@ contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" -copy-paste@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/copy-paste/-/copy-paste-1.3.0.tgz#a7e6c4a1c28fdedf2b081e72b97df2ef95f471ed" - dependencies: - iconv-lite "^0.4.8" - optionalDependencies: - sync-exec "~0.6.x" - core-js@^2.4.0: version "2.5.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b" @@ -448,6 +451,18 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + external-editor@^2.0.4: version "2.0.5" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.5.tgz#52c249a3981b9ba187c7cacf5beb50bf1d91a6bc" @@ -592,7 +607,7 @@ hosted-git-info@^2.1.4: version "2.5.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" -iconv-lite@^0.4.17, iconv-lite@^0.4.8: +iconv-lite@^0.4.17: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -1299,10 +1314,6 @@ symbol-observable@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" -sync-exec@~0.6.x: - version "0.6.2" - resolved "https://registry.yarnpkg.com/sync-exec/-/sync-exec-0.6.2.tgz#717d22cc53f0ce1def5594362f3a89a2ebb91105" - table@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36"