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

fix: upgrade the turbo package in Yarn 4 #8076

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

atimmer
Copy link

@atimmer atimmer commented May 3, 2024

Description

This fixes a failed install when running npx @turbo/codemod@latest update while using Yarn 4.

Screenshot 2024-05-03 at 10 26 15

yarn add turbo@latest --dev -W is not a valid command:
Screenshot 2024-05-03 at 10 27 05

Using yarn version 4.1.0:
Screenshot 2024-05-03 at 10 27 29

It seems to me that -W is not a valid flag for most yarn commands. The only command I could find is yarn workspaces foreach, but that's not the command being issued in this code.

I don't have a great understanding of this codebase, so I did my best to create a version that works. It looks to me that the code is trying to be resilient against which directory the user is at. So I replicated that behavior using yarn workspaces foreach --all --include .. It's a trick to run a specific command in the root of the workspace regardless of current location.

I wasn't able to build the repo. I was hoping for a TS only way to build only the codemod package, but I didn't find it. I currently don't have the time to setup the Go & Rust toolchain and I've never used either. I tested this by manually assembling the command from the code and testing that in my repo.

Testing Instructions

  1. Go to a repo with an outdated version of Turbo & Yarn 4 as the package manager.
  2. Run the codemod command
  3. It should now work after this change.

@atimmer atimmer requested a review from a team as a code owner May 3, 2024 08:33
@turbo-orchestrator turbo-orchestrator bot added needs: triage New issues get this label. Remove it after triage owned-by: turborepo pkg: turbo-codemod labels May 3, 2024
Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-svelte-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 3, 2024 8:34am
6 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 8:34am
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 8:34am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 8:34am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 8:34am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 8:34am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 8:34am

Copy link

vercel bot commented May 3, 2024

@atimmer is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage New issues get this label. Remove it after triage owned-by: turborepo pkg: turbo-codemod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant