apache / cordova-discuss

Discussions on features and the future
19 stars 28 forks source link

Use of patch-package? #83

Open brodycj opened 6 years ago

brodycj commented 6 years ago

I discovered https://www.npmjs.com/patch-package which looks like a really nice way to deal with minor patches needed. I have no idea if there is any way people can use this to patch minor issues with upstream plugins, hope to look at this someday. Any ideas or suggestions from the user community?

dpogue commented 6 years ago

This seems like a slightly nicer way of doing what I've done a few times. In my case I'd fix a Cordova bug, open a PR, and when save the patch in the root of my project, and apply it to the node_modules folder as a CI build step. It works well, but the problem is that it's not obvious to other developers that they need to apply patches manually.

For Cordova plugins however, the easiest option is always to try pointing at the git repo directly. You should only need to fallback to the patching hacks if there's a dependency chain that you can't satisfy with a git reference (i.e., cordova-plugin-file-transfer depends on a specific version of cordova-plugin-file, and you need to patch cordova-plugin-file)