diff --git a/.editorconfig b/.editorconfig index f352616..6e87a00 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,10 +5,9 @@ root = true charset = utf-8 indent_style = space indent_size = 2 -end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true [*.md] -max_line_length = 0 +max_line_length = off trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index fccc4d9..ce200cb 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,10 @@ # IDEs and editors /.idea +/.vscode .project .classpath +.c9/ *.launch .settings/ diff --git a/README.md b/README.md index 7d3bbc3..bf9d77e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ _The running web app can be seen at:_ **[d3-ng2-demo Github Page](https://tomwan ## Explore this Project Locally -This project was generated with **[angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.15**. +This project was generated with **[angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.21**. ### Installation diff --git a/angular-cli.json b/angular-cli.json index 086ac89..aa6ce1f 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -1,13 +1,15 @@ { "project": { - "version": "1.0.0-beta.15", + "version": "1.0.0-beta.21", "name": "d3-ng2-demo" }, "apps": [ { "root": "src", "outDir": "dist", - "assets": "assets", + "assets": [ + "assets" + ], "index": "index.html", "main": "main.ts", "test": "test.ts", @@ -40,6 +42,18 @@ }, "defaults": { "styleExt": "css", - "prefixInterfaces": false + "prefixInterfaces": false, + "inline": { + "style": false, + "template": false + }, + "spec": { + "class": false, + "component": true, + "directive": true, + "module": false, + "pipe": true, + "service": true + } } } diff --git a/e2e/app.po.ts b/e2e/app.po.ts index 1f8321e..2e6fb0d 100644 --- a/e2e/app.po.ts +++ b/e2e/app.po.ts @@ -1,4 +1,4 @@ -import { browser, element, by } from 'protractor/globals'; +import { browser, element, by } from 'protractor'; export class D3Ng2DemoPage { navigateTo() { @@ -15,3 +15,4 @@ export class D3Ng2DemoPage { } } + diff --git a/karma.conf.js b/karma.conf.js index e28922a..1f2613a 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -17,6 +17,9 @@ module.exports = function (config) { preprocessors: { './src/test.ts': ['angular-cli'] }, + mime: { + 'text/x-typescript': ['ts','tsx'] + }, remapIstanbulReporter: { reports: { html: 'coverage', @@ -27,7 +30,9 @@ module.exports = function (config) { config: './angular-cli.json', environment: 'dev' }, - reporters: ['progress', 'karma-remap-istanbul'], + reporters: config.angularCli && config.angularCli.codeCoverage + ? ['progress', 'karma-remap-istanbul'] + : ['progress'], port: 9876, colors: true, logLevel: config.LOG_INFO, diff --git a/package.json b/package.json index b84eee2..8d6076d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "d3-ng2-demo", - "version": "0.1.0", + "version": "0.1.1", "description": "An Angular 2 app which demonstrates the implementation of D3 version 4 components.", "keywords": [ "D3", @@ -27,35 +27,38 @@ "url": "https://github.com/tomwanzek/d3-ng2-demo" }, "dependencies": { - "@angular/common": "2.0.0", - "@angular/compiler": "2.0.0", - "@angular/core": "2.0.0", - "@angular/forms": "2.0.0", - "@angular/http": "2.0.0", - "@angular/platform-browser": "2.0.0", - "@angular/platform-browser-dynamic": "2.0.0", - "@angular/router": "3.0.0", + "@angular/common": "2.2.1", + "@angular/compiler": "2.2.1", + "@angular/core": "2.2.1", + "@angular/forms": "2.2.1", + "@angular/http": "2.2.1", + "@angular/platform-browser": "2.2.1", + "@angular/platform-browser-dynamic": "2.2.1", + "@angular/router": "3.2.1", "bootstrap": "^3.3.7", "core-js": "^2.4.1", - "d3-ng2-service": "1.1", + "d3-ng2-service": "^1.4.0", "rxjs": "5.0.0-beta.12", "ts-helpers": "^1.1.1", "zone.js": "^0.6.23" }, "devDependencies": { - "@types/jasmine": "^2.2.30", - "angular-cli": "1.0.0-beta.15", - "codelyzer": "~0.0.26", - "jasmine-core": "2.4.1", + "@angular/compiler-cli": "2.2.1", + "@types/jasmine": "2.5.38", + "@types/node": "^6.0.42", + "angular-cli": "1.0.0-beta.21", + "codelyzer": "~1.0.0-beta.3", + "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", - "protractor": "4.0.5", + "protractor": "4.0.9", "ts-node": "1.2.1", "tslint": "3.13.0", - "typescript": "2.0.2" + "typescript": "~2.0.3", + "webdriver-manager": "10.2.5" } } diff --git a/src/app/app.component.html b/src/app/app.component.html index 0de5861..5265fbb 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -37,7 +37,7 @@

Perfect Storm

- +

Take Flight

diff --git a/src/test.ts b/src/test.ts index 7727c8e..81af890 100644 --- a/src/test.ts +++ b/src/test.ts @@ -6,6 +6,11 @@ import 'zone.js/dist/sync-test'; import 'zone.js/dist/jasmine-patch'; import 'zone.js/dist/async-test'; import 'zone.js/dist/fake-async-test'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. declare var __karma__: any; @@ -14,21 +19,14 @@ declare var require: any; // Prevent Karma from running prematurely. __karma__.loaded = function () {}; - -Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') -]) - // First, initialize the Angular testing environment. - .then(([testing, testingBrowser]) => { - testing.getTestBed().initTestEnvironment( - testingBrowser.BrowserDynamicTestingModule, - testingBrowser.platformBrowserDynamicTesting() - ); - }) - // Then we find all the tests. - .then(() => require.context('./', true, /\.spec\.ts/)) - // And load the modules. - .then(context => context.keys().map(context)) - // Finally, start Karma to run the tests. - .then(__karma__.start, __karma__.error); +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +let context = require.context('./', true, /\.spec\.ts/); +// And load the modules. +context.keys().map(context); +// Finally, start Karma to run the tests. +__karma__.start(); diff --git a/src/tsconfig.json b/src/tsconfig.json index 9b4c84c..1cf713a 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": "", "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, diff --git a/src/typings.d.ts b/src/typings.d.ts index a73f586..ea52695 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -1,5 +1,2 @@ -// Typings reference file, see links for more information -// https://github.com/typings/typings +// Typings reference file, you can add your own global typings here // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html - -declare var System: any; diff --git a/tslint.json b/tslint.json index 29f24ee..ad0093e 100644 --- a/tslint.json +++ b/tslint.json @@ -107,6 +107,8 @@ "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true, - "directive-class-suffix": true + "directive-class-suffix": true, + "templates-use-public": true, + "invoke-injectable": true } }