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

Support yarn not installed in create-turbo #255

Merged
merged 5 commits into from
Dec 14, 2021

Conversation

seanyusa
Copy link
Contributor

Closes #241

Disable the yarn option if not installed.

Before
Screen Shot 2021-12-13 at 4 58 13 PM

After
Screen Shot 2021-12-13 at 5 02 35 PM

Note

There is one "valid" path that this prevents. ("valid" as in path that currently works)
That path is:

  • user doesn't have yarn installed
  • they select "Yarn" for package manager
  • but then answer No for "Do you want me to run yarn install?"

This path works because we don't have to execute yarn install on behalf of the user. Is this a case we want to keep? If so, then we will need to force "No" for the next question instead and log that yarn install was not run because yarn itself is not installed.

@vercel
Copy link

vercel bot commented Dec 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/vercel/turbo-site/HckpLZGpeL4MLfv6CMiJbeBqfj9U
✅ Preview: https://turbo-site-git-fork-seanyusa-create-turbo-yarn-not-installed.vercel.sh

@seanyusa seanyusa changed the title Create turbo/yarn not installed create-turbo support yarn not installed Dec 14, 2021
@@ -0,0 +1,10 @@
import { execSync } from "child_process";

export function checkIfYarnInstalled(): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse create-turbo/src/shouldUseYarn.ts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaredpalmer Ah yes, it's perfect! I didn't look into what the userAgent was, and I thought that was checking for something else, learned about a new value today!

Thoughts on renaming shouldUseYarn? Reads a bit to me like "are we supposed to use yarn", as opposed to checking if yarn is running/available, which is partially why I didn't look more closely at it in the first place.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it for now.

@seanyusa
Copy link
Contributor Author

Updated! Thanks for reviewing!

@jaredpalmer jaredpalmer self-requested a review December 14, 2021 18:59
@jaredpalmer jaredpalmer changed the title create-turbo support yarn not installed Support yarn not installed in create-turbo Dec 14, 2021
@jaredpalmer jaredpalmer merged commit 134078c into vercel:main Dec 14, 2021
@seanyusa seanyusa deleted the create-turbo/yarn-not-installed branch December 14, 2021 21:16
sokra pushed a commit that referenced this pull request Oct 25, 2022
jridgewell pushed a commit to vercel/next.js that referenced this pull request Mar 10, 2023
sokra added a commit to vercel/next.js that referenced this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting up via create-turbo should have yarn checks
2 participants