FLUID-6309 - Use npm prepublishOnly instead of prepublish
gtirloni at ocadu.ca
Wed Jul 25 22:08:00 UTC 2018
This is a change  to conform to changes in npm  but I wanted to share it more widely in case anyone can see any downsides and/or is relying on this behavior.
In summary, `prepublish` used to run before `npm publish` and `npm install`. npm has introduced `prepublishOnly` so it only runs, well, before `npm publish` like the name implies.
Our `prepublish` step is currently set to run `npm run buildDists && npm run buildStylus` which effectively means we're running these Grunt tasks at `npm install` time:
Besides shaving 1-3min from the `npm install` step, as it's currently specified, would mean the linter is not running during `npm install` and CI can run it as a separate step. Today, the "build" stage is CI fails hard if there are linting issues.
Do you see need to run all these steps during `npm install`? If so, would it be okay to rename `prepublish` to `prepublishOnly` and add a `preinstall` script for the steps you think are necessary during `npm install`? If not, the PR already contemplates the simplest case (just renaming).
0 - https://github.com/fluid-project/infusion/pull/916
1 - https://docs.npmjs.com/misc/scripts#deprecation-note
More information about the fluid-work