Skip to content
This repository has been archived by the owner on Feb 15, 2018. It is now read-only.

support yarn #15

Merged
merged 3 commits into from
Mar 1, 2017
Merged

support yarn #15

merged 3 commits into from
Mar 1, 2017

Conversation

kc-dot-io
Copy link
Contributor

Yarn will make generators a lot faster. So if the user has it installed we should use that and have a fallback to npm.

@alanpog
Copy link

alanpog commented Oct 30, 2016

They did exactly this at create-react-app and got a significant speedup.

@kc-dot-io kc-dot-io changed the title Add support for yarn support yarn Nov 11, 2016
@kc-dot-io kc-dot-io added this to the 3.0 milestone Feb 11, 2017
@kc-dot-io kc-dot-io self-assigned this Feb 14, 2017
@kc-dot-io
Copy link
Contributor

@ekryski @daffl This adds yarn support as per how it appears to be implemented in generator-feathers but I think it could use a bit more logic to check if yarn is installed so that in the cases where first timers try it, the fall back to NPM is still supported. I think this would be better then giving a configuration option as it's mostly gonna be the same for the duration of a systems lifetime and not likely to change project to project so this is just prompt clutter.

@daffl
Copy link
Member

daffl commented Feb 25, 2017

This looks good, I think we should merge it. What would be the best way to test for Yarn? Trying to see if running yarn --version returns with a non-error exit status (and potentially get the version number in the process)?

@kc-dot-io
Copy link
Contributor

kc-dot-io commented Feb 25, 2017 via email

@kc-dot-io
Copy link
Contributor

@daffl this should be ready now.

@kc-dot-io kc-dot-io merged commit 338f094 into master Mar 1, 2017
@kc-dot-io kc-dot-io deleted the slajax/15 branch March 1, 2017 04:20
// if not yarn, fall back to npm
let yarn = spawn('yarn', ['--version']);
if(yarn.error) {
delete template['engines']['yarn'];
Copy link
Member

Choose a reason for hiding this comment

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

Nice. Do you think we should backport this to the current version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couldn't hurt. Dynamic fallback is a nice feature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants