diff --git a/.travis.yml b/.travis.yml index 607608c28..9af31dda0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ sudo: required dist: trusty language: node_js node_js: -- '5.4' +- '6.9.4' addons: firefox: latest before_script: diff --git a/README.md b/README.md index af393dd8e..8925be362 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ Covalent is a reusable UI platform from Teradata for building web applications w ## Setup -* Ensure you have Node 5.5.0 - 6.9.1 and NPM 3+ installed. -* Install Angular CLI `npm i -g angular-cli@latest` +* Ensure you have Node 6.9.1 or up and NPM 3+ installed. +* Install Angular CLI `npm i -g @angular/cli@latest` * Install Typescript `npm i -g typescript` * Install TSLint `npm install -g tslint` * Install Protractor for e2e testing `npm install -g protractor` diff --git a/angular-cli.json b/angular-cli.json index dd835feae..72258ebf6 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -14,6 +14,7 @@ ], "index": "index.html", "main": "main.ts", + "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.json", "prefix": "app", @@ -35,13 +36,19 @@ } } ], - "addons": [], - "packages": [], "e2e": { "protractor": { "config": "./protractor.conf.js" } }, + "lint": [{ + "files": "src/**/*.ts", + "project": "src/tsconfig.json" + }, { + "files": "e2e/**/*.ts", + "project": "e2e/tsconfig.json" + } + ], "test": { "karma": { "config": "./karma.conf.js" @@ -50,6 +57,21 @@ "defaults": { "styleExt": "scss", "prefixInterfaces": false, - "lazyRoutePrefix": "+" + "serve": { + "port": 4200, + "host": "localhost" + }, + "inline": { + "style": false, + "template": false + }, + "spec": { + "class": false, + "component": true, + "directive": true, + "module": false, + "pipe": true, + "service": true + } } } diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index 9c55aa648..a3b9377b3 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -5,7 +5,7 @@ See the [material2 getting started](https://github.com/angular/material2/blob/m ## Install the CLI ```bash - npm install -g angular-cli + npm install -g @angular/cli@latest ``` ## Create a new project diff --git a/e2e/index.e2e.ts b/e2e/index.e2e.ts index d35588e88..72236ecc4 100644 --- a/e2e/index.e2e.ts +++ b/e2e/index.e2e.ts @@ -7,4 +7,4 @@ describe('hello, protractor', function(): void { expect(browser.getTitle()).toBe('Teradata Covalent - Angular Material Design UI Platform'); }); }); -}); \ No newline at end of file +}); diff --git a/karma.conf.js b/karma.conf.js index 7342d7e5e..f5c75b74f 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -4,13 +4,13 @@ module.exports = function (config) { var configuration = { basePath: '.', - frameworks: ['jasmine', 'angular-cli'], + frameworks: ['jasmine', '@angular/cli'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-firefox-launcher'), require('karma-remap-istanbul'), - require('angular-cli/plugins/karma') + require('@angular/cli/plugins/karma') ], customLaunchers: { // chrome setup for travis CI using chromium @@ -23,7 +23,7 @@ module.exports = function (config) { { pattern: './src/test.ts', watched: false } ], preprocessors: { - './src/test.ts': ['angular-cli'] + './src/test.ts': ['@angular/cli'] }, remapIstanbulReporter: { reports: { @@ -38,7 +38,9 @@ module.exports = function (config) { mime: { 'text/x-typescript': ['ts','tsx'] }, - 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 abc74d8df..e24e77e1d 100644 --- a/package.json +++ b/package.json @@ -76,11 +76,11 @@ }, "devDependencies": { "@angular/compiler-cli": "^2.4.4", + "@angular/cli": "1.0.0-beta.30", "@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.26", "codelyzer": "2.0.0-beta.4", "coveralls": "^2.11.15", "glob": "^6.0.4", diff --git a/protractor.conf.js b/protractor.conf.js index d18cc5908..ffded7018 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -1,5 +1,5 @@ // Protractor configuration file, see link for more information -// https://github.com/angular/protractor/blob/master/docs/referenceConf.js +// https://github.com/angular/protractor/blob/master/lib/config.ts /*global jasmine */ var SpecReporter = require('jasmine-spec-reporter'); @@ -7,7 +7,7 @@ var SpecReporter = require('jasmine-spec-reporter'); exports.config = { allScriptsTimeout: 11000, specs: [ - './e2e/**/*.e2e.ts' + './e2e/**/*.e2e-spec.ts' ], capabilities: { 'browserName': 'chrome' diff --git a/src/app/components/docs/build-tasks/build-tasks.component.html b/src/app/components/docs/build-tasks/build-tasks.component.html index 344f8884e..7d23075e0 100644 --- a/src/app/components/docs/build-tasks/build-tasks.component.html +++ b/src/app/components/docs/build-tasks/build-tasks.component.html @@ -4,12 +4,12 @@

Command Line Build Tasks

-

Important: Make sure you have Node 4 or greater!

+

Important: Make sure you have Node 6.9 or greater!

First install the CLI

- npm install -g angular-cli@latest + npm install -g @angular/cli@latest

Local server

diff --git a/src/app/components/docs/overview/overview.component.html b/src/app/components/docs/overview/overview.component.html index cd5f614d0..f5db25f87 100644 --- a/src/app/components/docs/overview/overview.component.html +++ b/src/app/components/docs/overview/overview.component.html @@ -31,7 +31,7 @@

Create a new Git repository for your product

Start Developing!

Prerequisites

If you don't have the Angular CLI, install:

- npm i -g angular-cli@latest + npm i -g @angular/cli@latest

Install Typescript 2.0:

diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index c9669790b..016bace37 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,3 +1,3 @@ -export const environment = { +export const environment: {production: boolean} = { production: true, }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index a20cfe557..6df83e00a 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,3 +1,3 @@ -export const environment = { +export const environment: {production: boolean} = { production: false, }; diff --git a/src/main.ts b/src/main.ts index 5c3c52040..8f155f413 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,3 @@ -import './polyfills.ts'; - import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { enableProdMode } from '@angular/core'; import { environment } from './environments/environment'; diff --git a/src/platform/charts/package.json b/src/platform/charts/package.json index baffb5d34..b29d7530c 100644 --- a/src/platform/charts/package.json +++ b/src/platform/charts/package.json @@ -12,7 +12,7 @@ "scripts": { }, "engines": { - "node": ">4.4 < 7", + "node": ">=6.9", "npm": ">= 3" }, "repository": { diff --git a/src/platform/core/package.json b/src/platform/core/package.json index 206e03309..5bdb047f4 100644 --- a/src/platform/core/package.json +++ b/src/platform/core/package.json @@ -13,7 +13,7 @@ "scripts": { }, "engines": { - "node": ">4.4 < 7", + "node": ">=6.9", "npm": ">= 3" }, "repository": { diff --git a/src/platform/dynamic-forms/package.json b/src/platform/dynamic-forms/package.json index 7f7a8bb52..75fd8a196 100644 --- a/src/platform/dynamic-forms/package.json +++ b/src/platform/dynamic-forms/package.json @@ -15,7 +15,7 @@ "scripts": { }, "engines": { - "node": ">4.4 < 7", + "node": ">=6.9", "npm": ">= 3" }, "repository": { diff --git a/src/platform/highlight/package.json b/src/platform/highlight/package.json index 2a54fcee8..c4ce5a381 100644 --- a/src/platform/highlight/package.json +++ b/src/platform/highlight/package.json @@ -15,7 +15,7 @@ "scripts": { }, "engines": { - "node": ">4.4 < 7", + "node": ">=6.9", "npm": ">= 3" }, "repository": { diff --git a/src/platform/http/package.json b/src/platform/http/package.json index 41a5f80f8..07948bbd3 100644 --- a/src/platform/http/package.json +++ b/src/platform/http/package.json @@ -16,7 +16,7 @@ "scripts": { }, "engines": { - "node": ">4.4 < 7", + "node": ">=6.9", "npm": ">= 3" }, "repository": { diff --git a/src/platform/markdown/package.json b/src/platform/markdown/package.json index 29d7c4992..ab6df6180 100644 --- a/src/platform/markdown/package.json +++ b/src/platform/markdown/package.json @@ -13,7 +13,7 @@ "scripts": { }, "engines": { - "node": ">4.4 < 7", + "node": ">=6.9", "npm": ">= 3" }, "repository": { diff --git a/src/polyfills.ts b/src/polyfills.ts index ebf7ac02a..3cf43c8c3 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -1,5 +1,5 @@ -// This file includes polyfills needed by Angular 2 and is loaded before -// the app. You can add your own extra polyfills to this file. +// This file includes polyfills needed by Angular and is loaded before the app. +// You can add your own extra polyfills to this file. import 'core-js/es6/symbol'; import 'core-js/es6/object'; import 'core-js/es6/function'; @@ -19,3 +19,22 @@ import 'core-js/es7/reflect'; import 'zone.js/dist/zone'; import 'rxjs/Rx'; + +// If you need to support the browsers/features below, uncomment the import +// and run `npm install import-name-here'; +// Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + +// Needed for: IE9 +// import 'classlist.js'; + +// Animations +// Needed for: All but Chrome and Firefox, Not supported in IE9 +// import 'web-animations-js'; + +// Date, currency, decimal and percent pipes +// Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 +// import 'intl'; + +// NgClass on SVG elements +// Needed for: IE10, IE11 +// import 'classlist.js'; diff --git a/src/test.ts b/src/test.ts index 23ed722f0..0ff5a902e 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,4 +1,4 @@ -import './polyfills.ts'; +// This file is required by karma.conf.js and loads recursively all the .spec and framework files import 'zone.js/dist/long-stack-trace-zone'; import 'zone.js/dist/proxy.js'; @@ -7,28 +7,27 @@ import 'zone.js/dist/jasmine-patch'; import 'zone.js/dist/async-test'; import 'zone.js/dist/fake-async-test'; import 'hammerjs'; +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; declare var require: any; // Prevent Karma from running prematurely. -__karma__.loaded = function (): void { /* noop */ }; +__karma__.loaded = function (): void {/* empty */}; -Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing'), -]) - // First, initialize the Angular testing environment. - .then(([testing, testingBrowser]: any[]) => { - 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: any) => 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. +const context: any = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); +// Finally, start Karma to run the tests. +__karma__.start();