diff --git a/.gitignore b/.gitignore index 707757d1..01d585d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules +src/node_modules npm-debug.log coverage lib @@ -6,5 +7,6 @@ build src/*.js src/*.map src/*.d.ts +src/*.ngfactory.ts demo/webpack/bundle.js demo/webpack/bundle.js.map \ No newline at end of file diff --git a/.npmignore b/.npmignore index 167e1d90..36979ca7 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ +.travis.yml demo test coverage @@ -7,4 +8,6 @@ tsd.json karma-test-shim.js karma.conf.js karma.coverage.js -lib/*.spec.* \ No newline at end of file +lib/*.spec.* +src/node_modules +debug.log \ No newline at end of file diff --git a/README.md b/README.md index 4ab089cd..26133816 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ largely based off of [AngularJS-Toaster](https://github.com/jirikavi/AngularJS-Toaster). [![Build Status](https://travis-ci.org/Stabzs/Angular2-Toaster.svg?branch=master)](https://travis-ci.org/Stabzs/Angular2-Toaster) -[![Coverage Status](https://coveralls.io/repos/github/Stabzs/Angular2-Toaster/badge.svg?branch=master&bump=0.5.1-rc.6)](https://coveralls.io/github/Stabzs/Angular2-Toaster?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/Stabzs/Angular2-Toaster/badge.svg?branch=master&bumped=0.5.2-rc.6)](https://coveralls.io/github/Stabzs/Angular2-Toaster?branch=master) -### Current Version 0.5.1-rc.6 +### Current Version 0.5.2-rc.6 ## Installation: @@ -21,6 +21,7 @@ npm install angular2-toaster ## Building the Source In order to build Angular2-Toaster, you will need to have Git and Node.js installed. +In addition, the library assumes that you will install all peer dependencies. Clone a copy of the repo: diff --git a/karma-test-shim.js b/karma-test-shim.js index 4316dd34..81f3e68e 100644 --- a/karma-test-shim.js +++ b/karma-test-shim.js @@ -64,7 +64,8 @@ Promise.all([ }).then(function () { return Promise.all( Object.keys(window.__karma__.files) - .filter(onlySpecFiles) + .filter(isSpecFile) + .filter(isBuiltFile) .map(file2moduleName) .map(importModules) ); @@ -75,8 +76,16 @@ Promise.all([ __karma__.start(); }); -function onlySpecFiles(path) { - return /[\.|-]spec\.js$/.test(path); +function isJsFile(path) { + return path.slice(-3) == '.js'; +} + +function isSpecFile(path) { + return /\.spec\.(.*\.)?js$/.test(path); +} + +function isBuiltFile(path) { + return isJsFile(path) && (path.indexOf('/base/lib/') > -1); } // Normalize paths to module names. diff --git a/package.json b/package.json index 42ba3814..e0eaae46 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "angular2-toaster", - "version": "0.5.1-rc.6", + "version": "0.5.2-rc.6", "description": "An Angular 2 Toaster Notification library based on AngularJS-Toaster", "main": "angular2-toaster.ts", "scripts": { "watch": "tsc -p src -w", "start": "npm run test && http-server -c-1 -o -p 8875 .", - "build": "tsc -p src && cpx src/toaster.css lib", + "build": "node_modules/.bin/ngc -p src && cpx src/toaster.css lib", "pretest": "npm run build", "test": "karma start karma.conf.js", "postcoverage": "node_modules/.bin/remap-istanbul -i coverage/ts-json-report/coverage-final.json -o coverage -t html", @@ -42,6 +42,8 @@ "rxjs": "5.0.0-beta.11" }, "devDependencies": { + "@angular/compiler-cli": "^0.6.0", + "@angular/platform-server": "^2.0.0-rc.6", "core-js": "^2.4.1", "coveralls": "^2.11.9", "cpx": "^1.3.1", diff --git a/src/toaster-container.component.spec.ts b/src/toaster-container.component.spec.ts index d2d4bae0..fe6ef7e8 100644 --- a/src/toaster-container.component.spec.ts +++ b/src/toaster-container.component.spec.ts @@ -25,6 +25,10 @@ export class TestComponent { public toasterconfig: ToasterConfig = new ToasterConfig({ showCloseButton: true, tapToDismiss: false, timeout: 0, toastContainerId: 1 }); public toasterconfig2: ToasterConfig = new ToasterConfig({ showCloseButton: true, tapToDismiss: false, timeout: 0, toastContainerId: 2 }); } +@NgModule({ + imports: [ToasterModule], + declarations: [TestComponent] +}) // Mock component for testing bodyOutputType Component rendering diff --git a/src/toaster-container.component.ts b/src/toaster-container.component.ts index 6e03b9ed..080b6599 100644 --- a/src/toaster-container.component.ts +++ b/src/toaster-container.component.ts @@ -204,4 +204,4 @@ export class ToasterContainerComponent { if(this.addToastSubscriber) { this.addToastSubscriber.unsubscribe(); } if(this.clearToastsSubscriber) { this.clearToastsSubscriber.unsubscribe(); } } -} +} \ No newline at end of file diff --git a/src/toaster.module.ts b/src/toaster.module.ts index 743a898c..15e7572b 100644 --- a/src/toaster.module.ts +++ b/src/toaster.module.ts @@ -1,5 +1,6 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; +import {ToasterConfig} from './toaster-config'; import {ToastComponent} from './toast.component'; import {ToasterContainerComponent} from './toaster-container.component'; import {ToasterService} from './toaster.service';