marklogic-community / slush-marklogic-node

Slush generator for a MarkLogic/node project
https://github.com/marklogic-community/slush-marklogic-node/wiki
Other
40 stars 28 forks source link

Reorganize directories #469

Open grtjn opened 7 years ago

grtjn commented 7 years ago

Aim is to better reflect route hierarchy, but at the same time try to keep it as simple as possible.

Related code style guidelines:

grtjn commented 7 years ago

Perhaps:

grtjn commented 7 years ago

Current tree structure of UI is:

app/templates/ui
├── app
│   ├── create
│   ├── detail
│   ├── error
│   ├── interceptors
│   ├── landing
│   ├── login
│   ├── message-board
│   ├── root
│   ├── route
│   ├── search
│   └── user
├── images
└── styles
grtjn commented 7 years ago

It also relates to #479. Some folders have a mixture of things, like services, interceptors, and directives as well as views and controllers. Makes it more difficult to find things when new to this, and copy/paste usually copies more than needed..

Directives should have a separate module..

grtjn commented 7 years ago

Some votes on this would by nice by the way.. Anyone reading this who cares to comment?

patrickmcelwee commented 7 years ago

I like the idea of separating 'routes' for features that correspond to a top-level route and 'core' for everything else.

I don't understand why directives should have a separate module. I followed the links above, but didn't find the explanation.

Also, I like that services, directives, views, and controllers related to a given feature live in the same place (with appropriate names). I wasn't sure from reading your comments: Are you suggesting changing that?

grtjn commented 7 years ago

Regarding files in same place or not: if code is dedicated to a view, then yes, otherwise I'm inclined to think differently.

It is tricky though. Login, user and profile are related, but there is a difference between login and user service, and interceptors on one side, and html, ctrl, directives related to login/profile view on the other side. I think interceptors and services belong to core, or maybe even some external package.

Directives is trickiest. We currently use the search dropdown directives on the search page only, but they might have use outside that page too. Secondly, they are isolated components. They could (theoretically) be pulled in from an external package too. Hence my thought of separating them out too.

I don't want to bloat the directory listing either, so we need to find a nice balance. I'm open to suggestions..