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

Document that it is not safe to run pinst in the prepack step #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ __Important__ if your project is using npm or pnpm, you can achieve the desired
{
"scripts": {
"postinstall": "<some dev only command>",
"prepack": "pinst --disable",
"postpack": "pinst --enable"
}
}
```

_On `prepack`, `postinstall` will be renamed to `_postinstall` (disabled)_
Before publishing your package, run `pinst --disable`. It will rename the `postinstall` script to `_postinstall` (disabled).

_On `postpack`, it will be renamed back to `postinstall` (enabled)_
After publishing your package, run `pinst --enable`. It will rename the script back to `postinstall` (enabled).

**Caution**: [It is not safe to run `pinst` in the `prepack` script](https://gist.github.com/djcsdy/3ca078e23fdac4c50e077c84e8284a95).

## CLI

Expand Down