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

Why use ~/.grunt-init? #38

Closed
NickHeiner opened this issue Feb 19, 2013 · 9 comments
Closed

Why use ~/.grunt-init? #38

NickHeiner opened this issue Feb 19, 2013 · 9 comments

Comments

@NickHeiner
Copy link

Why must the templates be installed in ~/.grunt-init? Can't they be bundled with the task itself, like how yeoman generators do it? It seems like this adds an unnecessary step to someone using my grunt init task.

@cowboy
Copy link
Member

cowboy commented Feb 19, 2013

What do you mean by, "Can't they be bundled with the task itself" ? I don't understand. These are templates, there are no tasks.

@NickHeiner
Copy link
Author

Ah, good point. I hadn't realized that grunt-init-* projects weren't just tasks.

I think it would be nicer if the workflow were more like:

$ npm install grunt-init
$ npm install grunt-init-foo

instead of having to mess with a directory that is global to all projects, and potentially deal with headaches when you want to be using different versions of grunt-init-foo with different projects.

@cowboy
Copy link
Member

cowboy commented Feb 19, 2013

But grunt-init templates aren't npm modules, so we don't publish them with npm. Also, when you do "npm install" you install modules locally to a project... but one of the ideas of grunt-init is that it works to initialize projects. It's a "chicken and egg" problem.

@NickHeiner
Copy link
Author

Hmm... perhaps I'm thinking about grunt init wrong. I was thinking of it as a task, because as part of my build process I want to generate certain templated scaffolding files. Perhaps I should just be using a task instead of grunt init?

@cowboy
Copy link
Member

cowboy commented Feb 19, 2013

You should be able to include the template files somewhere locally and specify grunt-init ./path/to/template.

@dylang
Copy link

dylang commented Feb 19, 2013

I appreciate that they are git projects to make it easy to have custom forks but I've found that to be something I just don't care to do. For me having the latest template is a higher priority than a custom template.

The NPM workflow seems pretty standard in the Node world, something like: npm -g install grunt-init grunt-init-gruntfile; grunt-init gruntfile. And npm -g update to get the latest versions of the templates.

I have nothing against git, I use it for everything, but it seems off-putting to make Git a requirement to use grunt templates. If I need something more custom I would clone the project and use npm link.

@billyvg
Copy link

billyvg commented Feb 28, 2013

Is there a way to load grunt-init as a task? Take this scenario, you want to generate a new Model file within an existing project. You want the templates to be within your project directory: ./project/.grunt-init/templates/model or something. It would be nice to be able to load grunt-init as a task so we can easily grunt init model within the project directory.

@cowboy
Copy link
Member

cowboy commented Feb 28, 2013

Unfortunately, no.

@cowboy cowboy closed this as completed Feb 28, 2013
@NickHeiner
Copy link
Author

@billyvg if you're in to that, you might want to check out yeoman generators. http://yeoman.io/

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

4 participants