berry icon indicating copy to clipboard operation
berry copied to clipboard

[Feature] Document how to remove patches

Open gruckion opened this issue 3 years ago • 6 comments

  • [x] I'd be willing to implement this feature (contributing guide)
  • [x] This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

Yarn offers a way to apply patches with yarn patch and yarn patch-commit. Having used the feature I like it and the document is pretty good. But it is not at all clear how we remove a patch?

https://yarnpkg.com/features/protocols#patch

Describe the solution you'd like

Please provide instructions on how we remove an applied patch.

Describe the drawbacks of your solution

I found myself having to delete .yarn .yarn-lock and my .yarnrc file along with the "resolution" block in package.json manually. Was awful as I then add to set the yarn version, install all the plugins again manually and then run my yarn dlx to setup typescript / vscode.

Describe alternatives you've considered

Using version control carefully to revert the change, and ensure .yarn is not excluded with .gitignore.

gruckion avatar Sep 23 '22 11:09 gruckion

Just remove the resolution and delete the file in your patches folder.

RDIL avatar Sep 24 '22 02:09 RDIL

is this issue donde?

Blueclaus13 avatar Feb 10 '23 22:02 Blueclaus13

What is the current status of this issue? Is it done? It looks like removing the resolution and deleting the file in the patches folder does not work. I'd be willing to implement a fix if it is still open.

fernandohjunqueira avatar Oct 29 '23 17:10 fernandohjunqueira

@fernandohjunqueira what is happening when you try to remove the resolution and delete the patch?

RDIL avatar Nov 06 '23 13:11 RDIL

Can we have patch remove option(-r,--remove)?

black7375 avatar May 11 '24 16:05 black7375

Hey, adding a new command to revert the patched marks is really helpful! just like what pnpm does here: https://pnpm.io/cli/patch-remove

mr-pinzhang avatar Aug 21 '24 08:08 mr-pinzhang

Removing patches manually is cumbersome; there should be an automated script/command

akkadaya avatar Sep 30 '25 03:09 akkadaya