Skip to content

Commit a8ea6b4

Browse files
author
Robert Ocel
committed
Upgrading base Libraries
- Upgraded to Angular 5+ - Upgraded to Angular CLI 1.7.0 - Upgraded to Angular Material 5+
1 parent 37ea0f2 commit a8ea6b4

26 files changed

+311
-244
lines changed

angular-cli.json .angular-cli.json

+13-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
23
"project": {
3-
"version": "1.0.0-beta.28.3",
4-
"name": "rxjs-test"
4+
"name": "ngclitest"
55
},
66
"apps": [
77
{
@@ -15,7 +15,8 @@
1515
"main": "main.ts",
1616
"polyfills": "polyfills.ts",
1717
"test": "test.ts",
18-
"tsconfig": "tsconfig.json",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
1920
"prefix": "app",
2021
"styles": [
2122
"styles.css"
@@ -35,12 +36,16 @@
3536
},
3637
"lint": [
3738
{
38-
"files": "src/**/*.ts",
39-
"project": "src/tsconfig.json"
39+
"project": "src/tsconfig.app.json",
40+
"exclude": "**/node_modules/**"
4041
},
4142
{
42-
"files": "e2e/**/*.ts",
43-
"project": "e2e/tsconfig.json"
43+
"project": "src/tsconfig.spec.json",
44+
"exclude": "**/node_modules/**"
45+
},
46+
{
47+
"project": "e2e/tsconfig.e2e.json",
48+
"exclude": "**/node_modules/**"
4449
}
4550
],
4651
"test": {
@@ -50,18 +55,6 @@
5055
},
5156
"defaults": {
5257
"styleExt": "css",
53-
"prefixInterfaces": false,
54-
"inline": {
55-
"style": false,
56-
"template": false
57-
},
58-
"spec": {
59-
"class": false,
60-
"component": true,
61-
"directive": true,
62-
"module": false,
63-
"pipe": true,
64-
"service": true
65-
}
58+
"component": {}
6659
}
6760
}

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
# compiled output
44
/dist
5+
/dist-server
56
/tmp
7+
/out-tsc
68

79
# dependencies
810
/node_modules
@@ -25,7 +27,7 @@
2527
# misc
2628
/.sass-cache
2729
/connect.lock
28-
/coverage/*
30+
/coverage
2931
/libpeerconnection.log
3032
npm-debug.log
3133
testem.log

README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# RxjsTest
22

3-
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.28.3.
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.0.
44

55
## Development server
6+
67
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
78

89
## Code scaffolding
910

10-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
1112

1213
## Build
1314

@@ -20,12 +21,7 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
2021
## Running end-to-end tests
2122

2223
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
23-
Before running the tests make sure you are serving the app via `ng serve`.
24-
25-
## Deploying to GitHub Pages
26-
27-
Run `ng github-pages:deploy` to deploy to GitHub Pages.
2824

2925
## Further help
3026

31-
To get more help on the `angular-cli` use `ng help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

karma.conf.js

+11-21
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,28 @@
11
// Karma configuration file, see link for more information
2-
// https://karma-runner.github.io/0.13/config/configuration-file.html
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
33

44
module.exports = function (config) {
55
config.set({
66
basePath: '',
7-
frameworks: ['jasmine', 'angular-cli'],
7+
frameworks: ['jasmine', '@angular/cli'],
88
plugins: [
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
11-
require('karma-remap-istanbul'),
12-
require('angular-cli/plugins/karma')
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular/cli/plugins/karma')
1314
],
14-
files: [
15-
{ pattern: './src/test.ts', watched: false }
16-
],
17-
preprocessors: {
18-
'./src/test.ts': ['angular-cli']
19-
},
20-
mime: {
21-
'text/x-typescript': ['ts','tsx']
15+
client:{
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
2217
},
23-
remapIstanbulReporter: {
24-
reports: {
25-
html: 'coverage',
26-
lcovonly: './coverage/coverage.lcov'
27-
}
18+
coverageIstanbulReporter: {
19+
reports: [ 'html', 'lcovonly' ],
20+
fixWebpackSourcePaths: true
2821
},
2922
angularCli: {
30-
config: './angular-cli.json',
3123
environment: 'dev'
3224
},
33-
reporters: config.angularCli && config.angularCli.codeCoverage
34-
? ['progress', 'karma-remap-istanbul']
35-
: ['progress'],
25+
reporters: ['progress', 'kjhtml'],
3626
port: 9876,
3727
colors: true,
3828
logLevel: config.LOG_INFO,

package.json

+36-34
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,52 @@
22
"name": "rxjs-test",
33
"version": "0.0.0",
44
"license": "MIT",
5-
"angular-cli": {},
65
"scripts": {
76
"ng": "ng",
87
"start": "ng serve",
8+
"build": "ng build --prod",
99
"test": "ng test",
10-
"pree2e": "webdriver-manager update --standalone false --gecko false",
11-
"e2e": "protractor"
10+
"lint": "ng lint",
11+
"e2e": "ng e2e"
1212
},
1313
"private": true,
1414
"dependencies": {
15-
"@angular/common": "^4.0.0-rc.1",
16-
"@angular/compiler": "^4.0.0-rc.1",
17-
"@angular/core": "^4.0.0-rc.1",
18-
"@angular/forms": "^4.0.0-rc.1",
19-
"@angular/http": "^4.0.0-rc.1",
20-
"@angular/material": "^2.0.0-beta.2",
21-
"@angular/platform-browser": "^4.0.0-rc.1",
22-
"@angular/platform-browser-dynamic": "^4.0.0-rc.1",
23-
"@angular/router": "^4.0.0-rc.1",
15+
"@angular/animations": "^5.2.0",
16+
"@angular/cdk": "^5.2.1",
17+
"@angular/common": "^5.2.0",
18+
"@angular/compiler": "^5.2.0",
19+
"@angular/core": "^5.2.0",
20+
"@angular/forms": "^5.2.0",
21+
"@angular/http": "^5.2.0",
22+
"@angular/material": "^5.2.1",
23+
"@angular/platform-browser": "^5.2.0",
24+
"@angular/platform-browser-dynamic": "^5.2.0",
25+
"@angular/router": "^5.2.0",
2426
"core-js": "^2.4.1",
25-
"cors": "^2.8.1",
26-
"express": "^4.15.2",
27+
"cors": "^2.8.4",
28+
"express": "^4.16.2",
2729
"hammerjs": "^2.0.8",
28-
"rxjs": "^5.0.1",
29-
"ts-helpers": "^1.1.1",
30-
"zone.js": "^0.7.2"
30+
"rxjs": "^5.5.6",
31+
"zone.js": "^0.8.19"
3132
},
3233
"devDependencies": {
33-
"@angular/cli": "^1.0.0-rc.0",
34-
"@angular/compiler-cli": "^4.0.0-rc.1",
35-
"@types/hammerjs": "^2.0.34",
36-
"@types/jasmine": "2.5.38",
37-
"@types/node": "^6.0.42",
38-
"codelyzer": "~2.0.0-beta.1",
39-
"jasmine-core": "2.5.2",
40-
"jasmine-spec-reporter": "2.5.0",
41-
"karma": "1.2.0",
42-
"karma-chrome-launcher": "^2.0.0",
43-
"karma-cli": "^1.0.1",
44-
"karma-jasmine": "^1.0.2",
45-
"karma-remap-istanbul": "^0.2.1",
46-
"protractor": "~4.0.13",
47-
"ts-node": "1.2.1",
48-
"tslint": "^4.3.0",
49-
"typescript": "^2.2.1"
34+
"@angular/cli": "~1.7.0",
35+
"@angular/compiler-cli": "^5.2.0",
36+
"@angular/language-service": "^5.2.0",
37+
"@types/jasmine": "~2.8.3",
38+
"@types/jasminewd2": "~2.0.2",
39+
"@types/node": "~6.0.60",
40+
"codelyzer": "^4.0.1",
41+
"jasmine-core": "~2.8.0",
42+
"jasmine-spec-reporter": "~4.2.1",
43+
"karma": "~2.0.0",
44+
"karma-chrome-launcher": "~2.2.0",
45+
"karma-coverage-istanbul-reporter": "^1.2.1",
46+
"karma-jasmine": "~1.1.0",
47+
"karma-jasmine-html-reporter": "^0.2.2",
48+
"protractor": "~5.1.2",
49+
"ts-node": "~4.1.0",
50+
"tslint": "~5.9.1",
51+
"typescript": "~2.5.3"
5052
}
5153
}

protractor.conf.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// Protractor configuration file, see link for more information
22
// https://github.com/angular/protractor/blob/master/lib/config.ts
33

4-
/*global jasmine */
5-
var SpecReporter = require('jasmine-spec-reporter');
4+
const { SpecReporter } = require('jasmine-spec-reporter');
65

76
exports.config = {
87
allScriptsTimeout: 11000,
@@ -20,13 +19,10 @@ exports.config = {
2019
defaultTimeoutInterval: 30000,
2120
print: function() {}
2221
},
23-
useAllAngular2AppRoots: true,
24-
beforeLaunch: function() {
22+
onPrepare() {
2523
require('ts-node').register({
26-
project: 'e2e'
24+
project: 'e2e/tsconfig.e2e.json'
2725
});
28-
},
29-
onPrepare: function() {
30-
jasmine.getEnv().addReporter(new SpecReporter());
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
3127
}
3228
};

src/app/app.component.html

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
<md-toolbar color="primary">
2-
<button md-icon-button [mdMenuTriggerFor]="menu">
3-
<md-icon>
1+
<mat-toolbar color="primary">
2+
<button mat-icon-button [matMenuTriggerFor]="menu">
3+
<mat-icon>
44
menu
5-
</md-icon>
5+
</mat-icon>
66
</button>
7-
<md-menu #menu="mdMenu">
8-
<a href="https://github.com/ladyleet/rxjs-test" target="_blank" md-menu-item>
7+
<mat-menu #menu="matMenu">
8+
<a href="https://github.com/ladyleet/rxjs-test" target="_blank" mat-menu-item>
99
<span>Github</span>
1010
</a>
11-
<a href="http://reactivex.io/rxjs/" target="_blank" md-menu-item>
11+
<a href="http://reactivex.io/rxjs/" target="_blank" mat-menu-item>
1212
<span>RxJS Docs</span>
1313
</a>
14-
<a href="http://rxworkshop.com" target="_blank" md-menu-item>
14+
<a href="http://rxworkshop.com" target="_blank" mat-menu-item>
1515
<span>Learn RxJS</span>
1616
</a>
17-
</md-menu>
17+
</mat-menu>
1818
<span>RxJS Pun App</span>
19-
</md-toolbar>
19+
</mat-toolbar>
2020

2121
<div class="body-margin">
2222
<app-pun-lookup></app-pun-lookup>
23-
</div>
23+
</div>

src/app/app.component.spec.ts

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
1-
/* tslint:disable:no-unused-variable */
2-
31
import { TestBed, async } from '@angular/core/testing';
42
import { AppComponent } from './app.component';
5-
63
describe('AppComponent', () => {
7-
beforeEach(() => {
4+
beforeEach(async(() => {
85
TestBed.configureTestingModule({
96
declarations: [
107
AppComponent
118
],
12-
});
13-
TestBed.compileComponents();
14-
});
15-
9+
}).compileComponents();
10+
}));
1611
it('should create the app', async(() => {
1712
const fixture = TestBed.createComponent(AppComponent);
1813
const app = fixture.debugElement.componentInstance;
1914
expect(app).toBeTruthy();
2015
}));
21-
22-
it(`should have as title 'app works!'`, async(() => {
16+
it(`should have as title 'app'`, async(() => {
2317
const fixture = TestBed.createComponent(AppComponent);
2418
const app = fixture.debugElement.componentInstance;
25-
expect(app.title).toEqual('app works!');
19+
expect(app.title).toEqual('app');
2620
}));
27-
2821
it('should render title in a h1 tag', async(() => {
2922
const fixture = TestBed.createComponent(AppComponent);
3023
fixture.detectChanges();
3124
const compiled = fixture.debugElement.nativeElement;
32-
expect(compiled.querySelector('h1').textContent).toContain('app works!');
25+
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
3326
}));
3427
});

src/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import { Component } from '@angular/core';
66
styleUrls: ['./app.component.css']
77
})
88
export class AppComponent {
9-
title = 'app works!';
9+
title = 'app';
1010
}

0 commit comments

Comments
 (0)