@@ -3,11 +3,17 @@ import * as semver from "semver";
3
3
import * as constants from "../constants" ;
4
4
import { UpdateControllerBase } from "./update-controller-base" ;
5
5
6
+ interface IPackage {
7
+ name : string ;
8
+ alias ?: string ;
9
+ }
10
+
6
11
export class UpdateController extends UpdateControllerBase implements IUpdateController {
7
- static readonly updatableDependencies : string [ ] = [
8
- constants . TNS_CORE_MODULES_NAME ,
9
- constants . TNS_CORE_MODULES_WIDGETS_NAME ,
10
- constants . WEBPACK_PLUGIN_NAME ] ;
12
+ static readonly updatableDependencies : IPackage [ ] = [
13
+ { name : constants . SCOPED_TNS_CORE_MODULES , alias : constants . TNS_CORE_MODULES_NAME } ,
14
+ { name : constants . TNS_CORE_MODULES_NAME } ,
15
+ { name : constants . TNS_CORE_MODULES_WIDGETS_NAME } ,
16
+ { name : constants . WEBPACK_PLUGIN_NAME } ] ;
11
17
static readonly folders : string [ ] = [
12
18
constants . LIB_DIR_NAME ,
13
19
constants . HOOKS_DIR_NAME ,
@@ -184,9 +190,17 @@ export class UpdateController extends UpdateControllerBase implements IUpdateCon
184
190
}
185
191
186
192
private getUpdatableDependencies ( dependencies : IDictionary < string > ) : IDictionary < string > {
187
- return _ . pickBy ( dependencies , ( value , key ) => {
188
- return UpdateController . updatableDependencies . indexOf ( key ) > - 1 ;
193
+ const updatableDependencies : IDictionary < string > = { } ;
194
+
195
+ UpdateController . updatableDependencies . forEach ( updatableDependency => {
196
+ if ( dependencies [ updatableDependency . name ] ) {
197
+ updatableDependencies [ updatableDependency . name ] = dependencies [ updatableDependency . name ] ;
198
+ } else if ( updatableDependency . alias && dependencies [ updatableDependency . alias ] ) {
199
+ updatableDependencies [ updatableDependency . name ] = dependencies [ updatableDependency . alias ] ;
200
+ }
189
201
} ) ;
202
+
203
+ return updatableDependencies ;
190
204
}
191
205
192
206
private getTemplateName ( projectData : IProjectData ) {
0 commit comments