From 6d7e08becb08065744fa08c7a7d3b167c0cd4862 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Fri, 11 May 2018 23:30:07 +0300 Subject: [PATCH] Fix npm@6 warnings about deprecated "prepublish" (#1340) --- package.json | 2 +- resources/prepublish.sh | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/package.json b/package.json index b4003fb953..15c57bf7d3 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "build:mjs": "BABEL_MODULES=1 babel src --optional runtime --ignore __tests__ --out-dir dist/module/ && for file in $(find dist/module -name '*.js'); do mv \"$file\" `echo \"$file\" | sed 's/dist\\/module/dist/g; s/.js$/.mjs/g'`; done && rm -rf dist/module", "build:flow": "for file in $(find ./src -name '*.js' -not -path '*/__tests__*'); do cp \"$file\" `echo \"$file\" | sed 's/\\/src\\//\\/dist\\//g'`.flow; done", "preversion": ". ./resources/checkgit.sh && npm test", - "prepublish": ". ./resources/prepublish.sh", + "prepublishOnly": ". ./resources/prepublish.sh", "gitpublish": ". ./resources/gitpublish.sh" }, "dependencies": { diff --git a/resources/prepublish.sh b/resources/prepublish.sh index 4914ae48d0..933d406dc8 100644 --- a/resources/prepublish.sh +++ b/resources/prepublish.sh @@ -1,10 +1,3 @@ -# Because of a long-running npm issue (https://github.com/npm/npm/issues/3059) -# prepublish runs after `npm install` and `npm pack`. -# In order to only run prepublish before `npm publish`, we have to check argv. -if node -e "process.exit(($npm_config_argv).original.length > 0 && ($npm_config_argv).original[0].indexOf('pu') === 0)"; then - exit 0; -fi - # Publishing to NPM is currently supported by Travis CI, which ensures that all # tests pass first and the deployed module contains the correct file structure. # In order to prevent inadvertently circumventing this, we ensure that a CI