Skip to content

Making create.js more extensible#92

Open
darielnoel wants to merge 12 commits into
yui:masterfrom
darielnoel:create_interface
Open

Making create.js more extensible#92
darielnoel wants to merge 12 commits into
yui:masterfrom
darielnoel:create_interface

Conversation

@darielnoel
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Author

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

Comment thread lib/create.js Outdated
Copy link
Copy Markdown

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

Comment thread lib/create.js Outdated
Copy link
Copy Markdown

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
Copy Markdown

derek commented Aug 21, 2013

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

@darielnoel
Copy link
Copy Markdown
Author

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

@caridy
Copy link
Copy Markdown
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
Copy Markdown
Author

All format problems have been fixed.

@caridy
Copy link
Copy Markdown
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