News for hackers. Stuff that matters.
Re:Deno 1.28: Featuring 1.3M New Modules by trinovantes on Monday November 14, 2022 @09:37AM (#33594498)
patch-package is a tool for this specific purpose

https://www.npmjs.com/package/patch-package

You commit your changes as a diff text file and add the patch-package command to your post-install hook so it runs after every install

My main use for it is fixing other packages' package.json exports field and Typescript definitions

Re:Deno 1.28: Featuring 1.3M New Modules by warent on Monday November 14, 2022 @09:55AM (#33594818)
Interesting, I can definitely see this being particularly useful for typescript fixes.

Where should one put the text files in the code base? Do you create some root level "patch" directory?

Re:Deno 1.28: Featuring 1.3M New Modules by amaranth on Monday November 14, 2022 @10:08AM (#33595047)
patch-package automatically makes a `patches` directory at the top level of your project with `{package-name}+{package-version}.patch` files in it.
Re:Deno 1.28: Featuring 1.3M New Modules by jitl on Monday November 14, 2022 @10:12AM (#33595116)
yes