turbo
3edbe5f0 - fix: Support pnpm patches in prune (#1967)

Commit
3 years ago
fix: Support pnpm patches in prune (#1967) Addresses #1963 This PR fixes two issues with the current implementation of prune for pnpm: Pruning the importers section of pnpm-lock.yaml, previously the pruned lockfile would pickup any direct dependency changes for any project in the workspace Copy dependency patches into the output directory while pruning Fixing the first issue required updating the Lockfile interface take a list of workspace dependencies when constructing the subgraph. This is required as workspace dependencies don't appear in packages in the pnpm lockfile format. Taking a quick look at the npm lockfile format, this additional information will be helpful when implementing npm prune so it seems sensible to make this addition. The current implementation of copying dependency patches copies all patches instead of those that are strictly necessary. This was done due to the fact that pnpm duplicates patch info in package.json and in order to only copy the necessary patches we would first need to learn how to prune package.json. This should be done in the future, but is outside of the scope of this fix. * fix pruning of importers * fix copy patches during pruning * force paths to use unix style paths for pnpm workspace packages * address review feedback, fixup path types
Parents
Loading