@@ -16,7 +16,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
1616 private $addPlatformService : IAddPlatformService ,
1717 private $pluginsService : IPluginsService ,
1818 private $projectDataService : IProjectDataService ) {
19- super ( $fs , $platformCommandHelper , $platformsDataService , $packageInstallationManager , $packageManager ) ;
19+ super ( $fs , $platformCommandHelper , $platformsDataService , $packageInstallationManager , $packageManager ) ;
2020 }
2121
2222 static readonly folders : string [ ] = [
@@ -28,36 +28,36 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
2828 constants . TSCCONFIG_TNS_JSON_NAME
2929 ] ;
3030
31- static readonly migrationDependencies : IMigrationDependency [ ] = [
32- { packageName : constants . TNS_CORE_MODULES_NAME , verifiedVersion : "6.0.0-next-2019-06-10-092158 -01" } ,
33- { packageName : constants . TNS_CORE_MODULES_WIDGETS_NAME , verifiedVersion : "6.0.0-next-2019-06-10-092158 -01" } ,
34- { packageName : "node-sass" , isDev : true , verifiedVersion : "4.12.0" } ,
35- { packageName : "typescript" , isDev : true , verifiedVersion : "3.4.1" } ,
36- { packageName : "less" , isDev : true , verifiedVersion : "3.9.0" } ,
37- { packageName : "nativescript-dev-sass" , isDev : true , replaceWith : "node-sass" } ,
38- { packageName : "nativescript-dev-typescript" , isDev : true , replaceWith : "typescript" } ,
39- { packageName : "nativescript-dev-less" , isDev : true , replaceWith : "less" } ,
40- { packageName : constants . WEBPACK_PLUGIN_NAME , isDev : true , shouldAddIfMissing : true , verifiedVersion : "0.25.0-webpack -2019-06-11-105349-01" } ,
41- { packageName : "nativescript-camera" , verifiedVersion : "4.5.0" } ,
42- { packageName : "nativescript-geolocation" , verifiedVersion : "5.1.0" } ,
43- { packageName : "nativescript-imagepicker" , verifiedVersion : "6.2.0" } ,
44- { packageName : "nativescript-social-share" , verifiedVersion : "1.5.2" } ,
45- { packageName : "nativescript-ui-chart" , verifiedVersion : "5.0.0-androidx-110619" } ,
46- { packageName : "nativescript-ui-dataform" , verifiedVersion : "5.0.0-androidx-110619" } ,
47- { packageName : "nativescript-ui-gauge" , verifiedVersion : "5.0.0-androidx" } ,
48- { packageName : "nativescript-ui-listview" , verifiedVersion : "7.0.0-androidx-110619" } ,
49- { packageName : "nativescript-ui-sidedrawer" , verifiedVersion : "7.0.0-androidx-110619" } ,
50- { packageName : "nativescript-ui-calendar" , verifiedVersion : "5.0.0-androidx-110619-2" } ,
51- { packageName : "nativescript-ui-autocomplete" , verifiedVersion : "5.0.0-androidx-110619" } ,
52- { packageName : "nativescript-datetimepicker" , verifiedVersion : "1.1.0" } ,
31+ static readonly migrationDependencies : IMigrationDependency [ ] = [
32+ { packageName : constants . TNS_CORE_MODULES_NAME , verifiedVersion : "6.0.0-next-2019-06-20-155941 -01" } ,
33+ { packageName : constants . TNS_CORE_MODULES_WIDGETS_NAME , verifiedVersion : "6.0.0-next-2019-06-20-155941 -01" } ,
34+ { packageName : "node-sass" , isDev : true , verifiedVersion : "4.12.0" } ,
35+ { packageName : "typescript" , isDev : true , verifiedVersion : "3.4.1" } ,
36+ { packageName : "less" , isDev : true , verifiedVersion : "3.9.0" } ,
37+ { packageName : "nativescript-dev-sass" , isDev : true , replaceWith : "node-sass" } ,
38+ { packageName : "nativescript-dev-typescript" , isDev : true , replaceWith : "typescript" } ,
39+ { packageName : "nativescript-dev-less" , isDev : true , replaceWith : "less" } ,
40+ { packageName : constants . WEBPACK_PLUGIN_NAME , isDev : true , shouldAddIfMissing : true , verifiedVersion : "0.25.0-next -2019-06-21-150426-03" } ,
41+ { packageName : "nativescript-camera" , verifiedVersion : "4.5.0" } ,
42+ { packageName : "nativescript-geolocation" , verifiedVersion : "5.1.0" } ,
43+ { packageName : "nativescript-imagepicker" , verifiedVersion : "6.2.0" } ,
44+ { packageName : "nativescript-social-share" , verifiedVersion : "1.5.2" } ,
45+ { packageName : "nativescript-ui-chart" , verifiedVersion : "5.0.0-androidx-110619" } ,
46+ { packageName : "nativescript-ui-dataform" , verifiedVersion : "5.0.0-androidx-110619" } ,
47+ { packageName : "nativescript-ui-gauge" , verifiedVersion : "5.0.0-androidx" } ,
48+ { packageName : "nativescript-ui-listview" , verifiedVersion : "7.0.0-androidx-110619" } ,
49+ { packageName : "nativescript-ui-sidedrawer" , verifiedVersion : "7.0.0-androidx-110619" } ,
50+ { packageName : "nativescript-ui-calendar" , verifiedVersion : "5.0.0-androidx-110619-2" } ,
51+ { packageName : "nativescript-ui-autocomplete" , verifiedVersion : "5.0.0-androidx-110619" } ,
52+ { packageName : "nativescript-datetimepicker" , verifiedVersion : "1.1.0" } ,
5353 //TODO update with compatible with webpack only hooks
54- { packageName : "kinvey-nativescript-sdk" , verifiedVersion : "4.2.1" } ,
54+ { packageName : "kinvey-nativescript-sdk" , verifiedVersion : "4.2.1" } ,
5555 //TODO update with compatible with webpack only hooks
56- { packageName : "nativescript-plugin-firebase" , verifiedVersion : "9.0.1" } ,
56+ { packageName : "nativescript-plugin-firebase" , verifiedVersion : "9.0.1" } ,
5757 //TODO update with no prerelease version compatible with webpack only hooks
58- { packageName : "nativescript-vue" , verifiedVersion : "2.3.0-rc.0" } ,
59- { packageName : "nativescript-permissions" , verifiedVersion : "1.3.0" } ,
60- { packageName : "nativescript-cardview" , verifiedVersion : "3.2.0" }
58+ { packageName : "nativescript-vue" , verifiedVersion : "2.3.0-rc.0" } ,
59+ { packageName : "nativescript-permissions" , verifiedVersion : "1.3.0" } ,
60+ { packageName : "nativescript-cardview" , verifiedVersion : "3.2.0" }
6161 ] ;
6262
6363 static readonly backupFolder : string = ".migration_backup" ;
@@ -71,7 +71,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
7171 } ;
7272 }
7373
74- public async migrate ( { projectDir} : { projectDir : string } ) : Promise < void > {
74+ public async migrate ( { projectDir } : { projectDir : string } ) : Promise < void > {
7575 const projectData = this . $projectDataService . getProjectData ( projectDir ) ;
7676 const backupDir = path . join ( projectDir , MigrateController . backupFolder ) ;
7777
@@ -94,7 +94,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
9494 }
9595 }
9696
97- public async shouldMigrate ( { projectDir} : IProjectDir ) : Promise < boolean > {
97+ public async shouldMigrate ( { projectDir } : IProjectDir ) : Promise < boolean > {
9898 const projectData = this . $projectDataService . getProjectData ( projectDir ) ;
9999
100100 for ( let i = 0 ; i < MigrateController . migrationDependencies . length ; i ++ ) {
@@ -115,8 +115,8 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
115115 }
116116
117117 for ( const platform in this . $devicePlatformsConstants ) {
118- const hasRuntimeDependency = this . hasRuntimeDependency ( { platform, projectData} ) ;
119- if ( ! hasRuntimeDependency || await this . shouldUpdateRuntimeVersion ( { targetVersion : this . verifiedPlatformVersions [ platform . toLowerCase ( ) ] , platform, projectData} ) ) {
118+ const hasRuntimeDependency = this . hasRuntimeDependency ( { platform, projectData } ) ;
119+ if ( ! hasRuntimeDependency || await this . shouldUpdateRuntimeVersion ( { targetVersion : this . verifiedPlatformVersions [ platform . toLowerCase ( ) ] , platform, projectData } ) ) {
120120 return true ;
121121 }
122122 }
@@ -145,7 +145,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
145145 if ( ! replacementDep ) {
146146 this . $errors . failWithoutHelp ( "Failed to find replacement dependency." ) ;
147147 }
148- this . $logger . info ( `Replacing '${ dependency . packageName } ' with '${ replacementDep . packageName } '.` , ) ;
148+ this . $logger . info ( `Replacing '${ dependency . packageName } ' with '${ replacementDep . packageName } '.` ) ;
149149 this . $pluginsService . addToPackageJson ( replacementDep . packageName , replacementDep . verifiedVersion , replacementDep . isDev , projectData . projectDir ) ;
150150 continue ;
151151 }
@@ -165,8 +165,8 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
165165
166166 for ( const platform in this . $devicePlatformsConstants ) {
167167 const lowercasePlatform = platform . toLowerCase ( ) ;
168- const hasRuntimeDependency = this . hasRuntimeDependency ( { platform, projectData} ) ;
169- if ( ! hasRuntimeDependency || await this . shouldUpdateRuntimeVersion ( { targetVersion : this . verifiedPlatformVersions [ lowercasePlatform ] , platform, projectData} ) ) {
168+ const hasRuntimeDependency = this . hasRuntimeDependency ( { platform, projectData } ) ;
169+ if ( ! hasRuntimeDependency || await this . shouldUpdateRuntimeVersion ( { targetVersion : this . verifiedPlatformVersions [ lowercasePlatform ] , platform, projectData } ) ) {
170170 const verifiedPlatformVersion = this . verifiedPlatformVersions [ lowercasePlatform ] ;
171171 const platformData = this . $platformsDataService . getPlatformData ( lowercasePlatform , projectData ) ;
172172 this . $logger . info ( `Updating ${ platform } platform to version '${ verifiedPlatformVersion } '.` ) ;
@@ -192,8 +192,8 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
192192 return ! ( maxSatisfyingVersion && semver . gte ( maxSatisfyingVersion , dependency . verifiedVersion ) ) ;
193193 }
194194
195- protected async shouldUpdateRuntimeVersion ( { targetVersion, platform, projectData} : { targetVersion : string , platform : string , projectData : IProjectData } ) : Promise < boolean > {
196- const maxRuntimeVersion = await this . getMaxRuntimeVersion ( { platform, projectData} ) ;
195+ protected async shouldUpdateRuntimeVersion ( { targetVersion, platform, projectData } : { targetVersion : string , platform : string , projectData : IProjectData } ) : Promise < boolean > {
196+ const maxRuntimeVersion = await this . getMaxRuntimeVersion ( { platform, projectData } ) ;
197197
198198 return ! ( maxRuntimeVersion && semver . gte ( maxRuntimeVersion , targetVersion ) ) ;
199199 }
0 commit comments