[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ x ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
When I add a new feature with ng g af todo/todo there will be generated folder structure like this:
- state
-- feature.model.ts
-- feature.query.ts
-- feature.service.ts
-- feature.store.ts
But now we want to have a structure like this (with a custom folder name _store):
- _store
-- feature
--- feature.model.ts
--- feature.query.ts
--- feature.service.ts
--- feature.store.ts
There should be a way to customize the root store-foldername from store to _store and create a subfolder for every feature like above.
Only execute ng g af toto/todo.
Angular version: 8.0.0
@NetanelBasal I can try to take this on.
@Disane87 I took a look at this. So basically instead of ng g af todo/todo you can run ng g af todo/_store/todo --dirName todo to get the desired structure. Is that what you mean?
Or do you want something like ng g af todo/todo --parentDir _store?
@Disane87 As far as I understand, your motivation is to be able to create multiple states for the same feature in a convenient way. For example, you want to run the commands below:
ng g af todo/todos --parentDir _store
ng g af todo/new-todo --parentDir _store
and end up with the following structure:
todo
βββ _store
βββ new-todo
βΒ Β βββ new-todo.model.ts
βΒ Β βββ new-todo.query.ts
βΒ Β βββ new-todo.service.ts
βΒ Β βββ new-todo.store.ts
βββ todos
βββ todo.model.ts
βββ todos.query.ts
βββ todos.service.ts
βββ todos.store.ts
Is that right?
@theorlovsky Thank you for your investigation! Need to check that, but apparently I'm pretty busy with stuff going on at work. Gonna report back when I've checked it :)
At first glance, this looks promising.
@theorlovsky it would be great if you can add it to the docs.
@NetanelBasal I guess this issue was closed by mistake, I havenβt finished with this yet.
@theorlovsky I've checked your post from a few days ago. Sorry for the long delay :)
Imageine, I have a module "CRM" where I have a few entities, like addresses or contacts. Now I want to have one single folder under "CRM" with "_store" or whatever and under that for every store a subfolder like this:
βββ _store
βββ address
β βββ address.model.ts
β βββ address.query.ts
β βββ address.service.ts
β βββ address.store.ts
βββ contacts
βββ contacts.model.ts
βββ contacts.query.ts
βββ contacts.service.ts
βββ contacts.store.ts
So your approach seems reasonable and looks like it's working for my juse case.
I'm not sure what's the status of the issue. @Disane87 is @theorlovsky suggestion solved the issue?
@NetanelBasal No IMHO it's not solved because an option like @theorlovsky suggested is not available (--parentDir)
Oh, I thought it's something that exists in Angular schematics :)
Btw _store should be state by default.
βββ state
βββ address
β βββ address.model.ts
β βββ address.query.ts
β βββ address.service.ts
β βββ address.store.ts
βββ contacts
βββ contacts.model.ts
βββ contacts.query.ts
βββ contacts.service.ts
βββ contacts.store.ts
Btw
_storeshould bestateby default.βββ state βββ address β βββ address.model.ts β βββ address.query.ts β βββ address.service.ts β βββ address.store.ts βββ contacts βββ contacts.model.ts βββ contacts.query.ts βββ contacts.service.ts βββ contacts.store.ts
Indeed state is a better term for this :)
@NetanelBasal so now what I need to do is to basically implement a --flat flag that is true by default for backward compatibility?
No, it should be a new option.
You can add something like:
ng g af CRM/address --grouped
ng g af CRM/contacts --grouped
I thought --flat is a new option since there is no one in akita-cli now. And the usage is:
ng g af CRM/address (same as ng g af CRM/address --flat true) β current behaviorng g af CRM/address --flat false β desired behavior:sh
CRM
βββ state
βββ address
βββ address.model.ts
βββ address.query.ts
βββ address.service.ts
βββ address.store.ts
I believe that --flat has more obvious meaning than --grouped.
Agree
And one can easily combine it with existing --dirName:
ng g af CRM/address --flat false --dirName _store
CRM
βββ _store
βββ address
βββ address.model.ts
βββ address.query.ts
βββ address.service.ts
βββ address.store.ts
Ok then, I'll open a PR this Saturday
Most helpful comment
And one can easily combine it with existing
--dirName:ng g af CRM/address --flat false --dirName _store