aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-08-09 05:01:12 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-08-09 05:01:12 +0800
commit797fd38e00e48abddc03be214984f81bf7b1c29c (patch)
tree1f90bf3e7f8fbdbc8572d0ef67ef92dda4b6b18b
parent8199e8794331f555679496d32cb87ad8513c31d1 (diff)
downloaddexon-sol-tools-797fd38e00e48abddc03be214984f81bf7b1c29c.tar
dexon-sol-tools-797fd38e00e48abddc03be214984f81bf7b1c29c.tar.gz
dexon-sol-tools-797fd38e00e48abddc03be214984f81bf7b1c29c.tar.bz2
dexon-sol-tools-797fd38e00e48abddc03be214984f81bf7b1c29c.tar.lz
dexon-sol-tools-797fd38e00e48abddc03be214984f81bf7b1c29c.tar.xz
dexon-sol-tools-797fd38e00e48abddc03be214984f81bf7b1c29c.tar.zst
dexon-sol-tools-797fd38e00e48abddc03be214984f81bf7b1c29c.zip
feat(monorepo-scripts): Add confirmation prompt before publishing
-rw-r--r--packages/monorepo-scripts/src/publish.ts22
-rw-r--r--yarn.lock67
2 files changed, 14 insertions, 75 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 5992131db..6ff0c9bef 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -31,12 +31,25 @@ const packageNameToWebsitePath: { [name: string]: string } = {
'ethereum-types': 'ethereum-types',
};
+async function confirmAsync(message: string): Promise<void> {
+ prompt.start();
+ const result = await promisify(prompt.get)([message]);
+ const didConfirm = result[message] === 'y';
+ if (!didConfirm) {
+ utils.log('Publish process aborted.');
+ process.exit(0);
+ }
+}
+
(async () => {
// Fetch public, updated Lerna packages
const shouldIncludePrivate = true;
const allUpdatedPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
if (!configs.IS_LOCAL_PUBLISH) {
+ await confirmAsync(
+ 'THIS IS NOT A TEST PUBLISH! You are about to publish one or more packages to npm. Are you sure you want to continue? (y/n)',
+ );
await confirmDocPagesRenderAsync(allUpdatedPackages);
}
@@ -107,14 +120,7 @@ package.ts. Please add an entry for it and try again.`,
opn(link);
});
- prompt.start();
- const message = 'Do all the doc pages render properly? (yn)';
- const result = await promisify(prompt.get)([message]);
- const didConfirm = result[message] === 'y';
- if (!didConfirm) {
- utils.log('Publish process aborted.');
- process.exit(0);
- }
+ await confirmAsync('Do all the doc pages render properly? (y/n)');
}
async function pushChangelogsToGithubAsync(): Promise<void> {
diff --git a/yarn.lock b/yarn.lock
index 10db1da42..84f690011 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -565,37 +565,6 @@
lodash "4.17.10"
uuid "3.2.1"
-"@0xproject/contract-wrappers@^1.0.1-rc.2":
- version "1.0.1-rc.1"
- dependencies:
- "@0xproject/assert" "^1.0.3"
- "@0xproject/base-contract" "^1.0.3"
- "@0xproject/fill-scenarios" "^1.0.1-rc.1"
- "@0xproject/json-schemas" "^1.0.1-rc.2"
- "@0xproject/order-utils" "^1.0.1-rc.1"
- "@0xproject/types" "^1.0.1-rc.2"
- "@0xproject/typescript-typings" "^1.0.3"
- "@0xproject/utils" "^1.0.3"
- "@0xproject/web3-wrapper" "^1.1.1"
- ethereum-types "^1.0.3"
- ethereumjs-blockstream "5.0.0"
- ethereumjs-util "^5.1.1"
- ethers "3.0.22"
- js-sha3 "^0.7.0"
- lodash "^4.17.4"
- uuid "^3.1.0"
-
-"@0xproject/dev-utils@^1.0.3":
- version "1.0.2"
- dependencies:
- "@0xproject/subproviders" "^1.0.3"
- "@0xproject/types" "^1.0.1-rc.2"
- "@0xproject/typescript-typings" "^1.0.3"
- "@0xproject/utils" "^1.0.3"
- "@0xproject/web3-wrapper" "^1.1.1"
- ethereum-types "^1.0.3"
- lodash "^4.17.4"
-
"@0xproject/fill-scenarios@^0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@0xproject/fill-scenarios/-/fill-scenarios-0.0.4.tgz#4d23c75abda7e9f117b698c0b8b142af07e0c69e"
@@ -653,23 +622,6 @@
jsonschema "1.2.2"
lodash.values "4.3.0"
-"@0xproject/migrations@^1.0.3":
- version "1.0.2"
- dependencies:
- "@0xproject/base-contract" "^1.0.3"
- "@0xproject/order-utils" "^1.0.1-rc.1"
- "@0xproject/sol-compiler" "^1.0.3"
- "@0xproject/subproviders" "^1.0.3"
- "@0xproject/typescript-typings" "^1.0.3"
- "@0xproject/utils" "^1.0.3"
- "@0xproject/web3-wrapper" "^1.1.1"
- "@ledgerhq/hw-app-eth" "^4.3.0"
- ethereum-types "^1.0.3"
- ethers "3.0.22"
- lodash "^4.17.4"
- optionalDependencies:
- "@ledgerhq/hw-transport-node-hid" "^4.3.0"
-
"@0xproject/order-utils@^0.0.7":
version "0.0.7"
resolved "https://registry.yarnpkg.com/@0xproject/order-utils/-/order-utils-0.0.7.tgz#eaa465782ea5745bdad54e1a851533172d993b7c"
@@ -718,25 +670,6 @@
ethereumjs-util "5.1.5"
lodash "4.17.10"
-"@0xproject/order-utils@^1.0.1-rc.2":
- version "1.0.1-rc.1"
- dependencies:
- "@0xproject/assert" "^1.0.3"
- "@0xproject/base-contract" "^1.0.3"
- "@0xproject/json-schemas" "^1.0.1-rc.2"
- "@0xproject/sol-compiler" "^1.0.3"
- "@0xproject/types" "^1.0.1-rc.2"
- "@0xproject/typescript-typings" "^1.0.3"
- "@0xproject/utils" "^1.0.3"
- "@0xproject/web3-wrapper" "^1.1.1"
- "@types/node" "^8.0.53"
- bn.js "^4.11.8"
- ethereum-types "^1.0.3"
- ethereumjs-abi "0.6.5"
- ethereumjs-util "^5.1.1"
- ethers "3.0.22"
- lodash "^4.17.4"
-
"@0xproject/order-watcher@^0.0.7":
version "0.0.7"
resolved "https://registry.yarnpkg.com/@0xproject/order-watcher/-/order-watcher-0.0.7.tgz#fbe019aa33447781096b5d562e7a3a4ec91a1da2"