Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(yarn-pnp): adding support for turbo run w/ yarn pnp #797

Merged
merged 3 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions cli/internal/backends/nodejs/nodejs.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ var NodejsBerryBackend = api.LanguageBackend{
}

if isBerry {
isNMLinker, err := util.IsNMLinker(cwd)
if err != nil {
return false, fmt.Errorf("could not determine if yarn is using `nodeLinker: node-modules`: %w", err)
} else if !isNMLinker {
return false, fmt.Errorf("only yarn v2/v3 with `nodeLinker: node-modules` is supported at this time")
}

return true, nil
}
} else {
Expand Down
9 changes: 9 additions & 0 deletions cli/internal/prune/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ func (c *PruneCommand) Run(args []string) int {
if !util.IsYarn(ctx.Backend.Name) {
c.logError(c.Config.Logger, "", fmt.Errorf("this command is not yet implemented for %s", ctx.Backend.Name))
return 1
} else if ctx.Backend.Name == "nodejs-berry" {
isNMLinker, err := util.IsNMLinker(pruneOptions.cwd)
if err != nil {
c.logError(c.Config.Logger, "", fmt.Errorf("could not determine if yarn is using `nodeLinker: node-modules`: %w", err))
return 1
} else if !isNMLinker {
c.logError(c.Config.Logger, "", fmt.Errorf("only yarn v2/v3 with `nodeLinker: node-modules` is supported at this time"))
return 1
}
}

logger.Printf("Generating pruned monorepo for %v in %v", ui.Bold(pruneOptions.scope), ui.Bold(filepath.Join(pruneOptions.cwd, "out")))
Expand Down