@@ -159,7 +159,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
159159 if ( ngcVersion ) {
160160 // e.g. 8.0.3
161161 ngcVersion = await this . $packageInstallationManager . maxSatisfyingVersion ( ngcPackageName , ngcVersion ) ;
162- const ngcManifest = await this . getTemplateManifest ( ngcPackageName , ngcVersion ) ;
162+ const ngcManifest = await this . getPackageManifest ( ngcPackageName , ngcVersion ) ;
163163 // e.g. >=3.4 <3.5
164164 verifiedVersion = ( ngcManifest && ngcManifest . peerDependencies &&
165165 ngcManifest . peerDependencies [ MigrateController . typescriptPackageName ] ) || verifiedVersion ;
@@ -288,7 +288,6 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
288288
289289 private async migrateDependency ( dependency : IMigrationDependency , projectData : IProjectData ) : Promise < void > {
290290 const hasDependency = this . hasDependency ( dependency , projectData ) ;
291- const dependencyVersion = await this . getDependencyVerifiedVersion ( dependency , projectData ) ;
292291 if ( dependency . warning ) {
293292 this . $logger . warn ( dependency . warning ) ;
294293 }
@@ -309,6 +308,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
309308 return ;
310309 }
311310
311+ const dependencyVersion = await this . getDependencyVerifiedVersion ( dependency , projectData ) ;
312312 if ( hasDependency && await this . shouldMigrateDependencyVersion ( dependency , projectData ) ) {
313313 this . $logger . info ( `Updating '${ dependency . packageName } ' to compatible version '${ dependencyVersion } '` ) ;
314314 this . $pluginsService . addToPackageJson ( dependency . packageName , dependencyVersion , dependency . isDev , projectData . projectDir ) ;
@@ -322,10 +322,11 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
322322 }
323323
324324 private async getDependencyVerifiedVersion ( dependency : IMigrationDependency , projectData : IProjectData ) : Promise < string > {
325- const verifiedVersion = dependency . getVerifiedVersion ?
326- await dependency . getVerifiedVersion ( projectData ) : dependency . verifiedVersion ;
325+ if ( ! dependency . verifiedVersion && dependency . getVerifiedVersion ) {
326+ dependency . verifiedVersion = await dependency . getVerifiedVersion ( projectData ) ;
327+ }
327328
328- return verifiedVersion ;
329+ return dependency . verifiedVersion ;
329330 }
330331
331332 private async shouldMigrateDependencyVersion ( dependency : IMigrationDependency , projectData : IProjectData ) : Promise < boolean > {
0 commit comments