Skip to content

Are changes to prepublishOnly and prepublish still planned? #8191

Open
@hyoretsu

Description

@hyoretsu

Bun follows the same lifecycle scripts outlined in NPM docs, but PNPM runs both scripts when using pnpm publish. But if you scroll further up in NPM docs, you'll (still) read this:

As of [email protected], a new event has been introduced, prepare, that preserves this existing behavior. A new event, prepublishOnly has been added as a transitional strategy to allow users to avoid the confusing behavior of existing npm versions and only run on npm publish (for instance, running the tests one last time to ensure they're in good shape).

See npm/npm#10074 for a much lengthier justification, with further reading, for this change.

And in the issue there's a plan outlined, which is still missing 1 or 2 steps:

  1. In a year or so, make a semver-major bump to npm and make prepublish's behavior match prepublishOnly.
  2. Either then or sometime after that, deprecate prepublishOnly and have just prepare and prepublish.

Seems like we're still stuck in a "transitional" state, having both prepublishOnly and prepublish while still "planning" to finish it but still supporting the old, confusing prepublish script behavior in install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions