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
feat: add patch
and patch-commit
commands
#4900
Conversation
Currently, for the patch to be applied, node_modules should be removed and reinstalled. |
# @pnpm/plugin-commands-patches | ||
|
||
> Commands for creating patches | ||
|
||
## Installation | ||
|
||
```sh | ||
pnpm add @pnpm/plugin-commands-patches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typos → plugin-commands-patching
``` | ||
pnpm patch-commit <path to temp folder> | ||
``` | ||
|
||
This will create a patch file and write it to `<project>/patches/express@1.0.0.patch`. | ||
Also, it will reference this new patch file from the `patchedDependencies` field in `package.json`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... so this should be compatible with patch-package
putting .scripts.postinstall = "patch-package"
in package.json should be safe
as double-patching fails, and patch-package only prints warnings, but no fatal errors
so the install process will continue
👀 I'm wondering if we can |
`pnpm patch <pkg>` prepares a package for patching. For instance, if you want to patch express v1, run: | ||
|
||
``` | ||
pnpm patch express@1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running this hangs for me, using 7.3.0.
is the feature fully released?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see, I need to wait for 7.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 7.4.0-0
close #3077
close #2675