You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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. :)
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 modulecomponents.auth
in directorycomponents/auth
but instead ng-poly creates the module in new root directorycomponents-auth
. After that I remember that I need to write module name in terms of directoriesyo 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 withauth
(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 modulescomponents.auth
andauth
then ng-poly will offer this two modules as parent for or newauth.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
.The text was updated successfully, but these errors were encountered: