Content-Length: 308276 | pFad | https://github.com/npm/npm/issues/10074

72 resolving prepublish-on-install · Issue #10074 · npm/npm · GitHub
Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

resolving prepublish-on-install #10074

Closed
Closed
@othiym23

Description

@othiym23

See also: #3059, #8402, #9722, #9733, probably many others.

Many, many people intensely dislike the fact that a lifecycle event named "prepublish" also gets run when a package is also installed for development, as this precludes the ability to have a set of validation checks that get run before publishing (and also because the name becomes confusingly inaccurate). The reasons for this behavior have been discussed, bikeshedded, and vehemently argued over elsewhere. There is a consensus that the current behavior is undesirable, and the CLI team agrees that this situation needs to be fixed. This is what we intend to do:

  1. Introduce a new prepare lifecycle event, which has the current behavior of the prepublish event – it runs before the package tarball is packed and uploaded to the registry during the publishing process, as well as when you run npm install (with no package name) after cloning a package, to prepare it for use (i.e. by transpiling source).
  2. Introduce a new prepublishOnly lifecycle event, which runs only at prepublish time.
  3. Add a new warning when the prepublish hook is used that the current behavior is deprecated, and will be removed at some point in the future.
  4. In a year or so, make a semver-major bump to npm and make prepublish's behavior match prepublishOnly.
  5. Either then or sometime after that, deprecate prepublishOnly and have just prepare and prepublish.

This should allow everyone to get the behavior they want, and will (eventually) result in a solution that is intuitive and unsurprising to everyone, and allows us to do so in about as gentle a way as possible for something so potentially disruptive.

Thoughts? Things we haven't considered? Parts 1-3 can (and will) be implemented as part of npm@3, probably over the next couple months, so it would be nice to get people's feedback relatively quickly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/npm/npm/issues/10074

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy