Skip to content

Skip missing entry points for lifecycle-built packages#782

Merged
sindresorhus merged 1 commit intomainfrom
packlist
Apr 4, 2026
Merged

Skip missing entry points for lifecycle-built packages#782
sindresorhus merged 1 commit intomainfrom
packlist

Conversation

@sindresorhus
Copy link
Copy Markdown
Owner

Keep npm pack --dry-run script-free when collecting packed files so prerequisite checks do not fail on broken lifecycle hooks or noisy script output.

Still run entry-point validation against that stable packlist, but only skip the failure when an entry point is missing and the package declares pack-related lifecycle scripts. That preserves validation for packages whose entry points are already present without scripts, while avoiding false negatives for packages that generate publishable files during prepare or prepack.

Fixes #780

Keep `npm pack --dry-run` script-free when collecting packed files so prerequisite checks do not fail on broken lifecycle hooks or noisy script output.

Still run entry-point validation against that stable packlist, but only skip the failure when an entry point is missing and the package declares pack-related lifecycle scripts. That preserves validation for packages whose entry points are already present without scripts, while avoiding false negatives for packages that generate publishable files during `prepare` or `prepack`.

Fixes #780
@sindresorhus sindresorhus requested a review from fregante April 4, 2026 14:49
Copy link
Copy Markdown
Collaborator

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the consequences of this change but the added flag and following tests seem to be what I want 🙌

@sindresorhus sindresorhus merged commit 6d4b88e into main Apr 4, 2026
4 checks passed
@sindresorhus sindresorhus deleted the packlist branch April 4, 2026 16: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.

np fails instantly if pack script fails

2 participants