@@ -26,13 +26,14 @@ import { hasNgModuleImport } from '../utils/ng-module-imports';
26
26
27
27
const bootstrapStylePath = `./node_modules/bootstrap/dist/css/bootstrap.min.css` ;
28
28
const datePickerStylePath = `./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css` ;
29
+ const datepickerComponentName = 'datepicker' ;
29
30
30
31
/* tslint:disable-next-line: no-default-export */
31
32
export default function ( options : Schema ) : Rule {
32
33
return chain ( [
33
34
addPackageJsonDependencies ( ) ,
34
35
installPackageJsonDependencies ( ) ,
35
- ! options . component || options . component === 'datepicker'
36
+ ! options . component || options . component === datepickerComponentName
36
37
? addStyles ( options , insertCommonStyles )
37
38
: addStyles ( options , insertBootstrapStyles ) ,
38
39
options . component
@@ -88,12 +89,12 @@ function addModuleOfComponent(projectName: string | undefined, componentName: st
88
89
function addPackageJsonDependencies ( ) : Rule {
89
90
return ( host : Tree , context : SchematicContext ) => {
90
91
const dependencies : { name : string ; version : string } [ ] = [
91
- { name : 'bootstrap' , version : '4.1 .1' } ,
92
- { name : 'ngx-bootstrap' , version : '3.0.1 ' }
92
+ { name : 'bootstrap' , version : '4.2 .1' } ,
93
+ { name : 'ngx-bootstrap' , version : '^3.1.4 ' }
93
94
] ;
94
95
95
96
dependencies . forEach ( dependency => {
96
- addPackageToPackageJson ( host , dependency . name , `^ ${ dependency . version } ` ) ;
97
+ addPackageToPackageJson ( host , dependency . name , `${ dependency . version } ` ) ;
97
98
context . logger . log ( 'info' , `✅️ Added "${ dependency . name } ` ) ;
98
99
} ) ;
99
100
0 commit comments