Skip to content

Commit 6d7e08b

Browse files
IvanGoncharovmjmahone
authored andcommitted
Fix npm@6 warnings about deprecated "prepublish" (#1340)
1 parent ef585e9 commit 6d7e08b

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"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",
3939
"build:flow": "for file in $(find ./src -name '*.js' -not -path '*/__tests__*'); do cp \"$file\" `echo \"$file\" | sed 's/\\/src\\//\\/dist\\//g'`.flow; done",
4040
"preversion": ". ./resources/checkgit.sh && npm test",
41-
"prepublish": ". ./resources/prepublish.sh",
41+
"prepublishOnly": ". ./resources/prepublish.sh",
4242
"gitpublish": ". ./resources/gitpublish.sh"
4343
},
4444
"dependencies": {

resources/prepublish.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# Because of a long-running npm issue (https://github.com/npm/npm/issues/3059)
2-
# prepublish runs after `npm install` and `npm pack`.
3-
# In order to only run prepublish before `npm publish`, we have to check argv.
4-
if node -e "process.exit(($npm_config_argv).original.length > 0 && ($npm_config_argv).original[0].indexOf('pu') === 0)"; then
5-
exit 0;
6-
fi
7-
81
# Publishing to NPM is currently supported by Travis CI, which ensures that all
92
# tests pass first and the deployed module contains the correct file structure.
103
# In order to prevent inadvertently circumventing this, we ensure that a CI

0 commit comments

Comments
 (0)