Skip to content

Commit

Permalink
feat(css): update bootstrap css to latest (#4999)
Browse files Browse the repository at this point in the history
* update: update bootstrap css to latest

* fix(schematics): add only tested ver of bootstrap css
  • Loading branch information
Domainv authored and valorkin committed Jan 17, 2019
1 parent d338dbf commit 91b78e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"@types/node": "10.0.8",
"@types/tapable": "1.0.2",
"@types/webpack": "4.1.6",
"bootstrap": "4.1.1",
"bootstrap": "4.2.1",
"chai": "4.1.2",
"classlist-polyfill": "1.2.0",
"codecov": "3.1.0",
Expand Down
9 changes: 5 additions & 4 deletions schematics/src/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ import { hasNgModuleImport } from '../utils/ng-module-imports';

const bootstrapStylePath = `./node_modules/bootstrap/dist/css/bootstrap.min.css`;
const datePickerStylePath = `./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css`;
const datepickerComponentName = 'datepicker';

/* tslint:disable-next-line: no-default-export */
export default function (options: Schema): Rule {
return chain([
addPackageJsonDependencies(),
installPackageJsonDependencies(),
!options.component || options.component === 'datepicker'
!options.component || options.component === datepickerComponentName
? addStyles(options, insertCommonStyles)
: addStyles(options, insertBootstrapStyles),
options.component
Expand Down Expand Up @@ -88,12 +89,12 @@ function addModuleOfComponent(projectName: string | undefined, componentName: st
function addPackageJsonDependencies(): Rule {
return (host: Tree, context: SchematicContext) => {
const dependencies: { name: string; version: string }[] = [
{ name: 'bootstrap', version: '4.1.1' },
{ name: 'ngx-bootstrap', version: '3.0.1' }
{ name: 'bootstrap', version: '4.2.1' },
{ name: 'ngx-bootstrap', version: '^3.1.4' }
];

dependencies.forEach(dependency => {
addPackageToPackageJson(host, dependency.name, `^${dependency.version}`);
addPackageToPackageJson(host, dependency.name, `${dependency.version}`);
context.logger.log('info', `✅️ Added "${dependency.name}`);
});

Expand Down

0 comments on commit 91b78e7

Please sign in to comment.