-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support yarn not installed in create-turbo
#255
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/vercel/turbo-site/HckpLZGpeL4MLfv6CMiJbeBqfj9U |
create-turbo
support yarn not installed
create-turbo/src/yarn.ts
Outdated
@@ -0,0 +1,10 @@ | |||
import { execSync } from "child_process"; | |||
|
|||
export function checkIfYarnInstalled(): boolean { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it for now.
Updated! Thanks for reviewing! |
create-turbo
support yarn not installedcreate-turbo
Closes #241
Disable the yarn option if not installed.
Before
After
Note
There is one "valid" path that this prevents. ("valid" as in path that currently works)
That path is:
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 thatyarn install
was not run becauseyarn
itself is not installed.