angular-architects / nx-ddd-plugin

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

[Bug] @ngrx/schematics bug for :domain when ngrx enabled and after Nx 11 upgrade #36

Closed benpsnyder closed 2 years ago

benpsnyder commented 3 years ago

After upgrading this plugin to Nx 11, when running:

nx generate @angular-architects/ddd:domain --addApp --ngrx --no-interactive --name=accounting

you get the error: Cannot read property 'root' of undefined

I've traced it to root: true on line 62 of libs/ddd/src/schematics/domain/index.ts

options.addApp && options.ngrx
      ? chain([
          externalSchematic('@ngrx/schematics', 'store', {
            project: options.name,
            root: true,
            minimal: true,
            module: 'app.module.ts',
            name: 'state',
          }),
          addNgrxImportsToApp(appModulePath),
          addNgRxToPackageJson(),
        ])
      : noop(),

Using @ngrx/schematics@10.1.2 https://ngrx.io/guide/schematics/store

leaderiop commented 3 years ago

i have the same probleme

manfredsteyer commented 3 years ago

//cc @peterbsmith2 Could you please look into this?

benpsnyder commented 3 years ago

@manfredsteyer I have already figured this out with my developers. Peter and I met over Zoom for the first time today and we are developing a working collaboration. I'll update the issues here soon; there is some key input our development team would like from you and Peter. Once we get alignment, we can submit PRs that implement the changes. I have projects kicking off within 1 so I am under pressure with my team to make these changes, and we really like the structure this plugin introduces.

ghost commented 3 years ago

I've not been able to reproduce on a fresh repository.

benpsnyder commented 3 years ago

@peterbsmyth because you have an angular.json file. This issue related to #40 and happens when you have a workspace.json file

manfredsteyer commented 3 years ago

Ah, I see. I thought, when creating an Angular project, you always have an angular.json. What do I need to do to get a workspace.json?