turbo
turbo copied to clipboard
[turborepo] `turbo prune` creates broken `pnpm-lock.yaml`
What version of Turborepo are you using?
1.6.3
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Describe the Bug
turbo prune --scope="<app-name>" --docker creates broken/incomplete pnpm-lock.yaml file, which leads to ERR_PNPM_ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY and ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE errors .
Expected Behavior
Pruned pnpm-lock.yaml lock file should still contain every needed dependency and pruned output should also include packages that a referenced from the project root (but are not inside the --scope)
To Reproduce
git clone https://github.com/dlehmhus/pnpm-prune-root-issue-example
cd pnpm-prune-root-issue-example/
docker build -f apps/web/Dockerfile -t "pnpm-prune-example" .
or, to inspect the output:
pnpm exec turbo prune --scope="web" --docker
if you take a look at the generated pnpm-lock.yaml you can see two issues:
apps/webreferences13.0.4_biqbaboplfbrettd7655fr4n2y, but that dependency doesn't exists in the prunedpnpm-lock.yaml.(projet root) links tolink:packages/package-for-cibut that doesn't exist inout/json
Reproduction Repo
https://github.com/dlehmhus/pnpm-prune-root-issue-example