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

Making create.js more extensible #92

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

darielnoel
Copy link

I am using Yogi sub commands for adding some features that I need for example, I need to generate an app skeleton from some configuration file. I have looked at create.js in yogi/lib/, in this file, I have found some functions like
createJSON(), and createDirs() which I would like to use in my custom sub command. The problem is that I can not access to these functions from my custom sub command.

I make YogiCreate = require(path.join(YOGI_PATH, 'lib/create')), but YogiCreate only contain the init() function. That is because create.js only export the init() function.

We could fix that in create.js, if we could export the createJSON() and createDirs() function.

I think that could be good, for adding more Yogi extensibility and reusability.

Best Regards Dariel

@derek
Copy link

derek commented Aug 21, 2013

It looks as though you have tabs set for 2 spaces instead of 4? This makes the diff a bit difficult to decipher. Could you update this PR to preserve the 4-space tabs?

Tip: Executing git diff prior to git commit is a good way to catch these changes.

@darielnoel
Copy link
Author

OK Derek, I am going to update that PR right now, the problem was JSlint tool.

};


util.mix(exports, mods);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an EOF newline

mods = {

/**
Create a JSON
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a bit more descriptive. Perhaps "Creates the JSON assets for the new module"?

@derek
Copy link

derek commented Aug 21, 2013

Looks good to me. I don't see any harm in exposing createDirs and createJSON.

@darielnoel
Copy link
Author

OK Dereks, thanks, now we can reuse that code in other places.

@caridy
Copy link
Member

caridy commented Aug 28, 2013

I had a quick chat with @darielnoel, he will make few more format changes before we merge this.

@darielnoel
Copy link
Author

All format problems have been fixed.

@caridy
Copy link
Member

caridy commented Aug 30, 2013

+1

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

Successfully merging this pull request may close these issues.

3 participants