turbo
turbo copied to clipboard
[turborepo] npm dependencies with peerDependencies in root package.json fails to clean-install from pruned artifacts
What version of Turborepo are you using?
1.6.3
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Mac
Describe the Bug
Attempting to run npm clean-install
with the output of turbo prune
fails if any of the dependencies in the root package.json
include peer dependencies that are flagged as optional via the peerDependenciesMeta
property.
This appears to be because due to a combination of the prune command trimming out the peerDependenciesMeta
property and npm behaving slightly differently for root packages vs workspace packages.
Expected Behavior
I should be able to run npm clean-install
on the output of turbo prune
.
To Reproduce
- Set up a basic repo with turborepo
- Install a dependency that has an optional peer dependency in the repo root
- The
next
package is a good example
- The
- Run
turbo prune --scope=<scope>
- Copy
out/package-lock.json
and the contents ofout/json
to a new directory - Run
npm clean-install
in the new directory
I happened to be working with this in Docker containers so my reproduction repo does this in the Dockerfiles with turbo prune --docker
.
Reproduction Repo
https://github.com/keawade/turbo-wat
I'm ignorant of how turbo repo releases get released and I wasn't able to find any documentation describing it.
Could someone point me to documentation describing how/when releases are done around here or tell me when we might see the fix implemented in #2740 be released for use?
@keawade we don't have a strict release cadence, but we usually cut a patch every ~2 weeks. We're in the middle of changing our release process so it might be slightly more delayed/only a canary would be released. @nathanhammond, I know the week has been crazy, but are close to cutting a canary?
Howdy folks, just looking to follow up on this and see if there might be a release coming soon. 😄 😅
@keawade it appears to me that the commit with the fix was released with https://github.com/vercel/turbo/releases/tag/v1.7.0 even though it is not called out in the release change log.
maybe @chris-olszewski can confirm to check my sanity though, I just compared the tag with the previous tag to confirm: https://github.com/vercel/turbo/compare/v1.6.3...v1.7.0
https://github.com/vercel/turbo/releases/tag/v1.7.0