So you have some jquery plugins and you:
- Want to have different customizations of the plugins per project
- Want to be able to update from version X to version Y of the base plugin without breaking any of your customizations
There isn’t a silver bullet here, this is one of the things that makes dependency management so complex. Let’s take a look at a couple scenarios. They’ll all be based on the assumptions:
- You have a plugin, P
- P has a function F that takes two parameters and returns some value
- In this particular project you have a customization, C
- C customizes the behavior of F to take three parameters and returns some value
What should happen if you update P to some new version that adds a third parameter to function F? The answer is, it depends. Do you want to use the functionality provided by that new third parameter in P.F? If not, maybe you don’t need to do anything. If you do, then you’ll probably have to change the implementation of C and anything that depends on C.F to compensate.
What should happen if you update P to some new version that adds a new function that needs to be customized by C before it is used? Then you’ll have to take the time to provide the new customized function or at least stub it out so that it throws an error if it is used before it is customized.
Essentially, there is no one-size-fits-all solution to the general question you’re asking. There are too many variables and what-ifs and some of them will need to be solved on a case-by-case basis. If your customizations all follow a specific form, then perhaps some mechanism could be constructed but you’d need to supply a lot more details about what it is you’re trying to do.
I hope that helps!