From dace1c45a4e57c3a1fc29fc651423df3dc4f4421 Mon Sep 17 00:00:00 2001 From: Oleksandr Telnov Date: Wed, 21 Sep 2016 18:24:55 +0300 Subject: [PATCH] feat(build): use ngc compiler to produce metadata fixes #1060, fixes #992, fixes #933 --- .gitignore | 4 +++ .npmignore | 1 + components/carousel/carousel.component.ts | 34 ++++++++--------------- package.json | 13 +++++---- tsconfig.publish.json | 5 +++- 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 6aa803351d..072da860d5 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,7 @@ ng2-bootstrap.js ng2-bootstrap.d.ts ng2-bootstrap.js.map /logs + +factories + +/**/*.metadata.json diff --git a/.npmignore b/.npmignore index 4ddc70420c..3b1be64618 100644 --- a/.npmignore +++ b/.npmignore @@ -39,3 +39,4 @@ webpack.config.js /components/**/*.ts !/components/**/*.d.ts +factories diff --git a/components/carousel/carousel.component.ts b/components/carousel/carousel.component.ts index 3f88f86df3..e4d5fcd367 100644 --- a/components/carousel/carousel.component.ts +++ b/components/carousel/carousel.component.ts @@ -7,27 +7,6 @@ import { SlideComponent } from './slide.component'; export enum Direction {UNKNOWN, NEXT, PREV} -const NAVIGATION:any = { - [Ng2BootstrapTheme.BS4]: ` - - - Previous - - - - Next - - `, - [Ng2BootstrapTheme.BS3]: ` - - - - - - - ` -}; - // todo: // (ng-swipe-right)="prev()" (ng-swipe-left)="next()" /** @@ -45,7 +24,14 @@ const NAVIGATION:any = {
  • - ${NAVIGATION[Ng2BootstrapConfig.theme]} + + + Previous + + + + Next + ` }) @@ -71,6 +57,10 @@ export class CarouselComponent implements OnDestroy { private currentSlide:SlideComponent; private _interval:number; + public get isBS4():boolean { + return Ng2BootstrapConfig.theme === Ng2BootstrapTheme.BS4; + } + public ngOnDestroy():void { this.destroyed = true; } diff --git a/package.json b/package.json index 5d52a97f45..40381315e8 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "typedoc": "typedoc", "flow.docs": "npm run typedoc -- --exclude '**/*.spec.ts' ./components/", "flow.compile": "npm run flow.compile:common && npm run flow.compile:system", - "flow.compile:common": "tsc -p tsconfig.publish.json", + "flow.compile:common": "ngc -p tsconfig.publish.json", "flow.compile:system": "node ./.config/bundle-system.js", "flow.copy:src": "cpy ng2-bootstrap.ts \"components/*.ts\" ts --parents", "flow.clean": "del-cli bundles coverage demo-build \"components/**/*.+(js|d.ts|js.map)\" dist \"ng2-bootstrap.+(js|d.ts|js.map)\"", @@ -49,7 +49,7 @@ }, "homepage": "https://github.com/valor-software/ng2-bootstrap#readme", "dependencies": { - "moment": "2.15.0" + "moment": "2.15.1" }, "peerDependencies": { "@angular/common": "2.0.0", @@ -60,13 +60,14 @@ "devDependencies": { "@angular/common": "2.0.0", "@angular/compiler": "2.0.0", + "@angular/compiler-cli": "0.6.2", "@angular/core": "2.0.0", "@angular/forms": "2.0.0", "@angular/platform-browser": "2.0.0", "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", - "@types/jasmine": "2.2.33", - "@types/node": "6.0.38", + "@types/jasmine": "2.2.34", + "@types/node": "6.0.39", "@types/webpack": "1.12.34", "async": "2.0.1", "bootstrap": "3.3.7", @@ -77,7 +78,7 @@ "cpy-cli": "1.0.1", "cross-env": "2.0.1", "del-cli": "0.2.0", - "es6-promise": "3.3.0", + "es6-promise": "3.3.1", "es6-shim": "0.35.1", "es7-reflect-metadata": "1.6.0", "eslint-config-valorsoft": "0.1.0", @@ -99,6 +100,6 @@ "tslint-config-valorsoft": "1.1.1", "typedoc": "0.4.5", "typescript": "2.0.3", - "zone.js": "0.6.23" + "zone.js": "0.6.25" } } diff --git a/tsconfig.publish.json b/tsconfig.publish.json index a87697784e..e21d229155 100644 --- a/tsconfig.publish.json +++ b/tsconfig.publish.json @@ -24,5 +24,8 @@ "files": [ "./demo/custom-typings.d.ts", "./ng2-bootstrap.ts" - ] + ], + "angularCompilerOptions": { + "genDir": "factories" + } }