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

Support module names in ng-poly:module instead of directory names #143

Open
xak2000 opened this issue Apr 7, 2015 · 1 comment
Open

Comments

@xak2000
Copy link
Contributor

xak2000 commented Apr 7, 2015

I often catch myself on trying to create a module like this:

yo ng-poly:module components.auth and each time this creates not what I need. I expect to creating module components.auth in directory components/auth but instead ng-poly creates the module in new root directory components-auth. After that I remember that I need to write module name in terms of directories yo ng-poly:module components/auth.

Maybe we can support both ways? For example if module name not contains a path separator then we assume that is module name (not directory name) and try to resolve directory names.

For example if we trying to create a module auth.basic then we must find all existing modules with name ending with auth (last part of module name after dot or just directory name if this directory contains a module) and ask user which parent module he wants to use (If found more then one with appropriate name). For example if we have modules components.auth and auth then ng-poly will offer this two modules as parent for or new auth.basic module.

Another example: we trying to create a module userGroup. This string doesn't contains path separator nor dot. So we must ask which parent module to use. But in this case we offer all existing modules including main module.

I'm not sure about this last case. Maybe it is bad practice to have a module without dot in it's name if that is not parent module... But maybe someone already using that convention and don't want to rename all modules to have names like parent.child.

@xak2000
Copy link
Contributor Author

xak2000 commented Apr 7, 2015

The related issue is that I want to name my parent modules like app.home, app.models etc.

It is for clearly differentiate them from third party modules which often have names like somenicestuff. It is hard to quickly understand from app.js dependencie's definitions which modules are app's and which is just some thrid party components.

But if it is going to be a bad practice or something then I can live without this. :)

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

2 participants