@@ -159,7 +159,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
159
159
if ( ngcVersion ) {
160
160
// e.g. 8.0.3
161
161
ngcVersion = await this . $packageInstallationManager . maxSatisfyingVersion ( ngcPackageName , ngcVersion ) ;
162
- const ngcManifest = await this . getTemplateManifest ( ngcPackageName , ngcVersion ) ;
162
+ const ngcManifest = await this . getPackageManifest ( ngcPackageName , ngcVersion ) ;
163
163
// e.g. >=3.4 <3.5
164
164
verifiedVersion = ( ngcManifest && ngcManifest . peerDependencies &&
165
165
ngcManifest . peerDependencies [ MigrateController . typescriptPackageName ] ) || verifiedVersion ;
@@ -288,7 +288,6 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
288
288
289
289
private async migrateDependency ( dependency : IMigrationDependency , projectData : IProjectData ) : Promise < void > {
290
290
const hasDependency = this . hasDependency ( dependency , projectData ) ;
291
- const dependencyVersion = await this . getDependencyVerifiedVersion ( dependency , projectData ) ;
292
291
if ( dependency . warning ) {
293
292
this . $logger . warn ( dependency . warning ) ;
294
293
}
@@ -309,6 +308,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
309
308
return ;
310
309
}
311
310
311
+ const dependencyVersion = await this . getDependencyVerifiedVersion ( dependency , projectData ) ;
312
312
if ( hasDependency && await this . shouldMigrateDependencyVersion ( dependency , projectData ) ) {
313
313
this . $logger . info ( `Updating '${ dependency . packageName } ' to compatible version '${ dependencyVersion } '` ) ;
314
314
this . $pluginsService . addToPackageJson ( dependency . packageName , dependencyVersion , dependency . isDev , projectData . projectDir ) ;
@@ -322,10 +322,11 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
322
322
}
323
323
324
324
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
+ }
327
328
328
- return verifiedVersion ;
329
+ return dependency . verifiedVersion ;
329
330
}
330
331
331
332
private async shouldMigrateDependencyVersion ( dependency : IMigrationDependency , projectData : IProjectData ) : Promise < boolean > {
0 commit comments