@@ -13,8 +13,8 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma
1313 private $projectDataService : IProjectDataService ,
1414 private $fs : IFileSystem ,
1515 private $logger : ILogger ) {
16- super ( $options , $platformsData , $platformService , $projectData ) ;
17- this . $projectData . initializeProjectData ( ) ;
16+ super ( $options , $platformsData , $platformService , $projectData ) ;
17+ this . $projectData . initializeProjectData ( ) ;
1818 }
1919
2020 static readonly folders : string [ ] = [
@@ -83,8 +83,10 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma
8383 }
8484
8585 await this . $platformService . removePlatforms ( platforms . installed , this . $projectData ) ;
86- await this . $pluginsService . remove ( "tns-core-modules" , this . $projectData ) ;
87- await this . $pluginsService . remove ( "tns-core-modules-widgets" , this . $projectData ) ;
86+ await this . $pluginsService . remove ( constants . TNS_CORE_MODULES_NAME , this . $projectData ) ;
87+ if ( ! ! this . $projectData . dependencies [ constants . TNS_CORE_MODULES_WIDGETS_NAME ] ) {
88+ await this . $pluginsService . remove ( constants . TNS_CORE_MODULES_WIDGETS_NAME , this . $projectData ) ;
89+ }
8890
8991 for ( const folder of UpdateCommand . folders ) {
9092 this . $fs . deleteDirectory ( path . join ( this . $projectData . projectDir , folder ) ) ;
@@ -95,16 +97,16 @@ export class UpdateCommand extends ValidatePlatformCommandBase implements IComma
9597 await this . $platformService . addPlatforms ( [ platform + "@" + args [ 0 ] ] , this . $options . platformTemplate , this . $projectData , this . $options , this . $options . frameworkPath ) ;
9698 }
9799
98- await this . $pluginsService . add ( "tns-core-modules@" + args [ 0 ] , this . $projectData ) ;
100+ await this . $pluginsService . add ( ` ${ constants . TNS_CORE_MODULES_NAME } @ ${ args [ 0 ] } ` , this . $projectData ) ;
99101 } else {
100102 await this . $platformService . addPlatforms ( platforms . packagePlatforms , this . $options . platformTemplate , this . $projectData , this . $options , this . $options . frameworkPath ) ;
101- await this . $pluginsService . add ( "tns-core-modules" , this . $projectData ) ;
103+ await this . $pluginsService . add ( constants . TNS_CORE_MODULES_NAME , this . $projectData ) ;
102104 }
103105
104106 await this . $pluginsService . ensureAllDependenciesAreInstalled ( this . $projectData ) ;
105107 }
106108
107- private getPlatforms ( ) : { installed : string [ ] , packagePlatforms : string [ ] } {
109+ private getPlatforms ( ) : { installed : string [ ] , packagePlatforms : string [ ] } {
108110 const installedPlatforms = this . $platformService . getInstalledPlatforms ( this . $projectData ) ;
109111 const availablePlatforms = this . $platformService . getAvailablePlatforms ( this . $projectData ) ;
110112 const packagePlatforms : string [ ] = [ ] ;
0 commit comments