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

Improve (or replace) the "init" task. #239

Closed
cowboy opened this issue Jun 20, 2012 · 5 comments
Closed

Improve (or replace) the "init" task. #239

cowboy opened this issue Jun 20, 2012 · 5 comments

Comments

@cowboy
Copy link
Member

cowboy commented Jun 20, 2012

I'd love to rewrite the init task as part of 0.5, provided I get some feedback from people. That being said, I haven't gotten much feedback. So, let's talk it out.

Here are a few ideas:

  • make "are you sure?" final prompt optional - see make "are you sure?" final prompt optional #238
  • allow list of prompts to be dynamically generated
  • allow for arbitrary actions inside a list of prompts, or multiple lists of prompts
  • standardize a way for users to install init task plugins so they don't need a custom binary to use (home dir?)
  • accept options via CLI? (not sure how i feel about this)
  • provide method for dynamically warning existence of files?

Any more suggestions? Here's the place to discuss them!

Also, FWIW, I'd be totally open to the main yeoman init/generate task being inlined into grunt as a replacement to init.

@cowboy
Copy link
Member Author

cowboy commented Sep 1, 2012

Note to self: investigate using volo for fetching init templates.

@cowboy
Copy link
Member Author

cowboy commented Sep 10, 2012

An idea, using @tbranyen's bbb as an example:

The grunt init task could pull its templates from github repos, remote tarballs, local dirs, etc. It could, given a specific command, fetch a list of commonly used templates with aliases. Probably some file that's maintained as part of the init task repo.

So if bbb were aliased to a repo or tarball, once that list of aliases is fetched, grunt init:bbb could just pull that repo or tarball down, prompt the user as-needed, and generate files. Maybe it would cache the template locally. Whatever.

And, of course, if an alias for your project wasn't merged into the official list yet, someone could always use grunt init:git://github.com/tbranyen/bbb.git or whatever. And maybe you could specify your own alias list that could override or replace entries in the official list. We'll figure those details out later.

So, this bbb init template will, in addition to generating the whole project structure, also generate a package.json that specifies grunt and a grunt-bbb plugin collection as a devDependency. Then the user just does npm install (which could be automated, of course) and they've got everything they need to start grunting their project.

You wouldn't need a custom bbb global install anymore, and people wouldn't be confused about what is and isn't grunt.

@cowboy
Copy link
Member Author

cowboy commented Sep 10, 2012

So an init template would be the template itself plus a list of grunt plugins or a grunt plugin collection that template's generated code would use. It would write out package.json as part of the init process.

@leobalter
Copy link
Member

"init remote templates"++

In time:

"accept options via CLI"++

@geddski
Copy link

geddski commented Sep 24, 2012

Accepting options via CLI would be very useful. I'm wanting to build a node app that kicks off grunt init programmatically, passing in predefined and GUI-based options (think something like AppFog/CloudFoundry). Accepting answers to questions as CLI args would make integration with grunt a whole lot easier.

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

No branches or pull requests

4 participants