Skip to content

Commit 08b1e16

Browse files
author
Seth Davenport
committedFeb 22, 2017
Update to latest CLI.
Also noticed that our fake REST API was down, so took the opportunity to add a spinner and error handling.
1 parent 4273c54 commit 08b1e16

29 files changed

+1236
-1792
lines changed
 
Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
23
"project": {
3-
"version": "1.0.0-beta.24",
4-
"name": "zoo"
4+
"version": "1.0.0-beta.32.3",
5+
"name": "example-app"
56
},
67
"apps": [
78
{
@@ -13,47 +14,43 @@
1314
],
1415
"index": "index.html",
1516
"main": "main.ts",
17+
"polyfills": "polyfills.ts",
1618
"test": "test.ts",
1719
"tsconfig": "tsconfig.json",
1820
"prefix": "app",
19-
"mobile": false,
2021
"styles": [
2122
"styles.css"
2223
],
2324
"scripts": [],
25+
"environmentSource": "environments/environment.ts",
2426
"environments": {
25-
"source": "environments/environment.ts",
2627
"dev": "environments/environment.ts",
2728
"prod": "environments/environment.prod.ts"
2829
}
2930
}
3031
],
31-
"addons": [],
32-
"packages": [],
3332
"e2e": {
3433
"protractor": {
3534
"config": "./protractor.conf.js"
3635
}
3736
},
37+
"lint": [
38+
{
39+
"files": "src/**/*.ts",
40+
"project": "src/tsconfig.json"
41+
},
42+
{
43+
"files": "e2e/**/*.ts",
44+
"project": "e2e/tsconfig.json"
45+
}
46+
],
3847
"test": {
3948
"karma": {
4049
"config": "./karma.conf.js"
4150
}
4251
},
4352
"defaults": {
4453
"styleExt": "css",
45-
"prefixInterfaces": false,
46-
"inline": {
47-
"style": false,
48-
"template": false
49-
},
50-
"spec": {
51-
"class": false,
52-
"component": true,
53-
"directive": true,
54-
"module": false,
55-
"pipe": true,
56-
"service": true
57-
}
54+
"component": {}
5855
}
5956
}

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
.c9/
1515
*.launch
1616
.settings/
17+
*.sublime-workspace
1718

1819
# IDE - VSCode
1920
.vscode/*

‎README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ application.
1010
* [@angular-redux/form](https://github.com/angular-redux/form) Time travel with Angular forms
1111
* [Redux DevTools Chrome Extension](https://github.com/zalmoxisus/redux-devtools-extension)
1212

13-
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.24.
13+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0-beta.32.3.
1414

1515
## Development server
16+
1617
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.
1718

19+
## Code scaffolding
20+
21+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
22+
1823
## Build
1924

2025
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
@@ -27,3 +32,7 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
2732

2833
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
2934
Before running the tests make sure you are serving the app via `ng serve`.
35+
36+
## Further help
37+
38+
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).

‎e2e/app.po.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export class ZooPage {
66
}
77

88
getParagraphText() {
9-
return element(by.css('app-root h1')).getText();
9+
return element(by.css('zoo-root h1')).getText();
1010
}
1111
}

‎karma.conf.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,37 @@
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
],
15+
client:{
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
1418
files: [
1519
{ pattern: './src/test.ts', watched: false }
1620
],
1721
preprocessors: {
18-
'./src/test.ts': ['angular-cli']
22+
'./src/test.ts': ['@angular/cli']
1923
},
2024
mime: {
2125
'text/x-typescript': ['ts','tsx']
2226
},
23-
remapIstanbulReporter: {
24-
reports: {
25-
html: 'coverage',
26-
lcovonly: './coverage/coverage.lcov'
27-
}
27+
coverageIstanbulReporter: {
28+
reports: [ 'html', 'lcovonly' ],
29+
fixWebpackSourcePaths: true
2830
},
2931
angularCli: {
30-
config: './angular-cli.json',
32+
config: './.angular-cli.json',
3133
environment: 'dev'
3234
},
3335
reporters: config.angularCli && config.angularCli.codeCoverage
34-
? ['progress', 'karma-remap-istanbul']
35-
: ['progress'],
36+
? ['progress', 'coverage-istanbul']
37+
: ['progress', 'kjhtml'],
3638
port: 9876,
3739
colors: true,
3840
logLevel: config.LOG_INFO,

‎package.json

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,53 @@
11
{
2-
"name": "zoo",
2+
"name": "example-app",
33
"version": "0.0.0",
44
"license": "MIT",
55
"angular-cli": {},
66
"scripts": {
77
"ng": "ng",
88
"start": "ng serve",
9-
"lint": "tslint \"src/**/*.ts\"",
109
"test": "ng test",
11-
"pree2e": "webdriver-manager update --standalone false --gecko false",
12-
"e2e": "protractor"
10+
"lint": "ng lint",
11+
"e2e": "ng e2e"
1312
},
1413
"private": true,
1514
"dependencies": {
1615
"@angular-redux/form": "^6.0.1",
1716
"@angular-redux/router": "^6.0.1",
18-
"@angular-redux/store": "^6.0.0",
19-
"@angular/common": "^2.3.1",
20-
"@angular/compiler": "^2.3.1",
21-
"@angular/core": "^2.3.1",
22-
"@angular/forms": "^2.3.1",
23-
"@angular/http": "^2.3.1",
24-
"@angular/platform-browser": "^2.3.1",
25-
"@angular/platform-browser-dynamic": "^2.3.1",
26-
"@angular/router": "^3.3.1",
17+
"@angular-redux/store": "^6.0.1",
18+
"@angular/common": "^2.4.0",
19+
"@angular/compiler": "^2.4.0",
20+
"@angular/core": "^2.4.0",
21+
"@angular/forms": "^2.4.0",
22+
"@angular/http": "^2.4.0",
23+
"@angular/platform-browser": "^2.4.0",
24+
"@angular/platform-browser-dynamic": "^2.4.0",
25+
"@angular/router": "^3.4.0",
2726
"core-js": "^2.4.1",
2827
"redux": "^3.6.0",
2928
"redux-logger": "^2.8.1",
30-
"redux-observable": "^0.12.2",
31-
"rxjs": "^5.0.1",
32-
"ts-helpers": "^1.1.1",
33-
"zone.js": "^0.7.2"
29+
"redux-observable": "^0.13.0",
30+
"rxjs": "^5.1.0",
31+
"zone.js": "^0.7.6"
3432
},
3533
"devDependencies": {
36-
"@angular/compiler-cli": "^2.3.1",
34+
"@angular/cli": "1.0.0-beta.32.3",
35+
"@angular/compiler-cli": "^2.4.0",
3736
"@types/jasmine": "2.5.38",
38-
"@types/node": "^6.0.42",
37+
"@types/node": "~6.0.60",
3938
"@types/redux-logger": "^2.6.34",
40-
"angular-cli": "1.0.0-beta.24",
41-
"codelyzer": "~2.0.0-beta.1",
42-
"jasmine-core": "2.5.2",
43-
"jasmine-spec-reporter": "2.5.0",
44-
"karma": "1.2.0",
45-
"karma-chrome-launcher": "^2.0.0",
46-
"karma-cli": "^1.0.1",
47-
"karma-jasmine": "^1.0.2",
48-
"karma-remap-istanbul": "^0.2.1",
49-
"protractor": "~4.0.13",
50-
"ts-node": "1.2.1",
51-
"tslint": "^4.0.2",
52-
"typescript": "~2.0.3"
39+
"codelyzer": "~2.0.0-beta.4",
40+
"jasmine-core": "~2.5.2",
41+
"jasmine-spec-reporter": "~3.2.0",
42+
"karma": "~1.4.1",
43+
"karma-chrome-launcher": "~2.0.0",
44+
"karma-cli": "~1.0.1",
45+
"karma-coverage-istanbul-reporter": "^0.2.0",
46+
"karma-jasmine": "~1.1.0",
47+
"karma-jasmine-html-reporter": "^0.2.2",
48+
"protractor": "~5.1.0",
49+
"ts-node": "~2.0.0",
50+
"tslint": "~4.4.2",
51+
"typescript": "~2.0.0"
5352
}
5453
}

‎protractor.conf.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// https://github.com/angular/protractor/blob/master/lib/config.ts
33

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

77
exports.config = {
88
allScriptsTimeout: 11000,
@@ -20,13 +20,12 @@ exports.config = {
2020
defaultTimeoutInterval: 30000,
2121
print: function() {}
2222
},
23-
useAllAngular2AppRoots: true,
2423
beforeLaunch: function() {
2524
require('ts-node').register({
2625
project: 'e2e'
2726
});
2827
},
29-
onPrepare: function() {
30-
jasmine.getEnv().addReporter(new SpecReporter());
28+
onPrepare() {
29+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
3130
}
3231
};

‎src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { LionsEpics } from './lions/lions.epics';
1414
import { lionsReducer } from './lions/lions.reducer';
1515

1616
@Component({
17-
selector: 'app-root',
17+
selector: 'zoo-root',
1818
templateUrl: './app.component.html',
1919
styleUrls: ['./app.component.css']
2020
})

‎src/app/core/core.module.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { NgModule } from '@angular/core'
2+
import { CommonModule } from '@angular/common';
3+
4+
import { SpinnerComponent } from './spinner/spinner.component';
5+
import { ErrorWellComponent } from './error-well/error-well.component';
6+
7+
@NgModule({
8+
declarations: [
9+
SpinnerComponent,
10+
ErrorWellComponent,
11+
],
12+
providers: [],
13+
imports: [ CommonModule ],
14+
exports: [
15+
SpinnerComponent,
16+
ErrorWellComponent,
17+
],
18+
})
19+
export class CoreModule {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
:host {
2+
background: #FDD;
3+
border: solid maroon 1px;
4+
border-radius: 3px;
5+
color: maroon;
6+
display: block;
7+
padding: 3px;
8+
width: 100%;
9+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Error status: {{ statusCode$ | async }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Input, Component } from '@angular/core';
2+
import { Observable } from 'rxjs/Observable';
3+
4+
@Component({
5+
selector: 'zoo-error-well',
6+
templateUrl: './error-well.component.html',
7+
styleUrls: [ './error-well.component.css' ],
8+
})
9+
export class ErrorWellComponent {
10+
@Input() statusCode$: Observable<number>;
11+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/* Taken from https://projects.lukehaas.me/css-loaders/ */
2+
:host,
3+
:host:before,
4+
:host:after {
5+
border-radius: 50%;
6+
}
7+
:host {
8+
color: #000000;
9+
display: block;
10+
font-size: 11px;
11+
text-indent: -99999em;
12+
margin: 55px auto;
13+
position: relative;
14+
width: 10em;
15+
height: 10em;
16+
box-shadow: inset 0 0 0 1em;
17+
-webkit-transform: translateZ(0);
18+
-ms-transform: translateZ(0);
19+
transform: translateZ(0);
20+
}
21+
:host:before,
22+
:host:after {
23+
position: absolute;
24+
content: '';
25+
}
26+
:host:before {
27+
width: 5.2em;
28+
height: 10.2em;
29+
background: #fff;
30+
border-radius: 10.2em 0 0 10.2em;
31+
top: -0.1em;
32+
left: -0.1em;
33+
-webkit-transform-origin: 5.2em 5.1em;
34+
transform-origin: 5.2em 5.1em;
35+
-webkit-animation: load2 2s infinite ease 1.5s;
36+
animation: load2 2s infinite ease 1.5s;
37+
}
38+
:host:after {
39+
width: 5.2em;
40+
height: 10.2em;
41+
background: #fff;
42+
border-radius: 0 10.2em 10.2em 0;
43+
top: -0.1em;
44+
left: 5.1em;
45+
-webkit-transform-origin: 0px 5.1em;
46+
transform-origin: 0px 5.1em;
47+
-webkit-animation: load2 2s infinite ease;
48+
animation: load2 2s infinite ease;
49+
}
50+
@-webkit-keyframes load2 {
51+
0% {
52+
-webkit-transform: rotate(0deg);
53+
transform: rotate(0deg);
54+
}
55+
100% {
56+
-webkit-transform: rotate(360deg);
57+
transform: rotate(360deg);
58+
}
59+
}
60+
@keyframes load2 {
61+
0% {
62+
-webkit-transform: rotate(0deg);
63+
transform: rotate(0deg);
64+
}
65+
100% {
66+
-webkit-transform: rotate(360deg);
67+
transform: rotate(360deg);
68+
}
69+
}

0 commit comments

Comments
 (0)