From e8f6ab66e4455939868278a77f037a770ed1e580 Mon Sep 17 00:00:00 2001 From: Thibaut Boustany Date: Wed, 25 Jul 2018 18:51:39 +0200 Subject: [PATCH] Make yarn build | clean | watch work on Windows for each package --- packages/example-node/package.json | 6 +++--- packages/hw-app-ada/package.json | 6 +++--- packages/hw-app-btc/package.json | 6 +++--- packages/hw-app-eth/package.json | 6 +++--- packages/hw-app-str/package.json | 6 +++--- packages/hw-app-xrp/package.json | 6 +++--- packages/hw-hid-cli/package.json | 6 +++--- packages/hw-http-proxy-devserver/package.json | 6 +++--- packages/hw-transport-http/package.json | 6 +++--- packages/hw-transport-mocker/package.json | 6 +++--- packages/hw-transport-node-hid/package.json | 6 +++--- packages/hw-transport-u2f/package.json | 6 +++--- packages/hw-transport/package.json | 6 +++--- packages/react-native-hid/package.json | 6 +++--- packages/react-native-hw-transport-ble/package.json | 6 +++--- packages/test/package.json | 6 +++--- packages/web3-subprovider/package.json | 6 +++--- script/build.sh | 9 +++++++++ script/clean.sh | 5 +++++ script/watch.sh | 9 +++++++++ 20 files changed, 74 insertions(+), 51 deletions(-) create mode 100755 script/build.sh create mode 100755 script/clean.sh create mode 100755 script/watch.sh diff --git a/packages/example-node/package.json b/packages/example-node/package.json index 9f5bb9986..dc6043b50 100644 --- a/packages/example-node/package.json +++ b/packages/example-node/package.json @@ -16,8 +16,8 @@ "scripts": { "start": "node lib/index.js", "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-app-ada/package.json b/packages/hw-app-ada/package.json index ede7cebdc..f072cac57 100644 --- a/packages/hw-app-ada/package.json +++ b/packages/hw-app-ada/package.json @@ -35,9 +35,9 @@ "homepage": "https://github.com/LedgerHQ/ledgerjs#readme", "scripts": { "flow": "flow", - "clean": "rm -rf lib/ flow-typed/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib", + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh", "clean-test": "rm -rf test/lib", "build-test": "yarn run clean-test && cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d test/lib test/src && flow-copy-source -v test/src test/lib", "core-test": "yarn run build-test && yarn run flow && mocha --timeout 3500 test/lib/core", diff --git a/packages/hw-app-btc/package.json b/packages/hw-app-btc/package.json index a39d5ba68..37480a050 100644 --- a/packages/hw-app-btc/package.json +++ b/packages/hw-app-btc/package.json @@ -34,8 +34,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-app-eth/package.json b/packages/hw-app-eth/package.json index 6e971e046..fe68cec87 100644 --- a/packages/hw-app-eth/package.json +++ b/packages/hw-app-eth/package.json @@ -33,8 +33,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-app-str/package.json b/packages/hw-app-str/package.json index 398bd9cb2..9a1f12ab4 100644 --- a/packages/hw-app-str/package.json +++ b/packages/hw-app-str/package.json @@ -36,8 +36,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-app-xrp/package.json b/packages/hw-app-xrp/package.json index 020bff632..a2b49de61 100644 --- a/packages/hw-app-xrp/package.json +++ b/packages/hw-app-xrp/package.json @@ -34,8 +34,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-hid-cli/package.json b/packages/hw-hid-cli/package.json index a42a363be..de6e13d64 100644 --- a/packages/hw-hid-cli/package.json +++ b/packages/hw-hid-cli/package.json @@ -37,9 +37,9 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", "start": "node ./lib/cmd.js", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-http-proxy-devserver/package.json b/packages/hw-http-proxy-devserver/package.json index 77fb8937c..d07a5f181 100644 --- a/packages/hw-http-proxy-devserver/package.json +++ b/packages/hw-http-proxy-devserver/package.json @@ -40,9 +40,9 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", "start": "node ./lib/cmd.js", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-transport-http/package.json b/packages/hw-transport-http/package.json index 7637a511f..b54c2f310 100644 --- a/packages/hw-transport-http/package.json +++ b/packages/hw-transport-http/package.json @@ -33,8 +33,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-transport-mocker/package.json b/packages/hw-transport-mocker/package.json index db6c2d9a2..745ee1e7e 100644 --- a/packages/hw-transport-mocker/package.json +++ b/packages/hw-transport-mocker/package.json @@ -31,8 +31,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-transport-node-hid/package.json b/packages/hw-transport-node-hid/package.json index 96f1e8ae4..d7ffa57ba 100644 --- a/packages/hw-transport-node-hid/package.json +++ b/packages/hw-transport-node-hid/package.json @@ -34,8 +34,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-transport-u2f/package.json b/packages/hw-transport-u2f/package.json index 5010a3103..a8f81727e 100644 --- a/packages/hw-transport-u2f/package.json +++ b/packages/hw-transport-u2f/package.json @@ -35,8 +35,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/hw-transport/package.json b/packages/hw-transport/package.json index 4c9a0265e..5a090b319 100644 --- a/packages/hw-transport/package.json +++ b/packages/hw-transport/package.json @@ -31,8 +31,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/react-native-hid/package.json b/packages/react-native-hid/package.json index 80caed013..56ea73866 100755 --- a/packages/react-native-hid/package.json +++ b/packages/react-native-hid/package.json @@ -35,8 +35,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/react-native-hw-transport-ble/package.json b/packages/react-native-hw-transport-ble/package.json index 55848152b..6043bda3f 100644 --- a/packages/react-native-hw-transport-ble/package.json +++ b/packages/react-native-hw-transport-ble/package.json @@ -35,8 +35,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/test/package.json b/packages/test/package.json index 41c4deb81..9f4c6430c 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -24,8 +24,8 @@ "test-snapshot": "node lib/index-snapshot.js", "test": "yarn run test-snapshot", "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/packages/web3-subprovider/package.json b/packages/web3-subprovider/package.json index d903aa052..185559087 100644 --- a/packages/web3-subprovider/package.json +++ b/packages/web3-subprovider/package.json @@ -41,8 +41,8 @@ }, "scripts": { "flow": "flow", - "clean": "rm -rf lib/", - "build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", - "watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" + "clean": "bash ../../script/clean.sh", + "build": "bash ../../script/build.sh", + "watch": "bash ../../script/watch.sh" } } diff --git a/script/build.sh b/script/build.sh new file mode 100755 index 000000000..ca36f0a0f --- /dev/null +++ b/script/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +cd ../.. +PATH=$(yarn bin):$PATH +cd - +babel --source-maps -d lib src +flow-copy-source -v src lib diff --git a/script/clean.sh b/script/clean.sh new file mode 100755 index 000000000..2124fcb10 --- /dev/null +++ b/script/clean.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +rm -rf lib/ flow-typed/ diff --git a/script/watch.sh b/script/watch.sh new file mode 100755 index 000000000..c7f83c5f0 --- /dev/null +++ b/script/watch.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +cd ../.. +PATH=$(yarn bin):$PATH +cd - +babel --watch --source-maps -d lib src & +flow-copy-source -w -v src lib