refactor(@embark/utils): move copyToCliboard to embark-utils

This commit is contained in:
Jonathan Rainville 2019-04-29 13:02:45 -04:00 committed by Iuri Matias
parent ad01d1402c
commit bcd006a1cf
6 changed files with 32 additions and 10 deletions

View File

@ -48,7 +48,7 @@
"dependencies": {
"@babel/runtime-corejs2": "7.3.1",
"axios": "0.18.0",
"keccakjs": "0.2.1"
"keccakjs": "0.2.3"
},
"devDependencies": {
"@babel/cli": "7.2.3",

View File

@ -46,6 +46,7 @@
},
"dependencies": {
"@babel/runtime-corejs2": "7.3.1",
"clipboardy": "1.2.3",
"follow-redirects": "1.5.7",
"merge": "1.2.1",
"multihashes": "0.4.14",

View File

@ -1,6 +1,7 @@
const http = require('follow-redirects').http;
const https = require('follow-redirects').https;
const shelljs = require('shelljs');
const clipboardy = require('clipboardy');
const {canonicalHost, defaultCorsHost, defaultHost, dockerHostSwap, isDocker} = require('./host');
const {findNextPort} = require('./network');
@ -90,6 +91,10 @@ function runCmd(cmd, options, callback) {
});
}
function copyToClipboard(text) {
clipboardy.writeSync(text);
}
const Utils = {
joinPath: function() {
@ -97,6 +102,7 @@ const Utils = {
return path.join.apply(path.join, arguments);
},
canonicalHost,
copyToClipboard,
defaultCorsHost,
defaultHost,
dockerHostSwap,

View File

@ -83,7 +83,6 @@
"body-parser": "1.18.3",
"chalk": "2.4.2",
"chokidar": "2.0.4",
"clipboardy": "1.2.3",
"clone-deep": "4.0.0",
"colors": "1.3.2",
"commander": "2.18.0",
@ -92,6 +91,7 @@
"decompress": "4.2.0",
"deep-equal": "1.0.1",
"ejs": "2.6.1",
"embark-authenticator": "^4.1.0-beta.0",
"embark-compiler": "^4.0.0",
"embark-ens": "^4.1.0-beta.0",
"embark-logger": "^4.1.0-beta.0",

View File

@ -476,11 +476,6 @@ function fileTreeSort(nodes){
return folders.concat(files);
}
function copyToClipboard(text) {
const clipboardy = require('clipboardy');
clipboardy.writeSync(text);
}
function fuzzySearch(text, list, filter) {
const fuzzy = require('fuzzy');
return fuzzy.filter(text, list, {extract: (filter || function () {})});
@ -566,7 +561,6 @@ module.exports = {
errorMessage,
timer,
fileTreeSort,
copyToClipboard,
fuzzySearch,
jsonFunctionReplacer,
getWindowSize,

View File

@ -5213,6 +5213,14 @@ browserify-sha3@^0.0.1:
dependencies:
js-sha3 "^0.3.1"
browserify-sha3@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/browserify-sha3/-/browserify-sha3-0.0.4.tgz#086c47b8c82316c9d47022c26185954576dd8e26"
integrity sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=
dependencies:
js-sha3 "^0.6.1"
safe-buffer "^5.1.1"
browserify-sign@^4.0.0:
version "4.0.4"
resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298"
@ -11705,6 +11713,11 @@ js-sha3@^0.3.1:
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243"
integrity sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=
js-sha3@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.6.1.tgz#5b89f77a7477679877f58c4a075240934b1f95c0"
integrity sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=
js-sha3@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.7.0.tgz#0a5c57b36f79882573b2d84051f8bb85dd1bd63a"
@ -11954,7 +11967,15 @@ keccak@^1.0.2:
nan "^2.2.1"
safe-buffer "^5.1.0"
keccakjs@0.2.1, keccakjs@^0.2.0, keccakjs@^0.2.1:
keccakjs@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.3.tgz#5e4e969ce39689a3861f445d7752ee3477f9fe72"
integrity sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==
dependencies:
browserify-sha3 "^0.0.4"
sha3 "^1.2.2"
keccakjs@^0.2.0, keccakjs@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.1.tgz#1d633af907ef305bbf9f2fa616d56c44561dfa4d"
integrity sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=
@ -17473,7 +17494,7 @@ sha.js@^2.4.0, sha.js@^2.4.8:
inherits "^2.0.1"
safe-buffer "^5.0.1"
sha3@^1.1.0:
sha3@^1.1.0, sha3@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/sha3/-/sha3-1.2.2.tgz#a66c5098de4c25bc88336ec8b4817d005bca7ba9"
integrity sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k=