angular-architects / nx-ddd-plugin

Nx plugin for structuring a monorepo with domains and layers
313 stars 56 forks source link

[Bug] When using a directory for Feature with NgRx, filenames are not correct #37

Closed benpsnyder closed 3 years ago

benpsnyder commented 3 years ago

I'm generating entities for an application we're building to integrate with Dynamics 365. Code is based on #35. I want to organize these into a directory called cdm

My domains look like this:

# make the domains
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=accounting
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=admin 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=core 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=licensing 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=marketing 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=partner 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=project 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=referral 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=sales 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=service 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=time 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=user 
nx generate @angular-architects/ddd:domain --directory=frontend --addApp --appDirectory=domain --ngrx --no-interactive --name=integrations 

image image

Goal: make core CDM entities: https://docs.microsoft.com/en-us/common-data-model/schema/core/applicationcommon/overview

nx generate @angular-architects/ddd:feature --domain=core --directory=cdm --app=core --appDirectory=domain --domainDirectory=frontend --lazy --ngrx --no-prefix --no-interactive --name='account' --entity='account'
nx generate @angular-architects/ddd:feature --domain=core --directory=cdm --app=core --appDirectory=domain --domainDirectory=frontend --lazy --ngrx --no-prefix --no-interactive --name='activity' --entity='activity'
nx generate @angular-architects/ddd:feature --domain=core --directory=cdm --app=core --appDirectory=domain --domainDirectory=frontend --lazy --ngrx --no-prefix --no-interactive --name='activity party' --entity='activity party'
nx generate @angular-architects/ddd:feature --domain=core --directory=cdm --app=core --appDirectory=domain --domainDirectory=frontend --lazy --ngrx --no-prefix --no-interactive --name='address' --entity='address'
nx generate @angular-architects/ddd:feature --domain=core --directory=cdm --app=core --appDirectory=domain --domainDirectory=frontend --lazy --ngrx --no-prefix --no-interactive --name='appointment' --entity='appointment'
nx generate @angular-architects/ddd:feature --domain=core --directory=cdm --app=core --appDirectory=domain --domainDirectory=frontend --lazy --ngrx --no-prefix --no-interactive --name='article' --entity='article'
nx generate @angular-architects/ddd:feature --domain=core --directory=cdm --app=core --appDirectory=domain --domainDirectory=frontend --lazy --ngrx --no-prefix --no-interactive --name='article comment' --entity='article comment'
nx generate @angular-architects/ddd:feature --domain=core --directory=cdm --app=core --appDirectory=domain --domainDirectory=frontend --lazy --ngrx --no-prefix --no-interactive --name='article template' --entity='article template'

I need to be able to enter the directory parameter "N" levels deep like so: --directory=cdm/application-common/foundation-common/crm-common/project-service-automation image

image

We won't support need support for camelCase filenames ... only "hyphen-case" with all lowercase characters. Classes are generated LikeThis within typescript anyway

bilaljaved9215 commented 3 years ago

@benpsnyder I am working on this...

benpsnyder commented 3 years ago

Thanks @bilaljaved9215 - as discussed, given: nx generate @angular-architects/ddd:feature --domain=core --app='core' --appDirectory='domain' --domainDirectory='frontend' --lazy --ngrx --no-prefix --no-interactive --directory='cdm/standard/apps' --name='account' --entity='account'

Please update the NgRx structure to reflect the nested directory structure as well. image

manfredsteyer commented 3 years ago

Thanks for your PR: https://github.com/angular-architects/nx-ddd-plugin/pull/35