-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Since at least 2015, the documentation has mentioned that prepublish scripts[1], as well as install scripts[2] are discouraged, with the former also being deprecated. Conversely, the section immediately following the deprecation notice of prepublish recommends using it for transpilation and fetching remote resources.
Similarly, the only examples[3] on the page showcase the use of the recently removed uninstall script[4] along with install being used to execute Unix Make scripts, discouraged in favor of node-gyp (and ironically, prepublish scripts) just two sections later.
Expected Behavior
Documentation is consistent and leaves the reader informed, not confused. Current examples should be replaced with more realistic ones. According to bug 10074[5], prepare should take the place of prepublish.
- https://github.com/npm/cli/blob/4d93b484abb50e3704fb436db572b93fb36c7ac3/docs/content/using-npm/scripts.md#prepare-and-prepublish
- https://github.com/npm/cli/blob/4d93b484abb50e3704fb436db572b93fb36c7ac3/docs/content/using-npm/scripts.md#best-practices
- https://github.com/npm/cli/blob/4d93b484abb50e3704fb436db572b93fb36c7ac3/docs/content/using-npm/scripts.md#examples
- https://github.com/npm/cli/blob/4d93b484abb50e3704fb436db572b93fb36c7ac3/docs/content/using-npm/scripts.md#a-note-on-a-lack-of-npm-uninstall-scripts
- resolving prepublish-on-install npm#10074