static-dev / spike-core

:warning: UNMAINTAINED :warning: A modern static build tool, powered by webpack
https://spike.js.org
Other
58 stars 9 forks source link

Yarn support #234

Open calebeby opened 7 years ago

calebeby commented 7 years ago

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 commented 7 years ago

Sure, agreed. Interested in pull requesting this in?

calebeby commented 7 years ago

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

calebeby commented 7 years ago

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 commented 7 years ago

yep, that seems about right!

calebeby commented 7 years ago

Is there any kind of global spike config?

calebeby commented 7 years ago

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

jescalan commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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