@@ -3,11 +3,17 @@ import * as semver from "semver";
33import * as constants from "../constants" ;
44import { UpdateControllerBase } from "./update-controller-base" ;
55
6+ interface IPackage {
7+ name : string ;
8+ alias ?: string ;
9+ }
10+
611export 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 } ] ;
1117 static readonly folders : string [ ] = [
1218 constants . LIB_DIR_NAME ,
1319 constants . HOOKS_DIR_NAME ,
@@ -184,9 +190,17 @@ export class UpdateController extends UpdateControllerBase implements IUpdateCon
184190 }
185191
186192 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+ }
189201 } ) ;
202+
203+ return updatableDependencies ;
190204 }
191205
192206 private getTemplateName ( projectData : IProjectData ) {
0 commit comments