What is/should be the approach for "patching" dependencies?

Maybe makes more sense in the Explain category if there’s already a decided approach, and potentially similar to this topic.


What should be the approach for “patching” dependencies? I’m thinking in the style of pnpm patch or something like that - editing the code for an existing dependency (or transient dependency).

Easy answer is vendor your dependency and modify it.

At work we have a more complex setup with Bazel that apply patch files to a given dependency. Including LLVM and Zig itself.

Of course that’s not the recommended beginner approach.