Open Suniron opened 1 year ago
I recently had the same issue and the problematic setting is: shared-workspace-lockfile=false
because it allows multiple pnpm-lock.yaml
and turbo can't handle it yet
I recently had the same issue and the problematic setting is:
shared-workspace-lockfile=false
because it allows multiplepnpm-lock.yaml
and turbo can't handle it yet
Yes, i see your issue.. 😪
Did you find a solution to build a Docker image ?
This is something that won't be prioritized, but I'd be willing to help a community PR along to achieve this. Since pnpm is already splitting up the lockfile for us we just need to:
.npmrc
to and check if shared-workspace-lockfile=false
package/a/pnpm-lock.yaml
to the list of files to be copied for each workspaceI just did some code exploration and I think it is more than that:
Since this is a feature I only know from "classic" lerna
(without package manager powered workspaces) and pnpm
I don't think this should be included directly in the prune.go
file
So option A)
would be to extend the PackageManager
with a flag that indicates if it is a shared-workspace-lockfile
and than implement the detection within each packageManager or option B)
would be to just copy lock files if there is one beside a package.json
.
I tend to option B) because it would also enable support for "classic" lerna repos.
What do you think @chris-olszewski ?
I tend to option B)
There still needs to be a way to know when it's okay for our lockfile analysis to fail during prune. I think it's fine to extend the PackageManager
with a method to check if we should expect multiple lockfiles and only implement it for pnpm. From some quick looking around it looks like pnpm is the only package manager that supports multiple lockfiles when using workspaces.
support for "classic" lerna repos
Support for classic lerna repos is more of an ask and should probably be implemented independent of this one. I see you opened #3648 and I'll follow up with the team there.
What version of Turborepo are you using?
1.7.0
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Linux
Describe the Bug
On Linux as WSL2 Windows 10 distro.
I have only one .npmrc file at root which contains this code:
shamefully-hoist
andshared-workspace-lockfile
are needed in my configuration but with theese two options.If i try to prune with this command
pnpm turbo prune --scope @myapp/web --verbosity 10
, i got this error:Is there a way to prune the project (for Docker) with a
.npmrc
file like mine ? 🙏Expected Behavior
Project should be "pruned" in a
out
folder at root.To Reproduce
Add a
.npmrc
file with options like mine and try to prune with any app as scope.Reproduction Repo
No response