@@ -22,7 +22,6 @@ import {
2222 createChangeRecorder ,
2323} from '@ngrx/data/schematics-core' ;
2424import { Schema as EntityDataOptions } from './schema' ;
25- import { Path } from '@angular-devkit/core' ;
2625
2726function addNgRxDataToPackageJson ( ) {
2827 return ( host : Tree , context : SchematicContext ) => {
@@ -133,9 +132,9 @@ function renameNgrxDataModule(options: EntityDataOptions) {
133132 }
134133
135134 const changes = [
136- ...findNgrxDataImports ( sourceFile , path , ngrxDataImports ) ,
137- ...findNgrxDataImportDeclarations ( sourceFile , path , ngrxDataImports ) ,
138- ...findNgrxDataReplacements ( sourceFile , path ) ,
135+ ...findNgrxDataImports ( sourceFile , ngrxDataImports ) ,
136+ ...findNgrxDataImportDeclarations ( sourceFile , ngrxDataImports ) ,
137+ ...findNgrxDataReplacements ( sourceFile ) ,
139138 ] ;
140139
141140 if ( changes . length === 0 ) {
@@ -150,13 +149,11 @@ function renameNgrxDataModule(options: EntityDataOptions) {
150149
151150function findNgrxDataImports (
152151 sourceFile : ts . SourceFile ,
153- path : Path ,
154152 imports : ts . ImportDeclaration [ ]
155153) {
156154 const changes = imports . map ( specifier =>
157155 createReplaceChange (
158156 sourceFile ,
159- path ,
160157 specifier . moduleSpecifier ,
161158 "'ngrx-data'" ,
162159 "'@ngrx/data'"
@@ -168,7 +165,6 @@ function findNgrxDataImports(
168165
169166function findNgrxDataImportDeclarations (
170167 sourceFile : ts . SourceFile ,
171- path : Path ,
172168 imports : ts . ImportDeclaration [ ]
173169) {
174170 const changes = imports
@@ -198,7 +194,6 @@ function findNgrxDataImportDeclarations(
198194 . map ( ( { specifier, text } ) =>
199195 createReplaceChange (
200196 sourceFile ,
201- path ,
202197 specifier ! ,
203198 text ! ,
204199 ( renames as any ) [ text ! ]
@@ -208,7 +203,7 @@ function findNgrxDataImportDeclarations(
208203 return changes ;
209204}
210205
211- function findNgrxDataReplacements ( sourceFile : ts . SourceFile , path : Path ) {
206+ function findNgrxDataReplacements ( sourceFile : ts . SourceFile ) {
212207 const renameKeys = Object . keys ( renames ) ;
213208 let changes : ReplaceChange [ ] = [ ] ;
214209 ts . forEachChild ( sourceFile , node => find ( node , changes ) ) ;
@@ -252,7 +247,6 @@ function findNgrxDataReplacements(sourceFile: ts.SourceFile, path: Path) {
252247 changes . push (
253248 createReplaceChange (
254249 sourceFile ,
255- path ,
256250 change . node ,
257251 change . text ,
258252 ( renames as any ) [ change . text ]
0 commit comments