diff --git a/.travis.yml b/.travis.yml index d090926425..b5fffa9796 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,9 @@ before_script: install: - npm i process-nextick-args util-deprecate buffer-shims - npm install -- "./node_modules/.bin/ng build" script: - npm run tslint -- "./node_modules/.bin/ng test --watch=false" +- npm run test notifications: slack: secure: pkXQL5AZiSBh1yWjilrcA7KbcJjC4xxjhd0SAwogJCQgyEf/i8/CfR1ZXiZYsIBJT6HTI7UMdJzwP6TiY/zih6Mq8PqUg38NUsvGyznILkbksMQJieWrg1r+1ideplPJFX7qdXwrOcxvSVoEFIGha26X0Fglq3kXSBHpPR9U0lDCoUxLUO35txQ/iji85Na4hjQnmtBEQkqaJogA0hRdcSLIKxwScgSrb4UU2PXEaIS9Zpr2SOG/RTOMkrrSMOD7bgocZbhAbk3c5shPZNj51gpEN+692Qxp4kQ/nfT10Hu5ATLaFCM5v04+w0D3ZJLA46LpU47qP0ALy6O9d16pGUcxJGbWaMZpV53vV9jIl9y2ahaqN1h1J9BcLIOzJvaQy92km8F7a3l7cN8gWSUZjs5Hd+gPFQH9Flcydmq26e8Maa1tQDF5R3GIdaCw4qkuJYbl4ToE59wtiPQ6M7xVKqNK4Qypu1YNsKOoLG/tZRFvp4771vgWcR5Lu/DqJJ9SAB0jsdrOXpe+0DmdrLBwhoZv2D9FTce+clDHIJ7ObPEc/UKw8rtWAA5iCPCEJ0sPl+WZwOS3ZFp4QmMC+5mzffMUiX6HBnzxiyOZvYGJD/jTy1yA1Cmt4RJYrOPM73csI1ELs5tj4tvqBNJQ8daIenfkg7u42IJfByDGIsJz8to= diff --git a/build.conf.js b/build.conf.js index e716b87f75..0960aabf21 100644 --- a/build.conf.js +++ b/build.conf.js @@ -38,9 +38,17 @@ module.exports = { 'src/**/**.html', 'src/**/**.md', 'src/**/**.js', + 'src/**/**.ts', + '!src/**/**.spec.ts', 'src/**/**/package.json', '!src/app/**/**.html', '!src/app/**/**.js', + '!src/app/**/**.ts', + '!src/environments/**/**.ts', + '!src/polyfills.ts', + '!src/main.ts', + '!src/test.ts', + '!src/typings.d.ts', '!src/index.html' ] } diff --git a/package.json b/package.json index 4dcf95873a..905a75f3fc 100644 --- a/package.json +++ b/package.json @@ -14,13 +14,13 @@ "tslint": "tslint -c ./tslint.json \"./src/**/*.ts\" -e \"./src/**/typings.d.ts\" -e \"./src/environments/**\"", "postinstall": "webdriver-manager update", "webdriver-update": "bash ./node_modules/.bin/webdriver-manager update", - "pretest": "rm -rf ./dist && ng build", - "test": "npm run karma", - "karma": "karma start ./karma.conf.js --single-run", + "test": "ng test --code-coverage --single-run", + "show-coverage-win" : "start chrome ./coverage/index.html", "bump-dev": "gulp bump-version", "bump-patch": "gulp bump-version --ver patch", "bump-minor": "gulp bump-version --ver minor", "bump-major": "gulp bump-version --ver major", + "aot": "./node_modules/.bin/ngc -p src/platform/tsconfig-aot.json", "build": "bash scripts/build-release", "publish": "bash scripts/publish-release", "ghpages-deploy": "bash scripts/ghpages-deploy", @@ -46,34 +46,35 @@ "Ed Morales ", "Jason Weaver ", "Jeremy Wilken ", - "Jeremy Smartt " + "Jeremy Smartt ", + "Ilsun Park " ], "dependencies": { - "@angular/common": "^2.3.0", - "@angular/compiler": "^2.3.0", - "@angular/core": "^2.3.0", - "@angular/forms": "^2.3.0", - "@angular/http": "^2.3.0", - "@angular/material": "2.0.0-alpha.11-3", - "@angular/platform-browser": "^2.3.0", - "@angular/platform-browser-dynamic": "^2.3.0", - "@angular/platform-server": "^2.3.0", - "@angular/router": "^3.3.0", + "@angular/common": "^2.4.1", + "@angular/compiler": "^2.4.1", + "@angular/core": "^2.4.1", + "@angular/forms": "^2.4.1", + "@angular/http": "^2.4.1", + "@angular/material": "2.0.0-beta.1", + "@angular/platform-browser": "^2.4.1", + "@angular/platform-browser-dynamic": "^2.4.1", + "@angular/platform-server": "^2.4.1", + "@angular/router": "^3.4.1", "core-js": "^2.4.1", "hammerjs": "^2.0.8", "highlight.js": "9.6.0", - "rxjs": "5.0.0-rc.4", + "rxjs": "^5.0.1", "showdown": "1.4.2", "zone.js": "^0.7.2", "d3": "^4.2.1" }, "devDependencies": { - "@angular/compiler-cli": "^2.3.0", + "@angular/compiler-cli": "^2.4.1", "@types/hammerjs": "^2.0.30", "@types/jasmine": "^2.2.31", "@types/node": "^6.0.34", "@types/selenium-webdriver": "^2.52.0", - "angular-cli": "1.0.0-beta.19-3", + "angular-cli": "1.0.0-beta.24", "codelyzer": "~0.0.26", "awesome-typescript-loader": "^2.2.4", "ember-cli-inject-live-reload": "1.4.0", diff --git a/public/.npmignore b/public/.npmignore index e69de29bb2..84d292728a 100644 --- a/public/.npmignore +++ b/public/.npmignore @@ -0,0 +1,4 @@ +# compiled aot output +*.ngsummary.json +*.ngfactory.ts +*.shim.ngstyle.ts \ No newline at end of file diff --git a/scripts/build-release b/scripts/build-release index 2886adbb60..145e7831a7 100644 --- a/scripts/build-release +++ b/scripts/build-release @@ -6,6 +6,11 @@ rm -rf ./deploy # Perform a build. gulp build echo "Platform compiled..." +# AoT compilation +npm run aot +echo "Generated *.metadata.json files..." +gulp clean-aot +echo "Cleaned AoT excess" # Inline the css and html into the component files. gulp inline-resource-files echo "Files inlined..." diff --git a/scripts/clean-aot.js b/scripts/clean-aot.js new file mode 100644 index 0000000000..8a0969e113 --- /dev/null +++ b/scripts/clean-aot.js @@ -0,0 +1,13 @@ +'use strict'; + +var gulp = require('gulp-help')(require('gulp')); +var del = require('del'); + +gulp.task('clean-aot', "Clean unwanted AoT files from /deploy folder", function() { + return del([ + 'deploy/**/*.ngsummary.json', + 'deploy/**/*.ngfactory.ts', + 'deploy/**/*.shim.ngstyle.ts', + 'deploy/**/node_modules/' + ]); +}); \ No newline at end of file diff --git a/scripts/compile-ts.js b/scripts/compile-ts.js index d1b7439a7b..f55bdf98a1 100644 --- a/scripts/compile-ts.js +++ b/scripts/compile-ts.js @@ -11,18 +11,20 @@ var tsProject = ts.createProject({ emitDecoratorMetadata: true, experimentalDecorators: true, mapRoot: "./", - lib: ["es6", "dom"], - module: "es6", + lib: ["es6", "es2015", "dom"], + module: "es2015", moduleResolution: "node", noEmitOnError: true, - noImplicitAny: false, + noImplicitAny: true, target: "ES5", + inlineSources: true, + stripInternal: false, typescript: require('typescript'), typeRoots: [ "../node_modules/@types" ], types: [ - "hammerjs" + "jasmine", "hammerjs", "rxjs" ] }); diff --git a/src/app/app.component.html b/src/app/app.component.html index 5b1abb19f1..13e8237621 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,4 +1,4 @@ - + {{item.icon}}{{item.title}} diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index eea1a340e5..6f44e55943 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -13,7 +13,7 @@ import { DocsAppComponent } from './app.component'; describe('Component: App', () => { let generalResponses: Map = new Map(); - generalResponses.set('app/assets/icons/teradata.svg', new Response(new ResponseOptions({ + generalResponses.set('/app/assets/icons/teradata.svg', new Response(new ResponseOptions({ status: 200, body: '', }))); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 83f111a571..4fdfa2e4da 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,11 @@ import { Component } from '@angular/core'; +import { DomSanitizer } from '@angular/platform-browser'; +import { MdIconRegistry } from '@angular/material'; @Component({ selector: 'docs-covalent', - templateUrl: 'app.component.html', - styleUrls: ['app.component.scss'], + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], }) export class DocsAppComponent { @@ -29,4 +31,22 @@ export class DocsAppComponent { title: 'Components & Addons', }, ]; + + constructor(private _iconRegistry: MdIconRegistry, + private _domSanitizer: DomSanitizer) { + this._iconRegistry.addSvgIconInNamespace('assets', 'teradata', + this._domSanitizer.bypassSecurityTrustResourceUrl('/app/assets/icons/teradata.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'github', + this._domSanitizer.bypassSecurityTrustResourceUrl('/app/assets/icons/github.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'covalent', + this._domSanitizer.bypassSecurityTrustResourceUrl('/app/assets/icons/covalent.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'teradata-ux', + this._domSanitizer.bypassSecurityTrustResourceUrl('/app/assets/icons/teradata-ux.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'appcenter', + this._domSanitizer.bypassSecurityTrustResourceUrl('/app/assets/icons/appcenter.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'listener', + this._domSanitizer.bypassSecurityTrustResourceUrl('/app/assets/icons/listener.svg')); + this._iconRegistry.addSvgIconInNamespace('assets', 'querygrid', + this._domSanitizer.bypassSecurityTrustResourceUrl('/app/assets/icons/querygrid.svg')); + } } diff --git a/src/app/components/components/charts/charts.component.ts b/src/app/components/components/charts/charts.component.ts index ed76b3e992..6cc4374799 100644 --- a/src/app/components/components/charts/charts.component.ts +++ b/src/app/components/components/charts/charts.component.ts @@ -2,8 +2,8 @@ import { Component} from '@angular/core'; @Component({ selector: 'charts-demo', - styleUrls: ['charts.component.scss'], - templateUrl: 'charts.component.html', + styleUrls: ['./charts.component.scss'], + templateUrl: './charts.component.html', }) export class ChartsDemoComponent { diff --git a/src/app/components/components/chips/chips.component.ts b/src/app/components/components/chips/chips.component.ts index 23c8820e4b..080e193e5a 100644 --- a/src/app/components/components/chips/chips.component.ts +++ b/src/app/components/components/chips/chips.component.ts @@ -2,8 +2,8 @@ import { Component } from '@angular/core'; @Component({ selector: 'chips-demo', - styleUrls: ['chips.component.scss'], - templateUrl: 'chips.component.html', + styleUrls: ['./chips.component.scss'], + templateUrl: './chips.component.html', }) export class ChipsDemoComponent { diff --git a/src/app/components/components/components.component.html b/src/app/components/components/components.component.html index 76816f83d7..af0d16182e 100644 --- a/src/app/components/components/components.component.html +++ b/src/app/components/components/components.component.html @@ -1,4 +1,4 @@ - +