@@ -16,7 +16,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
16
16
private $addPlatformService : IAddPlatformService ,
17
17
private $pluginsService : IPluginsService ,
18
18
private $projectDataService : IProjectDataService ) {
19
- super ( $fs , $platformCommandHelper , $platformsDataService , $packageInstallationManager , $packageManager ) ;
19
+ super ( $fs , $platformCommandHelper , $platformsDataService , $packageInstallationManager , $packageManager ) ;
20
20
}
21
21
22
22
static readonly folders : string [ ] = [
@@ -28,36 +28,36 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
28
28
constants . TSCCONFIG_TNS_JSON_NAME
29
29
] ;
30
30
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" } ,
53
53
//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" } ,
55
55
//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" } ,
57
57
//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" }
61
61
] ;
62
62
63
63
static readonly backupFolder : string = ".migration_backup" ;
@@ -71,7 +71,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
71
71
} ;
72
72
}
73
73
74
- public async migrate ( { projectDir} : { projectDir : string } ) : Promise < void > {
74
+ public async migrate ( { projectDir } : { projectDir : string } ) : Promise < void > {
75
75
const projectData = this . $projectDataService . getProjectData ( projectDir ) ;
76
76
const backupDir = path . join ( projectDir , MigrateController . backupFolder ) ;
77
77
@@ -94,7 +94,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
94
94
}
95
95
}
96
96
97
- public async shouldMigrate ( { projectDir} : IProjectDir ) : Promise < boolean > {
97
+ public async shouldMigrate ( { projectDir } : IProjectDir ) : Promise < boolean > {
98
98
const projectData = this . $projectDataService . getProjectData ( projectDir ) ;
99
99
100
100
for ( let i = 0 ; i < MigrateController . migrationDependencies . length ; i ++ ) {
@@ -115,8 +115,8 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
115
115
}
116
116
117
117
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 } ) ) {
120
120
return true ;
121
121
}
122
122
}
@@ -145,7 +145,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
145
145
if ( ! replacementDep ) {
146
146
this . $errors . failWithoutHelp ( "Failed to find replacement dependency." ) ;
147
147
}
148
- this . $logger . info ( `Replacing '${ dependency . packageName } ' with '${ replacementDep . packageName } '.` , ) ;
148
+ this . $logger . info ( `Replacing '${ dependency . packageName } ' with '${ replacementDep . packageName } '.` ) ;
149
149
this . $pluginsService . addToPackageJson ( replacementDep . packageName , replacementDep . verifiedVersion , replacementDep . isDev , projectData . projectDir ) ;
150
150
continue ;
151
151
}
@@ -165,8 +165,8 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
165
165
166
166
for ( const platform in this . $devicePlatformsConstants ) {
167
167
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 } ) ) {
170
170
const verifiedPlatformVersion = this . verifiedPlatformVersions [ lowercasePlatform ] ;
171
171
const platformData = this . $platformsDataService . getPlatformData ( lowercasePlatform , projectData ) ;
172
172
this . $logger . info ( `Updating ${ platform } platform to version '${ verifiedPlatformVersion } '.` ) ;
@@ -192,8 +192,8 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
192
192
return ! ( maxSatisfyingVersion && semver . gte ( maxSatisfyingVersion , dependency . verifiedVersion ) ) ;
193
193
}
194
194
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 } ) ;
197
197
198
198
return ! ( maxRuntimeVersion && semver . gte ( maxRuntimeVersion , targetVersion ) ) ;
199
199
}
0 commit comments