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