Skip to content

Commit 3cfb8cc

Browse files
author
Peter Smith
committed
feat: ngrx error handling
1 parent 1434f50 commit 3cfb8cc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

libs/ddd/src/schematics/domain/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ export default function (options: DomainOptions): Rule {
3030
const appPath = `apps/${appFolderName}/src/app`;
3131
const appModulePath = `${appPath}/app.module.ts`;
3232

33+
if (options.ngrx && !options.addApp) {
34+
throw new Error(
35+
`The 'ngrx' option may only be used when the 'addApp' option is used.`
36+
)
37+
}
38+
3339
return chain([
3440
externalSchematic('@nrwl/angular', 'lib', {
3541
name: 'domain',

libs/ddd/src/schematics/feature/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ export default function (options: FeatureOptions): Rule {
6565
}
6666
}
6767

68+
if (options.ngrx && !options.entity) {
69+
throw new Error(
70+
`The 'ngrx' option may only be used when the 'entity' option is used.`
71+
)
72+
}
73+
6874
const domainTemplates =
6975
options.ngrx && options.entity
7076
? apply(url('./files/forDomainWithNgrx'), [

0 commit comments

Comments
 (0)