@@ -82,7 +82,7 @@ export class PlatformService implements IPlatformService {
82
82
let packageToInstall = "" ;
83
83
let npmOptions : IStringDictionary = {
84
84
pathToSave : path . join ( this . $projectData . platformsDir , platform ) ,
85
- dependencyType : "save"
85
+ dependencyType : "save-dev "
86
86
} ;
87
87
88
88
if ( ! this . $options . frameworkPath ) {
@@ -97,8 +97,7 @@ export class PlatformService implements IPlatformService {
97
97
let frameworkDir = path . join ( downloadedPackagePath , constants . PROJECT_FRAMEWORK_FOLDER_NAME ) ;
98
98
frameworkDir = path . resolve ( frameworkDir ) ;
99
99
100
- let coreModuleName = await this . addPlatformCore ( platformData , frameworkDir ) ;
101
- await this . $npm . uninstall ( coreModuleName , { save : true } , this . $projectData . projectDir ) ;
100
+ await this . addPlatformCore ( platformData , frameworkDir ) ;
102
101
} catch ( err ) {
103
102
this . $fs . deleteDirectory ( platformPath ) ;
104
103
throw err ;
@@ -129,17 +128,15 @@ export class PlatformService implements IPlatformService {
129
128
if ( customTemplateOptions ) {
130
129
frameworkPackageNameData . template = customTemplateOptions . selectedTemplate ;
131
130
}
132
- this . $projectDataService . setValue ( platformData . frameworkPackageName , frameworkPackageNameData ) ;
133
131
134
132
return coreModuleName ;
135
-
136
133
}
137
134
138
135
private async getPathToPlatformTemplate ( selectedTemplate : string , frameworkPackageName : string ) : Promise < any > {
139
136
if ( ! selectedTemplate ) {
140
137
// read data from package.json's nativescript key
141
138
// check the nativescript.tns-<platform>.template value
142
- let nativescriptPlatformData = this . $projectDataService . getValue ( frameworkPackageName ) ;
139
+ let nativescriptPlatformData = this . $projectDataService . getValue ( frameworkPackageName , constants . DEV_DEPENDENCIES ) ;
143
140
selectedTemplate = nativescriptPlatformData && nativescriptPlatformData . template ;
144
141
}
145
142
@@ -577,6 +574,7 @@ export class PlatformService implements IPlatformService {
577
574
let platformDir = path . join ( this . $projectData . platformsDir , platform ) ;
578
575
this . $fs . deleteDirectory ( platformDir ) ;
579
576
this . $projectDataService . removeProperty ( platformData . frameworkPackageName ) ;
577
+ this . $npm . uninstall ( platformData . frameworkPackageName , { "save-dev" : true } ) ;
580
578
581
579
this . $logger . out ( `Platform ${ platform } successfully removed.` ) ;
582
580
} ) ;
@@ -709,7 +707,7 @@ export class PlatformService implements IPlatformService {
709
707
let platformData = this . $platformsData . getPlatformData ( platform ) ;
710
708
711
709
this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
712
- let data = this . $projectDataService . getValue ( platformData . frameworkPackageName ) ;
710
+ let data = this . $projectDataService . getValue ( platformData . frameworkPackageName , constants . DEV_DEPENDENCIES ) ;
713
711
let currentVersion = data && data . version ? data . version : "0.2.0" ;
714
712
715
713
let newVersion = version === constants . PackageVersion . NEXT ?
0 commit comments