Skip to content

[BUG] scripts.md promotes the use of deprecated and otherwise discouraged features #3992

@m132

Description

@m132

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.

  1. https://github.com/npm/cli/blob/4d93b484abb50e3704fb436db572b93fb36c7ac3/docs/content/using-npm/scripts.md#prepare-and-prepublish
  2. https://github.com/npm/cli/blob/4d93b484abb50e3704fb436db572b93fb36c7ac3/docs/content/using-npm/scripts.md#best-practices
  3. https://github.com/npm/cli/blob/4d93b484abb50e3704fb436db572b93fb36c7ac3/docs/content/using-npm/scripts.md#examples
  4. https://github.com/npm/cli/blob/4d93b484abb50e3704fb436db572b93fb36c7ac3/docs/content/using-npm/scripts.md#a-note-on-a-lack-of-npm-uninstall-scripts
  5. resolving prepublish-on-install npm#10074

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingDocumentationdocumentation related issueRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions