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

Yarn support #234

Open
calebeby opened this issue May 2, 2017 · 9 comments
Open

Yarn support #234

calebeby opened this issue May 2, 2017 · 9 comments

Comments

@calebeby
Copy link

calebeby commented May 2, 2017

Hi @jescalan, I think it would be nice if when you run spike new it would have the option to install dependencies using yarn rather than npm, or at least give the option to not install dependencies.

Thanks!

@jescalan
Copy link
Member

jescalan commented May 3, 2017

Sure, agreed. Interested in pull requesting this in?

@calebeby
Copy link
Author

calebeby commented May 3, 2017

Sure I can. Assuming it'll be two PRs, one for spike-core, one for spike?

@calebeby
Copy link
Author

calebeby commented May 3, 2017

So I think I'll change this function: https://github.com/static-dev/spike-core/blob/master/lib/index.js#L153 to be a generic installDeps which accepts a parameter that is 'npm' or 'yarn', and defaults to 'npm'.

@jescalan
Copy link
Member

jescalan commented May 3, 2017

yep, that seems about right!

@calebeby
Copy link
Author

calebeby commented May 3, 2017

Is there any kind of global spike config?

@calebeby
Copy link
Author

calebeby commented May 3, 2017

Can I store the default install tool with the default template?

@jescalan
Copy link
Member

jescalan commented May 8, 2017

Hey sorry for the late response here -- yeah you can, global config is right in the main js file here:

https://github.com/static-dev/spike-core/blob/master/lib/index.js#L301

@calebeby
Copy link
Author

@jescalan How do I create a cli flag that does not need a keyword after it?

Right now I have:

    s.addArgument(['--yarn', '-y'], {
      help: 'Use yarn rather than npm to install dependencies'
    });

and it says

usage: spike new [-h] [--yarn YARN] [--template TEMPLATE]
                 [--overrides OVERRIDES]
                 path
spike new: error: argument "--yarn/-y": Expected one argument. null

I want to just be able to say --yarn and have it use yarn. Any ideas?

@calebeby
Copy link
Author

I figured it out 😄 I had to use nargs: 0

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

No branches or pull requests

2 participants