3
3
const path = require ( "path" ) ;
4
4
const fs = require ( "fs" ) ;
5
5
6
- const browserDynamicDependency = "@angular/platform-browser-dynamic" ;
7
6
const binPath = __dirname ;
8
7
const pluginPath = path . dirname ( binPath ) ;
9
8
const pluginPackageJsonPath = path . join ( pluginPath , "package.json" ) ;
@@ -28,17 +27,25 @@ function updateDeps(deps, devDeps, newDeps) {
28
27
deps [ dependencyName ] = version ;
29
28
}
30
29
31
- console . log ( `Updated dependency ${ dependencyName } to version: ${ version } .` ) ;
30
+ logUpdatedDependency ( dependencyName , version ) ;
32
31
} ) ;
33
32
34
33
const ngDep = Object . keys ( newDeps ) . find ( dep => dep . startsWith ( "@angular" ) ) ;
35
34
const version = newDeps [ ngDep ] ;
36
- if ( deps [ "@angular/animations" ] ) {
37
- deps [ "@angular/animations" ] = version ;
35
+ const animationsDependency = "@angular/animations" ;
36
+ if ( deps [ animationsDependency ] ) {
37
+ deps [ animationsDependency ] = version ;
38
+ logUpdatedDependency ( animationsDependency , version ) ;
38
39
}
39
40
40
- if ( deps [ "@angular/compiler-cli" ] ) {
41
- deps [ "@angular/compiler-cli" ] = version ;
41
+ const compilerCliDependency = "@angular/compiler-cli" ;
42
+ if ( devDeps [ compilerCliDependency ] ) {
43
+ devDeps [ compilerCliDependency ] = version ;
44
+ logUpdatedDependency ( compilerCliDependency , version ) ;
45
+ }
46
+
47
+ function logUpdatedDependency ( dependencyName , version ) {
48
+ console . log ( `Updated dependency ${ dependencyName } to version: ${ version } .` ) ;
42
49
}
43
50
}
44
51
0 commit comments