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.
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.
... 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.
running this hangs for me, using 7.3.0.
is the feature fully released?
There was a problem hiding this comment.
ah, I see, I need to wait for 7.4
close #3077
close #2675