Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are changes to prepublishOnly and prepublish still planned? #8191

Open
hyoretsu opened this issue Mar 27, 2025 · 0 comments
Open

Are changes to prepublishOnly and prepublish still planned? #8191

hyoretsu opened this issue Mar 27, 2025 · 0 comments

Comments

@hyoretsu
Copy link

hyoretsu commented Mar 27, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant