Support applying updated patches
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 325
- PR merge metrics
- No merged PRs in 30d
Description
If someone has updated an existing patch and pushed it, other team members will have this error after pulling and running `yarn install`:
> 2020-04-25T06:33:26.1898694Z ==============================================================================
> 2020-04-25T06:33:26.2035566Z ##[command]yarn install --network-timeout 600000
> 2020-04-25T06:33:26.5664887Z yarn install v1.22.0
> 2020-04-25T06:33:26.7544423Z [1/4] Resolving packages...
> 2020-04-25T06:33:27.5343788Z success Already up-to-date.
> 2020-04-25T06:33:27.5380704Z $ patch-package
> 2020-04-25T06:33:30.0196534Z patch-package 6.2.2
> 2020-04-25T06:33:30.0211271Z Applying patches...
> 2020-04-25T06:33:30.1409920Z
> 2020-04-25T06:33:30.1411009Z **ERROR** Failed to apply patch for package leaflet at path
> 2020-04-25T06:33:30.1411521Z
> 2020-04-25T06:33:30.1411954Z node_modules/leaflet
> 2020-04-25T06:33:30.1412284Z
> 2020-04-25T06:33:30.1412926Z This error was caused because patch-package cannot apply the following patch file:
> 2020-04-25T06:33:30.1413466Z
> 2020-04-25T06:33:30.1413885Z patches/leaflet+1.6.0.patch
> 2020-04-25T06:33:30.1414267Z
> 2020-04-25T06:33:30.1414895Z Try removing node_modules and trying again. If that doesn't work, maybe there was
> 2020-04-25T06:33:30.1415798Z an accidental change made to the patch file? Try recreating it by manually
> 2020-04-25T06:33:30.1416515Z editing the appropriate files and running:
> 2020-04-25T06:33:30.1416939Z
> 2020-04-25T06:33:30.1417348Z patch-package leaflet
> 2020-04-25T06:33:30.1417711Z
> 2020-04-25T06:33:30.1418340Z If that doesn't work, then it's a bug in patch-package, so please submit a bug
> 2020-04-25T06:33:30.1419001Z report. Thanks!
> 2020-04-25T06:33:30.1419289Z
> 2020-04-25T06:33:30.1419773Z https://github.com/ds300/patch-package/issues
> 2020-04-25T06:33:30.1420225Z
`patch-package --reverse` will also fail because the patch has already been updated.
So every team member need to remove node_modules manually and to install packages again.
Wouldn't it be much more convenient to have fully transparent experience?
In such case patch-package could replace the previously patched package with the original one and apply new patch.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.