Skip to content

update README stating this is technique is not safe for publishing #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update README.md
Co-authored-by: Pedro Augusto de Paula Barbosa <papb1996@gmail.com>
  • Loading branch information
davidmurdoch and papb authored Aug 18, 2022
commit 50d5e0c69deda48ddb4fe12d885610c9c53c80b2
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@
dependencies. It's a vital band-aid for those of us living on the bleeding edge.

_Note for module authors: it is not safe to publish an npm package that uses
`patch-package` to patch a non-dev-dependency because patches are applied to
a specific file in your node_modules folder, but when a package is installed
by end users the node_modules dependency tree may shift things around, and
this shifting could be due to factors that can't be controlled by
`patch-package`._

_Also, if the dependency you are patching is also imported by the user of your
package, patch package shouldn't patch that version of the package... which is
not really feasible._
`patch-package` to patch a non-dev-dependency. This is because `patch-package` works by patching specific files in specific places within the `node_modules` folder, and currently cannot control the following factors:_
- _When an end user installs your package, their `node_modules` dependency tree may have shifted things around._
- _If the dependency you patched is also depended on by other packages (or directly by the end user), you might be causing unintended breaking changes._

```sh
# fix a bug in one of your dependencies
Expand Down