Skip to content

Conversation

@MaxBlack-dev
Copy link
Contributor

Description

Fixes the documented lifecycle event order for the prepare script to match the actual behavior during npm publish.

Changes

  • Updated the prepare script documentation to correctly state it runs AFTER prepublishOnly and prepack, but BEFORE postpack
  • Previously incorrectly stated it runs AFTER prepublish, but BEFORE prepublishOnly

Fixes

Closes #4893

Rationale

The documentation contradicted the actual lifecycle event order. The correct order during npm publish is:

  1. prepublishOnly
  2. prepack
  3. prepare
  4. postpack
  5. publish
  6. postpublish

The old documentation stated prepare ran before prepublishOnly, which was incorrect.

Type of Change

Documentation update

@MaxBlack-dev MaxBlack-dev requested a review from a team as a code owner November 19, 2025 23:00
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

Successfully merging this pull request may close these issues.

[DOCS] npm publish - lifecycle event order discrepancy

1 participant