angular-architects / nx-ddd-plugin

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

feat: Allow for the creation of a feature module that is not associated with an app #64

Closed bjornharvold closed 2 years ago

bjornharvold commented 3 years ago

The use case is very helpful for very large domains with many reactive entities. The module tends to become large when it could be separated into separate features.

Example:

apps:
   - my-app
libs:
   - my-app
      - domain
      -    +state
      -       feature-1
      -       feature-2
      -       feature-100
      - feature-1
      - feature-2
      - feature-100

Instead:

apps:
   - my-app
libs:
   - my-app
   -    domain -> +state
   -    feature-core-1
   -    feature-core-2
   - my-app-feature-1
   -    domain -> +state
   -    feature-1-create
   -    feature-1-update
   - my-app-feature-2
   -    domain -> +state
   -    feature-2-create
   -    feature-2-update
   - my-app-feature-100
   -    domain -> +state
   -    feature-100-create
   -    feature-100-update

All feature libraries would depend on domain and parent domain modules:

MyAppFeature100CreateModule {
  imports: [CommonModule, MyAppDomainModule, MyAppFeature100DomainModule]
}

Thoughts on this appreciated. I want to avoid creating ui modules and then rename them to feature because they contain reactive code.

Cheers on a great plugin!

manfredsteyer commented 2 years ago

The next version (2.0.0) will have a --no-app switch for this.