Skip to content

Commit 4e20613

Browse files
[Bug] When using a directory for Feature with NgRx, filenames are not correct #37... change of filename as requested later
1 parent 5d474d5 commit 4e20613

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ export default function (options: FeatureOptions): Rule {
127127
);
128128
}
129129

130+
let updatedEntityNameOptions = Object.assign({},options);
131+
updatedEntityNameOptions.entity = featureDirectoryAndNameDasherized;
132+
130133
const domainTemplates =
131134
options.ngrx && entityName
132135
? apply(url('./files/forDomainWithNgrx'), [
@@ -184,21 +187,21 @@ export default function (options: FeatureOptions): Rule {
184187
mergeWith(domainTemplates),
185188
entityName
186189
? addTsExport(domainIndexPath, [
187-
`./lib/entities/${entityName}`,
188-
`./lib/infrastructure/${entityName}.data.service`,
190+
`./lib/entities/${featureDirectoryAndNameDasherized}`,
191+
`./lib/infrastructure/${featureDirectoryAndNameDasherized}.data.service`,
189192
])
190193
: noop(),
191194
options.ngrx && entityName && host.exists(domainModuleFilepath)
192195
? chain([
193196
addNgRxToPackageJson(),
194-
addNgrxImportsToDomain(domainModuleFilepath, entityName),
197+
addNgrxImportsToDomain(domainModuleFilepath, featureDirectoryAndNameDasherized),
195198
addTsExport(domainIndexPath, [
196-
`./lib/+state/${entityName}/${entityName}.actions`,
199+
`./lib/+state/${featureDirectoryAndNameDasherized}/${featureDirectoryAndNameDasherized}.actions`,
197200
]),
198201
])
199202
: noop(),
200203
addTsExport(domainIndexPath, [
201-
`./lib/application/${entityName}.facade`, //featureDirectoryAndNameDasherized
204+
`./lib/application/${featureDirectoryAndNameDasherized}.facade`, //featureDirectoryAndNameDasherized
202205
]),
203206
mergeWith(featureTemplates),
204207
addTsExport(featureIndexPath, [

0 commit comments

Comments
 (0)