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

Generators directory #753

Closed
jahvi opened this issue Dec 1, 2012 · 8 comments
Closed

Generators directory #753

jahvi opened this issue Dec 1, 2012 · 8 comments

Comments

@jahvi
Copy link

jahvi commented Dec 1, 2012

I'm trying to create my first generator for yeoman but I'm not exactly should I put it, considering I created it using yeoman init generator testing where should I place this folder?

Sorry if it's a newb question I wasn't able to find the answer anywhere 😢

@sleeper
Copy link
Contributor

sleeper commented Dec 1, 2012

@sindresorhus is currently rewriting totally the generators as well as the API to use to implement a generator... I would say, wait a little bit ;)

@jahvi
Copy link
Author

jahvi commented Dec 1, 2012

That's nice (and kind of sucks at the same time) :(

I've always been confused on how the generator development workflow should be (including unic testing and all) I'm not sure what to do exactly after yeoman init generator name

@sindresorhus
Copy link
Member

@sleeper That's not completely correct. Sorry for not keeping you in the loop. @mklabs is rewriting the internal generator API, but the user-end generator API will stay mostly unchanged for 1.0, except for addition of a Bower dep require API.

@JavierVD See the generators docs: https://github.com/yeoman/yeoman/blob/master/docs/cli/generators.md#generators-lookup

@jahvi
Copy link
Author

jahvi commented Dec 2, 2012

I see, I took a look at the docs but my main question about the workflow remains, basically what I'm doing now to create my test generator is:

  1. yeoman init generators testing
  2. Create package.json file with dependencies
  3. npm install
  4. Code stuff

Is this the correct way to do it?

@sindresorhus
Copy link
Member

@mklabs

@mklabs
Copy link
Contributor

mklabs commented Dec 2, 2012

@JavierVD That's petty much it 👍

You'll need to specify yeoman-generators as one of your package.json dep to be able to require it. Since it's not on npm yet, you can rely on the tarball url until it gets published: https://github.com/yeoman/generators/archive/master.tar.gz

To see if your generator is ok, you can try yeoman init --help, or directly yeoman init testing.

Hope it helps, one thing we really need to improve is the user documentation to develop custom generators.

@jahvi
Copy link
Author

jahvi commented Dec 2, 2012

Thanks yeoman does pick it up I just wanted to make sure I was doing it right 👍

@jahvi
Copy link
Author

jahvi commented Dec 4, 2012

Final question: how should I "install" my custom generator to run it? I mean, I can run yeoman init testing within my generator directory but I want to be able to test it out in another folder to check the output and whatnot, should I just symlink the generator folder into my global installed yeoman generators?

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