| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@ds300 any chance of getting this reviewed anytime soon? |
Sorry, something went wrong.
|
A gentle reminder about this |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #595, partially addresses #277
Context
npm's experimental install-strategy=linked stores packages in node_modules/.store/<pkg>@<version>-<hash>/node_modules/<pkg>/ and creates symlinks. For nested dependencies in monorepo/workspace setups, the symlink may not exist at the path patch-package expects (e.g. node_modules/parent/node_modules/child), causing patch application to fail with "package not present" errors.
Similarly, in monorepos with hoisting (#277), a workspace package's dependency may be installed in the root node_modules/ rather than the workspace's own node_modules/, causing the same failure.
How it works
resolvePackagePath() tries three strategies in order:
When the resolved path differs from the original, remapPatchPaths() rewrites the path prefixes in all patch effects (file patches, creations, deletions, renames, mode changes) before executeEffects runs. The resolved path is also passed to state file operations so .patch-package.json is read/written at the correct location.